Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Validates Terminal User Interface (TUI) output using freeze for screenshot capture and LLM-as-judge for semantic validation. Supports both visual (PNG/SVG) and text-based validation modes.
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-12 | ✗→✓ | ▲ Improved | 119% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 93% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 163% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 143% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 95% | 0% |
This skill validates Terminal User Interface (TUI) applications by capturing their output and using LLM-as-judge for semantic validation. It leverages freeze from Charmbracelet for high-fidelity terminal screenshots and provides structured validation criteria.
Philosophy: Rather than brittle string matching, this skill uses semantic understanding to validate that TUI output "looks right" - checking layout, content presence, and visual hierarchy without breaking on minor formatting changes.
Required:
freeze CLI tool installed (brew install charmbracelet/tap/freeze)tmux for interactive TUI capture (optional, for live applications)Verification:
bash# Check freeze is installed freeze --version # Check tmux is installed (for interactive capture) tmux -V
file:<path> - ANSI output file to validatecommand:<cmd> - Command to execute and capturetmux:<session> - Live tmux session to capturebuffer:<text> - Raw text/ANSI to validatesvg - Vector format, best for documentationpng - Raster format, best for visual difftext - Text-only extraction, fastest{target_name}.{format} in current directorysemantic - LLM judges based on meaning and layoutstrict - Also checks exact content presencevisual - Requires PNG, checks visual appearanceralph-headerValidates Ralph TUI header component:
[iter N] or [iter N/M] formatMM:SS format▶ auto or ⏸ paused)[SCROLL]idle: Nsralph-footerValidates Ralph TUI footer component:
◉ active, ◯ idle, or ■ done)ralph-fullValidates complete Ralph TUI layout:
tui-basicGeneric TUI validation:
Capture TUI output based on target type:
For file targets:
bashfreeze {file_path} -o /tmp/tui-capture.{format}
For command targets:
bashfreeze --execute "{command}" -o /tmp/tui-capture.{format}
For tmux targets:
bashtmux capture-pane -pet {session} | freeze -o /tmp/tui-capture.{format}
For buffer targets:
bashecho "{buffer}" | freeze -o /tmp/tui-capture.{format}
Constraints:
--theme base16 for consistent rendering--width and --heightExtract content for LLM analysis:
For text/semantic validation:
text, use the captured text directlysvg or png, also capture text version for content analysisFor visual validation:
Constraints:
visualApply LLM-as-judge with the appropriate criteria:
Semantic Validation Prompt Template:
Analyze this terminal UI output and determine if it meets the following criteria:
CRITERIA:
{criteria_description}
TERMINAL OUTPUT:
{captured_text}
Evaluate each criterion and provide:
1. PASS or FAIL for each requirement
2. Brief explanation for any failures
3. Overall verdict: PASS or FAIL
Be lenient on exact formatting but strict on:
- Required content presence
- Logical layout and hierarchy
- No rendering errors or artifactsVisual Validation Prompt Template (with image):
Examine this terminal screenshot and validate:
CRITERIA:
{criteria_description}
Check for:
1. Visual hierarchy and layout
2. Color coding correctness
3. No rendering artifacts or broken characters
4. Proper alignment and spacing
Verdict: PASS or FAIL with explanationConstraints:
Report validation results:
On PASS:
✅ TUI Validation PASSED
Criteria: {criteria_name}
Target: {target}
Mode: {judge_mode}
All requirements satisfied.
{optional_notes}On FAIL:
❌ TUI Validation FAILED
Criteria: {criteria_name}
Target: {target}
Mode: {judge_mode}
Issues found:
- {issue_1}
- {issue_2}
Screenshot saved: {path_if_saved}Constraints:
Input:
/tui-validate file:test_output.txt criteria:ralph-headerProcess:
test_output.txt containing ANSI outputfreeze test_output.txt -o /tmp/capture.svgralph-header criteria via LLM judgeInput:
/tui-validate tmux:ralph-session criteria:ralph-full save_screenshot:trueProcess:
tmux capture-pane -pet ralph-session | freeze -o ralph-session.svgtmux capture-pane -pet ralph-session > /tmp/text.txtralph-full criteria checking header, content, and footerralph-session.svgInput:
/tui-validate command:"cargo run --example tui_demo" criteria:"Shows a bordered box with 'Hello World' text centered inside" output_format:png judge_mode:visualProcess:
freeze --execute "cargo run --example tui_demo" -o /tmp/capture.pngInput:
/tui-validate buffer:"[iter 3/10] 04:32 | 🔨 Builder | ▶ auto" criteria:ralph-header output_format:textProcess:
yamlname: ralph-header description: Ralph TUI header component validation requirements: - name: iteration_counter description: Shows iteration in [iter N] or [iter N/M] format required: true pattern: '\[iter \d+(/\d+)?\]' - name: elapsed_time description: Shows elapsed time in MM:SS format required: true pattern: '\d{2}:\d{2}' - name: hat_indicator description: Shows current hat with emoji prefix required: true examples: ["🔨 Builder", "📋 Planner", "🎯 Executor"] - name: mode_indicator description: Shows loop mode status required: true values: ["▶ auto", "⏸ paused"] - name: scroll_indicator description: Shows [SCROLL] when in scroll mode required: false pattern: '\[SCROLL\]' - name: idle_countdown description: Shows idle timeout when present required: false pattern: 'idle: \d+s'
yamlname: ralph-footer description: Ralph TUI footer component validation requirements: - name: activity_indicator description: Shows current activity state required: true values: ["◉ active", "◯ idle", "■ done"] - name: event_topic description: Shows last event topic required: false examples: ["task.start", "build.done", "loop.terminate"] - name: search_display description: Shows search query and match count when searching required: false pattern: 'Search: .+ \d+/\d+'
yamlname: ralph-full description: Complete Ralph TUI layout validation requirements: - name: header_section description: Header at top with iteration, time, hat, and mode required: true references: ralph-header - name: content_section description: Main terminal content area required: true checks: - Has visible content or is ready for content - Properly bounded between header and footer - name: footer_section description: Footer at bottom with activity status required: true references: ralph-footer - name: visual_hierarchy description: Clear visual separation between sections required: true checks: - Borders or spacing between sections - Consistent width across sections
bash# macOS brew install charmbracelet/tap/freeze # Linux (via Go) go install github.com/charmbracelet/freeze@latest # Verify installation freeze --version
tmux list-sessionstmux list-panes -t {session}tmux capture-pane -pet {session}:{pane}--theme flag for consistent colorsstrict mode for exact matching requirementssemantic mode for layout/presence checkingThis skill can be integrated into test suites:
rust// In tests/tui_validation.rs #[test] #[ignore] // Run with: cargo test -- --ignored fn validate_header_rendering() { // 1. Render header to buffer let output = render_header_to_string(&test_state); // 2. Save to temp file std::fs::write("/tmp/header_test.txt", &output).unwrap(); // 3. Run tui-validate skill (via CLI or programmatic) // /tui-validate file:/tmp/header_test.txt criteria:ralph-header // 4. Assert validation passed }
Other measured skills in the registry, with their headline benchmark lift.