with one click
dx-plan-validate
// Cross-check the implementation plan against requirements. Verifies every requirement has a step, no unrequested features snuck in, and dependencies flow correctly. Use after /dx-plan and before /dx-step.
// Cross-check the implementation plan against requirements. Verifies every requirement has a step, no unrequested features snuck in, and dependencies flow correctly. Use after /dx-plan and before /dx-step.
[HINT] Download the complete skill directory including SKILL.md and all related files
| name | dx-plan-validate |
| description | Cross-check the implementation plan against requirements. Verifies every requirement has a step, no unrequested features snuck in, and dependencies flow correctly. Use after /dx-plan and before /dx-step. |
| argument-hint | [Work Item ID or slug (optional — uses most recent if omitted)] |
| context | fork |
| allowed-tools | ["read","edit","search","write","agent"] |
You cross-check implement.md against explain.md to verify the plan is complete, correct, and ready for execution.
Use ultrathink for this skill — careful cross-referencing benefits from deep reasoning.
You run in a forked context. Before emitting any chat output, determine whether you were invoked by the orchestrator (dx-agent-all) or standalone — see plugins/dx-core/shared/orchestration-check.md:
ORCHESTRATED=0
FLAG=".ai/run-context/orchestrating.flag"
if [ -f "$FLAG" ]; then
AGE=$(( $(date +%s) - $(date -r "$FLAG" +%s) ))
[ "$AGE" -lt 7200 ] && ORCHESTRATED=1
fi
$ORCHESTRATED == 1 (orchestrator path): write the full report to $SPEC_DIR/validation-report.md and emit ONLY the ## Return block to chat.$ORCHESTRATED == 0 (standalone path): write the same report AND emit the human-friendly summary marked <!-- standalone-only --> below, followed by the ## Return block at the very end.Per-phase progress lines during the run are allowed in both paths.
This skill writes its full report to $SPEC_DIR/validation-report.md (overall verdict, per-requirement mapping, reuse check, warnings). The orchestrator reads this file only on demand.
SPEC_DIR=$(bash .ai/lib/dx-common.sh find-spec-dir $ARGUMENTS)
Read from $SPEC_DIR:
explain.md (required)implement.md (required)research.md (if exists — for file existence verification)If either explain.md or implement.md is missing, print which is missing and STOP.
Run these checks sequentially using extended thinking:
For each numbered requirement in explain.md, find at least one step in implement.md that addresses it.
Report:
For each step in implement.md, verify it maps to at least one requirement in explain.md.
Report:
Verify steps are in valid execution order:
Report:
If research.md is available, verify files referenced in implement.md actually exist (for "Modify" actions) or that their parent directories exist (for "Create" actions).
Report:
path/to/file — not found in codebaseVerify the testing plan covers the key changes:
**Test:** has a valid test command or approachReport:
If research.md has an "Existing Implementation Check" section, cross-reference it against implement.md:
If research.md doesn't have the section, scan implement.md for "Create new" steps and verify no existing equivalent was missed by checking the codebase (quick Grep for similar names/patterns).
Report:
<thing> but existing <path> already provides this functionalityWrite the following table and overall verdict to $SPEC_DIR/validation-report.md. Do not print to chat.
## Plan Validation: <Title>
| Check | Result | Details |
|-------|--------|---------|
| Requirement Coverage | ✅/❌ | <N>/<total> covered |
| No Scope Creep | ✅/⚠️ | <N> steps without requirement mapping |
| Dependency Order | ✅/❌ | <details if issues> |
| File Existence | ✅/❌ | <N> files verified |
| Testing Coverage | ✅/⚠️ | <details> |
| Reuse Check | ✅/❌/⚠️ | <N> reuse opportunities verified |
**Overall: PASS / FAIL / PASS WITH WARNINGS**
<If FAIL — list specific issues that must be fixed>
<If PASS WITH WARNINGS — list items to review but not blocking>
<If PASS — "Plan is ready for execution.">
/dx-plan-validate 2416553 — Cross-checks implement.md against explain.md for story #2416553. Reports that all 5 requirements are covered, no scope creep detected, dependency order is valid, and test coverage is adequate. Verdict: PASS.
/dx-plan-validate (no argument) — Uses the most recent spec directory. Finds that Requirement 3 has no corresponding step in implement.md and Step 7 references a file that doesn't exist. Verdict: FAIL with specific issues listed.
/dx-plan-validate 2416553 (after plan-resolve) — Re-validates the updated plan. Confirms previously flagged risks are now resolved, all requirements are covered, and the reuse check passes. Verdict: PASS.
"explain.md or implement.md not found"
Cause: The required spec files haven't been generated yet.
Fix: Run /dx-req <id> and /dx-plan <id> first to generate both files.
False "scope creep" warnings on infrastructure steps Cause: Steps like "set up test fixtures" or "update build config" don't map directly to a numbered requirement. Fix: These are flagged as warnings, not failures. Review them — infrastructure steps are legitimate and don't block execution.
Reuse check flags a "create new" step incorrectly Cause: The existing utility found by the check has a similar name but different functionality. Fix: Review the flagged step and the existing code. If the existing code doesn't cover the need, proceed — the flag is advisory.
When running standalone, emit the validation table to chat:
## Plan Validation: <Title>
| Check | Result | Details |
|-------|--------|---------|
| Requirement Coverage | ✅/❌ | <N>/<total> covered |
| No Scope Creep | ✅/⚠️ | <N> steps without requirement mapping |
| Dependency Order | ✅/❌ | <details if issues> |
| File Existence | ✅/❌ | <N> files verified |
| Testing Coverage | ✅/⚠️ | <details> |
| Reuse Check | ✅/❌/⚠️ | <N> reuse opportunities verified |
**Overall: PASS / FAIL / PASS WITH WARNINGS**
<If FAIL — list specific issues that must be fixed>
<If PASS WITH WARNINGS — list items to review but not blocking>
<If PASS — "Plan is ready for execution.">
### Next step:
<If PASS or WARN:> - `/dx-step-all` — execute the plan
<If FAIL:> - `/dx-plan-resolve` — fix flagged issues, then re-validate
When orchestrated ($ORCHESTRATED == 1), skip this section entirely and emit only the ## Return block.
This skill runs in a forked context. It MUST end with a ## Return block per plugins/dx-core/shared/skill-return-contract.md.
Examples:
## Return
verdict: pass
summary: All 9 requirements covered by 4 plan steps; no scope creep; reuse check clean.
artifacts:
- .ai/specs/2490722-microsite/validation-report.md
next_action: continue to Phase 2.5 (feature branch)
## Return
verdict: warn
summary: Plan covers all reqs but has 2 non-blocking warnings (no test infra; 2 open PO questions).
artifacts:
- .ai/specs/2490722-microsite/validation-report.md
next_action: continue (warnings non-blocking) or run /dx-plan-resolve
## Return
verdict: fail
summary: Requirement #5 (test coverage) has no corresponding plan step.
artifacts:
- .ai/specs/2490722-microsite/validation-report.md
next_action: run /dx-plan-resolve