tui-testing
Skill3 starsChanged 8 months agoMITView on GitHub
Visual testing of TUI and CLI output using VHS and Freeze. Use when making changes to TUI views, CLI output formatting, theme styling, layout, or any visual component. Must be used after any change to View() functions, lipgloss styles, footer, sidebar, metadata, output pane, wizard overlay, or CLI error formatting.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- black12-ag/wefttheir own version, first seen Aug 19, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- black12-ag/weft★ 2same name
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 repository19 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- bubbletea-patternsSkill
- charm-stylingSkill
- clean-code-boundariesSkill
- clean-code-designSkill
- clean-code-errorsSkill
- clean-code-functionsSkill
- clean-code-namingSkill
- clean-code-solidSkill
- clean-code-testingSkill
- cli-structureSkill
- create-runbookSkill
- demo-recordingSkill
- mutation-testingSkill
- shell-scriptsSkill
- spec-workflowSkill
- tdd-workflowSkill
- tui-layoutSkill
- wizard-formsSkill
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 6 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 9
After any change to visual output (TUI or CLI), verify the result using VHS or Freeze before considering the change complete.
- Very specific: line 58
IMPORTANT: Always prefix with DOPS_NO_ALT_SCREEN=1 in VHS tapes.
- Very specific: line 64
Always Sleep 2s after launching the TUI to let it render
- Very specific: line 74
Write or update a .tape file targeting the changed behavior
- Distinctive: line 76
Read the screenshot(s) to verify
- Distinctive: line 77
If wrong, fix and repeat from step 2
- Distinctive: line 98
Run the CLI command piped to freeze
- Distinctive: line 99
Read the screenshot to verify
- Distinctive: line 100
If wrong, fix and repeat
- Very specific: line 111
Run mouse tests with: go test ./internal/tui/sidebar/ -run "Mouse" -v
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Visual Testing with VHS and Freeze
After any change to visual output (TUI or CLI), verify the result using VHS or Freeze before considering the change complete.
When to Use Which
| Tool | Use For |
| VHS | TUI testing — interactive flows, navigation, execution, wizard, multi-step sequences |
| Freeze | CLI output testing — static command output, error formatting, config list |
VHS — TUI Testing
VHS records terminal sessions from .tape scripts and produces screenshots/GIFs.
Directory structure:
tapes/— tape scripts (.tapefiles)tapes/screenshots/— output screenshots (.png) and GIFs (.gif)
Write tapes in tapes/, output to tapes/screenshots/:
Output tapes/screenshots/test-name.gif
Set Shell "zsh"
Set Width 1200
Set Height 800
Set FontSize 14
Set Theme "Catppuccin Mocha"
Type "DOPS_NO_ALT_SCREEN=1 ./dops"
Enter
Sleep 2s
Screenshot tapes/screenshots/test-name.png
Type "q"
Sleep 500msRun: vhs tapes/test-name.tape
Then read the screenshot to verify the visual result matches expectations.
Key VHS commands:
Type "text"— type charactersEnter,Up,Down,Left,Right,Escape,Tab— key pressesSleep 500ms/Sleep 2s— wait for rendering/executionScreenshot tapes/name.png— capture current stateOutput tapes/name.gif— set GIF output
IMPORTANT: Always prefix with DOPS_NO_ALT_SCREEN=1 in VHS tapes. The real app uses alt screen (full terminal takeover), but VHS can't capture BubbleTea v2 declarative alt screen.
Type "DOPS_NO_ALT_SCREEN=1 ./dops"Best practices:
- Always
Sleep 2safter launching the TUI to let it render Sleep 500msafter navigation for state to updateSleep 2sor more afterEnterthat triggers script execution- Take screenshots at each meaningful state change
- Name screenshots descriptively:
tapes/sidebar-collapse.png,tapes/wizard-form.png - End tapes with
Type "q"andSleep 500msto cleanly exit
Testing flow for TUI changes:
- Make the code change
go build -o ./dops .- Write or update a
.tapefile targeting the changed behavior vhs tapes/the-tape.tape- Read the screenshot(s) to verify
- If wrong, fix and repeat from step 2
Freeze — CLI Output Testing
Freeze captures static terminal output as styled screenshots.
Usage (output to tapes/screenshots/):
./dops run unknown.runbook 2>&1 | freeze -o tapes/screenshots/cli-error.png
./dops config list 2>&1 | freeze -o tapes/screenshots/cli-config.png
./dops version 2>&1 | freeze -o tapes/screenshots/cli-version.pngWith custom styling:
./dops config list 2>&1 | freeze -o tapes/screenshots/output.png --theme "Catppuccin Mocha"Testing flow for CLI changes:
- Make the code change
go build -o ./dops .- Run the CLI command piped to freeze
- Read the screenshot to verify
- If wrong, fix and repeat
Limitations
VHS does not support mouse events. Mouse click behavior must be tested via unit tests using synthetic tea.MouseClickMsg messages. VHS can only test keyboard-driven interactions.
For mouse testing, write unit tests like:
m, cmd := m.Update(tea.MouseClickMsg{X: 5, Y: 2, Button: tea.MouseLeft})Run mouse tests with: go test ./internal/tui/sidebar/ -run "Mouse" -v
What to Verify
After sidebar changes: collapse/expand indicators, risk badges, selection cursor, tree connectors, scrollbar, search filtering
After metadata changes: runbook name, description, risk badge color, version, ID, border alignment
After output pane changes: header background fill, command text visibility, stderr coloring, log path readability, placeholder text, scrollbar
After footer changes: keybind key colors, description text, background fill, all states (normal, wizard, running, palette)
After theme changes: border visibility, color contrast, dark/light variant selection
After layout changes: panel proportions, no dead space, responsive to window size, borders aligned
Do NOT Skip Visual Testing
Even if unit tests pass, visual bugs (invisible borders, wrong colors, layout overflow, text wrapping) are only caught by looking at the rendered output. Always verify visually after changes to view code.
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.

