Loading...
Loading...
Use when capturing Playwright screenshots or GIF recordings for PR evidence — before/after comparisons and feature demos.
npx skill4agent add fellowship-dev/dogfooded-skills visual-evidencecd /tmp && npm install playwright 2>&1 | tail -3 && \
npx playwright install-deps chromium 2>&1 | tail -3 && \
npx playwright install chromium 2>&1 | tail -3 && \
echo PW_READYsudo apt-get update -qq && sudo apt-get install -y -qq ffmpeg 2>&1 | tail -1 && echo FFMPEG_READY/tmp/screenshot.mjsimport { chromium } from '/tmp/node_modules/playwright/index.mjs';
const [url, output] = process.argv.slice(2);
const browser = await chromium.launch({ headless: true });
const page = await browser.newPage({ viewport: { width: 1280, height: 720 } });
console.log(`Navigating to ${url}...`);
await page.goto(url, { waitUntil: 'networkidle', timeout: 30000 });
const title = await page.title();
console.log(`Page title: ${title}`);
await page.screenshot({ path: output, fullPage: true });
console.log(`Screenshot saved: ${output}`);
await browser.close();node /tmp/screenshot.mjs http://localhost:3000 /tmp/evidence-home.png
node /tmp/screenshot.mjs http://localhost:3000/admin /tmp/evidence-admin.png/tmp/record.mjsimport { chromium } from '/tmp/node_modules/playwright/index.mjs';
const [url, output, ...actions] = process.argv.slice(2);
const browser = await chromium.launch({ headless: true });
const context = await browser.newContext({
viewport: { width: 1280, height: 720 },
recordVideo: { dir: '/tmp/videos', size: { width: 1280, height: 720 } }
});
const page = await context.newPage();
console.log(`Navigating to ${url}...`);
await page.goto(url, { waitUntil: 'networkidle', timeout: 30000 });
// Execute actions passed as JSON array
if (actions[0]) {
const steps = JSON.parse(actions[0]);
for (const step of steps) {
if (step.action === 'click') {
console.log(`Clicking ${step.selector}...`);
await page.click(step.selector);
} else if (step.action === 'dblclick') {
console.log(`Double-clicking ${step.selector}...`);
await page.click(step.selector);
await page.waitForTimeout(200);
await page.click(step.selector);
} else if (step.action === 'wait') {
console.log(`Waiting ${step.ms}ms...`);
await page.waitForTimeout(step.ms);
} else if (step.action === 'fill') {
console.log(`Filling ${step.selector}...`);
await page.fill(step.selector, step.value);
} else if (step.action === 'screenshot') {
console.log(`Snapshot: ${step.label}`);
await page.screenshot({ path: `/tmp/evidence-${step.label}.png` });
}
}
}
await page.waitForTimeout(500);
await page.close();
await context.close();
await browser.close();
// Convert to GIF
const { execSync } = await import('child_process');
const webm = execSync('ls -t /tmp/videos/*.webm | head -1').toString().trim();
console.log(`Video: ${webm}`);
execSync(`ffmpeg -y -i "${webm}" -vf "fps=10,scale=1280:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop 0 "${output}" 2>&1 | tail -3`);
console.log(`GIF saved: ${output}`);node /tmp/record.mjs http://localhost:3000/form /tmp/evidence-before.gif \
'[{"action":"click","selector":".submit-btn"},{"action":"wait","ms":2000}]'$PYLOT_GATEWAY_URL$PYLOT_DISPATCH_TOKEN/evidence-uploadpublic_url## Visual Evidence
<details>
<summary>Before / After</summary>
**Before (bug present on default branch):**

**After (fix applied):**

</details>## Visual Evidence
<details>
<summary>Interaction demo</summary>

*Caption: what this demonstrates*
</details>| Scenario | Format |
|---|---|
| Visual layout change | Screenshot (PNG) |
| New page / feature | Screenshot (PNG) |
| Button disable on click | GIF |
| Loading spinner / skeleton | GIF |
| Double-click prevention | GIF |
| Form validation feedback | GIF |
| Transition / animation | GIF |
| Error → retry flow | GIF |
/tmp/