pr-demo — скилл для Claude Code: GIF-демо для pull request
Записывает терминал через asciinema и превращает запись в GIF или SVG, который можно вставить в описание PR.
npx skills add mikeyobrien/ralph-orchestrator --skill pr-demo -a claude-codeЧто делает pr-demo
Скилл ведёт по цепочке «сценарий → запись → конвертация → вставка». Сначала вы пишете короткий сценарий демо: что печатается, что выполняется, где ключевой момент. Потом готовите терминал — простой промпт, TERM=xterm-256color, размер 100x24, чтобы текст читался в уменьшенном GIF.
Запись идёт в .cast через asciinema rec demo.cast --cols 100 --rows 24, конвертация — agg demo.cast demo.gif. Если файл выходит тяжёлым, есть путь через svg-term-cli с меньшим размером. Внутри есть и самопроверка: проверка размера файла, длительности из метаданных .cast и поиск утечек вроде ключей API или путей с именем пользователя.
Заранее нужны сами инструменты: brew install asciinema, cargo install --git https://github.com/asciinema/agg и по желанию npm install -g svg-term-cli. Без установленного agg шаг конвертации не пройдёт, так что проверьте это до записи — перезаписывать демо из-за отсутствующего конвертера обидно.
Какие задачи решает
- записать терминальное демо для описания pull request
- собрать GIF из сессии asciinema
- уменьшить вес демо, переключившись на SVG
- проверить запись на утечку ключей и путей
- вставить готовое демо в README или PR
Примеры запросов агенту
- Запиши демо работы команды
initи сконвертируй в GIF для PR - Проверь
demo.castна ключи API и длительность записи - Сделай SVG-версию демо, GIF весит слишком много
Как установить pr-demo
1Через Skills CLI (Vercel)
npx skills add mikeyobrien/ralph-orchestrator --skill pr-demo -a claude-code2Вручную: положить файлы
~/.claude/skills/pr-demo/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/pr-demo/
1Через Skills CLI (Vercel)
npx skills add mikeyobrien/ralph-orchestrator --skill pr-demo -a codex2Вручную: положить файлы
.agents/skills/pr-demo/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add mikeyobrien/ralph-orchestrator --skill pr-demo -a cursor2Вручную: положить файлы
.cursor/skills/pr-demo/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install mikeyobrien/ralph-orchestrator pr-demo2Вручную: положить файлы
.github/skills/pr-demo/SKILL.md1Через Skills CLI (Vercel)
npx skills add mikeyobrien/ralph-orchestrator --skill pr-demo -a gemini-cli2Командой платформы
gemini skills install https://github.com/mikeyobrien/ralph-orchestrator --path .claude/skills/pr-demoВручную: положить файлы
.devin/skills/pr-demo/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add mikeyobrien/ralph-orchestrator --skill pr-demo -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о pr-demo
Как установить pr-demo в Claude Code?
Выполните npx skills add mikeyobrien/ralph-orchestrator --skill pr-demo -a claude-code, файл скилла окажется в ~/.claude/skills/pr-demo/SKILL.md.
Что делает pr-demo?
Проводит через запись терминала в asciinema и конвертацию в GIF или SVG, плюс проверяет размер, длительность и отсутствие чувствительных данных в записи.
Что нужно поставить до записи демо?
asciinema и agg — без них не получится ни записать, ни сконвертировать. svg-term-cli нужен только для SVG-варианта.
Исходный текст
SKILL.md · MIT
--- name: pr-demo description: Use when creating animated demos (GIFs) for pull requests or documentation. Covers terminal recording with asciinema and conversion to GIF/SVG for GitHub embedding. metadata: internal: true --- # PR Demo Creation ## Overview Create polished terminal demos for PRs using asciinema recordings converted to GIF. The workflow: **script → record → convert → embed**. ## Tool Selection | Goal | Tool Chain | Output | |------|------------|--------| | CLI demo for GitHub PR | asciinema → agg | GIF (< 5MB) | | Smaller file needed | asciinema → svg-term-cli | SVG (< 500KB) | | TUI screenshot | tmux → freeze | SVG/PNG | **Default choice:** asciinema + agg (best compatibility, GitHub renders GIFs natively) ## Prerequisites ```bash # Install tools (macOS) brew install asciinema cargo install --git https://github.com/asciinema/agg npm install -g svg-term-cli # Optional: for SVG output ``` ## Workflow ### 1. Script Your Demo (REQUIRED) Before recording, write a brief script: ```markdown ## Demo: [feature name] Duration: ~20-30 seconds 1. [0-3s] Show command being typed 2. [3-10s] Command executes, show key output 3. [10-25s] Highlight the "aha moment" - what makes this valuable 4. [25-30s] Clean exit or final state ``` **Keep it short.** 20-30 seconds max. Show ONE thing well. ### 2. Prepare Environment ```bash # Clean terminal state clear export PS1='$ ' # Simple prompt export TERM=xterm-256color # Consistent colors # Hide sensitive info (API keys, paths with usernames) ``` Terminal size: **100x24** (readable when scaled down) ### 3. Record ```bash # Record to .cast file asciinema rec demo.cast --cols 100 --rows 24 # Execute your scripted demo # Press Ctrl+D or type 'exit' when done ``` **Tips:** - Type at readable speed (not too fast) - Pause briefly after key moments - If you make a mistake, start over (editing is harder than re-recording) ### 4. Convert to GIF ```bash # Basic conversion (recommended) agg demo.cast demo.gif # With speed adjustment (1.5x faster) agg --speed 1.5 demo.cast demo.gif # With custom font size for readability agg --font-size 14 demo.cast demo.gif ``` **Alternative - SVG (smaller files):** ```bash svg-term --in demo.cast --out demo.svg --window ``` ### 5. Validate (Self-Validation) Claude can self-validate demos using three approaches: #### A. Automated Checks (run these first) ```bash # Check file size (must be < 5MB for GitHub) ls -lh demo.gif # Check recording duration from .cast metadata head -1 demo.cast | jq '.duration // "check manually"' ``` #### B. Visual Validation (LLM-as-judge) Extract a static frame for Claude to analyze: ```bash # Option 1: Use svg-term to render a specific timestamp (e.g., 15 seconds in) svg-term --in demo.cast --out demo-preview.svg --at 15000 # Option 2: Use asciinema cat + freeze for a snapshot asciinema cat demo.cast | head -500 | freeze -o demo-preview.png # Option 3: Just convert to GIF and use the file directly # Claude can read GIF files with the Read tool ``` Then ask Claude to analyze using the Read tool on the image: **Validation prompt:** ``` Analyze this terminal demo screenshot. Check: 1. Is the text readable (not too small/blurry)? 2. Is the command being demonstrated visible? 3. Is there any sensitive info (API keys, /Users/username paths)? 4. Does the terminal look clean (simple prompt, no clutter)? 5. Is the "aha moment" visible - what value does this demo show? Rate: PASS or FAIL with specific issues. ``` #### C. Content Validation (parse .cast file) The `.cast` file is JSON lines - validate the content programmatically: ```bash # Check what commands were typed (input events) grep '"i"' demo.cast | head -20 # Check recording duration head -1 demo.cast | jq -r '.duration | floor' # Should be 20-30 seconds # Look for sensitive patterns grep -iE '(api.?key|password|secret|/Users/[a-z])' demo.cast && echo "WARNING: Sensitive data found!" ``` #### D. Full Validation Checklist After running the above, verify: - [ ] File size < 5MB (automated) - [ ] Duration 20-30 seconds (automated) - [ ] No sensitive info in .cast (automated) - [ ] Text readable in preview frame (visual/LLM) - [ ] Demo shows feature clearly (visual/LLM) - [ ] Clean terminal appearance (visual/LLM) ### 6. Embed in PR ```markdown ## Demo  *Shows: [one-sentence description of what the demo shows]* ``` Store demos in `docs/demos/` or `assets/` directory. ## Quick Reference | Setting | Recommended Value | |---------|------------------| | Duration | 20-30 seconds | | Terminal size | 100x24 | | Speed multiplier | 1.0-1.5x | | Target file size | < 2MB ideal, < 5MB max | | Font size (agg) | 14-16 | ## Common Mistakes | Mistake | Fix | |---------|-----| | Demo too long | Script it first, show ONE thing | | Text unreadable | Use --font-size 14+, terminal 100x24 | | File too large | Use svg-term-cli instead, or increase speed | | Cluttered terminal | Clean PS1, clear history, hide paths | | No context in PR | Add one-line description below GIF | ## File Organization ``` docs/demos/ ├── feature-name.gif # The demo ├── feature-name.cast # Source recording (optional, for re-rendering) └── README.md # Recording instructions for future maintainers ```
© mikeyobrien · MIT · mikeyobrien/ralph-orchestrator