What problem does it solve?
The Refactor Guardian audits the current state of the Domain Model V4 refactor to surface invariant violations, ADR drift, missing migrations, and other blockers before proceeding to the next phase, preventing accidental regressions or incomplete migrations.
Core Features & Use Cases
- Non-destructive verification: Reads DOMAIN_MODEL_V4_MASTER.md, inspects git changes since the pre-v4-baseline tag, and runs safe smoke checks (npm test baseline, astro build, MCP smoke) to validate refactor health.
- ADR and migration integrity: Verifies ADR integrity (no Accepted ADRs edited without new ADRs), greps for acceptance criteria evidence, and reports drift between ADRs and code.
- Actionable recommendations: Proposes diffs to update the master refactor document and issues a clear proceed/blocker recommendation for phase gating.
- Use Case: Run at the start and end of any session touching the refactor to confirm migrations, org_id population post-Phase 1, and that the codebase matches documented ADR decisions.
Quick Start
Invoke the Refactor Guardian agent with the user's current goal (e.g., starting-session or ending-session) and point it to .claude/agents/refactor-guardian.md for instructions.