agentleFS
AmElmoAmElmo/proofshot/CLAUDE.md

proofshot

CLAUDE.md866 starsChanged 9 months agoMITView on GitHub

Visual verification tool for AI coding agents. Records browser sessions, captures screenshots, collects errors, and bundles proof artifacts. Entry point: bin/proofshot.ts → src/cli.ts → src/commands/*.ts Edit src/utils/error-patterns.ts — add a new entry to the PATTERNS array:

The file

We split this CLAUDE.md into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Create src/commands/mycommand.ts with export async function mycommandCommand(options): Promise<void>

    line 47

≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

ProofShot CLI

Visual verification tool for AI coding agents. Records browser sessions, captures screenshots, collects errors, and bundles proof artifacts.

Quick reference

npm run build          # Build with tsup (must run after changes)
npm test               # Run vitest once
npm run dev            # Watch mode build

Architecture

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

Entry point: bin/proofshot.ts → src/cli.ts → src/commands/*.ts

Key conventions

  • ESM only — all imports MUST use .js extensions: import { foo } from '../utils/config.js'
  • Build before test — CLI runs from dist/, always npm run build after code changes
  • agent-browser — external peer dependency (Rust CLI + Node daemon). All browser commands go through ab() in utils/exec.ts which calls agent-browser <command> via execSync
  • Session state — start writes .session.json, exec and stop read it. stop clears it. Don't assume session exists without checking
  • Session metadata — start writes metadata.json inside each session folder with git branch/commit. This persists after stop and is used by pr to match sessions to branches
  • Per-session subfolders — artifacts go in proofshot-artifacts/YYYY-MM-DD_HH-mm-ss_slug/

Command lifecycle

  1. proofshot start — spawns dev server, opens browser, starts recording, saves session state + writes metadata.json with git branch/commit
  2. proofshot exec <args> — logs action to session-log.json, forwards to agent-browser
  3. proofshot stop — collects errors, stops recording, trims video, generates SUMMARY.md + viewer.html, clears session
  4. proofshot pr [number] — finds sessions for current branch, uploads artifacts to GitHub, posts PR comment

Adding a new command

  1. Create src/commands/mycommand.ts with export async function mycommandCommand(options): Promise<void>
  2. Register in src/cli.ts with program.command('mycommand')...
  3. Export from src/index.ts if it should be part of the public API

Adding error patterns for a new language

Edit src/utils/error-patterns.ts — add a new entry to the PATTERNS array:

{
  name: 'Swift',
  patterns: [
    /Fatal error:/,
    /Thread \d+: signal SIGABRT/,
  ],
},

Session artifacts

FileCreated byContains
metadata.jsonstartGit branch, commit SHA, timestamp (persists after stop)
session.webmstartVideo recording (Playwright screencast)
session-log.jsonexec (appended each call)Action timeline with relative timestamps
server.logstart (piped stdout+stderr)All dev server output
console-output.logstopBrowser console output
step-*.pngexec screenshotScreenshots at key moments
SUMMARY.mdstopMarkdown report with errors and screenshots
viewer.htmlstopStandalone HTML viewer with video + timeline

Versioning & releases

  • Automatic — merging to main triggers semantic-release via GitHub Actions
  • Never manually edit version in package.json — semantic-release handles it
  • Conventional Commits determine the version bump:
    • feat: → minor (0.1.0 → 0.2.0)
    • fix:, perf:, refactor: → patch (0.2.0 → 0.2.1)
    • feat!: or BREAKING CHANGE: footer → major (0.2.1 → 1.0.0)
    • docs:, style:, chore:, test:, ci: → no release
  • Commit format: type(scope): description — e.g. feat(cli): add diff command, fix(viewer): correct timestamp offset
  • Branch naming: AmElmo/<descriptive-name>

Gotchas

  • proofshot exec has special shell quoting logic (buildShellCommand in exec.ts) — eval commands get single-quoted, args with special chars get auto-quoted
  • Video trimming adjusts session-log.json timestamps to match the trimmed video (see trimOffsetSec in stop.ts)
  • Server log capture only works when proofshot starts the server itself — if the port is already occupied, we skip spawning and get no server logs
  • The consoleErrors/consoleOutput from agent-browser are point-in-time snapshots collected at stop time

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.