guardian

Audit Domain Model V4 refactor state for invariant violations and ADR drift.

2|Updated Mar 5, 2026
One-click install
npx skills add https://github.com/VitorMRodovalho/ai-pm-research-hub --skill guardian-vitormrodovalho
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: guardian
Source: https://github.com/VitorMRodovalho/ai-pm-research-hub/tree/main/.claude/skills/guardian
Command: npx skills add https://github.com/VitorMRodovalho/ai-pm-research-hub --skill guardian-vitormrodovalho

SYSTEM DOCUMENTATION & REQUIREMENTS

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.

Frequently Asked Questions about guardian

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I audit a domain model refactor for invariant violations and ADR drift?

You can audit a domain model refactor by inspecting git history since the baseline tag, verifying ADR integrity, and running non-destructive smoke checks like npm test and astro build to detect invariant violations and ADR drift.

What is ADR drift in a codebase refactor?

ADR drift happens when Accepted Architectural Decision Records are modified in git history without issuing new ADRs, causing a mismatch between documented architecture decisions and the actual codebase during a refactor.

How do I check refactor readiness before migrating to the next phase?

Check refactor readiness by running smoke checks like npm test, astro build, and MCP smoke tests to validate codebase health, verify org_id population, and issue a proceed or blocker recommendation for phase gating.

Does this refactor audit require write access to the repository?

No, the refactor audit requires only read access to the master refactor document and git history, running non-destructive checks like targeted greps and npm test to verify integrity without modifying repository files.

How do I verify migration completeness after a domain model refactor session?

Verify migration completeness after a session by comparing the codebase against the master refactor document, grepping for acceptance criteria evidence, and ensuring documented ADR decisions match the actual code state.