一键导入
capture-pr-visuals
Auto-capture screenshots and GIFs of the running app for PR documentation using Playwright and project context from chalk.json
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Auto-capture screenshots and GIFs of the running app for PR documentation using Playwright and project context from chalk.json
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Pins and manages per-project Flutter SDK versions with FVM (Flutter Version Management). Use when the project has or needs a .fvmrc or .fvm/ directory, when contributors need a reproducible Flutter SDK, when installing FVM, pinning or switching the Flutter version, wiring FVM into VS Code or Android Studio, configuring CI to honor .fvmrc, or troubleshooting "wrong Flutter version" symptoms.
End-to-end review pipeline — creates a handoff, generates a review (self-review or paste-ready for another provider), then offers to fix findings. Use when you want to review your changes before pushing.
Build a competitive positioning matrix and strategy canvas when the user asks to analyze competitors, compare products, or assess competitive landscape
Audit project dependencies for risk when the user asks to check dependencies, audit packages, review dependency health, check for vulnerabilities, or assess supply chain risk
Analyze product metrics and identify trends when the user asks to review metrics, analyze KPIs, or assess product health
Audit a feature for WCAG 2.1 AA compliance using POUR principles when the user asks to check accessibility, audit a11y, or verify WCAG compliance
| name | capture-pr-visuals |
| description | Auto-capture screenshots and GIFs of the running app for PR documentation using Playwright and project context from chalk.json |
| author | chalk |
| version | 1.0.0 |
| metadata-version | 3 |
| allowed-tools | Bash, Read, Write, Glob, Grep, Edit |
| argument-hint | [optional: specific routes to capture, e.g. '/home /settings', or 'all'] |
| read-only | false |
| destructive | false |
| idempotent | false |
| open-world | true |
| user-invocable | true |
| tags | git, pr, visuals |
Capture screenshots and GIFs of the running application for PR visual documentation. Reads chalk.json for dev server and route info, falls back to auto-discovery if chalk docs don't exist. Uses Playwright via npx.
Read .chalk/chalk.json to get:
dev.command — how to start the dev serverdev.port — what port it runs ondev.url — the full URLroutes[] — what pages to captureproject.framework — for framework-specific handling (e.g., Electron)If chalk.json doesn't exist or is missing key fields, auto-discover:
Read package.json — detect framework from dependencies:
next → Next.js (port 3000, file-based routing)vite / @vitejs/plugin-react → Vite SPA (port 5173)react-scripts → CRA (port 3000)nuxt → Nuxt (port 3000)@angular/core → Angular (port 4200)svelte / @sveltejs/kit → SvelteKit (port 5173)electron / electron-vite → Electron (renderer on separate port)vue → Vue (port 5173 or 8080)Detect routes — scan based on framework:
app/**/page.{tsx,jsx,ts,js} or pages/**/*.{tsx,jsx,vue}<Route or createBrowserRouter in src/path: in router configssearchParams.getsrc/pages/, src/views/, src/app/, src/routes/Confirm with user — show auto-detected URL and routes, let them correct before proceeding.
If auto-discovery also fails, ask the user for the dev URL and routes. Suggest running /setup-chalk for future use.
git diff main..HEAD --name-only
git diff main..HEAD --stat
Map changed files to affected routes using chalk.json routes[].src or the architecture docs. For example:
src/pages/dashboard/ → /dashboard routesrc/components/Header.tsx → all pages (shared component)If the user provided specific routes as arguments, use those instead.
If no route mapping is possible (backend-only changes), inform the user and ask which pages to capture.
curl -s -o /dev/null -w "%{http_code}" http://localhost:<PORT> 2>/dev/null
If not running:
dev.command from chalk.jsonNote the PID if starting the server so it can be stopped later.
npx playwright install chromium 2>/dev/null || echo "Playwright install failed"
Check for ffmpeg (needed for GIF generation):
which ffmpeg 2>/dev/null
If ffmpeg is missing, warn: "ffmpeg not found — screenshots only (no GIFs). Install with brew install ffmpeg for GIF support."
First, clean any previous screenshots to ensure a fresh capture:
rm -rf .github/pr-screenshots/ 2>/dev/null
mkdir -p .github/pr-screenshots/
Then create a temporary capture script at .chalk/local/capture-script.ts:
import { chromium } from 'playwright';
import { mkdirSync } from 'fs';
import { join } from 'path';
const BASE_URL = '<DETECTED_URL>';
const ROUTES: { path: string; name: string }[] = [
// Populated from chalk.json routes or Step 2 analysis
];
const OUTPUT_DIR = '.github/pr-screenshots';
const VIDEO_DIR = join(OUTPUT_DIR, 'videos');
(async () => {
mkdirSync(OUTPUT_DIR, { recursive: true });
mkdirSync(VIDEO_DIR, { recursive: true });
const browser = await chromium.launch({ headless: true });
for (const route of ROUTES) {
const context = await browser.newContext({
viewport: { width: 1280, height: 800 },
recordVideo: { dir: VIDEO_DIR, size: { width: 1280, height: 800 } },
});
const page = await context.newPage();
try {
await page.goto(`${BASE_URL}${route.path}`, {
waitUntil: 'networkidle',
timeout: 15000,
});
await page.screenshot({
path: join(OUTPUT_DIR, `${route.name}.png`),
fullPage: true,
});
// Brief interaction for video
await page.evaluate(() => window.scrollTo({ top: document.body.scrollHeight, behavior: 'smooth' }));
await page.waitForTimeout(1500);
await page.evaluate(() => window.scrollTo({ top: 0, behavior: 'smooth' }));
await page.waitForTimeout(1500);
} catch (err) {
console.error(`Failed to capture ${route.name}: ${err}`);
}
await page.close();
await context.close();
}
await browser.close();
console.log('Capture complete.');
})();
Adapt the script based on the project:
BASE_URL from chalk.json dev.url or detected URLROUTES from chalk.json or Step 2 analysis?home=trueExecute:
npx tsx .chalk/local/capture-script.ts
If ffmpeg is available:
for f in .github/pr-screenshots/videos/*.webm; do
name=$(basename "$f" .webm)
ffmpeg -y -i "$f" -vf "fps=10,scale=1280:-1:flags=lanczos" -loop 0 ".github/pr-screenshots/${name}.gif" 2>/dev/null
done
Clean up videos:
rm -rf .github/pr-screenshots/videos
Commit the new visual artifacts:
git add .github/pr-screenshots/
git commit -m "chore: add PR visual artifacts"
Print markdown references for the PR body:
## Visual Preview
### <Page Name>


Suggest: "Visual artifacts committed. Run /create-pr to create the PR with embedded screenshots."
rm -f .chalk/local/capture-script.tspackage.json or install permanent dependenciesnpx for Playwright and tsx.github/pr-screenshots/ (committed to the branch)If chalk.json has project.framework: "electron" or package.json has electron as a dependency:
BASE_URL (not the Electron window)?home=true, ?canvas) should be used as route paths