Tui Design 标志

Tui Design

社区
pedronauck
tui-design

设计终端用户界面、创建 TUI 布局、选择 TUI 配色方案、实现键盘导航、构建终端仪表盘或使用任何 TUI 框架时使用此技能。提及 TUI 设计、终端 UI、Ratatui 布局、Ink 组件、Textual 控件、Bubbletea 视图、终端调色板、按键绑定设计、面板布局、分栏、终端仪表盘、方框绘制字符、迷你图、进度条、模态对话框、焦点管理或终端无障碍功能时触发。

Add to TypingMind

概览

发布者pedronauck
代码仓库skills
技能名称tui-design
星标数
635
复刻数
89
附带文件
2
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 2 个附带文件

    模型执行任务时可读取的脚本、模板和参考资料。这些文件为只读文件,绝不会被执行。

  • 开源

    由 pedronauck 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Tui Design AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/pedronauck/skills/tree/main/skills/curated/tui-design
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/pedronauck/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/skills/curated/tui-design .claude/skills/tui-design
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Tui Design,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Tui Design。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Tui Design 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

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.

dot
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

Truncate only at grapheme boundaries, accounting for wide cells, combining marks, variation selectors, and emoji sequences. Width libraries and emulators can disagree; test representative user text and offer ASCII indicators where rendering is uncertain.

Treat filenames, logs, and remote strings as untrusted display data. Escape control sequences before writing them through raw output APIs; otherwise a displayed value can move the cursor, change a title, or invoke an OSC operation. Use the framework's supported text/sanitization path.

Terminal queries share the input stream with keystrokes. Let one parser correlate replies, limit waiting for unsupported queries, and choose a fallback without swallowing user input.

Visual Hierarchy and Accessibility

Define semantic slots such as foreground, muted text, focus, selection, warning, and error. Keep theme values out of widget code. Use stable spacing and labels before introducing more borders. Provide dark and light variants when the application sets its own background; transparent/default backgrounds need testing against the user's theme.

Pair status colors with text or shape. Use focus indicators that survive monochrome mode, and avoid dimming important values until they become unreadable. WCAG's 4.5:1 normal-text contrast is a useful design target, but terminal font size and ANSI colors are user-controlled; a bold terminal heading does not automatically qualify for the large-text exception. Do not claim formal accessibility compliance from a palette alone.

Provide a plain or linear presentation when a full-screen interface defeats screen-reader navigation. Meaningful labels, keyboard access, and a non-animated mode still need testing with the intended terminal and assistive technology. Avoid blinking warnings or rapidly flashing status. Let users reduce motion; animation must not delay input or hide the final state.

Rendering and Terminal Lifecycle

Use the framework's buffered rendering and cell diffing. Batch writes; use synchronized output only when supported and always pair begin/end even on errors. A single write is not proof of atomic rendering, and synchronized output is an enhancement rather than a prerequisite for a usable TUI.

Render on state changes or an active animation deadline. Measure input latency, output bandwidth, and redraw cost under the intended data rate, including SSH and multiplexers. Choose a refresh cadence for the actual workload; do not impose a universal FPS cap or artificially delay streamed text.

Acquire terminal modes through a scoped owner and restore everything the app enabled: raw mode, alternate screen, cursor visibility, mouse capture, bracketed paste, and keyboard protocol state. Cover normal exit, initialization failure, exceptions/panics, and handled signals. A framework restoration helper may cover only a subset; check its contract. SIGKILL cannot run cleanup.

Verification That Changes Confidence

Use deterministic state-transition tests for selection after deletion, stale async results, modal focus restoration, and cancelled operations. Use the framework's test backend for layout boundaries; inspect at least one real PTY session because snapshots do not exercise terminal modes or input protocols.

Exercise launch, typing, paste, resize, modal open/close, slow or failed I/O, and exit. Include light/dark themes, color disabled, wide/combining text, and the actual supported terminal/multiplexer path. After exit, verify the shell cursor and echo behavior are restored. Expand the matrix when a portability requirement or failure justifies it.

Anti-Patterns

Anti-PatternBetter action
NO_COLOR checked after true-color detectionResolve user preference before capability selection
Global mnemonic shortcuts consume text inputRoute events through focus and active mode
Unicode release cutoff presented as compatibilityMeasure graphemes/cells and test supported emulators
Async request completion overwrites newer stateCorrelate result identity with current view/query
Screen clears or escape codes from background loggingSend logs through state or a separate sink
Lower FPS or concurrency hides an overloaded queueProfile the producer, state processing, and renderer separately
Only normal exit restores the terminalUse lifecycle guards and framework panic/signal handling

Primary Sources

Checked 2026-09-04: Ratatui application patterns, Ratatui restoration contract, Crossterm input ownership, kitty keyboard protocol, NO_COLOR, Unicode grapheme segmentation, and contrast guidance.

The state-ownership and verification guidance is engineering synthesis from these contracts, not a claim that a protocol guarantees application correctness.

What This Skill is NOT

  • Not a framework API manual or a mandate to adopt a new toolkit.
  • Not a reason to add animation, icons, or modes to a simple picker.
  • Not a substitute for testing the actual terminal and accessibility path.

附带文件

技能加载后,模型会按需读取这些文件。它们仅作为可读文件提供,绝不会被执行。

常见问题

Tui Design AI 技能有什么作用?

设计终端用户界面、创建 TUI 布局、选择 TUI 配色方案、实现键盘导航、构建终端仪表盘或使用任何 TUI 框架时使用此技能。提及 TUI 设计、终端 UI、Ratatui 布局、Ink 组件、Textual 控件、Bubbletea 视图、终端调色板、按键绑定设计、面板布局、分栏、终端仪表盘、方框绘制字符、迷你图、进度条、模态对话框、焦点管理或终端无障碍功能时触发。

为什么在 TypingMind 中使用 Tui Design?

因为您只需安装一次,就能搭配任何模型使用。Tui Design 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Tui Design?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/pedronauck/skills/tree/main/skills/curated/tui-design。TypingMind 会读取其中的 SKILL.md,打包相关文件,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Tui Design?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Tui Design 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Tui Design 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Tui Design AI 技能免费吗?

pedronauck 已在 GitHub 上发布了该技能。请查看代码仓库了解许可条款。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇