README Source History Refs Reviews Compare Notes Search Review guide Add the capture skill for TUI screenshots and recordings 68c8b40dc60930c68c920a07c5f8c43f25a83a0a
Oliver Jan Krylow <oliver@bugabinga.net > · 23 Jul 2026
SSH signature · not checked
Browse files Compare with HEAD
PR evidence, QA repros, and debugging all want visuals, and a TUI capture
fails in its own way: a full-size terminal grid rendered small leaves the
text illegible. The skill pins a vhs tape workflow whose legibility
defaults were validated headless in a root agent container (VHS_NO_SANDBOX
required; a tmux+freeze path covers browserless stills), and pushes all
verbose material into references/ and examples/ so the core stays terse.
Evidence publishes as release assets, never into the git object store.
A .agents/skills symlink to .claude/skills lets harnesses that discover
skills there load the same definitions instead of a parallel copy.
The skill lives in .claude/skills/capture/ with a thin .pi adapter. Changed files (10) +301 / −3 text lines · 1 metadata-only
Diff layout Auto Unified Split
new file mode 120000Link change (old → new): absent → target: ../.claude/skills.
.claude/skills/capture/SKILL.md Added new file mode 100644+60 / −0 text lines
3 + description: Capture legible screenshots (PNG) and recordings (GIF/MP4) of TUI runs for PRs, QA, and debugging. Invoke with a target, e.g. /capture prototypes/p27 layout demo.6 + # capture — TUI screenshots and recordings 8 + Produce a legible still or recording of a terminal run, as evidence: what a9 + PR achieved, what a bug looks like, what a prototype does.11 + Focus on the target given with the invocation — what to run and what12 + behavior to show. If none was given, ask for one.16 + 1. **Tools.** Needs `vhs`, `ttyd`, `ffmpeg` (plus `freeze` for the17 + fallback still path). Any missing → `references/setup.md`.18 + 2. **Write a tape.** Copy from `examples/`, keep the sizing defaults19 + (`FontSize 20`, `Width 1200`, `Height 700`, `Padding 12` — legibility20 + comes from font size, not canvas size). Full syntax and sizing math →21 + `references/tape.md`.22 + 3. **Run.** `VHS_NO_SANDBOX=true vhs the.tape` (`VHS_NO_SANDBOX` is23 + required when running as root, which agent sandboxes usually are).24 + 4. **Look at it.** Read the PNG (and GIF) yourself before delivering.25 + Illegible text, mistimed frames, wrong state on screen → fix the tape,26 + rerun. Never ship a capture you have not seen.27 + 5. **Deliver.** GIF for anything that must render inline on GitHub; how and28 + where to put files → `references/publishing.md`.32 + - **Capture, don't fabricate.** The image must be a render of a real33 + terminal session (vhs, or tmux + freeze). Never fake a "screenshot" by34 + drawing command output into an image with an image library — that is35 + fabricated evidence, and colors/attributes/interaction state are lost.36 + - **One capture, one claim.** Show exactly the behavior the PR or issue is37 + about. Trim scope with terminal size and tape length, never by editing38 + the image afterwards.39 + - **Deterministic tapes.** Drive the app with `Type`/`Enter`/key commands and40 + fixed `Sleep`s; no wall-clock-dependent content in the frame if you can41 + avoid it (clocks, PIDs, load averages make diffs and reruns noisy).42 + - **Stills are tapes too.** Use the `Screenshot` command inside a tape; it43 + captures at an exact scripted moment.44 + - **No browser or ffmpeg available?** Use the tmux + `freeze` still path45 + in `references/setup.md`. Recordings need vhs; stills do not.49 + End with Markdown, not JSON:56 + - `path/to/capture.gif` — what it shows.claude/skills/capture/examples/demo.tape Added new file mode 100644+23 / −0 text lines
1 + # Short interaction demo → GIF (+ still of the end state).2 + # Replace `top` and the keystrokes with the app under capture.9 + Set Theme "Catppuccin Mocha"16 + # drive the app: sort by memory, then back21 + Screenshot end-state.png.claude/skills/capture/examples/screenshot.tape Added new file mode 100644+15 / −0 text lines
1 + # Single still of a TUI. Replace `top` with the app under capture.2 + # No Output line: a tape with only Screenshot renders no gif.8 + Set Theme "Catppuccin Mocha".claude/skills/capture/references/publishing.md Added new file mode 100644+61 / −0 text lines
1 + # Getting captures into PRs and issues 5 + **No capture ever enters the git object store.** Not on a branch, not6 + "temporarily", not on an orphan ref — blobs in git history are permanent7 + bloat (owner ruling). The only exception is an asset that *ships* as8 + product content (docs site, book), which is committed deliberately like13 + - **GIF** — the default. It is the only motion format GitHub renders14 + inline from a markdown image link, and it is all an agent can publish15 + (the drag-and-drop attachment upload that accepts MP4 is web-UI-only,17 + - **MP4** — smaller for long demos, but only a human can attach it to a18 + PR body. Emit as a secondary `Output` when the GIF would bust 10 MB,19 + hand it over, and say so.20 + - **PNG** — stills; always fine.22 + ## Where evidence goes: release assets, not git 24 + Release assets live outside git (they add zero objects and don't count25 + toward repo size), are uploadable by the bot via API, and their URLs26 + render inline in PR/issue bodies.28 + 1. Ensure the rolling evidence prerelease exists (first use only):29 + `gh release create captures --prerelease --title "capture evidence"30 + --notes "PR/issue evidence uploads; not a product release."`31 + The tag points at an existing commit — no new git objects.32 + **Bootstrap proof, once:** the inline-render claim below is an33 + assumption until demonstrated on this repo. On first use, upload one34 + PNG, embed it in a comment, and look at the rendered result. If it35 + renders, delete this paragraph and carry on. If it only links, change36 + step 3's guidance to plain links and note the finding here.37 + 2. Upload with a unique, traceable name:38 + `gh release upload captures pr53-fold-demo.gif`41 + 43 + 4. Fetch the URL once to confirm it resolves before posting.45 + Evidence for a closed/merged PR can be deleted later46 + (`gh release delete-asset captures <name>`) — or kept; either way git49 + Throwaway QA/debug captures stay in the scratchpad and get Read there;50 + publish only what a human needs to see.52 + ## Checklist before embedding 54 + - You Read the image and the text is legible at PR-body width (~900 px).55 + - **No secrets in any frame** — keys, tokens, private paths, provider56 + responses. Captures are secret sinks like logs; a frame is published57 + forever once fetched. When in doubt, re-capture with a scrubbed59 + - File ≤ 10 MB (GitHub stops inlining above that).60 + - The frame shows the claim — not a prompt, not build output.61 + - Asset name carries its origin (`pr<N>-` / `issue<N>-` prefix)..claude/skills/capture/references/setup.md Added new file mode 100644+48 / −0 text lines
3 + All steps verified on Ubuntu 24.04 (noble) inside a root agent container.5 + ## Recording stack (vhs) 7 + `vhs` scripts a real headless terminal (ttyd + Chromium) and renders8 + GIF/MP4/PNG via ffmpeg.12 + apt-get install -y ffmpeg ttyd 13 + go install github.com/charmbracelet/vhs@latest14 + export PATH= "$PATH:$HOME/go/bin" 17 + No Go toolchain? Use the release binaries:18 + <https://github.com/charmbracelet/vhs/releases> and19 + <https://github.com/tsl0922/ttyd/releases> (static `ttyd.x86_64`).23 + - First run downloads a Chromium into `~/.cache/rod/` (needs network).24 + - Running as root: set `VHS_NO_SANDBOX=true` or the browser refuses to25 + start (`Running as root without --no-sandbox is not supported`).26 + - A pre-installed Playwright Chromium does not help; vhs uses its own.28 + ## Still-only fallback (tmux + freeze) 30 + When no browser/ffmpeg is possible, capture the pane's ANSI and render it31 + to PNG. No recordings on this path, stills only.34 + go install github.com/charmbracelet/freeze@latest36 + tmux new-session -d -s cap -x 120 -y 30 'the-tui-command' 39 + tmux capture-pane -t cap -ep > pane.ansi 40 + tmux kill-session -t cap41 + freeze pane.ansi --output shot.png --font.size 1647 + for t in vhs ttyd ffmpeg freeze; do command -v "$t" || echo "$t missing" ; done .claude/skills/capture/references/tape.md Added new file mode 100644+79 / −0 text lines
1 + # Tape writing and sizing 3 + A `.tape` is a deterministic script: settings first, then keystrokes and4 + sleeps. Full grammar: `vhs manual`.6 + ## The commands that matter 10 + | `Output demo.gif` | render target; repeat for more formats (`.mp4`, `.webm`); omit entirely for still-only tapes |11 + | `Require cmd` | fail fast if `cmd` is not installed |12 + | `Set <option> <val>` | see sizing below; must precede all actions |13 + | `Type "text"` / `Enter` / `Down 3` / `Ctrl+C` | drive the app; every special key is a bare command (`Space`, `Tab`, `Escape`, `PageDown`, arrows with optional repeat count) — there is no `Key` prefix |14 + | `Sleep 2s` | fixed wait — the only timing primitive; be generous after launch |15 + | `Screenshot shot.png` | still frame at exactly this point in the script |16 + | `Hide` / `Show` | exclude setup noise (cd, build output) from the render |18 + ## Sizing for legibility — the TUI-specific part 20 + A TUI screenshot fails by being a huge terminal with ant-sized text.21 + Fix the *font* size, then give the app only the columns it needs:23 + - `FontSize` ≥ 16; **20 is the default here**.24 + - Columns ≈ `(Width − 2·Padding) / (FontSize × 0.6)`. The defaults25 + (`Width 1200`, `Padding 12`, `FontSize 20`) yield a ~98×27 grid — about26 + right for a full-screen TUI rendered into a ~900 px-wide PR body.27 + - Wider app? Prefer 1600×800 @ FontSize 18 (~145 cols) over shrinking the28 + font further. Below 14 pt, text in a PR is decoration, not evidence.29 + - `Set Theme "Catppuccin Mocha"` (or any high-contrast dark theme) and30 + `Set Padding 12` keep edges and colors readable.32 + ## Two environment traps 34 + - **No UTF-8 locale in the vhs shell.** Non-ASCII text (§, em-dashes,35 + box-drawing) renders as raw bytes like `<C2><A7>`. Put36 + `Env LANG "C.UTF-8"` in every tape (add `Env LESSCHARSET "utf-8"` when37 + driving `less`), and when verifying the output, check a non-ASCII glyph39 + - **Absolute `Output` paths can be rejected** by the tape parser (e.g.40 + deep paths with hyphen-leading components). Keep `Output` and41 + `Screenshot` paths relative and run `vhs` from the directory the files44 + ## Keeping recordings small 46 + GitHub renders inline images up to ~10 MB; aim well under.48 + - Shortest tape that proves the claim; ≤ 30 s of footage.49 + - `Set PlaybackSpeed 2` to compress long waits; `Set TypingSpeed 50ms`50 + so typing does not dominate.51 + - `Set Framerate 24` (default 50) roughly halves GIF size.52 + - Long or high-motion demo → also emit `Output demo.mp4` and let a human53 + attach it (see publishing.md); keep the GIF as the inline version.64 + Set Theme "Catppuccin Mocha"67 + Type "cd prototypes/p27-per-frame-layout && cargo build -q"74 + Screenshot startup.png.pi/prompts/capture.md Added new file mode 100644+10 / −0 text lines
3 + description: Capture TUI screenshots and recordings for PRs, QA, debugging.4 + argument-hint: "[target]"7 + Read `.claude/skills/capture/SKILL.md` and follow it as your instructions.8 + It is the canonical, harness-agnostic definition of this command.10 + Where it says "the target given with the invocation", use: $ARGUMENTS+4 / −2 text lines
67 67 4. Open questions: stop and ask. No guessing.4. Open questions: stop and ask. No guessing.68 68 5. Invoke spec work: `/smith <topic>`. Commands are defined once,5. Invoke spec work: `/smith <topic>`. Commands are defined once,69 69 harness-agnostically, in `.claude/skills/<name>/SKILL.md` harness-agnostically, in `.claude/skills/<name>/SKILL.md`70 - (smith, pioneer, handmade, sabotnik); `.pi/prompts/` holds thin pi 71 - adapters that defer to them.70 + (smith, pioneer, handmade, sabotnik, capture ); `.pi/prompts/` holds thin71 + pi adapters that defer to them. ` .agents/skills ` symlinks to 72 + `.claude/skills` so harnesses that discover skills there (codex-style)73 + read the same definitions; smith's own CI wiring does not consume it.72 74 6. Cargo is the sole build system. See `docs/PROJECT-INVARIANTS.md` §1.6. Cargo is the sole build system. See `docs/PROJECT-INVARIANTS.md` §1.73 75 7. Agents must not modify `docs/SPEC.md` or `docs/PROJECT-INVARIANTS.md` without approval.7. Agents must not modify `docs/SPEC.md` or `docs/PROJECT-INVARIANTS.md` without approval.docs/plans/AGENTIC-DEVELOPMENT.md Modified +1 / −1 text lines
89 89 in the agent files — an agent doesn't need to know what woke it; the trigger is ain the agent files — an agent doesn't need to know what woke it; the trigger is a90 90 property of the workflow that runs it (the encoding surface), and is listed hereproperty of the workflow that runs it (the encoding surface), and is listed here91 91 only for the reader's map. The craft skills (`sabotnik`, `handmade`, `pioneer`,only for the reader's map. The craft skills (`sabotnik`, `handmade`, `pioneer`,92 - `smith`) are *verbs the agents wield*, not agents.92 + `smith`, ` capture ` ) are *verbs the agents wield*, not agents.94 94 Two axes set each agent: a **model** (intelligence) and a **reasoning effort**Two axes set each agent: a **model** (intelligence) and a **reasoning effort**95 95 (how hard it thinks). Effort runs `off · low · medium · high · xhigh · max`, and(how hard it thinks). Effort runs `off · low · medium · high · xhigh · max`, and