Back to all projects
GoMCPAI AgentsCLIHomebrew

RegressGuard.

A regression guard built for the AI agent loop: record a known-good baseline, and after an agent edits your app, know exactly what broke before it reaches a human.

  • Ships as an MCP server, so Claude Code and Cursor can verify their own edits and self-correct before a human sees the diff
  • Same engine runs as a plain CLI for humans and CI — two commands, no test-writing
  • Auto-detects test command, framework, and dev server URL on `rg init`
  • Distributed via Homebrew tap and a one-line install script
An AI agent breaks an API contract; rg check blocks the commit and names the culprit file; the agent fixes it and the check goes green
Break → detect → fix → green. The agent verifies its own work through the MCP server, with no human in the loop.

The problem

When an AI coding agent edits an app it can silently break an API contract — a removed field, a changed status code, a test that now fails — and still report success. The failure surfaces later, in review or in production, long after the context that caused it is gone.

Approach

Record a known-good baseline before the agent session, then diff against it afterward and name exactly what regressed. The critical design bet was where that check runs: not as a CI step after the fact, but inside the agent’s own loop as an MCP server, so the agent verifies itself and self-corrects with zero extra steps.

Key decisions & tradeoffs

MCP server first, CLI second

A CI-only check catches regressions after the agent has already declared success. Exposing snapshot/check/status as MCP tools puts verification inside the loop, which is the difference between catching a break and preventing one. The same engine still runs as a CLI so humans and CI are not second-class.

Baseline over written tests

Asking users to write tests before they can benefit is a non-starter at the moment they need this most. Recording actual observed behavior as the baseline gets useful coverage in under 15 seconds, at the cost of only catching regressions against exercised paths.

Shipping as `rg`, colliding with ripgrep

ripgrep also installs as `rg`, so whichever lands first on PATH wins and `rg check` could silently run the wrong binary. Rather than rename, the pre-commit hook and GitHub Action use absolute paths, `rg doctor` detects the collision, and the README leads with the warning — the ergonomic name kept, the failure mode made loud instead of silent.

Outcome

RegressGuard is early — two tagged releases and a Homebrew tap — but it answers a problem that only exists because agents now write code unsupervised. Building it clarified where AI tooling actually belongs: not wrapped around the agent as a gate, but handed to the agent as a tool it can call on itself.

Next project

RivalEye

Next project →