Install
openclaw skills install designing-tuisDesign, replicate, or iterate terminal user interfaces from screenshots, descriptions, layout sketches, or existing .tui files. Generate framework code (BubbleTea/Ink/Textual) directly or via .tui Schema intermediate representation.
openclaw skills install designing-tuisUse this skill to turn conversation, screenshots, or existing .tui files into practical terminal UI designs and runnable framework code. Two routes are available depending on the use case.
Trigger for welcome screens, dashboards, wizards, CLI launch screens, tool panels, lazygit/k9s/btop-style layouts, pane descriptions, or terminal UI visuals even when the user does not say “TUI”.
Default route: Screenshot/Description → 3-Phase Decomposition → Framework Code → Preview/Compare/Iterate
Advanced route: Screenshot/Description → 3-Phase Decomposition → .tui Schema → Schema→Code Converter → Framework Code
Preferred for most tasks. TUI's simplicity (no Z-axis overlap, ~20 component types, strict orthogonal grid layout) means the intermediate schema layer has low marginal benefit. Direct code generation is faster with no precision loss.
Use when:
.tui Schema generates BubbleTea (Go) + Ink (JS) + Textual (Python) simultaneously.tui files, developers consume code.tui sourceIdentify the mode before acting:
.tui edit: inspect the current tree and patch only the requested nodes..tui file, then convert to framework code using schema-to-code mapping.Both routes share Phases 1-2. Phase 3 diverges by route.
Goal: Identify top-level structural regions and establish the global skeleton.
Output: Top-level region list (typically 2-5 regions) with direction and proportion annotations.
Goal: Recursively analyze each top-level region, build a hierarchical layout tree, and lock proportions.
references/layout-inference-rules.md)Output:
Default route (→ Code):
Advanced route (→ Schema → Code):
.tui file with { version: "1", meta, tree } structurereferences/schema-to-code-mapping.mdTUI proportions are precisely quantifiable via character counting (no sub-pixel ambiguity):
| Type | When to Use | Example |
|---|---|---|
| Fixed | Semantically fixed areas | status bar (1-2 rows), divider (1 col), title (1 row) |
| Percentage | Proportional areas | sidebar 30%, main 70% |
| Fill | Takes all remaining space | main content area |
| Type | BubbleTea (Go) | Ink (React) | Textual (Python) |
|---|---|---|---|
| Fixed N | lipgloss.Width(N) | <Box width={N}> | min-width: N |
| Percentage | Compute from tea.WindowSizeMsg | <Box width="30%"> | width: 30% / fr units |
| Fill | totalWidth - fixedChildren | <Box flexGrow={1}> | width: 1fr |
| Min size | max(calculated, minW) | <Box minWidth={20}> | min-width: 20 |
BubbleTea note: No native percentage/flex. Must store window dimensions in model, recalculate on tea.WindowSizeMsg.
TUI rendering is character-by-character overwrite. Improper handling causes ghosts (old frame characters lingering). Generated code must follow:
View() is naturally full-return; Ink React reconciler naturally full-diff; Textual compositor naturally full-compose)tea.WithAltScreen(), Ink default, Textual default) to avoid mixing with shell outputrunewidth (Go) / string-width (JS) / wcwidth (Python) for CJK textWhen a rendered preview or original screenshot is available, perform structured comparison:
| Priority | Dimension | Check | Fix Cost |
|---|---|---|---|
| P0 | layout-error | Layout direction wrong, nesting level wrong | High |
| P0 | proportion-error | Component proportion deviates >10% from target, or layout breaks on resize | High |
| P0 | render-ghost | Render ghosts, lingering characters, screen flicker | High |
| P1 | component-mismatch | Component type misidentified (e.g., List should be Table) | Medium |
| P2 | content-missing | Text content omitted, list items missing | Low |
| P3 | style-drift | Color, border style, bold attribute deviation | Low |
| P4 | spacing-off | Padding/gap inconsistency | Low |
TUI's character grid nature makes it easier to reproduce precisely than Web UI — no element overlap, no component crossing, layout is naturally an orthogonal tree.
| Complexity | Typical Examples | Expected Fidelity | Iterations |
|---|---|---|---|
| Simple | 2-3 panels, clear borders | High — usable on first generation | 0-1 |
| Medium | Multi-panel nesting, tab navigation, lists/tables | Medium-high — structure correct, proportions need tuning | 1-2 |
| Complex | lazygit/k9s/btop level | Medium — multiple iterations, layout and proportions first | 2-3 |
Load only what is needed:
references/components-cheatsheet.md before creating or editing components. It is the field/default/visual-signature source of truth.references/layout-inference-rules.md during Phase 1-2 decomposition for layout direction, component identification, spacing, and proportion rules.references/color-accessibility.md when choosing colors, designing status indicators, or any time color conveys meaning. Ensures WCAG compliance and color-blind safety.references/schema-to-code-mapping.md when using the advanced route (Schema → Code conversion) or when generating multi-framework output.references/known-quirks.md before debugging rendering problems or using edge-case layout behavior.references/workflow-examples.md when the task resembles screenshot replication, multi-framework output, or iterative refinement.This repository is documentation-only. Do not assume render or export tools ship with it.
.tui
designs/<name>.tui unless user specifies another path{ version: "1", meta, tree }references/schema-to-code-mapping.md for target frameworkWhen delivering a design update, include:
.tui file)Stop and re-check before any of these:
"fill" on a non-main flex axisprops or layoutPopover, Tooltip, or TextArea.tui directly from a screenshot without confirming intenttea.WithAltScreen() (BubbleTea) or equivalent alternate screen usagetea.WindowSizeMsg handling for responsive layoutdim text on dark backgrounds without verifying contrast ≥ 4.5:1 (WCAG 1.4.3)