本文へ移動
cccskills
無料GitHub で公開

tui-design-system

Use when designing or building any terminal user interface — choosing a layout paradigm, keybindings/interaction model, color system, data visualization, or motion. Framework-agnostic universal patterns that work with Ratatui, Ink, Textual, Bubbletea, or any TUI toolkit. For the repo's own pythinker-code TUI, use write-tui instead.

インストール方法を見る

含まれるファイル(1)

  • SKILL.md15.9 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

TUI Design System

Universal design patterns for building exceptional terminal user interfaces. Framework-agnostic — works with Ratatui, Ink, Textual, Bubbletea, or any TUI toolkit.

For editing this repo's terminal UI (apps/pythinker-code/src/tui), use the write-tui skill instead. This skill is the cross-project design vocabulary.

Core philosophy: TUIs earn their power through spatial consistency, keyboard fluency, and information density that respects human attention. Design for the expert's speed without abandoning the beginner's discoverability.

Design process

digraph tui_design {
    rankdir=TB;
    "What are you building?" [shape=diamond];
    "Select layout paradigm" -> "Design interaction model" -> "Define visual system" -> "Validate against anti-patterns" -> "Ship it";
    "What are you building?" -> "Select layout paradigm";
    "Ship it" [shape=doublecircle];
}
  1. Pick a layout paradigm from what you're building.
  2. Design the interaction model (navigation, keybindings, help, dialogs).
  3. Define the visual system (color tiers, semantic slots, hierarchy).
  4. Add data visualization and motion where they earn their place.
  5. Validate against the anti-patterns checklist, then ship.

1. Layout paradigm selector

App typeParadigmExamples
File managerMiller Columnsyazi, ranger
Git / DevOps toolPersistent Multi-Panellazygit, lazydocker
System monitorWidget Dashboardbtop, bottom, oxker
Data browser / K8sDrill-Down Stackk9s, diskonaut
SQL / HTTP clientIDE Three-Panelharlequin, posting
Shell augmentationOverlay / Popupatuin, fzf
Log / event viewerHeader + Scrollable Listhtop, tig

Persistent Multi-Panel

All panels visible simultaneously; focus shifts between them. Users build spatial memory — "branches are always bottom-left."

┌─ Status ──┬─────────── Detail ──────────┐
├─ Files ───┤                             │
│ > file.rs │  diff content here...       │
│   main.rs │                             │
├─ Branches ┤                             │
│ * main    │                             │
│   feat/x  │                             │
└───────────┴─────────────────────────────┘
  [q]uit [c]ommit [p]ush [?]help

Use for: multi-faceted tools needing simultaneous context (git clients, container managers, monitoring). Key rule: panels keep fixed positions across sessions. Never rearrange without user action.

Miller Columns

Three-pane past/present/future navigation: parent (left), current (center), preview (right).

┌── Parent ──┬── Current ──┬── Preview ────────┐
│   ..       │ > config/   │ port: 8080        │
│   src/     │   lib/      │ host: localhost   │
│ > config/  │   main.rs   │ log_level: debug  │
│   tests/   │   mod.rs    │ db_url: postgres  │
└────────────┴─────────────┴───────────────────┘

Use for: navigating hierarchical data where context above and below matters. Key rule: selecting in the center shifts everything left; the preview always reflects the highlighted item.

Drill-Down Stack

One level at a time; navigation pushes/pops levels like a stack. Breadcrumb shows depth.

 Context > namespace: prod > pods
┌─────────────────────────────────────────────┐
│ NAME              READY   STATUS    AGE       │
│ > api-7f9c        2/2     Running   3d        │
│   worker-1a2b     1/1     Running   3d        │
└─────────────────────────────────────────────┘
 :pods  :deploy  :svc        [Enter] drill [Esc] up

Use for: deep hierarchies where showing all levels at once is impractical (Kubernetes, DB schemas). Key rule: always show the navigation path as a breadcrumb. Provide a :resource command mode for direct jumps.

Widget Dashboard

Self-contained widget panels with independent data. All info visible at once; no navigation required.

┌─── CPU ──────────────┬─── Memory ──────────┐
│ ▁▂▃▅▇█▇▅▃▂▁▂▃▅▇      │ ████████░░ 78%       │
│ core0: 45% core1: 67%│ 12.4G / 16.0G        │
├─── Network ──────────┼─── Disk ─────────────┤
│ ▲ 1.2 MB/s ▼ 340KB/s │ /: 67%  /home: 45%   │
├─── Processes ────────┴──────────────────────┤
│ PID   USER  CPU%  MEM%  CMD                  │
│ 1234  root  23.4  4.5   postgres             │
└──────────────────────────────────────────────┘

Use for: monitoring, real-time status, dashboards. Key rule: each widget is self-contained with its own title. Use braille/block characters for density.

IDE Three-Panel

Sidebar (left), editor/main (center), detail/output (bottom). Tab bar along top. Use for: editing-focused tools (SQL clients, HTTP tools, config editors). Key rule: sidebar toggles with a single key. Center supports tabs. Bottom panel can expand to full height.

Overlay / Popup

TUI appears on demand over the shell, disappears after use. Use for: shell augmentations (history search, file picker, command palette). Key rule: configurable height; return the selection to the caller; never disrupt scrollback.

Header + Scrollable List

Fixed header with meters/stats, scrollable data below, function bar at bottom. Use for: single-purpose viewers of one stream (process lists, logs, commit history). Key rule: header and footer stay pinned; only the middle scrolls.


2. Responsive layout

Terminals resize constantly. Pick a degradation strategy and test it.

StrategyBehavior
Priority collapseLess important panels hide first below minimum width
StackingPanels collapse to title-only bars; the active one expands (zellij pattern)
Breakpoint modesSwitch layout entirely below a threshold (multi-panel → single panel)
Minimum size gateShow "terminal too small" below a usable minimum

Rules:

  • Define a minimum size (typically 80×24). Below it, show a resize message.
  • Never crash on resize. Handle SIGWINCH gracefully.
  • Use constraint-based layouts (percentages, min/max, ratios) — not absolute positions.
  • Test at 80×24, 120×40, 200×60.

3. Interaction model

Navigation style by complexity

App complexityRecommended model
Single-purpose, <20 actionsDirect keybinding (every key = action)
Multi-view, complexVim-style modes + contextual footer
IDE-like, many featuresCommand palette + tabs + vim motions
Data browserDrill-down + fuzzy search + : command mode

Keyboard design layers

LayerKeysAudienceAlways shown?
L0 Universalarrows, Enter, Esc, qEveryoneYes (footer)
L1 Vim motionshjkl / ? : gg GIntermediateYes (footer)
L2 Actionssingle mnemonics: delete, commit, pushRegularOn ? help
L3 Powercomposed commands, macros, custom bindingsPowerDocs only

Lingua franca (don't deviate): j/k down/up · h/l left/right or collapse/expand · / search · ? help · : command mode · q quit (or Esc back one level) · Enter select/confirm/drill · Tab switch focus · Space toggle selection · g/G top/bottom.

Never bind: Ctrl+C (interrupt), Ctrl+Z (suspend), Ctrl+\ (quit). They belong to the terminal.

Focus management

  • Only one widget receives input at a time. Tab/Shift+Tab cycle focus.
  • Focus indicator: highlighted border, color change, or cursor presence. Unfocused panels are dimmed or use thinner borders.
  • Modal dialogs are focus traps — the background receives no events.
  • Nested focus: the outer container routes events to the focused child.

Search & filtering

Universal pattern: press /, type, results filter live.

  • n/N next/previous match · Esc dismiss.
  • Fuzzy by default; ' prefix for exact. Highlight matched characters. Preview updates for the highlighted result.

Help — three tiers

TierTriggerContentAudience
Always visibleFooter bar3–5 essential shortcutsEveryone
On demand?Full keybindings for current contextRegular
Documentation--help / man pageComplete referencePower

Footer format: [q]uit [/]search [?]help [Tab]focus [Enter]select. Make it context-sensitive — show only what's actionable right now.

Dialogs & confirmation

SeverityPattern
ReversibleJust do it; brief status-bar confirmation
Moderate (delete file)Inline "Press y to confirm"
Severe (drop database)Modal requiring the resource name typed in
Irreversible batch--dry-run flag + explicit confirmation

Modals render over a dimmed background. Toasts auto-dismiss in 3–5s. Status-bar messages are vim-style one-liners that auto-fade.


4. Color design system

Terminal color tiers — design for graceful degradation

TierSequenceColorsStrategy
16 ANSI\033[31m16 (relative)Foundation; terminal theme controls appearance
256\033[38;5;{n}m256Extended; fixed colors may clash with themes
True color\033[38;2;{r};{g};{b}m16.7M (absolute)Full control; needs COLORTERM=truecolor

Detection order: COLORTERM=truecolor|24bit → true color · TERM contains 256color → 256 · NO_COLOR set → no color · else 16 ANSI.

Golden rule: the TUI must be usable in 16-color mode. True color enhances — it never creates the hierarchy.

Semantic color slots — name by function, not appearance

SlotPurposeTypical dark
fg.defaultBody text#c0caf5
fg.mutedSecondary / metadata#565f89
fg.emphasisHeaders, focused#e0e0e0
bg.basePrimary background#1a1b26
bg.surfacePanel/widget bg#24283b
bg.overlayPopup/dialog bg#414868
bg.selectionSelected highlight#364a82
accent.primaryInteractive / focus#7aa2f7
accent.secondarySupporting#bb9af7
status.errorErrors / deletions#f7768e
status.warningCaution#e0af68
status.successSuccess / additions#9ece6a
status.infoInformational#7dcfff

Never hardcode hex in widget code. Always reference a semantic slot.

Visual hierarchy techniques

TechniqueEffectUse for
Bold (SGR 1)More weightHeaders, labels, active items
Dim (SGR 2)Less weightMetadata, timestamps
Italic (SGR 3)DistinctionComments, types
Underline (SGR 4)ActionableLinks, URLs
Reverse (SGR 7)Swap fg/bgSelection (always works!)
Strikethrough (SGR 9)NegationDeleted/deprecated

Recipe: 80% of content in fg.default. Headers bold + fg.emphasis. Metadata dim + fg.muted. Status in semantic colors. Accents for interactive elements only.

Background layering

Create depth without borders by stepping lightness: bg.base → bg.surface → bg.overlay, each ~5–8% lighter in dark themes. The contrast gradient reads as depth and reduces the need for box-drawing.

Theme architecture & accessibility

  • Base16 pattern: 8 monotones (background↔foreground gradient) + 8 accents. Ship a dark theme by default, at least one light variant, and respect NO_COLOR.
  • WCAG AA: 4.5:1 for body text, 3:1 for large text / UI elements.
  • Never use color alone — pair with symbols (✓ ✗ ▲), text, position, or typography.
  • Color-blind-safe pairs: blue+orange, blue+yellow, black+white. Avoid red vs green as the only signal.
  • Test: monochrome mode, a color-blindness simulator, 3+ terminal emulators, light and dark.

5. Data visualization

Character-resolution building blocks

ElementCharactersResolutionUse for
Full blocks█▉▊▋▌▍▎▏8 steps/cellProgress bars, bar charts
Shade blocks░▒▓█4 densitiesHeatmaps, density plots
Braille⠁⠂…⣿ (U+2800–28FF)2×4 dots/cellHigh-res line/scatter
Sparkline▁▂▃▄▅▆▇█8 heightsInline mini-charts

Common widgets

WidgetPatternTips
Progress bar[████████░░░░] 67%Show % + ETA; gradient green→yellow→red by urgency
Sparkline▁▂▃▅▇█▇▅▃▂Inline time-series in headers/status bars
GaugeCPU [██████████░░] 83%Label + bar + value; color by threshold
TableSortable, zebra stripesNumbers right, text left; truncate with …
Tree├── └── │ guidesIndent 2–4/level; expand/collapse with Enter
Diffgreen +, red -Word-level highlight within changed lines
Logcolored level + ts + msgTRACE dim · DEBUG cyan · INFO default · WARN yellow · ERROR red · FATAL red+bold

Spinners

ContextSpinnerInterval
Default / modernbraille ⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏80ms
Minimal-|/130ms
Heavy processingblocks ▖▘▝▗100ms

Spinners for indeterminate work, progress bars for determinate. Show spinners only after a ~200ms delay so fast operations don't flash.


6. Animation & motion

Flicker-free rendering, three layers — all required:

  1. Double buffering — render to an off-screen buffer, then swap. Never paint directly to the visible screen.
  2. Diff-based updates — compute the changed cells and emit only those escape sequences; don't repaint the whole screen each frame.
  3. Frame budget — cap at the display rate (15–60 fps is plenty for a TUI). Coalesce rapid state changes into one frame; throttle on resize.

Motion guidelines:

  • Animate to communicate state change (loading, transition, focus move), not for decoration.
  • Keep transitions short (<150ms feel). Anything longer needs a cancel path.
  • Respect reduced-motion preferences and NO_COLOR-style restraint — offer a static fallback.
  • Never animate on every keystroke; input must always feel instant.

7. Validate against anti-patterns

Before shipping, confirm none of these are true:

  • Crashes or corrupts on resize / below minimum size (no size gate).
  • Hierarchy depends on true color — unusable in 16-color or NO_COLOR.
  • Information conveyed by color alone (no symbol/text/position backup).
  • Body-text contrast below WCAG AA (4.5:1).
  • Binds Ctrl+C, Ctrl+Z, or Ctrl+\.
  • No footer hints and no ? help — undiscoverable.
  • Panels rearrange themselves between sessions (broken spatial memory).
  • Destructive action with no confirmation proportional to severity.
  • Full-screen repaint every frame (flicker, wasted bandwidth over SSH).
  • Hardcoded hex/ANSI in widget code instead of semantic slots.
  • Search doesn't filter live, or Esc doesn't dismiss it.
  • Disrupts shell scrollback (for overlay/popup tools).

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction.

日本語の概要は準備中です。原文の説明を表示しています。

PyModel/pythinker-code292026年10月10日 更新

Use when developing in packages/agent-core-v2 (the DI × Scope agent engine) — adding or modifying a domain Service, choosing a LifecycleScope, wiring DI dependencies, splitting a domain across scopes, owning or migrating a config section, gating behavior behind an experimental flag, raising coded errors, working on the permission system, writing DI/Scope tests, porting business logic from agent-core (v1) to v2, triaging a main-branch commit against v2, or exposing a v2 domain over server-v2 while keeping the /api/v1 wire contract compatible with released clients. Self-contained guide organized by development stage (orient → design → implement → test → verify) plus align workflows for v1→v2 migration, main-branch commit triage, and server-v2 wire exposure; each file carries the rules, examples, and red lines for its step.

日本語の概要は準備中です。原文の説明を表示しています。

PyModel/pythinker-code292026年10月10日 更新

Apply an approved sub-skill grouping by moving user-specified skills into a parent bundle, with timestamped backups of every modified directory.

日本語の概要は準備中です。原文の説明を表示しています。

PyModel/pythinker-code292026年10月10日 更新

dogfood

無料

Systematically explore and test a web application to find bugs, UX issues, and other problems. Use when asked to "dogfood", "QA", "exploratory test", "find issues", "bug hunt", "test this app/site/platform", or review the quality of a web application. Produces a structured report with full reproduction evidence -- step-by-step screenshots, repro videos, and detailed repro steps for every issue -- so findings can be handed directly to the responsible teams.

日本語の概要は準備中です。原文の説明を表示しています。

PyModel/pythinker-code292026年10月10日 更新

electron

無料

Automate Electron desktop apps (VS Code, Slack, Discord, Figma, Notion, Spotify, etc.) using agent-browser via Chrome DevTools Protocol. Use when the user needs to interact with an Electron app, automate a desktop app, connect to a running app, control a native app, or test an Electron application. Triggers include "automate Slack app", "control VS Code", "interact with Discord app", "test this Electron app", "connect to desktop app", or any task requiring automation of a native Electron application.

日本語の概要は準備中です。原文の説明を表示しています。

PyModel/pythinker-code292026年10月10日 更新

Use when generating changesets in the pythinker-code repository — deciding whether to write one, which package to list, the bump level, the wording, and the confirmation workflow.

日本語の概要は準備中です。原文の説明を表示しています。

PyModel/pythinker-code292026年10月10日 更新

PyModel のスキルをすべて見る

このスキルの問題を報告する