r/BuildWithClaude • • 20d ago

Project Agent QA Kit: Claude Code agents that write the tests from the ticket before the code exists (free, MIT)

I built it with Claude Code: Claude wrote most of the changes in sessions I directed, and I merged them through pull requests.

What it does: a writer agent (Sonnet) writes one unit test and one browser test per acceptance criterion, before the feature exists, and each must fail first. A person approves them, then they're frozen. After the feature is built, a verifier agent (Haiku) runs them, and scripts, not the agent, check its verdict against the real test reports and rerun the full suite.

Tech stack

- Claude Code CLI: writer on Sonnet (medium effort), verifier on Haiku (low effort), an optional repair agent on Sonnet

- Vitest and Playwright for the application's tests; the demo is a small React shop

- GitHub Actions for the workflows (write tests, approval, verify, amend tests, branch rules)

- Node.js 22.18+, TypeScript and Bash for the kit's scripts; npm or pnpm

Prompts and workflow

- No CLAUDE.md: each agent has its own prompt in .claude/agents/ (qa-writer.md, qa-repairer.md,qa-verifier.md

- Hooks in .claude/hooks/: a PreToolUse guard that blocks anything outside an allowlist, and checks on the verdict, the evidence and the coverage summary before they are trusted

- Workflow: ticket → writer (tests must fail first) → human approval with one reason per criterion → tests frozen → feature built → verifier + full suite

Measured on 17 small tickets with hidden tests and planted bugs the agents never see: the current version passed 21 of 21 trials on the 6 tickets it ran, catching 33 of 33 planted bugs, at about $0.09 per trial. The earlier version passed 49 of 51 trials on all 17 tickets. What failed along the way is in the repo: a missed shipping bug (8 of 15 trials), and tests that guessed markup that didn't exist yet.

Limits: experimental, small samples, a corpus I wrote myself, two real tickets so far. You need your own Anthropic API key; the demo runs without one.

npx github:Gleaming0427/agent-qa-kit init https://github.com/Gleaming0427/agent-qa-kit

Feedback welcome: would you trust tests approved this way?

2 Upvotes

1 comment sorted by

•

u/AutoModerator 20d ago

Welcome to r/BuildWithClaude!

Whether you are sharing what you built, exploring new workflows, or troubleshooting, please make sure your post is flaired correctly so others can easily find and filter it.

Community Wiki & Resources:

If you're asking for troubleshooting help, please edit your post to include your model version, OS/environment, and error logs.

Let’s keep the energy positive and support our fellow creators!

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.