/dr-qa
Multi-layer quality verification across PRD, design, plan, and code
Overview
/dr-qa runs a four-layer quality verification that checks whether the implementation actually matches what was planned, designed, and required. It resolves the target task first, then each layer runs conditionally — only if the relevant artifacts exist.
Usage
/dr-qa
The Four Layers
- Layer 1: PRD Alignment — compares stated requirements against implementation. Flags missing features and scope creep. Only runs if
datarim/prd/*.mdexists. - Layer 2: Design Conformance — verifies that architectural decisions (ADRs) are respected in code and chosen patterns are actually used. Only runs if
datarim/creative/*.mdexists. - Layer 3: Plan Completeness — checks that each planned implementation step was completed, flags skipped or unplanned steps. Only runs if
tasks.mdhas implementation steps. - Layer 4: Code Quality — always runs. Includes five sub-checks:
- 4a. Tests — runs the project test suite and reports pass/fail/skip counts
- 4b. Security — scans for hardcoded secrets, exposed endpoints, missing input validation, dependency vulnerabilities
- 4c. Anti-Patterns — methods over 50 lines, 7+ parameters, duplicated code, missing error handling, stray console.log statements
- 4d. Live Smoke-Test Gate — if changed code uses
$queryRaw,raw(),sequelize.query(), or any path bypassing the ORM type-checker, a live smoke test against the actual target datasource is mandatory. Mocked/unit tests do not satisfy this gate. In multi-datasource projects, verifies the correct client is injected. The exact smoke-test command, datasource hit, and result are recorded in the QA report. No smoke test = Layer 4 verdict is FAIL. - 4e. Definition of Done — reads DoD from
tasks.mdorprd/*.mdand checks each criterion
CLI Agent Exit Code Pattern
Many CLI agents return exit code 0 even when the JSON output contains is_error: true. When testing integrations with CLI agents, check is_error/subtype in JSON — do not rely on exit codes for pass/fail determination.
Arguments
None. Operates on the currently active task (resolved via Task Resolution).
Output
Creates: datarim/qa/qa-report-{task-id}.md with per-layer verdicts.
Verdicts
- PASS — all checks satisfied, no issues
- PASS_WITH_NOTES — all checks satisfied, minor observations that do not block
- FAIL — one or more checks failed, must be addressed
Overall: ALL_PASS (proceed), CONDITIONAL_PASS (proceed with notes), or BLOCKED (return to /dr-do with fix list).
Example Session
> /dr-qa
Task Resolution: AUTH-0001 (Level 3)
Layer 1: PRD Alignment — PASS
8/8 requirements implemented
No scope creep detected
Layer 2: Design Conformance — PASS_WITH_NOTES
ADR-001 (WebSocket): Followed
ADR-002 (Redis cache): Followed
Note: Connection pooling added (not in design, but improvement)
Layer 3: Plan Completeness — PASS
8/8 steps completed
No skipped steps
Layer 4: Code Quality — PASS
4a. Tests: 14 passed, 0 failed
4b. Security issues: 0
4c. Anti-patterns: 0
4d. Smoke test: SELECT 1 on auth DB — OK (1 row)
4e. DoD: 5/5 criteria met
Overall: ALL_PASS
Report saved: datarim/qa/qa-report-AUTH-0001.md
Next step: /dr-compliance or /dr-archive
Related Commands
- /dr-do — return here if BLOCKED
- /dr-compliance — next for L3-4
- /dr-archive — next for L1-2 (reflection runs as Step 0.5)