Back to personal projects

AI agent · Developer tooling

unitbot

Stack
  • Claude Code
  • GitHub Actions
  • Node.js
  • Vitest
  • mutation testing

A Claude Code agent that writes unit tests for each pull request, checks them with coverage and mutation testing, and opens them as a separate PR without touching production code.

The Approach

  • Changed files are classified without an LLM first. With nothing to test, the agent is not called at all.
  • Tests are checked with patch coverage and mutation testing, not only "they pass".
  • The agent's patch is verified again from scratch, with no secrets and with tooling from the base branch.
  • Hooks block writes outside test files and shell commands outside an allowlist.
  • A report is posted as one comment on the pull request. When existing tests fail, it reports a regression instead of rewriting them.

The Outcome

5

CI jobs, and only one of them holds the LLM key

Report: a "refactor" that changed behaviour, caught as a regression
The workflow: resolve, detect, generate, verify, publish
Tests the agent wrote, opened as their own pull request