### Clone and set up the sample app Source: https://github.com/amelmo/proofshot/blob/main/content/docs/quick-start.mdx Clones the ProofShot repo, builds it, and installs the sample app dependencies. ```sh git clone https://github.com/AmElmo/proofshot.git cd proofshot npm install && npm run build && npm link cd test/fixtures/sample-app && npm install ``` -------------------------------- ### Install ProofShot with npm Source: https://github.com/amelmo/proofshot/blob/main/content/docs/quick-start.mdx Installs the ProofShot CLI globally using npm. Requires Node.js 18+. ```sh npm install -g proofshot ``` -------------------------------- ### ProofShot start output shown to agent Source: https://github.com/amelmo/proofshot/blob/main/proofshot-spec.md Example output displayed to the agent after 'proofshot start'. Includes dev server info, browser mode, recording path, errors log path, and usage hints for agent-browser commands. ```text ✅ ProofShot session started Dev server: Vite on :5173 Browser: Chromium (headless) Recording: ./proofshot-artifacts/session-2026-02-25.webm Errors log: ./proofshot-artifacts/server-errors.log Use agent-browser to navigate and test: agent-browser snapshot -i # See interactive elements agent-browser click @e3 # Click an element agent-browser fill @e2 "test@example.com" # Fill a form agent-browser screenshot ./proofshot-artifacts/step.png # Capture a moment When done, run: proofshot stop ``` -------------------------------- ### Install and build commands Source: https://github.com/amelmo/proofshot/blob/main/README.md Commands for installing dependencies, building the project, running tests, and starting watch mode. The build is required after changes. ```bash npm install npm run build # Build (required after changes) npm test # Run tests npm run dev # Watch mode ``` -------------------------------- ### Install ProofShot with yarn Source: https://github.com/amelmo/proofshot/blob/main/content/docs/quick-start.mdx Installs the ProofShot CLI globally using yarn. Requires Node.js 18+. ```sh yarn global add proofshot ``` -------------------------------- ### Install ProofShot with pnpm Source: https://github.com/amelmo/proofshot/blob/main/content/docs/quick-start.mdx Installs the ProofShot CLI globally using pnpm. Requires Node.js 18+. ```sh pnpm add -g proofshot ``` -------------------------------- ### Expected output from proofshot install Source: https://github.com/amelmo/proofshot/blob/main/content/docs/quick-start.mdx Shows the expected output when ProofShot detects and installs skills for Claude Code and Cursor. ```text Detected tools: ✓ Claude Code ✓ Cursor Installing skills... ✓ Claude Code → ~/.claude/skills/proofshot/SKILL.md ✓ Cursor → ~/.cursor/rules/proofshot.mdc Done! Your AI agent now knows how to use ProofShot. ``` -------------------------------- ### Start a verification session Source: https://github.com/amelmo/proofshot/blob/main/content/docs/quick-start.mdx Starts the dev server, opens a headless browser, and begins recording video. ```sh proofshot start --run "npm run dev" --port 3000 --description "Login page verification" ``` -------------------------------- ### Install good-vibes package with npm Source: https://github.com/amelmo/proofshot/blob/main/test/fixtures/sample-app/index.html Install the 'good-vibes' package as a dev dependency using npm. This command is shown in the page's hero section. ```bash $ npm i --save-dev good-vibes ``` -------------------------------- ### proofshot start Source: https://github.com/amelmo/proofshot/blob/main/content/docs/reference/cli.mdx Starts a verification session. Opens a browser, begins video recording, and optionally starts your dev server. ```APIDOC ## proofshot start ### Description Start a verification session. Opens a browser, begins video recording, and optionally starts your dev server. ### Usage ```sh proofshot start [options] ``` ### Options - `--run ` - Shell command to start your dev server (default: none) - `--port ` - Port your dev server runs on (default: `3000`) - `--url ` - URL to open instead of the root (default: `http://localhost:`) - `--description ` - Description of what you're verifying (appears in reports) (default: none) - `--headed` - Show the browser window (visible Chromium) (default: `false`) - `--output ` - Custom output directory for artifacts (default: `./proofshot-artifacts`) ### Examples ```sh proofshot start # Server already running on port 3000 proofshot start --run "npm run dev" --port 3000 # Start server, capture logs proofshot start --url http://localhost:3000/login # Open a specific page proofshot start --description "Verify checkout flow" # Add description to report proofshot start --headed # Show the browser window ``` ### Behavior 1. If `--run` is provided: starts the dev server, pipes output to `server.log`, waits for the port 2. Opens headless Chromium via agent-browser 3. Navigates to `--url` (or `http://localhost:`) 4. Starts video recording (retries up to 3 times) 5. Writes `.session.json` and `metadata.json` (git branch and commit SHA) ``` -------------------------------- ### Install ProofShot CLI Source: https://github.com/amelmo/proofshot/blob/main/docs/index.html Install the ProofShot CLI globally and run the setup to enable visual verification for AI agents. ```bash npm install -g proofshot && proofshot install ``` -------------------------------- ### proofshot start - Start a verification session Source: https://github.com/amelmo/proofshot/blob/main/content/docs/reference/cli.mdx Opens a browser, begins video recording, and optionally starts your dev server. Options: --run, --port, --url, --description, --headed, --output. ```sh proofshot start [options] ``` ```sh proofshot start # Server already running on port 3000 proofshot start --run "npm run dev" --port 3000 # Start server, capture logs proofshot start --url http://localhost:3000/login # Open a specific page proofshot start --description "Verify checkout flow" # Add description to report proofshot start --headed # Show the browser window ``` -------------------------------- ### ProofShot workflow: start, test, stop Source: https://github.com/amelmo/proofshot/blob/main/README.md Three-step workflow: start, test, stop. Start opens the browser, begins recording, and captures server logs. Test uses the AI agent to drive the browser. Stop bundles video, screenshots, and errors into proof artifacts. ```bash # 1. Start — open browser, begin recording, capture server logs proofshot start --run "npm run dev" --port 3000 --description "Login form verification" # 2. Test — the AI agent drives the browser agent-browser snapshot -i # See interactive elements agent-browser open http://localhost:3000/login # Navigate agent-browser fill @e2 "test@example.com" # Fill form agent-browser click @e5 # Click submit agent-browser screenshot ./proofshot-artifacts/step-login.png # Capture proof # 3. Stop — bundle video + screenshots + errors into proof artifacts proofshot stop ``` -------------------------------- ### Install ProofShot CLI and skill Source: https://github.com/amelmo/proofshot/blob/main/README.md Install the ProofShot CLI globally and then install the ProofShot skill for your AI coding tools. The first command installs the CLI and agent-browser with headless Chromium; the second detects your AI coding tools and installs the skill at user level. ```bash npm install -g proofshot proofshot install ``` -------------------------------- ### Clone and set up ProofShot Source: https://github.com/amelmo/proofshot/blob/main/README.md Clones the repository, installs dependencies, builds, and links the package globally. Then sets up the sample app in test/fixtures/sample-app. ```bash git clone https://github.com/AmElmo/proofshot.git cd proofshot npm install && npm run build && npm link # Set up the sample app cd test/fixtures/sample-app npm install ``` -------------------------------- ### Setup existing task cards and initialization Source: https://github.com/amelmo/proofshot/blob/main/test/fixtures/todo-app/index.html Attaches event handlers to existing task cards and initializes all features: drag-drop, context menu, add-task forms, modal, search, and column counts. ```javascript // ---- Subtask checkbox events for existing cards ---- function setupExistingCards() { $$('.task-card').forEach(card => setupCardEvents(card)); } // ---- Init ---- setupDragDrop(); setupContextMenu(); setupAddTaskForms(); setupModal(); setupSearch(); setupExistingCards(); updateColumnCounts(); ``` -------------------------------- ### proofshot start - Start verification session Source: https://github.com/amelmo/proofshot/blob/main/README.md Start a verification session: browser, recording, error capture. Options include --run, --port, --description, --url, --headed, --force. ```bash proofshot start # Server already running proofshot start --run "npm run dev" --port 3000 # Start and capture server proofshot start --description "Verify checkout flow" # Add description to report proofshot start --url http://localhost:3000/login # Open specific URL proofshot start --headed # Show browser (debugging) proofshot start --force # Override a stale session from a previous crash ``` -------------------------------- ### proofshot init - Initialize project Source: https://github.com/amelmo/proofshot/blob/main/proofshot-spec.md Detects framework, creates config, installs skill file. Flags: --agent to specify agent type, --force to overwrite existing config. ```bash proofshot init # Flags: # --agent claude|codex|cursor|gemini|copilot|generic # --force (overwrite existing config) ``` -------------------------------- ### proofshot start Source: https://github.com/amelmo/proofshot/blob/main/proofshot-spec.md Starts a verification session by launching the dev server, browser, recording, and error capture. Supports flags to set a description, override the port, skip server startup, run headed, specify output directory, and open a specific URL. ```APIDOC ## proofshot start ### Description Start a verification session: dev server, browser, recording, error capture. ### Usage ```bash proofshot start ``` ### Flags - `--description` (string) - Optional - Description included in the proof report - `--port` (number) - Optional - Override detected port - `--no-server` (boolean) - Optional - Don't start dev server, assume it's running - `--headed` (boolean) - Optional - Show browser window for debugging - `--output` (string) - Optional - Custom output directory - `--url` (string) - Optional - Open this URL instead of root ``` -------------------------------- ### proofshot.config.json example Source: https://github.com/amelmo/proofshot/blob/main/content/docs/reference/configuration.mdx Example configuration file with all options: devServer, output, defaultPages, viewport, and headless. This file is optional; defaults work for most projects. ```json { "devServer": { "port": 3000, "startupTimeout": 30000 }, "output": "./proofshot-artifacts", "defaultPages": ["/"], "viewport": { "width": 1280, "height": 720 }, "headless": true } ``` -------------------------------- ### Start ProofShot with dev server Source: https://github.com/amelmo/proofshot/blob/main/docs/index.html Launches your dev server, opens headless Chromium, and starts recording video. ```bash proofshot start --run "npm run dev" ``` -------------------------------- ### Start a ProofShot session Source: https://github.com/amelmo/proofshot/blob/main/proofshot-spec.md Run by the AI agent after the developer says 'verify this visually with proofshot'. Starts the dev server if not running, captures server errors, waits for readiness, opens the browser, sets viewport, starts recording, and saves session state. ```bash proofshot start --description "Login form: fill credentials, submit, verify redirect to dashboard" ``` -------------------------------- ### proofshot install - Install ProofShot skill Source: https://github.com/amelmo/proofshot/blob/main/README.md Detect AI coding tools and install the ProofShot skill. Run once per machine. Options: --only, --skip, --force. ```bash proofshot install # Interactive tool selection proofshot install --only claude # Only install for specific tools proofshot install --skip cursor # Skip specific tools proofshot install --force # Overwrite existing installations ``` -------------------------------- ### Build, test, and watch commands Source: https://github.com/amelmo/proofshot/blob/main/CLAUDE.md Run these npm scripts to build with tsup, run tests once with vitest, or start watch mode. Build must run after code changes because the CLI runs from dist/. ```bash npm run build # Build with tsup (must run after changes) npm test # Run vitest once npm run dev # Watch mode build ``` -------------------------------- ### Snapshot output example Source: https://github.com/amelmo/proofshot/blob/main/content/docs/guides/verify-feature.mdx Example output from the snapshot command showing interactive elements with stable references. ```text @e1: navigation link "Home" @e2: input[type=email] "Email address" @e3: input[type=password] "Password" @e4: button "Sign in" @e5: link "Forgot password?" ``` -------------------------------- ### Start ProofShot with dev server Source: https://github.com/amelmo/proofshot/blob/main/content/docs/guides/verify-feature.mdx Starts a ProofShot session, launching the dev server with the given command and capturing its logs. Opens a headless Chromium browser, begins video recording, and starts capturing server logs. ```sh proofshot start --run "npm run dev" --port 3000 --description "Checkout flow verification" ``` -------------------------------- ### Install ProofShot skills Source: https://github.com/amelmo/proofshot/blob/main/content/docs/guides/install-skills.mdx Scans for supported AI tools and installs a skill file for each one. Shows checkboxes to select which tools to configure. ```sh proofshot install ``` -------------------------------- ### Install ProofShot skills for specific tools only Source: https://github.com/amelmo/proofshot/blob/main/content/docs/guides/install-skills.mdx Use the --only flag to install for specific tools. Multiple tools can be specified with commas. ```sh proofshot install --only claude proofshot install --only cursor,codex ``` -------------------------------- ### Skip specific tools during ProofShot install Source: https://github.com/amelmo/proofshot/blob/main/content/docs/guides/install-skills.mdx Use the --skip flag to exclude specific tools from installation. ```sh proofshot install --skip gemini ``` -------------------------------- ### Start a ProofShot session with proofshot start Source: https://github.com/amelmo/proofshot/blob/main/skills/claude/SKILL.md Starts a verification session, opening a browser and beginning recording. If the port is already in use, proofshot kills the existing process automatically. Always use --run to capture dev server logs; omit it only if the server was started externally. Add --force to override a previous session that was not stopped cleanly. ```bash proofshot start --run "your-dev-command" --port PORT --description "what you are about to verify" ``` -------------------------------- ### Modal Setup for New Task Creation Source: https://github.com/amelmo/proofshot/blob/main/test/fixtures/todo-app/index.html Configures the modal for creating new tasks: opens with empty fields, closes on cancel or overlay click, and submits to create a task with a toast notification. Supports Escape to close and Enter to submit (except in textareas). ```javascript function setupModal() { const overlay = $('#modal-overlay'); const openBtn = $('#new-task-btn'); const cancelBtn = $('#modal-cancel'); const submitBtn = $('#modal-submit'); function openModal() { overlay.classList.add('visible'); $('#modal-title').value = ''; $('#modal-desc').value = ''; setTimeout(() => $('#modal-title').focus(), 50); } function closeModal() { overlay.classList.remove('visible'); } openBtn.addEventListener('click', openModal); cancelBtn.addEventListener('click', closeModal); overlay.addEventListener('click', e => { if (e.target === overlay) closeModal(); }); submitBtn.addEventListener('click', () => { const title = $('#modal-title').value.trim(); if (!title) return; const priority = $('#modal-priority').value; const tag = $('#modal-tag').value; const column = $('#modal-column').value; createTaskCard(title, priority, tag, column); toast(`Created ${$('#modal-title').value} in ${column.replace('-', ' ')}`); closeModal(); }); // Enter to submit, Escape to close overlay.addEventListener('keydown', e => { if (e.key === 'Escape') closeModal(); if (e.key === 'Enter' && e.target.tagName !== 'TEXTAREA') { ``` -------------------------------- ### Force reinstall ProofShot skills Source: https://github.com/amelmo/proofshot/blob/main/content/docs/guides/install-skills.mdx Overwrites existing skill files. Useful after updating ProofShot to get the latest skill content. ```sh proofshot install --force ``` -------------------------------- ### Copy install command to clipboard Source: https://github.com/amelmo/proofshot/blob/main/docs/index.html JavaScript event handler that copies the install command to the clipboard and shows a temporary checkmark icon. ```javascript document.getElementById('heroInstall').addEventListener('click', function() { var cmd = 'npm install -g proofshot'; var btn = this; navigator.clipboard.writeText(cmd).then(function() { var icon = btn.querySelector('.copy-icon'); icon.innerHTML = ''; btn.title = 'Copied!'; setTimeout(function() { icon.innerHTML = ''; btn.title = 'Click to copy'; }, 2000); }); }); ``` -------------------------------- ### Start ProofShot with existing dev server Source: https://github.com/amelmo/proofshot/blob/main/content/docs/guides/verify-feature.mdx Starts a ProofShot session when the dev server is already running. Does not capture server logs because ProofShot did not start the server. ```sh proofshot start --port 3000 --description "Checkout flow verification" ``` -------------------------------- ### proofshot install - Install skill files for AI coding tools Source: https://github.com/amelmo/proofshot/blob/main/content/docs/reference/cli.mdx Detects AI coding tools and installs the ProofShot skill file for each. Run once per machine. Options: --only, --skip, --force. ```sh proofshot install [options] ``` ```sh proofshot install # Interactive tool selection proofshot install --only claude # Claude Code only proofshot install --skip cursor # All detected except Cursor proofshot install --force # Overwrite existing installations ``` -------------------------------- ### proofshot exec passthrough example Source: https://github.com/amelmo/proofshot/blob/main/issues/02-interactive-timeline-viewer.md Shows the command invocation and its expected behavior: logs the action, runs agent-browser, and returns output to stdout. ```bash proofshot exec snapshot -i # → logs: { "action": "snapshot -i", "relativeTimeSec": 3.2, "timestamp": "2026-02-27T..." } # → runs: agent-browser snapshot -i # → returns: the snapshot output to stdout ``` -------------------------------- ### Start ProofShot and open specific URL Source: https://github.com/amelmo/proofshot/blob/main/content/docs/guides/verify-feature.mdx Starts a ProofShot session, launches the dev server, and opens the specified URL instead of the root page. ```sh proofshot start --run "npm run dev" --port 3000 --url http://localhost:3000/checkout ``` -------------------------------- ### proofshot init Source: https://github.com/amelmo/proofshot/blob/main/proofshot-spec.md Initializes Proofshot in the current project by detecting the framework, creating a configuration file, and installing the skill file. Supports flags to specify the agent and to force overwrite existing configuration. ```APIDOC ## proofshot init ### Description Detects framework, creates config, installs skill file. ### Usage ```bash proofshot init ``` ### Flags - `--agent` (string) - Optional - Specify agent type: claude, codex, cursor, gemini, copilot, generic - `--force` (boolean) - Optional - Overwrite existing config ``` -------------------------------- ### Initialize ProofShot in a project Source: https://github.com/amelmo/proofshot/blob/main/proofshot-spec.md Run inside the project directory. Detects the framework (Next.js, Vite, Remix, Astro, CRA, etc.), creates proofshot.config.json with detected settings, and installs the skill file for the detected agent (Claude Code, Codex, Cursor, or general). ```bash cd my-project proofshot init ``` -------------------------------- ### Install ProofShot globally via npm Source: https://github.com/amelmo/proofshot/blob/main/docs/index.html Install the ProofShot CLI globally using npm. This command is shown in the hero section as the primary installation method. ```bash npm install -g **proofshot** ``` -------------------------------- ### Card Event Setup for Editing and Subtasks Source: https://github.com/amelmo/proofshot/blob/main/test/fixtures/todo-app/index.html Attaches event listeners to a card: double-click on the editable title triggers inline editing, and changes to subtask checkboxes update subtask progress. ```javascript function setupCardEvents(card) { // Double-click to edit title const title = $('[data-editable]', card); if (title) { title.addEventListener('dblclick', e => { e.stopPropagation(); startInlineEdit(title); }); } // Subtask checkboxes $$('.subtask-item input[type="checkbox"]', card).forEach(cb => { cb.addEventListener('change', () => updateSubtaskProgress(card)); }); } ``` -------------------------------- ### Run sample-app (SaaS Dashboard) Source: https://github.com/amelmo/proofshot/blob/main/docs/test-apps.md Starts the sample-app fixture on port 5173. Requires Node.js and npm. ```bash cd test/fixtures/sample-app && npm install && npm run dev ``` -------------------------------- ### Start a ProofShot session Source: https://github.com/amelmo/proofshot/blob/main/docs/architecture.md Starts a new session with a dev server and video recording. Fails fast if the port is occupied, spawns the server detached, and aborts if recording fails after 3 retries. ```bash proofshot start --run "npm run dev" --port 3000 --description "Login flow" ``` -------------------------------- ### proofshot exec examples Source: https://github.com/amelmo/proofshot/blob/main/content/docs/reference/cli.mdx Example invocations of proofshot exec for clicking, filling, taking screenshots, scrolling, and pressing keys. Each call appends an entry to session-log.json. ```sh proofshot exec click @e3 ``` ```sh proofshot exec fill @e2 "user@example.com" ``` ```sh proofshot exec screenshot step-checkout.png ``` ```sh proofshot exec scroll down ``` ```sh proofshot exec press Enter ``` -------------------------------- ### Session log format example Source: https://github.com/amelmo/proofshot/blob/main/issues/02-interactive-timeline-viewer.md Example content of session-log.json stored in the output directory, listing actions with relative times and timestamps. ```json [ { "action": "snapshot -i", "relativeTimeSec": 3.2, "timestamp": "2026-02-27T14:32:03Z" }, { "action": "open http://localhost:5173/settings.html", "relativeTimeSec": 5.1, "timestamp": "2026-02-27T14:32:05Z" }, { "action": "fill @e1 \"John Smith\"", "relativeTimeSec": 8.7, "timestamp": "2026-02-27T14:32:08Z" }, { "action": "click @e5", "relativeTimeSec": 10.3, "timestamp": "2026-02-27T14:32:10Z" }, { "action": "screenshot ./proofshot-artifacts/step-settings.png", "relativeTimeSec": 12.0, "timestamp": "2026-02-27T14:32:12Z" } ] ``` -------------------------------- ### proofshot install Source: https://github.com/amelmo/proofshot/blob/main/content/docs/reference/cli.mdx Detects AI coding tools on your machine and installs the ProofShot skill file for each one. Run once per machine. ```APIDOC ## proofshot install ### Description Detect AI coding tools on your machine and install the ProofShot skill file for each one. Run once per machine. ### Usage ```sh proofshot install [options] ``` ### Options - `--only ` - Install only for specific tools (comma-separated). Values: `claude`, `cursor`, `codex`, `gemini`, `windsurf` - `--skip ` - Skip specific tools (comma-separated) - `--force` - Overwrite existing skill files ### Examples ```sh proofshot install # Interactive tool selection proofshot install --only claude # Claude Code only proofshot install --skip cursor # All detected except Cursor proofshot install --force # Overwrite existing installations ``` ``` -------------------------------- ### proofshot diff example Source: https://github.com/amelmo/proofshot/blob/main/content/docs/reference/cli.mdx Example usage of proofshot diff with a baseline path. Compares screenshots by filename and outputs diff images highlighting pixel changes. ```sh proofshot diff --baseline ./proofshot-artifacts/2025-01-15_10-30-00_main/ ``` -------------------------------- ### Start ProofShot with headed browser Source: https://github.com/amelmo/proofshot/blob/main/content/docs/faq.mdx Starts ProofShot with the browser window visible, overriding the default headless mode. ```bash proofshot start --headed ``` -------------------------------- ### Proofshot session lifecycle steps Source: https://github.com/amelmo/proofshot/blob/main/proofshot-spec.md Lists the steps performed by proofshot start and proofshot stop. The agent uses agent-browser directly while proofshot is not running. ```text proofshot start: 1. Load config 2. Ensure output dir exists 3. Start dev server (if needed), piping stderr to server-errors.log 4. Open browser via agent-browser 5. Start recording via agent-browser 6. Write .session.json with metadata 7. Print instructions for the agent [Agent uses agent-browser directly — proofshot is not running] proofshot stop: 1. Read .session.json 2. Collect console errors via agent-browser errors 3. Collect console output via agent-browser console 4. Stop recording via agent-browser record stop 5. Close browser via agent-browser close 6. Read server-errors.log 7. List all screenshots in output dir 8. Generate SUMMARY.md 9. Delete .session.json 10. Print summary to stdout ``` -------------------------------- ### Project directory structure Source: https://github.com/amelmo/proofshot/blob/main/CLAUDE.md Shows the source layout: CLI entry, commands, browser wrappers, server utilities, session state/metadata, artifacts, and utils. Entry point is bin/proofshot.ts → src/cli.ts → src/commands/*.ts. ```text src/ ├── cli.ts # Commander.js command registration ├── commands/ # One file per CLI command (install, start, stop, exec, diff, pr, clean) ├── browser/ # agent-browser CLI wrappers (session, capture, interact, navigate) ├── server/ # Dev server detection, startup, port waiting ├── session/state.ts # .session.json lifecycle (save/load/clear) ├── session/metadata.ts # Persistent per-session metadata (branch, commit) for PR matching ├── artifacts/ # Output generation (viewer.html, SUMMARY.md, PR format) └── utils/ # Config, exec helpers, port utils, error patterns, GitHub API ``` -------------------------------- ### Start ProofShot with dev server Source: https://github.com/amelmo/proofshot/blob/main/PROOFSHOT.md Starts a ProofShot session, launching the dev server with the given command and port. Omit --run if the server is already running. ```bash proofshot start --run "your-dev-command" --port PORT --description "what you are verifying" ``` -------------------------------- ### Browser console logging for app initialization and API simulation Source: https://github.com/amelmo/proofshot/blob/main/test/fixtures/sample-app/index.html JavaScript code that logs app initialization, simulates an async API call to /api/stats, and handles a sign-up button click. Includes a warning that auth module is not loaded in demo mode. ```javascript console.log('\[app\] Home page loaded'); console.log('\[app\] Rendering feature cards...'); document.querySelectorAll('.card').forEach(function(card, i) { console.log('\[app\] Feature card #' + (i + 1) + ' mounted'); }); console.log('\[app\] All components initialized'); // Simulate an async API call on page load setTimeout(function() { console.log('\[api\] Fetching deploy stats from /api/stats...'); console.log('\[api\] Response: { deploys: 69420, uptime: "99.99%" }'); }, 500); // Sign-up button handler document.querySelector('.btn\[href="#"\]')?.addEventListener('click', function(e) { e.preventDefault(); console.log('\[app\] Sign Up button clicked'); console.warn('\[app\] Auth module not loaded yet — sign-up is a no-op in demo mode'); }); ``` -------------------------------- ### Run todo-app (Kanban Board) Source: https://github.com/amelmo/proofshot/blob/main/docs/test-apps.md Starts the todo-app fixture on port 5174. Requires Node.js and npm. ```bash cd test/fixtures/todo-app && npm install && npm run dev ``` -------------------------------- ### Server startup and error capture with ensureDevServer Source: https://github.com/amelmo/proofshot/blob/main/proofshot-spec.md Starts the dev server if the port is not already open, capturing stderr and stdout to an error log file. Uses spawn with detached mode and unref to allow independent process. Waits for readiness via waitForReady. ```typescript async function ensureDevServer(config, errorLogPath: string) { if (await isPortOpen(config.port)) return { alreadyRunning: true }; const errorLog = fs.createWriteStream(errorLogPath, { flags: 'a' }); const proc = spawn('sh', ['-c', config.command], { cwd: process.cwd(), stdio: ['ignore', 'pipe', 'pipe'], detached: true, }); // Capture server stderr to error log file proc.stderr.pipe(errorLog); proc.stdout.pipe(errorLog); // Also capture stdout for full context proc.unref(); await waitForReady(proc, config); return { alreadyRunning: false }; } ``` -------------------------------- ### Agent-browser commands for testing Source: https://github.com/amelmo/proofshot/blob/main/content/docs/quick-start.mdx Commands the agent uses to interact with the browser. Each action is logged with timestamps and element data. ```sh agent-browser snapshot -i # See interactive elements (@e1, @e2, ...) agent-browser open http://localhost:3000/login agent-browser fill @e2 "user@example.com" agent-browser fill @e3 "password123" agent-browser click @e5 # Submit button agent-browser screenshot step-login.png ``` -------------------------------- ### proofshot pr usage examples Source: https://github.com/amelmo/proofshot/blob/main/content/docs/reference/cli.mdx Shows common invocations: auto-detect PR from branch, post to a specific PR, preview without posting, and use the github-web-attachments upload provider. ```sh proofshot pr # Auto-detect PR from branch proofshot pr 42 # Post to PR #42 proofshot pr --dry-run # Preview without posting proofshot pr --upload-provider github-web-attachments ``` -------------------------------- ### ProofShot stop output shown to agent Source: https://github.com/amelmo/proofshot/blob/main/proofshot-spec.md Example output displayed to the agent after 'proofshot stop'. Summarizes video, screenshots, summary file, console/server errors, and duration. ```text ✅ ProofShot verification complete 📹 Video: ./proofshot-artifacts/session-2026-02-25.webm (45s) 📸 Screenshots: 3 captured 📝 Summary: ./proofshot-artifacts/SUMMARY.md Console errors: 0 Server errors: 0 Duration: 45 seconds Proof artifacts saved to ./proofshot-artifacts/ ``` -------------------------------- ### proofshot CLI testing commands Source: https://github.com/amelmo/proofshot/blob/main/issues/02-interactive-timeline-viewer.md Commands to test the interactive timeline viewer. Run from test/fixtures/sample-app. Steps include init, start, exec commands for opening a URL, taking a snapshot, filling an element, and capturing a screenshot, then stop. Verify viewer.html and session-log.json with 4 entries. ```bash proofshot init --agent claude --force ``` ```bash proofshot start --description "Test timeline viewer" ``` ```bash proofshot exec open http://localhost:5173/settings.html ``` ```bash proofshot exec snapshot -i ``` ```bash proofshot exec fill @e1 "New Name" ``` ```bash proofshot exec screenshot ./proofshot-artifacts/step-settings.png ``` ```bash proofshot stop ``` -------------------------------- ### proofshot doctor - Print environment info Source: https://github.com/amelmo/proofshot/blob/main/README.md Print the current ProofShot environment, including config path, browser mode, viewport, installed binaries, and any active session. ```bash proofshot doctor ``` -------------------------------- ### Run chat-app (Messaging Interface) Source: https://github.com/amelmo/proofshot/blob/main/docs/test-apps.md Starts the chat-app fixture on port 5175. Requires Node.js and npm. ```bash cd test/fixtures/chat-app && npm install && npm run dev ``` -------------------------------- ### proofshot exec - Pass-through to agent-browser Source: https://github.com/amelmo/proofshot/blob/main/README.md Pass-through to agent-browser with automatic session logging. Reuses the same isolated agent-browser session from proofshot start when active. ```bash proofshot exec click @e3 proofshot exec screenshot step-checkout.png ``` -------------------------------- ### ProofShot behind-the-scenes phases Source: https://github.com/amelmo/proofshot/blob/main/proofshot-spec.md Detailed sequence of actions performed by proofshot start, agent-browser commands during the session, and proofshot stop. Shows the exact agent-browser commands used for snapshot, click, fill, screenshot, and navigation. ```text Phase 1: proofshot start 1. proofshot detects dev server is not running 2. proofshot starts dev server (npm run dev) 3. proofshot captures dev server stderr → ./proofshot-artifacts/server-errors.log 4. proofshot waits for server to be ready (detects "ready on" or port open) 5. proofshot calls: agent-browser open http://localhost:3000 6. proofshot calls: agent-browser set viewport 1280 720 7. proofshot calls: agent-browser record start ./proofshot-artifacts/session.webm 8. proofshot saves session state to ./proofshot-artifacts/.session.json 9. proofshot outputs: "Session started. Use agent-browser to test. Run proofshot stop when done." Phase 2: Agent drives the browser (proofshot is not running) - agent-browser snapshot -i → See what's on the page - agent-browser click @e3 → Click a button - agent-browser fill @e2 "text" → Fill a form - agent-browser screenshot ./proofshot-artifacts/step-1.png → Capture key moments - agent-browser open http://localhost:3000/other-page → Navigate Phase 3: proofshot stop 1. proofshot calls: agent-browser errors → captures final console errors 2. proofshot calls: agent-browser console → captures console output 3. proofshot calls: agent-browser record stop → saves video 4. proofshot calls: agent-browser close → closes browser 5. proofshot reads server-errors.log for server-side errors 6. proofshot collects all screenshots in the output dir 7. proofshot generates SUMMARY.md with: description, video, screenshots, console errors, server errors 8. proofshot outputs: proof artifact summary to stdout ``` -------------------------------- ### Skill file markdown: Replace agent-browser with proofshot exec Source: https://github.com/amelmo/proofshot/blob/main/issues/02-interactive-timeline-viewer.md Markdown snippet for skill files that replaces agent-browser with proofshot exec. Shows the step heading and usage examples for proofshot exec commands including snapshot, open, click, fill, and screenshot. ```markdown ### Step 2: Drive the browser and test Use proofshot exec to navigate, interact, and verify: proofshot exec snapshot -i # See interactive elements proofshot exec open http://localhost:PORT/page # Navigate to a page proofshot exec click @e3 # Click a button proofshot exec fill @e2 "test@example.com" # Fill a form field proofshot exec screenshot ./proofshot-artifacts/step-NAME.png # Capture key moments ``` -------------------------------- ### Search and filter tasks with keyboard shortcuts Source: https://github.com/amelmo/proofshot/blob/main/test/fixtures/todo-app/index.html Sets up the search input to filter task cards by title, ID, or tags, updates column counts, and adds '/' to focus search and Escape to clear and blur. ```javascript // ---- Search / Filter ---- function setupSearch() { const input = $('#search-input'); input.addEventListener('input', () => { const q = input.value.toLowerCase().trim(); $$('.task-card').forEach(card => { const title = ($('.task-title', card)?.textContent || '').toLowerCase(); const id = (card.dataset.taskId || '').toLowerCase(); const tags = $$('.tag', card).map(t => t.textContent.toLowerCase()).join(' '); const match = !q || title.includes(q) || id.includes(q) || tags.includes(q); card.style.display = match ? '' : 'none'; }); // Update counts to reflect visible \['backlog', 'in-progress', 'shipped'\].forEach(col => { const body = $(\`[data-drop="${col}"]\`); const visible = body ? $$('.task-card', body).filter(c => c.style.display !== 'none').length : 0; const badge = $(\`[data-count="${col}"]\`); if (badge) badge.textContent = visible; }); }); // Keyboard shortcut: / to focus search document.addEventListener('keydown', e => { if (e.target.tagName === 'INPUT' || e.target.tagName === 'TEXTAREA' || e.target.contentEditable === 'true') return; if (e.key === '/') { e.preventDefault(); input.focus(); } }); // Escape to blur search input.addEventListener('keydown', e => { if (e.key === 'Escape') { input.value = ''; input.dispatchEvent(new Event('input')); input.blur(); } }); } ``` -------------------------------- ### Tip: Install ffmpeg to auto-trim dead time from videos. Source: https://github.com/amelmo/proofshot/blob/main/issues/01-video-dead-time-trimming.md Log message printed when ffmpeg is not available, indicating that trimming is skipped and the original video is kept. ```text Tip: Install ffmpeg to auto-trim dead time from videos. ``` -------------------------------- ### Duplicate, Archive, and Delete Task Actions Source: https://github.com/amelmo/proofshot/blob/main/test/fixtures/todo-app/index.html Handles context menu actions for duplicating, archiving, and deleting tasks. Duplicate clones the card, archive animates opacity and scale before removal, delete collapses the card before removal. Each action shows a toast notification. ```javascript clone.dataset.taskId = newId; const idEl = $('.task-id', clone); if (idEl) idEl.textContent = newId; setupCardEvents(clone); contextTarget.parentElement.insertBefore(clone, contextTarget.nextSibling); updateColumnCounts(); toast(`Duplicated ${taskId} as ${newId}`); break; } case 'archive': contextTarget.style.transition = 'all 0.3s'; contextTarget.style.opacity = '0'; contextTarget.style.transform = 'scale(0.9)'; setTimeout(() => { contextTarget.remove(); updateColumnCounts(); }, 300); toast(`Archived ${taskId}`); break; case 'delete': contextTarget.style.transition = 'all 0.2s'; contextTarget.style.opacity = '0'; contextTarget.style.height = '0'; contextTarget.style.padding = '0'; contextTarget.style.margin = '0'; contextTarget.style.overflow = 'hidden'; setTimeout(() => { contextTarget.remove(); updateColumnCounts(); }, 200); toast(`Deleted ${taskId}`); break; } menu.classList.remove('visible'); }); } ``` -------------------------------- ### Run ProofShot lifecycle without AI agent Source: https://github.com/amelmo/proofshot/blob/main/docs/test-apps.md Executes the full ProofShot lifecycle (start → browser interactions → stop → pr → clean) for the sample-app fixture. Requires the test-proofshot.sh script. ```bash cd test/fixtures/sample-app bash test-proofshot.sh ``` -------------------------------- ### Add Task Form Handling Source: https://github.com/amelmo/proofshot/blob/main/test/fixtures/todo-app/index.html Manages add-task forms: toggles visibility, handles cancel and submit actions, and supports Enter to submit and Escape to cancel. ```javascript function setupAddTaskForms() { $$('[data-add-column]').forEach(btn => { const col = btn.dataset.addColumn; const form = $(`[data-form-column="${col}"]`); btn.addEventListener('click', () => { btn.style.display = 'none'; form.classList.add('visible'); $('[data-form-title]', form).focus(); }); }); $$('[data-form-cancel]').forEach(btn => { btn.addEventListener('click', () => { const form = btn.closest('.add-task-form'); const col = form.dataset.formColumn; form.classList.remove('visible'); $('[data-form-title]', form).value = ''; $(`[data-add-column="${col}"]`).style.display = ''; }); }); $$('[data-form-submit]').forEach(btn => { btn.addEventListener('click', () => { const form = btn.closest('.add-task-form'); const col = form.dataset.formColumn; const title = $('[data-form-title]', form).value.trim(); const priority = $('[data-form-priority]', form).value; const tag = $('[data-form-tag]', form).value; if (!title) return; createTaskCard(title, priority, tag, col); toast(`Created task in ${col.replace('-', ' ')}`); // Reset form $('[data-form-title]', form).value = ''; form.classList.remove('visible'); $(`[data-add-column="${col}"]`).style.display = ''; }); }); // Submit on Enter $$('[data-form-title]').forEach(input => { input.addEventListener('keydown', e => { if (e.key === 'Enter') { const form = input.closest('.add-task-form'); $('[data-form-submit]', form).click(); } else if (e.key === 'Escape') { const form = input.closest('.add-task-form'); $('[data-form-cancel]', form).click(); } }); }); } ``` -------------------------------- ### Keyboard shortcut for new task and modal close Source: https://github.com/amelmo/proofshot/blob/main/test/fixtures/todo-app/index.html Global keydown listener that opens the modal on 'n' or 'N' and closes on 'Escape', ignoring events from input, textarea, or contenteditable elements. ```javascript // Global keyboard shortcut document.addEventListener('keydown', e => { // Don't trigger if typing in an input, textarea, or contenteditable const tag = e.target.tagName; const editable = e.target.contentEditable === 'true'; if (tag === 'INPUT' || tag === 'TEXTAREA' || editable) return; if (e.key === 'n' || e.key === 'N') { e.preventDefault(); openModal(); } if (e.key === 'Escape') { closeModal(); } }); ``` -------------------------------- ### proofshot pr command syntax Source: https://github.com/amelmo/proofshot/blob/main/content/docs/reference/cli.mdx Uploads session artifacts to GitHub and posts a verification comment on the pull request. Requires GitHub CLI (gh) installed and authenticated, or GH_TOKEN/GITHUB_TOKEN. ```sh proofshot pr [number] [options] ``` -------------------------------- ### Session state JSON file Source: https://github.com/amelmo/proofshot/blob/main/proofshot-spec.md Defines the .session.json file used by ProofShot to track the active session. Contains metadata such as start time, description, output directory, video path, server error log, port, framework, and PID. Read by `proofshot stop` to locate artifacts and include metadata in the summary. ```json { "startedAt": "2026-02-25T14:32:00.000Z", "description": "Login form: fill credentials, submit, verify redirect", "outputDir": "./proofshot-artifacts", "videoPath": "./proofshot-artifacts/session-2026-02-25.webm", "serverErrorLog": "./proofshot-artifacts/server-errors.log", "port": 5173, "framework": "Vite", "pid": 12345 } ``` -------------------------------- ### Add error pattern for Swift Source: https://github.com/amelmo/proofshot/blob/main/CLAUDE.md Add a new entry to the PATTERNS array in src/utils/error-patterns.ts. The example shows a Swift entry with regex patterns for fatal errors and SIGABRT signals. ```typescript { name: 'Swift', patterns: [ /Fatal error:/, /Thread \d+: signal SIGABRT/, ], }, ``` -------------------------------- ### ffmpeg trim command Source: https://github.com/amelmo/proofshot/blob/main/issues/01-video-dead-time-trimming.md Trims the raw video to the active portion using ffmpeg. The trimStart and trimEnd are computed from screenshot timestamps relative to the session start, with a 2-second buffer. This command is run in proofshot stop if ffmpeg is available. ```bash ffmpeg -i session-raw.webm -ss {trimStart} -to {trimEnd} -c copy session.webm ``` -------------------------------- ### Generated proofshot.config.json Source: https://github.com/amelmo/proofshot/blob/main/proofshot-spec.md Created by 'proofshot init' with detected settings. Contains dev server command, port, waitForText, startupTimeout, output directory, viewport, and headless mode. ```json { "devServer": { "command": "npm run dev", "port": 3000, "waitForText": "ready on", "startupTimeout": 30000 }, "output": "./proofshot-artifacts", "viewport": { "width": 1280, "height": 720 }, "headless": true } ``` -------------------------------- ### proofshot.config.json - Browser launch configuration Source: https://github.com/amelmo/proofshot/blob/main/README.md Configure browser launch behavior in proofshot.config.json. Set browser.configPath to use a project-specific config instead of inheriting ~/.agent-browser/config.json. Relative paths are resolved from the directory containing proofshot.config.json. ```json { "browser": { "configPath": "./agent-browser.local.json", "ignoreHttpsErrors": true, "executablePath": "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" } } ``` -------------------------------- ### Enriched SessionLogEntry interface with element data Source: https://github.com/amelmo/proofshot/blob/main/specs/visual-overlays.md Defines the optional element field for capturing bounding box, label, and viewport dimensions at action time. The bbox comes from `agent-browser get box @e3 --json`, the label from `agent-browser get text @e3` with fallback attributes, and viewport from `agent-browser eval`. ```typescript interface SessionLogEntry { action: string; relativeTimeSec: number; timestamp: string; // New optional fields: element?: { label: string; // From `agent-browser get text @e3` bbox: { // From `agent-browser get box @e3 --json` x: number; y: number; width: number; height: number; }; viewport: { // From `agent-browser eval` querying window dimensions width: number; height: number; }; }; } ``` -------------------------------- ### Fill forms, click buttons, navigate Source: https://github.com/amelmo/proofshot/blob/main/content/docs/guides/verify-feature.mdx Interact with the page by filling forms, clicking buttons, and navigating using the @eN references from the snapshot. ```sh agent-browser fill @e2 "buyer@example.com" agent-browser fill @e3 "secure-password" agent-browser click @e4 ``` -------------------------------- ### Generic ProofShot Workflow (AGENTS.md / PROOFSHOT.md) Source: https://github.com/amelmo/proofshot/blob/main/proofshot-spec.md Generic markdown instructions for ProofShot visual verification, including start/test/stop workflow and key agent-browser commands. ```markdown # ProofShot Visual Verification After building or modifying UI features, verify with this workflow: 1. Start: `proofshot start --description "what you are verifying"` 2. Test: Use `agent-browser` to navigate, click, fill forms, take screenshots 3. Stop: `proofshot stop` — bundles video, screenshots, and error report Key agent-browser commands: - `agent-browser snapshot -i` — see interactive elements - `agent-browser click @e3` — click an element - `agent-browser fill @e2 "text"` — fill a form field - `agent-browser screenshot ./proofshot-artifacts/step.png` — capture a moment Artifacts saved to ./proofshot-artifacts/ including video, screenshots, errors, and summary. ``` -------------------------------- ### Build and test Source: https://github.com/amelmo/proofshot/blob/main/content/docs/guides/add-error-pattern.mdx Run the build and test commands to verify the new patterns. ```sh npm run build npm test ```