Core principles
- Optimize for scanability first.
- Users should identify the screen, major sections, and key state in a few seconds.
- Prefer compact summaries over verbose dumps, use color to convey meaning.
- Put the most decision-relevant information first.
- Design for terminal constraints.
- Width is scarce and volatile.
- Height is also volatile; assume partial visibility and build scrolling support for every surface you create.
- Avoid layouts that depend on exact pixel positioning or mouse interaction.
- Use structure, not decoration, to create clarity.
- Good grouping, alignment, color, emphasis should be used wherever possible.
- Follow the 60/30/10 rule: 60% foreground color or faint variation of it, 30% primary color, 10% other colors (success/error/warning/secondary etc)
- Add chrome only when it explains the screen or improves navigation.
- Remove labels and lines that repeat information already obvious from context.
- Show cached/known state immediately, then hydrate progressively.
- Open the screen instantly.
- Render placeholders only for genuinely missing parts.
- Refresh slow sections asynchronously.
- Meet the visual bar before shipping, not after feedback.
- A polished, styled surface is the requirement, not a follow-up. "Make it work, leave it ugly" is a defect.
- Build every bounded surface to this standard in the same change that introduces it. Do not ship an unstyled text-block surface intending to style it later, and do not wait for the operator to complain before meeting the bar.
- Reactive styling is banned: never bolt color/spacing/borders onto an already-shipped raw-text surface after the fact. Layout and emphasis are designed into the surface from the start.
- Compose surfaces through the render framework's layout/style/widget primitives. Do not hand-assemble screens by concatenating strings, splicing ANSI escapes, or computing cursor row/column by manual line arithmetic — that path is what produces unstyled-then-hacked surfaces.
- Run the screen-review checklist (bottom of this skill) before the surface is considered done.
Surface choice
Use native scrollback for ongoing/log-style surfaces
Use the terminal's main screen and native scrollback when the UI is fundamentally append-only:
- chat transcripts
- logs
- command output streams
- timelines
- activity feeds
- Only ONE native scrollback surface is allowed per entire app. Avoid re-emission of the scrollback history as much as possible.
Rules:
- Once a line is emitted, do not rewrite or repaint history unless resize absolutely requires reflow.
- Prefer appending new information instead of replaying the whole screen.
- This mode should feel like a high-quality terminal session, not a canvas app.
Use alt-screen for full-screen destinations
Use the terminal alternate screen for surfaces that conceptually replace the current screen:
- pickers
- dashboards
- settings screens
- dedicated status pages
- process lists
- inspectors
- modal navigation destinations
Rules:
- Treat alt-screen as navigation to a separate destination, not as transcript detail.
- Preserve the main-screen scrollback underneath; returning should restore it intact.
- Full-screen destinations should not depend on replaying main-screen history on entry.
- If the screen is not append-only, it probably belongs in alt-screen.
Layout rules
Hierarchy
Use a consistent hierarchy:
- screen title or primary section labels
- primary value lines
- secondary metadata lines
- grouped subsections
- warnings or failure states near the affected section
Section structure
A good section usually looks like:
- title in a strong accent color
- 1-3 high-value lines
- optional grouped items under subheaders
- one blank line between major sections
Avoid:
- walls of labels
- repeated prefixes
- raw debug dumps unless explicitly requested
- explicit empty states where they can be inferred by vacuous truth, such as "0 overrides" or "no problems detected"
Padding and spacing
- Use vertical spacing more than horizontal indentation.
- Use one blank line between major sections.
- Use two blank lines between groups of major sections (highest level of separation)
Alignment
- Align repeated structures to the same column when it improves scanability.
- For rows like
label | bar | value | meta, pad the labels so bars align vertically.
- Keep grouped items visually parallel.
- When width gets tight, shorten the least important part first.
Text emphasis
Bold
Use bold for:
- titles
- primary values
- important state words like
clean, dirty, on, off, fast
Do not bold entire dense blocks unless the whole line is a key summary.
Faint text
Use faint for:
- timestamps
- helper metadata
- secondary IDs
- explanatory suffixes
- tree connectors
Do not use faint for:
- primary metrics
- important thresholds
- state the user must act on
- labels needed to understand the screen
Full-strength text
Use normal or bold full-strength text for:
- actual values
- section-relevant controls/state
- directory headers that group visible items
- threshold lines like
Compaction at ...
Color rules
Use color semantically, not decoratively.
Recommended roles
- Primary: section titles, subsection counters, navigation headings
- Green/Success: healthy/safe/available/clean/ahead-positive/good remaining quota
- Yellow/Warning: warnings, toggles like
fast, medium caution, partial depletion
- Red/Error: dirty/error/behind-negative/critical depletion
- Muted: secondary metadata, timestamps, decorations (trees, ascii symbols, dividers, separators)
- Default foreground: normal readable body text
Color discipline
- Prefer one accent color for structure and semantic colors for status.
- Avoid rainbow rows.
- Keep primary values readable in monochrome terminals.
- Never rely on color alone; the wording must still make sense.
Symbols and line art
Prefer ASCII first for broad compatibility.
Use Unicode only when it materially improves clarity and is widely supported:
- box or tree connectors like
├─ / └─
- bullets like
•. Use largest dot available by default to make it visible.
- block characters for progress bars
- Avoid Nerd fonts or icons unless the user asks or already used in codebase.
- NEVER use emoji for anything.
Guidelines:
- Tree structures are excellent for "items belong to this directory/group".
- Avoid heavy decorative box drawing unless the app really needs frames.
Progress bars
Use progress bars for quantities that benefit from immediate spatial reading:
- quota remaining
- context usage
- task progress
Guidelines:
- Keep bars on a single line with label and summary when possible.
- Use semantic fill color based on health, if applicable.
- Clamp for narrow widths; if space is tight, reduce bar width before dropping the summary.
- Use the render framework's drawing primitives (gauge/progress, styled rows) when they simplify rendering and remain visually stable; keep interactive behavior (input, cursor, selection, navigation) in the app model rather than in behavior-owning widgets.
Information design
- Each screen should have a way to surface errors or toasts/transient messages to the user. Prefer reusable architecture and UI for error/toast surfacing.
- Each screen should indicate loading in some way. No blank screens, no freezes, no placeholder values.
What not to include
Remove:
- redundant section titles repeated in body lines
- implementation details unless useful to operators
- long raw command output when a summary is enough
- placeholders like
none when silence is cleaner and no ambiguity is introduced
Summarize aggressively
Merge information to improve density
Example:
- Use
Pro subscription instead of repeated Subscription + Plan pro
Prefer grouped, counted lists:
3 skills
- directory header
- tree items
Responsive behavior
Narrow width strategy
When width shrinks:
- preserve section titles
- preserve primary value text
- shorten metadata
- shrink bars
- drop optional suffixes only last
Never let ANSI styling corrupt wrapping or truncation.
Pre-rendered styled lines must go through ANSI-aware width handling.
Height strategy
- Assume the user may only see the top section at first.
- Put high-value sections first.
- Make all screens scrollable.
- Do not assume the entire screen fits at once.
Loading and caching
Progressive loading
- Open first, load second.
- Cache slow data in memory when repeated opens are expected.
- Render cached state immediately if it is still useful.
- Refresh in background and merge results by section.
Interaction guidance
- Keep visible controls minimal.
- Hidden keybindings are acceptable only when the screen is otherwise obvious and low-risk.
- If the screen is read-only, avoid control clutter.
- Refresh affordances should exist only if they earn their screen space.
Screen review checklist
Before shipping a TUI screen, check:
- Does it open instantly?
- Does it still look good at narrow widths?
- Are titles, values, and metadata clearly differentiated?
- Are colors semantic and restrained?
- Are repeated rows aligned?
- Is faint text only used for secondary information?
- Does scrolling reveal lower sections cleanly?
- Does alt-screen usage match the screen's purpose?
- Can the main scrollback be restored cleanly?
- Are cached and loading states honest?
1---2name: tui-design3description: How to design TUI frontends. Use when requests involve TUI layout, spacing, colors, UX/UI and working on user-facing surfaces.4---56## Core principles71. Optimize for scanability first.8- Users should identify the screen, major sections, and key state in a few seconds.9- Prefer compact summaries over verbose dumps, use color to convey meaning.10- Put the most decision-relevant information first.11122. Design for terminal constraints.13- Width is scarce and volatile.14- Height is also volatile; assume partial visibility and build scrolling support for every surface you create.15- Avoid layouts that depend on exact pixel positioning or mouse interaction.16173. Use structure, not decoration, to create clarity.18- Good grouping, alignment, color, emphasis should be used wherever possible.19- Follow the 60/30/10 rule: 60% foreground color or faint variation of it, 30% primary color, 10% other colors (success/error/warning/secondary etc)20- Add chrome only when it explains the screen or improves navigation.21- Remove labels and lines that repeat information already obvious from context.22234. Show cached/known state immediately, then hydrate progressively.24- Open the screen instantly.25- Render placeholders only for genuinely missing parts.26- Refresh slow sections asynchronously.27285. Meet the visual bar before shipping, not after feedback.29- A polished, styled surface is the requirement, not a follow-up. "Make it work, leave it ugly" is a defect.30- Build every bounded surface to this standard in the same change that introduces it. Do not ship an unstyled text-block surface intending to style it later, and do not wait for the operator to complain before meeting the bar.31- Reactive styling is banned: never bolt color/spacing/borders onto an already-shipped raw-text surface after the fact. Layout and emphasis are designed into the surface from the start.32- Compose surfaces through the render framework's layout/style/widget primitives. Do not hand-assemble screens by concatenating strings, splicing ANSI escapes, or computing cursor row/column by manual line arithmetic — that path is what produces unstyled-then-hacked surfaces.33- Run the screen-review checklist (bottom of this skill) before the surface is considered done.3435## Surface choice3637### Use native scrollback for ongoing/log-style surfaces38Use the terminal's main screen and native scrollback when the UI is fundamentally append-only:39- chat transcripts40- logs41- command output streams42- timelines43- activity feeds44- Only ONE native scrollback surface is allowed per entire app. Avoid re-emission of the scrollback history as much as possible.4546Rules:47- Once a line is emitted, do not rewrite or repaint history unless resize absolutely requires reflow.48- Prefer appending new information instead of replaying the whole screen.49- This mode should feel like a high-quality terminal session, not a canvas app.5051### Use alt-screen for full-screen destinations52Use the terminal alternate screen for surfaces that conceptually replace the current screen:53- pickers54- dashboards55- settings screens56- dedicated status pages57- process lists58- inspectors59- modal navigation destinations6061Rules:62- Treat alt-screen as navigation to a separate destination, not as transcript detail.63- Preserve the main-screen scrollback underneath; returning should restore it intact.64- Full-screen destinations should not depend on replaying main-screen history on entry.65- If the screen is not append-only, it probably belongs in alt-screen.6667## Layout rules6869### Hierarchy70Use a consistent hierarchy:71- screen title or primary section labels72- primary value lines73- secondary metadata lines74- grouped subsections75- warnings or failure states near the affected section7677### Section structure78A good section usually looks like:79- title in a strong accent color80- 1-3 high-value lines81- optional grouped items under subheaders82- one blank line between major sections8384Avoid:85- walls of labels86- repeated prefixes87- raw debug dumps unless explicitly requested88- explicit empty states where they can be inferred by vacuous truth, such as "0 overrides" or "no problems detected"8990### Padding and spacing91- Use vertical spacing more than horizontal indentation.92- Use one blank line between major sections.93- Use two blank lines between groups of major sections (highest level of separation)9495### Alignment96- Align repeated structures to the same column when it improves scanability.97- For rows like `label | bar | value | meta`, pad the labels so bars align vertically.98- Keep grouped items visually parallel.99- When width gets tight, shorten the least important part first.100101## Text emphasis102103### Bold104Use bold for:105- titles106- primary values107- important state words like `clean`, `dirty`, `on`, `off`, `fast`108109Do not bold entire dense blocks unless the whole line is a key summary.110111### Faint text112Use faint for:113- timestamps114- helper metadata115- secondary IDs116- explanatory suffixes117- tree connectors118119Do not use faint for:120- primary metrics121- important thresholds122- state the user must act on123- labels needed to understand the screen124125### Full-strength text126Use normal or bold full-strength text for:127- actual values128- section-relevant controls/state129- directory headers that group visible items130- threshold lines like `Compaction at ...`131132## Color rules133134Use color semantically, not decoratively.135136### Recommended roles137- Primary: section titles, subsection counters, navigation headings138- Green/Success: healthy/safe/available/clean/ahead-positive/good remaining quota139- Yellow/Warning: warnings, toggles like `fast`, medium caution, partial depletion140- Red/Error: dirty/error/behind-negative/critical depletion141- Muted: secondary metadata, timestamps, decorations (trees, ascii symbols, dividers, separators)142- Default foreground: normal readable body text143144### Color discipline145- Prefer one accent color for structure and semantic colors for status.146- Avoid rainbow rows.147- Keep primary values readable in monochrome terminals.148- Never rely on color alone; the wording must still make sense.149150## Symbols and line art151152Prefer ASCII first for broad compatibility.153154Use Unicode only when it materially improves clarity and is widely supported:155- box or tree connectors like `├─` / `└─`156- bullets like `•`. Use largest dot available by default to make it visible.157- block characters for progress bars158- Avoid Nerd fonts or icons unless the user asks or already used in codebase.159- NEVER use emoji for anything.160161Guidelines:162- Tree structures are excellent for "items belong to this directory/group".163- Avoid heavy decorative box drawing unless the app really needs frames.164165## Progress bars166167Use progress bars for quantities that benefit from immediate spatial reading:168- quota remaining169- context usage170- task progress171172Guidelines:173- Keep bars on a single line with label and summary when possible.174- Use semantic fill color based on health, if applicable.175- Clamp for narrow widths; if space is tight, reduce bar width before dropping the summary.176- Use the render framework's drawing primitives (gauge/progress, styled rows) when they simplify rendering and remain visually stable; keep interactive behavior (input, cursor, selection, navigation) in the app model rather than in behavior-owning widgets.177178## Information design179180- Each screen should have a way to surface errors or toasts/transient messages to the user. Prefer reusable architecture and UI for error/toast surfacing.181- Each screen should indicate loading in some way. No blank screens, no freezes, no placeholder values.182183### What not to include184Remove:185- redundant section titles repeated in body lines186- implementation details unless useful to operators187- long raw command output when a summary is enough188- placeholders like `none` when silence is cleaner and no ambiguity is introduced189190### Summarize aggressively191192Merge information to improve density193194Example:195- Use `Pro subscription` instead of repeated `Subscription` + `Plan pro`196197Prefer grouped, counted lists:198- `3 skills`199- directory header200- tree items201202## Responsive behavior203204### Narrow width strategy205When width shrinks:2061. preserve section titles2072. preserve primary value text2083. shorten metadata2094. shrink bars2105. drop optional suffixes only last211212Never let ANSI styling corrupt wrapping or truncation.213Pre-rendered styled lines must go through ANSI-aware width handling.214215### Height strategy216- Assume the user may only see the top section at first.217- Put high-value sections first.218- Make all screens scrollable.219- Do not assume the entire screen fits at once.220221## Loading and caching222223### Progressive loading224- Open first, load second.225- Cache slow data in memory when repeated opens are expected.226- Render cached state immediately if it is still useful.227- Refresh in background and merge results by section.228229## Interaction guidance230- Keep visible controls minimal.231- Hidden keybindings are acceptable only when the screen is otherwise obvious and low-risk.232- If the screen is read-only, avoid control clutter.233- Refresh affordances should exist only if they earn their screen space.234235## Screen review checklist236Before shipping a TUI screen, check:237- Does it open instantly?238- Does it still look good at narrow widths?239- Are titles, values, and metadata clearly differentiated?240- Are colors semantic and restrained?241- Are repeated rows aligned?242- Is faint text only used for secondary information?243- Does scrolling reveal lower sections cleanly?244- Does alt-screen usage match the screen's purpose?245- Can the main scrollback be restored cleanly?246- Are cached and loading states honest?