{"data":{"slug":"discovered-08fbe3465626ebeb549aac23d74c40838ab5db7622449922","title":"Tui Expert","summary":"Design, build, review, or refine responsive Terminal User Interfaces (TUIs), especially for Rust Ratatui and Ruby TTY\/cli-ui applications. Focus on TUI state and event architecture, terminal layout, navigation, keyboard and text-input behavior, async data loading, accessibility, rendering, resizing, and visual polish.","url":"https:\/\/skillshunter.net\/skills\/discovered-08fbe3465626ebeb549aac23d74c40838ab5db7622449922","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/discovered-08fbe3465626ebeb549aac23d74c40838ab5db7622449922","markdown_url":"https:\/\/skillshunter.net\/skills\/discovered-08fbe3465626ebeb549aac23d74c40838ab5db7622449922.md","download_url":"https:\/\/skillshunter.net\/skills\/discovered-08fbe3465626ebeb549aac23d74c40838ab5db7622449922\/download","category":{"slug":"software-development","name":"Software & Development"},"editor_note":"Ensure that global hotkeys such as `a`, `c`, `q`, `\/`, and `?` only fire outside text-entry mode, unless combined with an explicit modifier such as `Ctrl`. `Esc` must exit input mode or clear focus before returning to normal navigation. `Ctrl+C` or the configured emergency quit remains available even while editing text. Text input focus must override global printable-key hotkeys when a search box, command palette, URL field, or free-form editor is focused.","instructions":"---\nname: tui-expert\ndescription: >-\n  Design, build, review, or refine responsive Terminal User Interfaces (TUIs), especially Rust\n  Ratatui and Ruby TTY\/cli-ui applications. Use for TUI state and event architecture, terminal\n  layout, navigation, keyboard and text-input behavior, async data loading, accessibility,\n  rendering, resizing, empty\/error\/loading states, or visual polish. When the product also exposes\n  scriptable commands, use cli-design alongside this skill for the CLI contract.\n---\n\n# TUI Expert\n\nThis skill provides the architectural and interaction foundation for terminal user interfaces across Rust, Ruby, Go, and other ecosystems. It owns the interactive surface; the separate `cli-design` skill owns scriptable command contracts.\n\n## Compose the TUI with a CLI\n\nWhen a tool has both interfaces, load `cli-design` and keep them as sibling presentation adapters over shared application behavior.\n\n- Preserve an established bare-command TUI when compatibility requires it; for new automation-first tools, prefer an explicit `<tool> tui` entry.\n- Make important TUI reads and mutations available through documented non-interactive commands unless the operation is inherently visual or continuous.\n- Keep auth, configuration, validation, permissions, dry-run behavior, and result semantics consistent across both interfaces.\n- Keep rendering, keyboard state, and navigation out of the CLI layer; keep stdout\/stderr formatting and pipe behavior out of the TUI state model.\n- Test parity for the same operation through the shared application layer, then test each adapter's terminal contract separately.\n\nDo not duplicate a domain-specific CLI tree here. Use the CLI skill to derive commands from the product's actual resources and workflows.\n\n## Core Architectural Pattern: The \"Orchestrated State\"\n\nRegardless of the language, modern TUIs follow a state-driven approach where the UI is a pure function of the application state.\n\n1. **Models:** Raw data structures and domain logic.\n2. **Client:** Low-level wrapper for I\/O (HTTP, SSH, File System) with connection pooling.\n3. **Conductor\/Orchestrator:** Handles the lifecycle of data, parallelisation, and caching.\n4. **App State:** Manages user interaction (selections, filtering, modes).\n5. **UI\/View:** Transforms the `App State` into terminal frames.\n\n### Language-Specific Selection\n\n- **For Rust (Ratatui)**: Use the [rust_ratatui.md](references\/rust_ratatui.md) for layout engine and widget patterns.\n- **For Ruby (TTY\/cli-ui)**: See [ruby_specific.md](references\/ruby_specific.md) for modular gems and framing patterns.\n\n### Domain-Specific Patterns\n\n- **Monitoring (System\/Network)**: See [monitoring.md](references\/monitoring.md)\n- **Data & DB Management**: See [data_management.md](references\/data_management.md)\n- **File Management**: See [file_management.md](references\/file_management.md)\n- **Media & Entertainment**: See [media_entertainment.md](references\/media_entertainment.md)\n\n## Expert TUI Workflow (General)\n\n1. **Research:** Understand the data source. TUIs are \"windows into data\".\n2. **Strategy:** Plan the layout segmentation (Header \/ Content \/ Status).\n3. **Act:** Build in layers: Data Client -> State Manager -> UI Components.\n4. **Validate:** Test resizing, narrow and non-UTF-8 terminals, keyboard-only use, text-entry focus, empty\/loading\/error states, and clean shutdown.\n\n## Getting to \"Good\" Faster\n\nWhen the team builds multiple Rust TUIs, optimize for a shared foundation instead of repeating screen patterns:\n\n1. **Shared app shell:** Standardize header, footer, status line, hotkey help, loading, and error states.\n2. **Small component kit:** Reuse list, detail pane, inspector, confirmation dialog, toast\/banner, and empty state widgets.\n3. **Real design system:** Define spacing, borders, color roles, emphasis, and icon rules so each app feels related without copy-paste layouts.\n4. **Consistent navigation model:** Use the same modes everywhere, such as browse, filter, inspect, edit, and confirm.\n5. **Conductor\/state layer:** Keep async loading, caching, refresh, and error handling out of the view layer.\n6. **Graceful empty\/error\/loading states:** Treat these as first-class screens, not afterthoughts.\n7. **Terminal UX tests:** Add snapshot coverage for common screen recipes and verify narrow, tall, empty, and error states.\n8. **Screen recipes:** Maintain reusable patterns like list + detail, table + inspector, dashboard + drilldown, and command palette.\n\nPractical guidance:\n\n- Make modals the exception, not the default detail view.\n- Prefer side panels or inspectors for drilldown when space allows.\n- Keep keyboard shortcuts consistent across apps so users do not relearn the same actions.\n- Build one polished shared layout first, then let each app supply only its domain data and screen-specific widgets.\n\n## Text Input and Hotkeys\n\nText input focus must override global printable-key hotkeys. When a search box, command palette, URL field, or free-form editor is focused, printable keys are inserted into the input instead of being handled as global actions.\n\nRequired behavior:\n\n- Global hotkeys such as `a`, `c`, `q`, `\/`, and `?` only fire outside text-entry mode, unless combined with an explicit modifier such as `Ctrl`.\n- `Esc` exits input mode or clears focus before returning to normal navigation.\n- `Ctrl+C` or the configured emergency quit remains available even while editing text.\n- Tests must cover typing words that contain hotkey letters, such as `query`, `account`, and URL-like strings.\n\n## Global TUI Aesthetics\n\n- [ ] **Colour:** Use a small semantic palette with sufficient contrast; remain understandable with `NO_COLOR`, limited colour, and monochrome terminals.\n- [ ] **Hotkey Discoverability:** Always show shortcut keys in brackets or a distinct colour (e.g., `[q] quit`).\n- [ ] **Icons & Symbols:** Use UTF-8 symbols only with a tested ASCII fallback and never as the sole status signal.\n- [ ] **Adaptive UI:** Collapse panels or switch views based on terminal width\/height.\n- [ ] **Muted Meta:** Dim secondary data (timestamps, hashes) to reduce cognitive load.\n\n## Colour as a UI Primitive\n\nUse colour strategically without making it the only carrier of meaning:\n\n- **Status Perception:** Red\/Yellow\/Green for health.\n- **Hierarchy:** Highlighting the \"active\" item in a list with a distinct background.\n- **Focus:** Greying out inactive sections.\n","use_cases":["Designing TUIs for Rust Ratatui applications","Building TUIs with Ruby TTY\/cli-ui","Reviewing TUI state and event architecture","Implementing terminal layout and navigation","Testing keyboard and text-input behavior in TUIs","Ensuring async data loading and rendering in TUIs"],"limitations":[],"compatibility":[],"setup_tip":null,"sample_input":null,"sample_output":null,"source_url":"https:\/\/github.com\/damacus\/skills\/blob\/5706f70c0058822adf29da9bd7620c7ea780b9d6\/skills\/tui\/tui-expert\/SKILL.md","source_commit":"5706f70c0058822adf29da9bd7620c7ea780b9d6","license":null,"version":null,"listing_approved_at":"2026-12-02","created_at":"2026-11-30T08:54:48.000000Z","updated_at":"2026-12-02T09:15:01.000000Z","seo_title":"TUI Expert - Design and Build Responsive Terminal User Interfaces","seo_description":"Expertise in designing, building, and refining responsive Terminal User Interfaces (TUIs) for Rust Ratatui and Ruby TTY\/cli-ui applications. Focus on state and event arch","seo_keywords":["TUI design","Rust Ratatui","Ruby TTY\/cli-ui","Terminal User Interface","TUI state architecture","TUI event handling","Terminal layout","TUI navigation"]}}