tui-design
Skill2 starsChanged 35 days agoApache-2.0View on GitHub
Patterns and rules for building Mazarbul TUIs with the Charm stack. USE WHEN designing or implementing any Bubble Tea / Huh / lipgloss screen, picking components, applying themes, writing teatest snapshots. References agent-docs/tui-design.md for the canonical design system.
14 other projects use a version of this.
Adopted by
Most recently taken up by
- marcioaltoe/skillstheir own version, first seen Nov 29, 2026
- AlbertoVasquezR/panaltheir own version, first seen Nov 16, 2026
- marcus/marcus-skillstheir own version, first seen Nov 16, 2026
- pageton/tui-design-skilltheir own version, first seen Nov 14, 2026
- egregore-labs/egregoretheir own version, first seen Nov 6, 2026
- Praveensenpai/karakuritheir own version, first seen Nov 1, 2026
Used with
Projects with it also use unslop and web-design-guidelines.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
photon-groveSkillunslop
Detects and rewrites generic, overly polished, or AI-sounding prose while preserving meaning. Use when the user asks to "unslop", humanize, de-AI, tighten, or review whether writing sounds generated.
Also in 3 projects that use this
VercelSkillweb-design-guidelines
Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".
Also in 3 projects that use this
Other versions14 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 14
- pedronauck/skills★ 659same name
- egregore-labs/egregore★ 293same name
- hyperb1iss/hyperskills★ 39same name
- pageton/tui-design-skill★ 31same name
- castle-x/skills-x★ 18same name
- diegomarino/tui-design★ 18same name
- marcus/marcus-skills★ 4same name
- FelipeAngeli/skills★ 2same name
- lrstanley/skills★ 2same name
- aewing/skills★ 1same name
4 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository41 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- 12-principles-of-animationSkill
- aip-namingSkill
- architectSkill
- babysit-abortSkill
- babysit-prSkill
- babysit-tickSkill
- baseline-uiSkill
- commit-pushSkill
- complex-refactorSkill
- critiqueSkill
- deadSkill
- devstackSkill
- go-backendSkill
- goSkill
- go-strictSkill
- greptileSkill
- impl-checkSkill
- inspect-dbSkill
- inspect-deploySkill
- inspect-runtimeSkill
- interaction-designSkill
- issue-planSkill
- lessonsSkill
- mergeSkill
- new-resourceSkill
- plan-featureSkill
- preflightSkill
- pr-reviewSkill
- review-fixSkill
- reviewSkill
- shipSkill
- simplifySkill
- task-execution-protocolSkill
- teamSkill
- tui-component-browserSkill
- tui-design-labSkill
- verifySkill
- wrap-upSkill
- write-docsSkill
The file
We split this skill into the rules it gives an agent
12 rules. 0 are common, 7 are distinctive, and 5 are very specific to this project.
0
Common
Most of the 14 edited versions we read keep these.
7
Distinctive
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 15
Every Bubble Tea screen has three parts:
- Distinctive: line 21
Keep models small and orthogonal.
- Very specific: line 35
All colors come from internal/tui/style.Theme:
- Distinctive: line 63
Before writing a custom component, browse:
- Very specific: line 67
Use the /tui-component-browser skill, it captures the workflow.
- Distinctive: line 92
No animation longer than 1 second blocks input.
- Distinctive: line 93
Every blocking operation >200ms shows a spinner with a label that describes what's happening.
- Distinctive: line 99
Every command supports two modes:
- Very specific: line 108
Every TUI command has --no-tui for screen readers and CI logs.
- Distinctive: line 109
Never communicate state through color alone.
- Very specific: line 114
Every Bubble Tea model gets a teatest snapshot:
- Very specific: line 140
Forgetting NO_COLOR: Test with NO_COLOR=1 ./bin/maz <command>.
“Common” is measured: kept by at least 6 in 10 of the 14 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Mazarbul TUI Design System
The canonical reference is agent-docs/tui-design.md. This skill summarizes the rules.
The Elm Architecture
Every Bubble Tea screen has three parts:
- Init: returns the initial model and any startup commands.
- Update: pure function
(model, msg) -> (model, cmd). No I/O inline. Side effects are commands. - View: pure function
model -> string. Renders the current state.
Keep models small and orthogonal. If a model has more than ~10 fields, split it into sub-models.
The Charm stack
github.com/charmbracelet/bubbletearuntime.github.com/charmbracelet/bubblescomponents:spinner(Moon for thinking, Dot for waits),progress,list,viewport,textinput,table,paginator,key.github.com/charmbracelet/lipglossstyling, adaptive colors, layouts, borders.github.com/charmbracelet/huhforms. Always Huh for input collection in TUI mode, never raw scanners.github.com/charmbracelet/glamourmarkdown rendering in terminal.github.com/charmbracelet/x/exp/teatestsnapshot and integration tests.golang.org/x/termTTY detection.
Theme discipline
All colors come from internal/tui/style.Theme:
import "github.com/mo-cmyk/mazarbul/internal/tui/style"
style.Accent() // brand color
style.Subtle() // secondary text
style.Faint() // tertiary text, borders
style.Success()
style.Warning()
style.Error()
style.Info()
style.Panel() // bordered panel style
style.Code() // code block styleNever write raw hex outside internal/tui/style/themes/. CI catches this.
Built-in themes:
defender(default, Range Rover Coniston green)parchment(warm scroll/book)mithril(cool silvery monochrome)nocolor(auto-selected onNO_COLOR)
User themes load from TOML via --theme=<path>.
Component selection
Before writing a custom component, browse:
Use the /tui-component-browser skill, it captures the workflow.
Common picks:
- Input collection ->
huh.Formwithhuh.NewSelect,huh.NewInput,huh.NewConfirm. - Long-running task ->
bubbles/spinner.New(spinner.Moon). - Measurable progress ->
bubbles/progress.New(). - Selectable list ->
bubbles/list.New(). - Scrollable content ->
bubbles/viewport.New(). - Tabular data ->
bubbles/table.New().
Layout primitives
lipgloss.JoinHorizontal(lipgloss.Top, ...)for side-by-side.lipgloss.JoinVertical(lipgloss.Left, ...)for stacked.lipgloss.NewStyle().Border(lipgloss.RoundedBorder())for panels.lipgloss.Width(s)pluslipgloss.Height(s)for measuring.
Compose layouts top-down: outer panel, then inner sections, then content.
Animation
- Spinner Moon for "thinking" states (LLM-style work).
- Spinner Dot for short blocking work (<2s).
bubbles/progressfor measurable work.tea.Tickfor timed reveals (welcome splash, success animation).- No animation longer than 1 second blocks input.
- Every blocking operation >200ms shows a spinner with a label that describes what's happening.
The /12-principles-of-animation skill applies to terminal too: anticipation, follow-through, easing.
TTY detection and dual-mode
Every command supports two modes:
- TUI mode (default when stdout is a TTY): full Bubble Tea program.
- CLI mode (when piped,
--no-tui, or--json): plain output, no escape sequences.
Detection lives in internal/tui/mode.go. The /cli-developer skill owns the CLI side.
Accessibility
- Honor
NO_COLOR. lipgloss auto-detects; thenocolortheme is auto-selected. - Every TUI command has
--no-tuifor screen readers and CI logs. - Never communicate state through color alone. Pair with text or shape.
- Exit codes: 0 success, 1 expected failure, 2 unexpected, 130 user-cancelled.
Testing
Every Bubble Tea model gets a teatest snapshot:
func TestInit_DefaultTheme(t *testing.T) {
tm := teatest.NewTestModel(t, newModel(), teatest.WithInitialTermSize(80, 24))
// drive it
teatest.RequireEqualOutput(t, output)
}Snapshots live under internal/tui/<screen>/testdata/. Update via mise run tui:snap.
Minimum tests per screen:
- Default theme snapshot.
parchmenttheme snapshot.nocolor(NO_COLOR=1) snapshot.- Keyboard navigation test (all interactive paths reachable without mouse).
Demo recording
docs/demos/<name>.tape -> VHS renders -> docs/demos/<name>.gif. Run mise run demo.
Common pitfalls
- Raw hex outside the style package breaks the theme swap. Caught by CI.
- Animation that blocks Update freezes the UI. Always use
tea.Cmd. - Forgetting NO_COLOR. Test with
NO_COLOR=1 ./bin/maz <command>. - Bubbles components have their own message types, when embedding a sub-model, route messages explicitly.
huh.Form.Run()is synchronous, suitable for one-shot wizards but not embeddable in a larger Bubble Tea model. For embedding, use thehuh.Formas a Bubble Tea model directly.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

