hyperb1iss/hyperskills3 files

Tui Design

Use this skill when designing terminal user interfaces, creating TUI layouts, choosing TUI color schemes, implementing keyboard navigation, building terminal dashboards, or working with any TUI framework. Activates on mentions of TUI design, terminal UI, Ratatui layout, Ink components, Textual widgets, Bubbletea views, terminal color palette, keybinding design, panel layout, split panes, terminal dashboard, box-drawing characters, sparklines, progress bars, modal dialogs, focus management, or terminal accessibility.

Specification
Skill ID
hyperb1iss/hyperskills/tui-design
Publisher
hyperb1iss
Repository
hyperskills
Installs
0
Files
3
Synced
Sep 23, 2026
How to use it

Open any RiverX project, open the Skills panel in the chat, and search for this identifier. The files are fetched from the source repository at install time.

hyperb1iss/hyperskills/tui-designInstalls these files
  • SKILL.md
  • references/app-patterns.md
  • references/visual-catalog.md

What this skill tells the agent

TUI Design System

Design around the user's repeated action, the data they must keep in view, and the terminal capabilities actually available. Keep input responsive under slow I/O and make selection, focus, and operation state explicit.

Primary documentation checked: 2026-09-04. Framework APIs change; use the project's versions. Follow the project's visual identity (SilkCircuit Neon for Bliss's personal tools) rather than treating an example palette as a universal theme.

Choose the Layout from the Work

WorkLayoutUseful invariant
Browse related lists and detailsPersistent multi-panelStable panel roles and visible focus
Navigate a hierarchyMiller columns or drill-down stackBack restores selection and scroll position
Monitor changing measurementsWidget dashboardLabels, units, freshness, and a path to details
Edit requests, queries, or configurationSidebar, editor, resultsKeep editing state when switching panels
Select a value for a shell commandInline picker or overlayReturn a clean value and preserve shell scrollback
Read logs or eventsFixed controls plus virtualized listFollow mode is explicit; scrolling back stops auto-follow

Read app-patterns.md for examples and tradeoffs. Read visual-catalog.md only when selecting glyphs, borders, charts, or indicators.

Responsive Behavior

Use constraints and content priorities. Keep the selected item visible while collapsing secondary panels; preserve state when they reappear. Recompute layout on resize without treating a zero-sized transient area as an error. Clamp scrolling after filtering, deletion, or a smaller viewport.

Test narrow, ordinary, and wide layouts, including rapid resizing. The minimum usable size follows the task; 80x24 is a useful test case, not permission to disable a picker that would work in 40 columns. A size message should retain quit and recovery input.

Input, Focus, and Editing

ConcernDecision
Basic navigationSupport arrows, Enter, Escape, and discoverable focus movement
Expert shortcutsAdd vim motions or a command palette when they improve repeated work
Text fieldsPrintable keys edit text; q, j, /, and mnemonic actions must not fire globally
Multi-key shortcutsShow pending context and resolve Escape/prefix ambiguity through the input library
Modal dialogRoute input only to the modal; restore the prior valid focus target when it closes
Destructive actionShow the exact target and consequence; choose confirmation proportional to reversibility
Mouse supportMatch keyboard actions and provide a way to disable capture for terminal text selection

Maintain one owner for input parsing. With Crossterm, do not mix EventStream with read/poll, or run competing readers. Handle key press, repeat, and release deliberately; one physical press must not submit twice.

Enhanced keyboard protocols can distinguish keys that legacy terminals encode identically. Negotiate support and retain usable fallback bindings. Never assume Ctrl+I differs from Tab or Ctrl+M from Enter everywhere. Treat bracketed paste as a text event; pasted newlines must not accidentally submit destructive commands.

Raw mode can disable the terminal's normal signal handling. Implement Ctrl+C and suspend/resume deliberately through the framework; do not assume the OS will handle them unchanged. Restore terminal state before handing control to an editor, pager, shell, or suspended process, then reacquire it and redraw.

Show a short footer for currently available actions and a contextual help view. Keep essential instructions visible while a task is running. Durable errors need a retrievable location; a disappearing toast cannot be the only record.

State and Async Work

Separate input events, state transitions, effects, and rendering. Render a snapshot of state without starting network calls or mutating the domain model from a drawing function.

digraph tui_state {
    rankdir=LR;
    event -> update;
    update -> state;
    update -> effect;
    effect -> event [label="result + request identity"];
    state -> render;
}
Failure modeDesign response
Search A completes after search BTag requests and discard results that no longer match the active query
A row moves after a refreshTrack selection by stable identity, not only a row index
A view closes while work runsCancel owned work or detach it deliberately; late results must not resurrect the view
A cancelled write may already have reached the serverDistinguish cancelled waiting from confirmed rollback; reconcile remote state
Logs arrive faster than screen updatesRetain required events in the data layer and render a virtualized viewport
Work blocks the UI despite async syntaxIdentify blocking calls or CPU work and move them off the input/render path
Repeated action would start duplicate writesTrack pending operation identity and show its result before accepting a conflicting action

Batch state updates and render changed frames. Coalesce replaceable visual snapshots, not audit events or mutations. Diagnose queue growth, indexing, and allocation costs before dropping data or capping concurrency.

Terminal Capability Policy

Explicit application settings take precedence. In automatic mode, respect a non-empty NO_COLOR before color detection. A color override can opt back in deliberately; disabling color need not disable bold, underline, layout, or every terminal feature.

CapabilityEvidence and fallback
Interactive terminalCheck the actual input/output TTYs; support plain output or explain the need for a TTY
True colorUse the library's detection, terminfo, or negotiated support; COLORTERM is a hint, not a requirement
256/16 colorsMap semantic slots to supported colors and preserve labels and focus without hue
Images, hyperlinks, clipboardNegotiate the protocol through multiplexers; provide a text or file alternative
Nerd Font iconsMake them explicit or user-configurable; there is no portable reliable font-detection API
Unicode layoutSegment graphemes and measure terminal cell width; do not use byte or code-point length

Use this skill in a project

Open any RiverX project, search the Skills panel for hyperb1iss/hyperskills/tui-design, and install it in one click.

Use this skill