Implementation Planning Skill
Overview
Author the
section of the
one unified artifact — granular, parallelizable tasks tracing to the
requirements in the
same document's
section. There is no second file: traceability resolves within one doc. Ensures complete coverage through explicit, internal traceability. The artifact shape is owned by
references/spec-template.md
— author against it.
For a complete worked example, see
references/worked-example.md
.
Triggers
Activate this skill when:
- User runs command
- User wants to break a spec into tasks
- A unified artifact's Design & Rationale section needs decomposition
- User says "plan the implementation" or similar
- Auto-chained from after the Design & Rationale section is written
- Run directly (no prior ): at thin/standard depth, author the whole unified spec — light/standard Design & Rationale section plus Decomposition — in one pass
- Auto-chained from plan-review with flag (gaps found)
Revision Mode (--revise flag)
When invoked with
, plan-review found gaps. Read
from state, re-read the design, add tasks to address each gap, update the plan file, then clear gaps via
exarchos:exarchos_workflow
.
Revision Loop Guard
Max revisions: 3 per plan.
After 3 failed revisions:
- Set
planReview.revisionsExhausted = true
- Output: "Plan revision failed after 3 attempts. Design may be incomplete."
- Escalate: Suggest to revisit design
MANDATORY: Before accepting any rationalization for skipping tests, planning, or TDD steps, consult
references/rationalization-refutation.md
. Every common excuse is catalogued with a counter-argument and the correct action.
The Verification Ladder
Verification depth matches blast radius. The deeper rungs add tests, an adequacy kill-probe, and integration coverage — judged by outcome, test-after, not by a universal failing-test-first law. Each task gets the cheapest verification that still captures its risk:
| Risk tier | What it adds | Why |
|---|
| low | Static analysis (typecheck + lint) suffices | A docs/config/rename-only edit has near-zero blast radius; a test ceremony is pure overhead. |
| medium | Scoped tests + the kill-probe | The kill-probe recaptures test-first's one real guarantee — that a test can actually fail — at lower cost, judged test-after instead of mandating a failing test first on every commit. |
| high | The integration suite (and mutation-adequacy at the boundary) on top of medium | Schema/type/API/shared-contract surfaces span the codebase; here adequacy-judged coverage plus real-collaborator integration across the seam earns its cost. |
The planner stamps each task's
(and
); the classifier derives it from blast radius when the planner does not override. The dispatched implementer prompt and the gate sequence both scale off that stamp — so the verification effort is data-driven, not a blanket rule.
For a high-tier task, the discipline is outcome-based (write the behavior and its tests in whatever order is natural — test-after is fine):
- Cover the new/changed behavior with scoped tests that pin its contract
- Let the kill-probe prove the tests can actually fail (it reverts your source and asserts at least one test goes red)
- Add real-collaborator integration coverage across the seam
Verify high-tier test adequacy after implementation — the keeper gate (the test-FIRST ordering gate
was retired):
typescript
exarchos_orchestrate({
action: "check_test_adequacy",
featureId: "<featureId>",
taskId: "<taskId>",
branch: "feature/<name>",
riskTier: "high"
})
- — Reverting the task's source makes at least one new/changed test fail: the tests are not vacuous
- — A test still passes against the reverted source; strengthen it
Planning Process
Step 1: Analyze the Design & Rationale section
Read the unified spec's
section thoroughly (if
ran, it is already written; otherwise author it at thin/standard depth now, per
references/spec-template.md
). From it, extract:
- Problem Statement — Context (no tasks, but informs scope)
- Chosen Approach — Architectural decisions to implement
- Requirements (DR-N) — the provenance anchors every task must trace to
- Technical Design — Core implementation requirements
- Integration Points — Integration and glue code tasks
- Open Questions — Decisions to resolve or explicitly defer
Step 1.5: Spec Tracing (Required)
Create a traceability matrix mapping
requirements to planned tasks
within the unified document.
Consult
references/spec-tracing-guide.md
for the methodology and template.
Pre-populate the matrix using the traceability generator — pass the unified
artifact as
both and
(DR-N is parsed from its
region, tasks from its
region — one file):
typescript
exarchos_orchestrate({
action: "generate_traceability",
designFile: "docs/specs/<date>-<feature>.md",
planFile: "docs/specs/<date>-<feature>.md",
outputFile: "docs/specs/<date>-<feature>-traceability.md"
})
- — Matrix generated; review and fill in "Key Requirements" column
- — Parse error; the spec may lack expected / headers
Step 2: Decompose into Tasks
Each task follows the TDD format in
references/task-template.md
.
Granularity Guidelines:
- Each task: 2-5 minutes of focused work
- One test = one behavior
- Prefer many small tasks over few large ones
Assign a
to each task using
references/testing-strategy-guide.md
to control which verification techniques agents apply. Auto-determine
and
flags by matching each task's description and file paths against the category tables — do not leave these for the implementer to decide.
Task Ordering:
- Foundation first (types, interfaces, data structures)
- Core behaviors second
- Edge cases and error handling third
- Integration and glue code last
Step 3: Identify Parallelization
Analyze dependencies to find sequential chains and parallel-safe groups that can run simultaneously in worktrees.
Step 4: Author the Decomposition section
Write the
section into the unified spec at
docs/specs/YYYY-MM-DD-<feature>.md
, using
references/spec-template.md
. Its
carries the task breakdown, with traceability resolved
within this single document against the
DR-N source above it.
The legacy two-file split (
references/plan-document-template.md
→
) is retained only for in-flight workflows already on the old path; new features author the one
artifact.
Step 5: Plan Verification
Run deterministic verification scripts instead of manual checklist review. Each takes the
unified artifact as both
and
— the handlers parse DR-N from its design region and tasks from its decomposition region.
5a. Coverage — verify every Design & Rationale requirement maps to a task (the folded design-completeness acceptance-criteria check rides here now):
typescript
exarchos_orchestrate({
action: "check_plan_coverage",
featureId: "<id>",
designPath: "docs/specs/<date>-<feature>.md",
planPath: "docs/specs/<date>-<feature>.md"
})
- passed: true — All requirements covered; proceed to 5a-ii
- passed: false — Gaps found; add tasks for uncovered requirements or defer with rationale
- error — Usage error or empty spec; check arguments
5a-ii. Provenance chain verification — verify every DR-N requirement maps to a task via
field:
typescript
exarchos_orchestrate({
action: "check_provenance_chain",
featureId: "<id>",
designPath: "docs/specs/<date>-<feature>.md",
planPath: "docs/specs/<date>-<feature>.md"
})
- passed: true — All DR-N requirements traced; proceed to 5b
- passed: false — Block: gaps or orphan references found. Add to tasks for each uncovered requirement before proceeding. Every DR-N requirement MUST trace to at least one task.
- error — No DR-N identifiers in design (exit 2); if design doesn't use DR-N identifiers, this check is skipped (exempt)
5a-iii. D5: Task decomposition quality (advisory) — verify each task has clear description, file targets, and test expectations; dependency graph is a valid DAG; parallelizable tasks don't modify the same files:
typescript
exarchos_orchestrate({
action: "check_task_decomposition",
featureId: "<id>",
planPath: "docs/specs/<date>-<feature>.md"
})
- passed: true — All tasks well-decomposed; proceed to 5b
- passed: false — Findings recorded as D5 gate events for the ConvergenceView. Present findings to the user for awareness but do not block plan approval.
- error — Input error (missing file, no task headers); check arguments
Advisory: This gate verifies task structure quality but does not block plan approval. Findings are recorded for convergence tracking.
5b. Spec coverage check — verify planned test files exist and pass:
typescript
exarchos_orchestrate({
action: "spec_coverage_check",
planFile: "docs/specs/<date>-<feature>.md",
repoRoot: "."
})
- — All planned tests found and passing; plan verification complete
- — Missing test files or test failures; create missing tests or fix failures
For reference, consult
references/spec-tracing-guide.md
for the underlying methodology.
Anti-Patterns
| Don't | Do Instead |
|---|
| Ship medium/high-tier behavior with no tests | Cover it with adequacy-judged tests (test-after is fine) |
| Mandate red-green-refactor on every task | Scale verification to the task's ; RGR is a high-tier opt-in |
| Create large tasks | Break into 2-5 min chunks |
| Skip dependency analysis | Identify parallel opportunities |
| Vague test descriptions | Specific: Method_Scenario_Outcome |
| Assume your tests can fail | Let prove they can (revert source, re-run, expect red) |
| Add "nice to have" code | Only what the behavior requires |
Rationalization Debunking
The ladder already prices in genuinely low-risk work — so these excuses apply to medium/high-tier tasks, where they are rationalizations rather than reasonable tier choices:
| Excuse | Reality |
|---|
| "This is too simple for a test" (on a medium/high-tier task) | If it touches a high-blast surface, its tier is not low. Test it at the tier the ladder assigns. |
| "I'll add tests after" | You won't. Or they'll be weak — and will catch tests that can't fail. |
| "Tests slow me down" | Debugging an untested medium/high-tier change is slower. |
| "The design is obvious" | Obvious to you now. Not in 3 months. |
State Management
On spec save, record the artifact and transition phase based on
: feature →
, refactor →
. Set
to the
unified path — this is the key the
guard reads, and it points at the one unified doc (the same path
recorded as
). Artifacts and phase are two separate calls —
is non-phase mutation only; phase changes go through the HSM-guarded
action:
text
action: "update", featureId: "<id>", updates: {
"artifacts": { "plan": "docs/specs/<date>-<feature>.md" },
"tasks": [{ "id": "001", "title": "...", "status": "pending", "branch": "...", "blockedBy": [] }, ...]
}
action: "transition", featureId: "<id>", target: "<plan-review-phase>"
Phase Transitions and Guards
For the full transition table, consult
@skills/checkpoint/references/phase-transitions.md
.
Quick reference: The
→
transition requires guard
— set
to the unified
path before the
call.
Schema Discovery
Use
exarchos_workflow({ action: "describe", actions: ["update", "init"] })
for
parameter schemas and
exarchos_workflow({ action: "describe", playbook: "feature" })
(or
,
) for phase transitions, guards, and playbook guidance.
Use
exarchos_orchestrate({ action: "describe", actions: ["check_plan_coverage", "check_provenance_chain"] })
for orchestrate action schemas.
Completion Criteria
typescript
exarchos_orchestrate({
action: "check_coverage_thresholds",
coverageFile: "coverage/coverage-summary.json",
lineThreshold: 80,
branchThreshold: 70,
functionThreshold: 100
})
Transition
After decomposition completes,
auto-continue to plan-review. Transition to the appropriate review phase (feature:
, refactor:
). Plan-review is no longer an inline plan-vs-design delta (one artifact now) — it is a
dispatched, fresh-context, adversarial read-only pass over the unified artifact (DR-10): a clean reviewer provisioned with only {artifact + spec} (never this authoring transcript), prompted to refute the plan, its adversarial depth scaled by the frozen
. Provision it via
exarchos_orchestrate({ action: "prepare_review", scope: "plan", artifact: "docs/specs/<...>", designDepth: "<frozen>" })
.
- Refuted (gaps): set , auto-loop back to
- Survives: present to user for approval (the single human checkpoint)
- On approval: set
.planReview.approved = true
, invoke
REQUIRED: Run
exarchos_orchestrate({ action: "check_plan_coverage" })
over the unified artifact. If passed: false → auto-invoke
. If passed: true → transition to the plan-review phase and only invoke
after plan-review approval.
Exarchos Integration
Phase transitions auto-emit
events via
. No manual
append needed.
Troubleshooting
| Issue | Cause | Resolution |
|---|
| returns passed: false | Design sections not mapped to tasks | Add tasks for uncovered sections or add explicit deferral rationale |
| passed: false | Planned test files missing or failing | Create missing test stubs, verify file paths in plan match actual paths |
| passed: false | Design doc missing expected / headers | Verify design uses standard Markdown headings |
| Revision loop (3+ attempts) | Persistent gaps between design and plan | Set planReview.revisionsExhausted = true
, suggest |
Performance Notes
- Complete each step fully before advancing — quality over speed
- Do not skip validation checks even when the change appears trivial
- Trace every design section to at least one task. Do not leave uncovered sections without explicit rationale.