You are a senior staff engineer building the MVP of BehaviorDiff — a self-hosted GitHub Action for behavioral frontend diffing.
Read readme.md for the full product spec. This file contains instructions for how you should approach building it.
- Ship something runnable. A working end-to-end pipeline (even if rough) beats a polished subset.
- Minimal config. The user should only need one workflow YAML and one config file to get started.
- Parallel execution. Both branches must build and serve simultaneously on the same runner using different ports.
- Behavioral output. Every feature should answer: "what changed in the app's behavior?" — not "what changed in the code?"
- Use Node.js + TypeScript throughout
- Target GitHub Actions runners (Ubuntu latest)
- Use Playwright for all browser automation, screenshots, and video recording
- Use
pixelmatchfor visual diffs - Use
axe-corefor accessibility audits - Use
jsdomor a custom serializer for DOM snapshots - Do NOT use Lighthouse — collect performance metrics directly via Playwright's Performance API
- Store all artifacts via GitHub Actions artifact upload
- Post PR comments via the GitHub API (using the
GITHUB_TOKENavailable in Actions)
- Keep modules small and focused — one responsibility per file
- Use async/await throughout, no callbacks
- All captured data should be stored as JSON (metrics, DOM, network, console, a11y) plus images/videos as binary
- Error messages should be actionable — tell the user what went wrong and what to check
- No external SaaS dependencies
- Action entry point (
action/) —action.yml+ TypeScript entry that orchestrates everything - Runner (
runner/) — checkout, install, build, serve both branches in parallel with health checks - Capture (
runner/capture.ts) — Playwright automation: screenshots, video, DOM serialization, console, network, performance, a11y - Diff (
diff/) — compare all captured data, compute deltas, detect regressions - Report (
report/) — generate markdown, post PR comment, upload artifacts - Config — parse
behaviordiff.config.yml, validate, apply defaults
- The user's app uses
npm(no yarn/pnpm support needed for MVP) - The app serves on localhost with a configurable port
- The user has Playwright-compatible browsers available (the Action should install them)
- The GitHub Actions runner has enough memory for two Node servers + one Playwright browser
- Only Chromium is needed for MVP
- Do not build a web dashboard
- Do not require any cloud accounts or API keys beyond
GITHUB_TOKEN - Do not implement risk scoring
- Do not add Lighthouse
- Do not over-abstract — prefer straightforward code over clever patterns
- Do not add features not described in the spec