tui-visual-iteration

Renders and screenshots Go TUI frames to visually verify layout and color changes.

10|1|Updated Jul 7, 2026
One-click install
npx skills add https://github.com/catalystctl/catcode --skill tui-visual-iteration-catalystctl
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tui-visual-iteration
Source: https://github.com/catalystctl/catcode/tree/main/.catalyst-code/skills/tui-visual-iteration
Command: npx skills add https://github.com/catalystctl/catcode --skill tui-visual-iteration-catalystctl

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires playwright-core.

What problem does it solve? Redesigning a terminal UI by reading Go source or raw ANSI escape codes is guesswork — you cannot judge spacing, color harmony, or layout without seeing the rendered result. This Skill renders realistic TUI frames for any state (conversation, welcome, approval, busy, error) and screenshots them so design decisions are made by eyes, not assumptions. ## Core Features & Use Cases - Throwaway render harness: Builds a temporary tui/hack_visual.go that constructs realistic sessions with transcripts, tool blocks, and model state, then prints the rendered frame for any scene and terminal size. - ANSI-to-HTML screenshot pipeline: Converts SGR escape sequences (truecolor, xterm-256, bold, italic) into styled HTML and captures pixel-accurate screenshots using a cached Playwright headless Chromium. - Precise color auditing: Greps ANSI output for exact RGB triples to confirm every surface hits the intended design tokens (accent, success, card, rail colors), catching clashes invisible in plain-text views. - Use Case: While restyling the composer and transcript rails, render the conversation scene at 84x26, screenshot it, and verify the card background is exactly #242424 before committing. ## Quick Start Render the conversation scene of the Go TUI at 84 columns by 26 rows and screenshot it so I can review the new color scheme.

Frequently Asked Questions about tui-visual-iteration

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I screenshot a terminal UI to review design changes?

Render the TUI frame to stdout with a temporary Go harness, convert the ANSI escape codes to styled HTML, then capture the page with Playwright headless Chromium. This produces a pixel-accurate image of any scene at any terminal size.

How to convert ANSI escape codes to HTML for preview?

Parse SGR sequences with a small Python script: map 1 to bold, 3 to italic, 38;2;r;g;b to foreground color, 48;2;r;g;b to background, and 0 to reset. Wrap each segment in spans inside a pre-formatted block with a monospace font.

How do I verify exact RGB colors in terminal output?

Grep the raw ANSI output for 38;2 and 48;2 triples and compare them against your design tokens, such as accent 207;138;89 or card background 36;36;36. This catches color clashes that plain-text views hide.

Why do golden tests fail after changing TUI layout?

Visual golden tests snapshot the plain-text layout, so structural changes like new rails or an unboxed composer require updating the expected strings. Mouse drag-select tests also shift by the width of any added left rail.

Can I edit Go files containing Unicode box-drawing characters safely?

Box-drawing glyphs like ─, │, and ● corrupt search-and-replace edits and Python heredocs. Read the exact lines first and copy them verbatim, or splice around unique ASCII anchor lines with a script instead of retyping the glyphs.