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
- Spec-graph check — independently runs the compliance-stage spec-graph gate and reports graph completeness; the report-only grade never decides routing
- Acceptance recheck — rechecks every due acceptance case and its evidence instead of inferring all-green from earlier verdicts; discrepancies go back for correction
- Compliance report — writes a structured report to
datarim/reports/when the project has it, otherwise in chat
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
Before any source read or delegation it loads the security skill and applies its sensitive-source context boundary. Applies the compliance skill (self-contained workflow and report structure), immutability (acceptance and evidence loop) and cta-format (Next Step block; a non-compliant verdict uses the fail-routing variant). 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), security (always, before source reads), immutability (always), cta-format (always), code-simplifier agent (optional, for step 2).
Reporting the result
Apply Human Outcome Reporting before a human-facing update or result. Explain the user-visible outcome, the original conditions, checks and evidence, and open limitations. A stage result does not mean the entire task is complete. Keep exact protocols and technical records intact. To explain again without continuing work, use /dr-explain.