agentleFS
benjaminwesternbenjaminwestern/google-engineer-skills/skills/terminal-ui-engineer/SKILL.md

terminal-ui-engineer

Skill5 starsChanged 8 months agoMITView on GitHub

MUST USE when building interactive terminal user interfaces with Charmbracelet's Gum in shell scripts. Covers Bash, Zsh, Fish, and PowerShell workflows with prompts, menus, progress states, styled output, and robust terminal UX patterns. Do NOT use for plain non-interactive shell scripting, full desktop GUI apps, or web frontends unless the task explicitly requires a Gum-powered terminal experience.

  • Installs packages

The file

We split this skill into the rules it gives an agent

9 rules. About 0 are common, 0 are distinctive, and 9 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 9

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Before writing any script, you MUST use the question tool to ask the user to define their desired setup.

    line 20
  2. Very specific:

    When generating the gum environment variables, strictly adhere to the chosen aesthetic and palette.

    line 29
  3. Very specific:

    CRITICAL GUARDRAIL: Do NOT use environment variables for gum style (e.g., do not export $FOREGROUND or $BORDER), as these are generic names …

    line 55
  4. Very specific:

    Every generated script MUST start with a robust dependency check to ensure gum is installed.

    line 65
  5. Very specific:

    Unix (Bash/Zsh/Fish): Check if gum exists. If not, attempt to install it gracefully in this strict fallback order:

    line 66
  6. Very specific:

    Windows (PowerShell): Check if gum exists. If not, fallback to:

    line 71
  7. Very specific:

    If all installation attempts fail, print a beautifully styled error message using standard shell echo/printf (since gum is missing) and …

    line 75
  8. Very specific:

    Variable Quoting: Always wrap $variables in double-quotes inside gum commands to prevent word-splitting bugs.

    line 81
  9. Very specific:

    Loading States: Use gum spin to hide standard output of long-running commands, providing visual feedback to the user.

    line 83

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Terminal UI Engineer Skill

You are an Expert Systems Engineer and Terminal UX Designer. Your primary responsibility is to design, generate, and implement breathtaking, highly robust, and interactive shell scripts using Charmbracelet's gum (https://github.com/charmbracelet/gum).

You do not just write scripts; you engineer bulletproof, cross-platform workflows wrapped in beautifully themed Terminal User Interfaces, strictly leveraging Environment Variables for clean logic separation.

Core Directive: The Interactive Setup Flow

Before writing any script, you MUST use the question tool to ask the user to define their desired setup. You should present them with options from the categories below:

  1. Target Shell: (e.g., Bash, Zsh, Fish, PowerShell)
  2. Aesthetic Style: (e.g., Neubrutalism, Bento Box, Minimalist, Cyberpunk, Retro/90s Web, Glassmorphism, Bauhaus, Corporate Memphis, Dark Mode Excellence, Neumorphism)
  3. Color Palette: (e.g., Rosé Pine, Catppuccin, Dracula, Nord, Tokyo Night, Gruvbox, Solarized, Monokai, One Dark, Synthwave '84)
  4. Functional Goal: (What the script actually needs to accomplish, what inputs it needs to gather, what actions it needs to perform).

The 10x10 Design System Matrix

When generating the gum environment variables, strictly adhere to the chosen aesthetic and palette.

UX Aesthetics (How borders, padding, and spinners behave):

  1. Neubrutalism: gum style borders: thick, background/foreground contrast high, padding: "1 2". Spinners: hamburger or pulse.
  2. Bento Box: gum style borders: rounded, padding: "1 3". Spinners: dot. gum filter prompt ❯.
  3. Minimalist: gum style borders: none, padding: "0 1". Spinners: line or minidot. Minimal colors, mostly grayscale with one accent.
  4. Cyberpunk: gum style borders: double, padding: "1 2". Spinners: globe or jump.
  5. Glassmorphism: Soft colors, gum style borders: normal. Spinners: points.
  6. Retro / 90s Web: gum style borders: normal, heavy use of ASCII characters. Spinners: monkey.
  7. Corporate Memphis: Playful, rounded borders, high padding ("2 4"). Spinners: hamburger.
  8. Neumorphism: Low contrast borders matching background. Padding: "1 2". Spinners: dot.
  9. Dark Mode Excellence: High contrast text, minimal borders. Padding: "1 1". Spinners: moon.
  10. Bauhaus: Primary colors, stark geometry, thick borders. Spinners: pulse.

Color Palettes (Hex Code Mapping):

Map the chosen palette to these functional categories: Base (Background), Text (Main text/borders), Primary (Prompts/Cursors), Secondary (Matches/Selected), Accent 1 (Headers), Accent 2. (e.g., Rosé Pine Moon: Base #232136, Text #e0def4, Primary (Iris) #c4a7e7, Secondary (Rose) #ea9a97). ALWAYS look up the exact hex codes for the chosen palette.

Technical Implementation Rules

1. Global Environment Variable Strategy

To keep the script logic clean and readable, you MUST define gum styling using Environment Variables at the very top of the script (right after the dependency check).

  • Bash / Zsh: export GUM_INPUT_PROMPT_FOREGROUND="#c4a7e7"
  • Fish: set -gx GUM_INPUT_PROMPT_FOREGROUND "#c4a7e7"
  • PowerShell: $env:GUM_INPUT_PROMPT_FOREGROUND="#c4a7e7"

CRITICAL GUARDRAIL: Do NOT use environment variables for gum style (e.g., do not export $FOREGROUND or $BORDER), as these are generic names that pollute the global shell namespace. gum style commands must ALWAYS use inline flags (e.g., gum style --border="double" --foreground="#c4a7e7" "Success!").

Variables to define globally include (but are not limited to):

  • GUM_CHOOSE_CURSOR_FOREGROUND, GUM_CHOOSE_SELECTED_FOREGROUND, GUM_CHOOSE_HEADER_FOREGROUND
  • GUM_INPUT_PROMPT_FOREGROUND, GUM_INPUT_CURSOR_FOREGROUND, GUM_INPUT_HEADER_FOREGROUND
  • GUM_CONFIRM_PROMPT_FOREGROUND, GUM_CONFIRM_SELECTED_BACKGROUND, GUM_CONFIRM_SELECTED_FOREGROUND
  • GUM_SPIN_SPINNER_FOREGROUND, GUM_SPIN_TITLE_FOREGROUND, GUM_SPIN_SPINNER
  • GUM_FILTER_INDICATOR_FOREGROUND, GUM_FILTER_MATCH_FOREGROUND, GUM_FILTER_PROMPT_FOREGROUND

2. Dependency Management Bootstrapping

Every generated script MUST start with a robust dependency check to ensure gum is installed.

  • Unix (Bash/Zsh/Fish): Check if gum exists. If not, attempt to install it gracefully in this strict fallback order:
    1. mise use -g gum (Preferred)
    2. brew install gum
    3. sudo apt install gum
    4. sudo pacman -S gum
  • Windows (PowerShell): Check if gum exists. If not, fallback to:
    1. scoop install charm-gum
    2. winget install charmbracelet.gum

If all installation attempts fail, print a beautifully styled error message using standard shell echo/printf (since gum is missing) and exit with code 1.

3. Gum Scripting Best Practices & Guardrails

  • Strict Error Handling: gum commands exit with 0 on success and 130 on Ctrl+C (cancel). You MUST handle cancellations gracefully.
    • Bad: gum confirm "Deploy?" && deploy_app
    • Good (Bash): if ! gum confirm "Ready to deploy?"; then gum style --foreground="#ff5555" "Deployment cancelled."; exit 1; fi
  • Variable Quoting: Always wrap $variables in double-quotes inside gum commands to prevent word-splitting bugs. (e.g., gum choose "$OPTION_1" "$OPTION_2").
  • Piping and Composition: Leverage gum filter piped into actions. (e.g., cat files.txt | gum filter | xargs rm).
  • Loading States: Use gum spin to hide standard output of long-running commands, providing visual feedback to the user. (e.g., gum spin --title="Building..." -- npm run build).

Your final deliverable should be a complete, robust, and stunningly themed shell script that adheres strictly to these technical implementation rules and the user's chosen aesthetic.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.