Agent sonnet

Compliance

Runs the post-QA hardening workflow (7 steps): re-validate vs PRD/task, simplify code, check references/coverage/lint/tests, produce compliance report.

Overview

The Compliance Runner is the final quality gate before a task is archived. It executes a structured 7-step hardening workflow that re-validates implementation against the original requirements, simplifies recently modified code, checks references, coverage, lint, and tests, then produces a formal compliance report.

When It's Used

Invoked via /dr-compliance after the QA stage has passed. This is the last checkpoint before /dr-archive (which runs reflection as Step 0.5 and archives the task). It adapts to task type — code, documentation, research, legal, content, or infrastructure — applying the appropriate verification checklist.

Capabilities

  • PRD/task re-validation — verifies that implemented changes match the original requirements
  • Code simplification — applies Code Simplifier principles to recently modified code only
  • Reference checking — validates that all cross-references between documents are intact
  • Coverage verification — confirms test coverage meets the project's Definition of Done
  • Lint and test execution — runs linters and test suites, reports failures
  • Compliance report — writes a structured report to datarim/reports/

How It Works

The 7-step workflow runs sequentially. First, the agent reads the PRD and task definition, then checks what was implemented against what was planned. It runs the Code Simplifier on changed files, verifies documentation references, executes tests, and finally produces a report. If any step fails, the report flags it for resolution before archiving.

Example

/dr-compliance
→ Step 1: Read PRD and task definition
→ Step 2: Apply code simplification to changed files
→ Step 3: Verify cross-references in datarim/
→ Step 4: Run test suite, check coverage
→ Step 5: Run linter
→ Step 6: Generate compliance report
→ Step 7: Summary in chat → next step: /dr-archive

Context Loading

Applies the compliance skill (self-contained workflow and report structure). Reads project context: activeContext.md, tasks.md, and PRD when present. Optionally loads the Code Simplifier agent for step 2.

Skills Used

compliance (always — defines the full workflow), code-simplifier agent (optional, for step 2).