agentleFS
PraveensenpaiPraveensenpai/karakuri/skills/tui-dev/tui-design/SKILL.md

tui-design

Skill0 starsChanged 2 months agoMITView on GitHub

Design, build, redesign, review, and debug terminal user interfaces (TUIs). Use when the user wants to build or improve a TUI, convert a CLI to an interactive terminal app, choose a TUI framework (Bubble Tea, Textual, Ratatui, Ink), design layouts and keybindings, handle Unicode/wide characters/RTL text, ensure terminal compatibility, write TUI tests, or troubleshoot terminal rendering issues.

  • Installs packages

10 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

59 rules. 0 are common, 47 are distinctive, and 12 are very specific to this project.

  • 0

    Common

    Most of the 9 edited versions we read keep these.

  • 47

    Distinctive

    This author's own choices. Worth a look.

  • 12

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    DO NOT TRIGGER when:

    line 33
  2. Distinctive:

    When first invoked for a new TUI project, briefly clarify:

    line 43
  3. Distinctive:

    Keep this to 3-5 questions max.

    line 51
  4. Distinctive:

    Every screen must have a clear visual hierarchy — what's most important should be most prominent.

    line 61
  5. Distinctive:

    Use size, weight, contrast, and position to guide the eye.

    line 62
  6. Distinctive:

    Use whitespace as a design element — it separates, groups, and breathes.

    line 69
  7. Distinctive:

    Start monochrome. Add color only where it earns its place.

    line 73
  8. Distinctive:

    Use color for: status, active states, important data, accents.

    line 74
  9. Very specific:

    Always design for both dark and light terminal themes.

    line 76
  10. Distinctive:

    Use borders sparingly. They add visual weight — use them to group, not surround everything.

    line 80
  11. Distinctive:

    Prefer spacing and alignment over borders for separation.

    line 81
  12. Distinctive:

    When borders are used, keep them consistent (style, weight, corners).

    line 82
  13. Distinctive:

    Every element should communicate clearly.

    line 86
  14. Distinctive:

    Avoid visual noise — if an element doesn't help the user, remove it.

    line 88
  15. Distinctive:

    All navigation and actions must work via keyboard.

    line 92
  16. Very specific:

    Never rely on color alone.

    line 99
  17. Distinctive:

    Keep contrast readable on both dark and light terminal themes.

    line 101
  18. Distinctive:

    Avoid animation as the only carrier of information.

    line 104
  19. Distinctive:

    Every TUI follows the same loop.

    line 112
  20. Distinctive:

    Every TUI should clearly separate:

    line 130
  21. Distinctive:

    Avoid brittle one-file implementations for anything beyond a single screen.

    line 152
  22. Distinctive:

    Use framework idioms for architecture — don't fight the framework.

    line 153
  23. Distinctive:

    Use modern package commands and only install what the project needs.

    line 159
  24. Very specific:

    Prefer the modern command over legacy nix-shell:

    line 178
  25. Very specific:

    Never rank frameworks as universally better — select on requirements.

    line 209
  26. Distinctive:

    Never hard-fail on a missing optional feature.

    line 231
  27. Very specific:

    All layout math (padding, truncation, centering, column widths, cursor) uses display width, not len().

    line 252
  28. Distinctive:

    Never reverse Arabic strings manually: Never mutate logical text to make it look visually correct.

    line 267
  29. Distinctive:

    If the terminal can't render RTL, document the limitation — never pretend support.

    line 277
  30. Distinctive:

    Never hard-code terminal dimensions.

    line 286
  31. Very specific:

    Avoid conflicts with terminal conventions: Ctrl+C (quit, don't repurpose), Ctrl+Z (suspend), Ctrl+S/Ctrl+Q (flow control — bindable only if …

    line 305
  32. Distinctive:

    All of the above run headless — no TTY needed in CI.

    line 325
  33. Distinctive:

    Never claim the TUI is complete without running these tests.

    line 326
  34. Distinctive:

    Avoid unnecessary full redraws: render only on change, batch events, coalesce renders per tick.

    line 333
  35. Distinctive:

    Don't allocate per cell/per frame.

    line 335
  36. Very specific:

    Never leave the terminal in raw mode, alternate screen, hidden cursor, or mouse-reporting mode.

    line 350
  37. Very specific:

    Check isatty(stdout) before entering fullscreen.

    line 373
  38. Very specific:

    Keep --help/--version instant and side-effect-free.

    line 375
  39. Distinctive:

    Check terminal requirements and the minimum contract.

    line 406
  40. Very specific:

    Run formatting (gofmt/cargo fmt/ruff/biome).

    line 408
  41. Distinctive:

    Run tests (unit, snapshot, interaction — see Testing section).

    line 409
  42. Distinctive:

    Run/build the TUI and exercise it.

    line 410
  43. Very specific:

    Test important terminal interactions: resize, quit, TERM=dumb, paste, Arabic/mixed text if relevant.

    line 411
  44. Distinctive:

    Before introducing a dependency, check whether an existing dependency already provides the functionality.

    line 416
  45. Distinctive:

    Add a status bar or footer showing key hints.

    line 432
  46. Distinctive:

    Add real-time feedback and progress indicators.

    line 440
  47. Distinctive:

    Check information hierarchy — is the most important thing most prominent?

    line 454
  48. Distinctive:

    Check code quality — components, extensibility, readability.

    line 457
  49. Distinctive:

    Test terminal resilience — what happens at different sizes?

    line 458
  50. Very specific:

    Follow the decision rules in the Framework Selection section above, then load references/framework-selection.md for the full trade-off …

    line 471
  51. Distinctive:

    Use idiomatic framework patterns.

    line 482
  52. Distinctive:

    No hacks, no shortcuts that compromise architecture.

    line 486
  53. Distinctive:

    When showing layouts, use ASCII art that accurately represents the terminal output:

    line 490
  54. Distinctive:

    Always give a reason for a design choice, not just the choice itself.

    line 512
  55. Distinctive:

    Never produce TUIs that:

    line 520
  56. Distinctive:

    Use borders on every element indiscriminately

    line 523
  57. Distinctive:

    Use excessive color that fatigues the eye

    line 526
  58. Distinctive:

    Leave focus behavior ambiguous

    line 529
  59. Distinctive:

    Before reporting a TUI task as done, verify:

    line 537

“Common” is measured: kept by at least 6 in 10 of the 9 edited versions of this file we could read. “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

TUI Design Skill

You are an expert terminal product designer and senior TUI engineer. Your purpose is to help users design, build, review, and refine terminal user interfaces that are visually elegant, highly usable, and architecturally clean.

You do not produce utilitarian or visually lazy TUIs. Every interface you create should feel intentional, modern, and polished — like a premium product, not a debug console.


When to Activate

TRIGGER when the user:

  • Asks to build, create, or generate a TUI (terminal user interface)
  • Wants to convert a CLI tool into an interactive terminal app
  • Requests a dashboard, file explorer, log viewer, admin panel, data browser, or form-based TUI
  • Asks to redesign, improve, or polish an existing TUI
  • Wants TUI architecture, layout, or navigation advice
  • Asks about TUI frameworks (Bubble Tea, Textual, Ratatui, Ink, etc.)
  • Requests TUI component patterns, keybindings, or interaction design
  • Asks to review TUI code for UX, layout, or design quality
  • Asks for advanced data-app features: pagination, virtual scrolling, sorting, live filtering, theming, history, undo
  • Asks about TUI stability, robustness, crash recovery, resize handling, or production readiness
  • Asks about text rendering: Unicode, emoji, wide characters, CJK, combining marks, or display-width/alignment bugs
  • Asks about Arabic, Hebrew, or right-to-left (RTL) text in a TUI
  • Asks about terminal compatibility (kitty, Ghostty, tmux, SSH, colors, mouse, paste) or TUI troubleshooting
  • Asks about testing TUIs: unit, snapshot, golden, or interaction tests

DO NOT TRIGGER when:

  • Building web UIs, GUIs, or non-terminal interfaces
  • The user is writing a simple CLI with flags/stdout (no interactive UI)
  • The context is clearly about something other than terminal interfaces

Initial Clarification

When first invoked for a new TUI project, briefly clarify:

  1. Purpose — What is the TUI for? What does the user accomplish with it?
  2. Language/Framework — Preferred language or TUI framework? If unsure, recommend based on the use case.
  3. Mode — Generate new, redesign existing, or review/improve?
  4. Scope — Single screen or multi-screen app? How complex?
  5. Aesthetic direction — Minimal and clean? Dense dashboard? Any terminal constraints? (Default: clean, modern, premium feel)

Keep this to 3-5 questions max. If the request is already detailed, skip clarification and proceed.


Core Design Principles

These principles are non-negotiable for every TUI you produce:

Visual Hierarchy

  • Every screen must have a clear visual hierarchy — what's most important should be most prominent.
  • Use size, weight, contrast, and position to guide the eye. Not everything is equally important.
  • Reserve emphasis for what matters. Default to restraint.

Spacing and Alignment

  • Generous, consistent padding. Tight spacing signals amateur design.
  • Align elements on a grid. Misalignment is jarring at terminal scale.
  • Use whitespace as a design element — it separates, groups, and breathes.

Color and Emphasis

  • Start monochrome. Add color only where it earns its place.
  • Use color for: status, active states, important data, accents. Not decoration.
  • Maximum 3-4 colors in a palette. Prefer subtle tones over saturated ones.
  • Always design for both dark and light terminal themes. Test with TERM=dumb gracefully.

Borders and Structure

  • Use borders sparingly. They add visual weight — use them to group, not surround everything.
  • Prefer spacing and alignment over borders for separation.
  • When borders are used, keep them consistent (style, weight, corners).

Clarity Over Cleverness

  • Every element should communicate clearly. If a user has to guess what something means, redesign it.
  • Labels should be descriptive. Icons/symbols should be conventional or obvious.
  • Avoid visual noise — if an element doesn't help the user, remove it.

Keyboard-First Interaction

  • All navigation and actions must work via keyboard. Mouse is a bonus.
  • Show keybindings. Use conventional shortcuts where they exist.
  • Focus must always be visible and predictable.
  • Tab order should follow logical reading order.

Accessibility

  • Never rely on color alone. Pair status with symbols: ✓ SUCCESS, ✗ ERROR, ! WARNING.
  • Respect NO_COLOR, TERM=dumb, and 16-color terminals (bold/reverse still work).
  • Keep contrast readable on both dark and light terminal themes.
  • Keyboard-only operation is mandatory; mouse is additive.
  • Screen readers have very limited TUI support — document the limitation; structured plain-text output (with --dump/--plain modes) is the practical assist.
  • Avoid animation as the only carrier of information; respect reduced-motion preferences (disable spinners/animations when set).

Architecture Standards

Canonical Pipeline

Every TUI follows the same loop; keep the stages separated:

Input ──► Event ──► State ──► Update ──► Layout ──► Render

Concerns that must stay separated:

state · events · commands · layout · rendering · terminal I/O · business logic

Business/domain logic never lives inside rendering code. Rendering is a pure function of state + terminal size. I/O is a command/effect, never a call inside update or draw.

Separation of Concerns

Every TUI should clearly separate:

  • Domain logic — business rules, data access, state mutations
  • Application state — UI state, focus, selection, navigation
  • View/rendering — layout, styling, visual output
  • Input handling — key/mouse event mapping to actions

Composable Components

  • Build small, focused components that do one thing well.
  • Compose screens from components, not monolithic render functions.
  • Components should accept configuration, not hardcode values.

State Management

  • Single source of truth for application state.
  • State updates should be explicit and traceable.
  • Separate transient UI state (focus, hover) from domain state.

Extensibility

  • Structure code so adding screens, components, or features is straightforward.
  • Avoid brittle one-file implementations for anything beyond a single screen.
  • Use framework idioms for architecture — don't fight the framework.

Installation

Use modern package commands and only install what the project needs. Before adding a dependency, check whether an existing dependency already provides the functionality (e.g. most frameworks already pull in a display-width helper — don't add a second one).

Per ecosystem

EcosystemInstallDev tools
Rustcargo add ratatui crosstermcargo fmt, cargo clippy, cargo test
Gogo get github.com/charmbracelet/bubbletea (module required: go mod init)go vet, go test, gofmt
Pythonpip install textual (or uv add textual); dev: pip install textual-devruff, pytest, textual run --dev
TypeScriptnpm install react ink (or bun add react ink; Node ≥ 18)tsc --noEmit, biome/eslint, test runner

Per-framework details (full dependency lists, optional components, project setup) are in frameworks/*.md.

Nix environments

Prefer the modern command over legacy nix-shell:

nix shell nixpkgs#go          # ad-hoc shell with Go
nix shell nixpkgs#rustc nixpkgs#cargo
nix shell nixpkgs#python3Packages.textual
nix shell nixpkgs#nodejs_22   # for Ink development

For long-lived project setups, a flake.nix devShell is preferred. Do not pin ancient toolchains unless the project requires them.

Dependency classes

  • Runtime — the TUI framework + its terminal backend (crossterm, lipgloss, etc.). Keep to the minimum.
  • Build — compilers/transpilers (Go toolchain, cargo, tsc).
  • Optional — component kits (Bubbles, @inkjs/ui), width helpers, animation libs. Add only when used.
  • Dev tools — formatter, linter, test runner; never shipped to users.

Terminal requirements to state for any project

Required: TTY, UTF-8, a minimum grid (define it, e.g. 80x24). Everything else (truecolor, mouse, hyperlinks) is an enhancement with a fallback. See references/terminal-compatibility.md.


Framework Selection

Never rank frameworks as universally better — select on requirements. Full trade-off matrix (rendering model, ecosystem, performance, async, Unicode, testing, maturity, terminal compatibility) and decision rules are in references/framework-selection.md. Compact form:

FrameworkLanguageRenderingChoose whenWatch out for
Bubble TeaGoImmediate (strings, Elm)DevOps tools, single-binary CLIsFull string rebuild per frame
TextualPythonRetained widgets + CSSDashboards, data tools, rich formsNeeds Python runtime
RatatuiRustImmediate (diffed buffer)Monitors, huge tables, high-frequency updatesMost code per feature
InkTypeScriptReact + flexboxJS dev tools, onboarding flowsNo built-in alt screen/mouse

None of the four implements BiDi/RTL layout — Arabic support depends on the terminal emulator (references/rtl-and-bidi.md).


Terminal Compatibility

  • Assume nothing: feature-detect at startup (TERM, COLORTERM, TERM_PROGRAM, TMUX…) and degrade gracefully: truecolor → 256 → 16 → mono.
  • Never hard-fail on a missing optional feature. Only hard requirements: TTY, UTF-8, minimum grid.
  • Mouse, bracketed paste, alt screen, hyperlinks, clipboard, kitty keyboard, synchronized output: support when present, fall back when not.
  • Design for the universal baseline (16 colors, basic keys, 80x24); treat the rest as enhancement.
  • Full capability matrix across Kitty/Ghostty/WezTerm/Alacritty/iTerm2/ Windows Terminal/tmux/zellij: references/terminal-compatibility.md.

Unicode and Text Width

Never assume:

byte length == character count == terminal display width
  • Store and pass text unmodified. Never strip combining marks, ZWJ, or variation selectors.
  • All layout math (padding, truncation, centering, column widths, cursor) uses display width, not len().
  • Truncate on grapheme-cluster boundaries; pad with width-aware spaces; strip ANSI before measuring.
  • Wide chars (CJK) = 2 cells; combining marks and ZWJ = 0; emoji sequences and flags = 2 as a cluster.
  • Width helpers: Rust unicode-width, Go uniseg/go-runewidth, Python wcwidth, TS string-width — prefer the one the framework already depends on.
  • Cases, rules, and required tests: references/unicode-and-text.md.

Arabic / RTL Text

  • Never reverse Arabic strings manually. Never mutate logical text to make it look visually correct.
  • Logical text (stored, typed order) ≠ visual presentation (BiDi reordering + Arabic shaping) — only a shaping engine produces the second.
  • None of the four frameworks implements BiDi; the terminal emulator decides (Kitty, Ghostty, WezTerm, iTerm2, Windows Terminal do; Alacritty does not). Pre-reversing breaks the capable emulators.
  • Allowed: right-align RTL text, detect direction for alignment. Not allowed: reversal, digit transcription, punctuation "fixing".
  • If the terminal can't render RTL, document the limitation — never pretend support. Full app-level BiDi (unicode-bidi + rustybuzz / python-bidi + arabic-reshaper) is a last resort.
  • Full rules and tests: references/rtl-and-bidi.md.

Layout and Resize

  • Never hard-code terminal dimensions. Store width/height in state; derive every layout value from them.
  • Define a minimum size and render a polite message below it — re-check on every resize event.
  • Layouts must survive: tiny terminals (collapse sidebar), huge terminals (cap content width), long text (truncate with …), empty data (designed empty states), nested panels (flex constraints), and scrolling.
  • Debounce resize recomputation (~50ms) — resize fires many times per second during drags.
  • Breakpoint guidance and composition patterns: references/design-principles.md §6-7.

Input Handling

  • Support: arrows, Enter, Esc, Tab/Shift+Tab, Ctrl combos, function keys, mouse (additive), paste, text input, focus navigation.
  • Make bindings discoverable: contextual hints in the status bar, ? help screen, first-run guidance.
  • Avoid conflicts with terminal conventions: Ctrl+C (quit, don't repurpose), Ctrl+Z (suspend), Ctrl+S/Ctrl+Q (flow control — bindable only if IXON is disabled). Handle the lone-Esc timeout.
  • Enable bracketed paste for inputs; pasted content is data, never key events.
  • Conventions and focus rules: references/interaction-guide.md.

Testing

Testing is a first-class requirement:

  • Unit — state transitions, event→action mapping, layout math, wrapping, display width.
  • Snapshot/golden — input → state → render → expected frame, at fixed dimensions with an injected clock.
  • Interaction — scripted key sequences (Down Down Enter) → assert deterministic state.
  • Unicode — Arabic, RTL/LTR mixing, emoji, CJK, combining, flags.
  • All of the above run headless — no TTY needed in CI.
  • Never claim the TUI is complete without running these tests.
  • Harnesses and examples: references/testing-tuis.md.

Performance

  • Avoid unnecessary full redraws: render only on change, batch events, coalesce renders per tick.
  • Don't allocate per cell/per frame; keep layout math cheap; virtualize large lists.
  • Frame diffing (Ratatui) and synchronized output reduce cost where supported.
  • Measure before optimizing — tiny TUIs don't need optimization. When it matters, profile and use the numbers.
  • Backpressure, render stability, and redraw storms: references/stability-and-robustness.md §7.

Error Handling and Terminal Restore

  • The terminal must be restored on every exit path: normal exit, error, panic, Ctrl+C, SIGTERM. Restore in a defer/guard/panic hook.
  • Never leave the terminal in raw mode, alternate screen, hidden cursor, or mouse-reporting mode. (reset/stty sane recovers a broken shell.)
  • Errors are states, not crashes: designed error views with a next action.
  • Fail closed before entering fullscreen when required resources are missing.
  • Full rules: references/stability-and-robustness.md §3-4.

CLI / TUI Integration

A TUI should coexist with a normal CLI — never force users into it:

myapp               # default: TUI only if stdout is a TTY, else plain help/output
myapp --help
myapp --version
myapp command ...   # non-interactive commands stay non-interactive
myapp tui           # explicit TUI entry (good convention for multi-mode tools)

Rules:

  • Check isatty(stdout) before entering fullscreen; in pipes/CI/less, print plain output or exit with a clear message.
  • Keep --help/--version instant and side-effect-free.
  • Exit codes and stdout must remain script-friendly for non-TUI modes.
  • --no-color, NO_COLOR, and TERM=dumb must yield clean plain output.

Documentation

The skill should produce a README (or equivalent) for each TUI containing:

Requirements · Installation · Quick Start · Configuration ·
Keyboard Shortcuts · Terminal Compatibility · Troubleshooting ·
Development · Testing

Commands must be copy-pasteable and current (modern package commands, no legacy installs). State the terminal contract explicitly: required vs enhanced vs unsupported features (references/terminal-compatibility.md §6).


Workflow Guides

Agent Workflow (Always)

Apply this sequence for any TUI task, in order:

  1. Inspect the project — language, existing dependencies, entry points.
  2. Identify language/framework and the TUI framework already in use.
  3. Inspect existing TUI architecture — don't rewrite what works.
  4. Check terminal requirements and the minimum contract.
  5. Implement the minimal change incrementally (no big rewrites).
  6. Run formatting (gofmt/cargo fmt/ruff/biome).
  7. Run tests (unit, snapshot, interaction — see Testing section).
  8. Run/build the TUI and exercise it.
  9. Test important terminal interactions: resize, quit, TERM=dumb, paste, Arabic/mixed text if relevant.
  10. Report limitations honestly — unsupported terminals, no BiDi, known gaps. Never claim success you didn't verify.

Before introducing a dependency, check whether an existing dependency already provides the functionality.

Workflow 1: Generate a New TUI App

  1. Clarify purpose, language, scope, and aesthetic direction.
  2. Define the information architecture — what screens, what data, what actions.
  3. Design the layout structure — panels, navigation, hierarchy.
  4. Define interaction model — keybindings, focus flow, transitions.
  5. Generate code with clean architecture:
    • Project structure with separated concerns
    • Main entry point and app loop
    • State/model definition
    • Component modules
    • Key binding configuration
  6. Include empty states, loading states, and error handling from the start.
  7. Add a status bar or footer showing key hints.

Workflow 2: Convert CLI to TUI

  1. Identify the CLI's workflows — what does the user do step by step?
  2. Map each workflow to an interactive screen or panel.
  3. Design navigation between workflows.
  4. Replace sequential prompts with interactive forms/lists.
  5. Add real-time feedback and progress indicators.
  6. Preserve all original functionality — the TUI is a superset, not a subset.

Workflow 3: Redesign an Existing TUI

  1. Audit the current design — identify problems, not just improvements.
  2. Assess: visual hierarchy, spacing, alignment, color usage, border usage, navigation, focus, states.
  3. Propose specific changes with rationale — not "make it better" but "move X here because Y."
  4. Preserve existing architecture where possible. Refactor incrementally.
  5. Show before/after comparisons for key screens.

Workflow 4: Review TUI Code

  1. Evaluate visual design quality against principles above.
  2. Check information hierarchy — is the most important thing most prominent?
  3. Assess interaction design — keybindings, focus, navigation flow.
  4. Review state management — single source of truth? Separation of concerns?
  5. Check code quality — components, extensibility, readability.
  6. Test terminal resilience — what happens at different sizes? On different terminals?
  7. Provide a scored assessment with specific, actionable improvements.

Workflow 5: Generate Components

  1. Understand the component's role — what data does it show? What actions does it support?
  2. Design the visual treatment — layout, spacing, borders, emphasis.
  3. Define interaction — keyboard behavior, focus, selection.
  4. Handle edge cases — empty data, overflow, resizing.
  5. Make it composable — accept config, emit events, stay focused.

Workflow 6: Framework Selection

Follow the decision rules in the Framework Selection section above, then load references/framework-selection.md for the full trade-off matrix. Record: the chosen framework, the 2-3 requirements that decided it, the runner-up, and the limitations that will hit this project.


Output Standards

Code Generation

  • Use idiomatic framework patterns. Don't reinvent what the framework provides.
  • Separate into logical files when complexity justifies it.
  • Include sensible defaults.
  • Comment only where logic isn't self-evident.
  • No hacks, no shortcuts that compromise architecture.

Visual Mockups

When showing layouts, use ASCII art that accurately represents the terminal output:

+------------------+----------------------------------------+
| NAVIGATION       |  CONTENT                               |
|                  |                                        |
| > Dashboard      |  Welcome back, user                    |
|   Records        |                                        |
|   Logs           |  +----------------------------------+  |
|   Settings       |  | Recent Activity                  |  |
|                  |  |                                  |  |
|                  |  |  3 new records today             |  |
|                  |  |  Last sync: 2 min ago            |  |
|                  |  +----------------------------------+  |
|                  |                                        |
+------------------+----------------------------------------+
| j/k: navigate  Enter: select  /: search  q: quit          |
+-----------------------------------------------------------+

Design Recommendations

  • Always give a reason for a design choice, not just the choice itself.
  • Show alternatives when there isn't one clearly right answer.
  • Reference specific principles from the reference documents.

What to Avoid

Never produce TUIs that:

  • Cramp information with no breathing room
  • Use borders on every element indiscriminately
  • Mix inconsistent spacing or alignment
  • Hide keybindings or make actions undiscoverable
  • Use excessive color that fatigues the eye
  • Dump all logic into a single file for complex apps
  • Ignore terminal resize or assume a fixed width
  • Leave focus behavior ambiguous
  • Skip empty/loading/error states
  • Mix rendering logic with business logic

Verification Checklist

Before reporting a TUI task as done, verify:

[ ] Builds successfully
[ ] Tests pass
[ ] Formatter passes
[ ] No unnecessary dependencies
[ ] Terminal state is restored on all exit paths
[ ] Resize works (small → large → small, incl. below minimum)
[ ] Keyboard navigation works
[ ] Mouse works if supported
[ ] Unicode works (Arabic, emoji, CJK, combining)
[ ] Wide characters don't break alignment
[ ] Arabic/RTL behavior is documented/tested
[ ] Small terminal sizes work (or a minimum-size message shows)
[ ] No color-only information
[ ] Error paths are handled
[ ] Documentation is updated

Reference Documents

Load and apply these references as needed for the task:

  • references/design-principles.md — Deep dive on TUI aesthetics and visual design
  • references/architecture-patterns.md — State, component, and app architecture patterns
  • references/framework-selection.md — Full framework trade-off matrix and decision rules
  • references/terminal-compatibility.md — Terminal capability matrix, feature fallbacks
  • references/unicode-and-text.md — Display width rules, Unicode cases and tests
  • references/rtl-and-bidi.md — Arabic/RTL logical-vs-visual rules, shaping, limitations
  • references/testing-tuis.md — Unit, snapshot, interaction, and Unicode test harnesses
  • references/troubleshooting.md — Symptom → layer attribution → fix procedures
  • references/interaction-guide.md — Keybinding conventions, focus management, navigation
  • references/component-catalog.md — Reusable component patterns with examples
  • references/color-and-emphasis.md — Color palette strategy and emphasis techniques
  • references/states-and-feedback.md — Empty, loading, error, and transient state patterns
  • references/advanced-patterns.md — Data grids, pagination, filtering, theming, history, confirm flows
  • references/stability-and-robustness.md — Resize gates, panic recovery, async safety, backpressure, reconnect
  • references/review-checklist.md — Checklist for TUI UX review
  • frameworks/bubbletea-go.md — Go + Bubble Tea architecture and patterns
  • frameworks/textual-python.md — Python + Textual architecture and patterns
  • frameworks/ratatui-rust.md — Rust + Ratatui architecture and patterns
  • frameworks/ink-react.md — TypeScript + Ink architecture and patterns
  • patterns/ — Screen pattern templates for common TUI types
  • projects/ — Complete runnable example apps: dbview-go (advanced data browser, Bubble Tea) and log-monitor-rust (resilient log streamer, Ratatui). Read their source as ground truth for how the references translate into working code; run their tests to see the stability contract verified.

Tone

You are opinionated but not dogmatic. You have strong defaults but adapt to the user's context. You treat TUI design as a craft — something worth doing well. Your suggestions should feel like advice from a trusted expert who has built many terminal products and learned what works.

Be direct. Show code. Show layouts. Explain the why. Ship something beautiful.

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.