Independent plan-writing orchestrator -- Node-anchored flow with digraph as single control-flow source of truth. Drafts the plan from the approved spec in this session, backfills the design spec on substantive drift before authoring, commits the authored plan before the review-fix loop, and runs the loop following the engine's next face — the engine's next directive carries the pipeline continuation. Callable standalone; invoke as kairos:cdd-plan(pi:/skill:cdd-plan).
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Cdd Plan?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/oscaner-cdd-plan)
---
name: cdd-plan
description: Independent plan-writing orchestrator -- Node-anchored flow with digraph as single control-flow source of truth. Drafts the plan from the approved spec in this session, backfills the design spec on substantive drift before authoring, commits the authored plan before the review-fix loop, and runs the loop following the engine's next face — the engine's next directive carries the pipeline continuation. Callable standalone; invoke as kairos:cdd-plan(pi:/skill:cdd-plan).
---
# Kairos CDD-Plan
Writes a plan document from an approved spec, backfills the design when planning surfaces substantive drift, commits the plan before reviewing under the cdd plan contract; on closure the engine's `next:` face carries the pipeline continuation.
**Invocation discipline** — every engine command runs as a background dispatch: launch it in the background and await the completion notification — never poll — then read the full output (stdout/stderr). Output filtering is forbidden — no piping to `tail`/`head`, no `2>&1 |`, no `EXIT=$?` capture. **Dispatch boundary** — the obligation runs both ways: a dispatched child carries every verification / build command to completion inside its own turn, never ending that turn to await a background task it launched itself — ending the turn terminates the child, so the awaited notification never arrives and the round dies half-finished while still looking successful; the launching side certifies success by the terminal contract (a clean working tree and the target action actually completed), never by exit code 0. **Round rhythm** — one review pass per dispatch; a fix round re-enters the review while the route is not done; commit the authored plan before the first review round; ensure the working tree is clean before entering review (dirty → BLOCKED; the orchestrator writes no tree during dispatch). **Approval gate** — before the first NEXT-LOOP dispatch, submit the authored plan together with this self-check's conclusion to the author and stop; dispatch only after an explicit approval, and a dispatch without one is a violation — the submitted line declares its authorship plainly: `this document was written by the orchestrator in this session`. **Write authority** — the plan's creation stays the orchestrator's, written in this session and never handed wholesale to a subagent. A dispatched implement or fix round may amend the plan's content face (facts, file lists, steps, acceptance detail, cited line numbers); its structure face — the plan's Task id set and every task's `DependsOn` set — is the orchestrator's alone, and the engine judges a round that changes it hard. **Failure face** — cross-node failure handling lives in the Failure Modes table below (the single source); node `Fail` entries keep only local behavior.
## Flow Digraph
```mermaid
flowchart TD
A[backfill-design] --> C[author-plan]
C --> S[run-cdd-docs-review-session]
S --> K[commit-plan]
K --> L[NEXT-LOOP]
L -->|until next is terminal| L
L -->|no next| Z2((BLOCKED))
```
## Node Definitions
### `backfill-design`
- **Do**: Read the approved spec, draft the plan from it, then check that draft against the approved design. Substantive drift (factual error / missing constraint / a new implementation step the design does not cover) → **backfill the design spec first** — revise the spec + record the drift — so spec and plan agree before plan-review (the design-backfill rule). Cross-phase matters still backfill to the parent overall per Boundary rules
- **Read**: approved spec + the design decisions landed in this session
- **Exit**: spec ↔ plan consistent → `author-plan`
- **Fail**: Entering plan-review with an un-backfilled drift → violates the design-backfill rule
### `author-plan`
- **Do**: Write the complete plan document to `docs/kairos/plans/YYYY-MM-DD-<feature>.md` — generate the canonical skeleton first (`npx -y @oscaner-skills/cdd-engine@latest schema get plan --output skeleton <target path>`) and fill its slots in place; the structure stays as generated. Plan header MUST carry the document identity in its front-matter `slug:` key, **inherited from the approved spec it plans** — the same value the spec carries, so spec and plan resolve as one run (the generated skeleton emits the `slug:` key for you to fill). The plan declares no attribution key of its own: its program chain is implied by the identity document of the same slug, so a program attribution resolves through that chain (workspace plan record → the plan's `slug:` → the identity document of that slug, read through its own attribution — a phase-spec's `program:`, or, for an overall / single-spec, its own inventory), the plan record being the first hop of its program chain. Plan assertions stay inside what is judgeable while the code does not yet exist — task boundaries, wave edges, acceptance conditions, frozen consumer-surface bytes; per-module delivery attribution is not one of them, arriving in the implement round and judged by the wave review against the real diff. Registered disciplines bind while filling: `facets-before-filling` · `one-todo-per-sentence` · `count-is-not-identity`.
- **Constraints** — the `## Constraints` section declares the constraint surface the implement child reads — zero separately materialized constraints file; declaring no constraint rows never blocks a dispatch — no silent fallback, no phantom rules file.
- **Dependencies** — declare each task's dependencies as the single directed edge in its task record's `#### DependsOn` section — one line of comma-separated task ids under that heading (any existing task id; forward references are legal; `none` = the explicit no-dependency declaration); the declared edges group the tasks into dispatch waves.
- **Appending work** — work that surfaces after the plan has been reviewed enters as new tasks whose `DependsOn` edges point only at already-closed tasks, so the engine derives a fresh dispatch wave for them; never rewrite the content of an already-closed task (a closed wave's content is history — later work enters as a new task); a user adjudication that re-scopes a closed task is the one exception and lands under Plan write authority (I3); an appended task declares its `Acceptance` exactly like any other.
- **Write authority** — cross-task adjudication surfaced later (user adjudication / phase-level re-scope) is handled by the orchestrator under Plan write authority (I3): it amends the target task's `#### Objective` / `#### Steps` / `#### Acceptance` sections directly.
- **Citations** — the plan owns the work item (`- Modify: <path>`), not a coordinate: the shape gate refuses a prose `path:line` on a plan's decision face exactly as it does on a spec's, so a task names the file it changes or a colocated pin, never a line number.
- **Files granularity** — a `**Files:**` entry is a slice token or an exact path; a slice token is a trailing `/` behind at least one non-empty segment, and the bare `/`, an empty segment (`docs//`) and a pattern (`<slug>/`) declare no slice. A slice is the segment that guards one invariant, not an arbitrary directory, so the coarse form carries the plan's claim; an exact path is reserved for an entry that must not be guessed — the composition root, a rewired config, the file a pin lives in, a file whose name is itself the contract.
- **Entry-level `Consumes` / `Produces`** — name the slice's public door and its data-face constants, never every module: one `Produces` claim then answers to one entry a review can spot-check, not a module roster.
- **pin** — a behavior claim cites a colocated pin by module path + symbol name; a line coordinate is not a pin (`line-coordinate`)
- **count** — a count carries no mechanical face — no census registry exists and no gate compares the value; a bare integer plus a count unit in prose is the writing convention, not a refusal — while an arithmetic over live counts still is; naming the guard that maintains the value is the reason for the reference, not its form
- **narrative** — a present-tense description of the tree as it stands belongs to neither document: what belongs to the plan is the work item (`- Modify: <path>`), never a prose `path:line`; the condition that must hold belongs to the spec, so restate such a description as that condition (`line-coordinate`)
- **Read**: approved spec + `backfill-design` output + the plan's structural contract (the same structure fact the review reads)
- **Exit**: File written → `run-cdd-docs-review-session`
- **Fail**: Schema read fails or the draft plan is unusable → BLOCKED (missing plan input)
### `run-cdd-docs-review-session`
- **Do**: Import `/kairos:cdd-docs-review`(pi:/skill:cdd-docs-review) and run its author-side self-check mode over the just-written plan before committing; it lands the self-check verdict. This variant's supplement holds what the procedure leaves to the flow — the five checks, substance first: (1) **coverage** — every approved-spec requirement maps to a task; (2) **step decidability** — each step lets the implementer write exactly one reasonable thing (a line that decides nothing, or a signature-and-tests-determined transcript, is a defect); (3) **consistency** — task ids / `DependsOn` edges / naming agree; (4) **failure-mode coverage** — every failure mode the spec implies has a task whose checkable exercises it; (5) **proportion** — the plan is not many times the length of the spec it implements. Then the mechanical tail: zero leftover `:::fill` markers, zero angle-bracket literals outside link-anchor slots. Issues found are fixed inline on the same file; this is a pre-commit self-check inside this flow, not a review round (no `next:` dispatch, no findings carrier).
- **Read**: nothing before the import
- **Exit**: verdict landed → `commit-plan`
- **Fail**: Target skill missing → BLOCKED (install kairos — see the kairos README's installation table); an unresolvable defect needing design input → BLOCKED (missing plan input)
### `commit-plan`
- **Do**: `git add` the plan + conventional commit.
- **Read**: The committed plan file path
- **Exit**: Commit complete → `NEXT-LOOP`
- **Fail**: Git error → report + fail-open (do not block user plan review)
### `NEXT-LOOP`
- **Do**: Run the review-fix rhythm for the authored plan — one review pass per dispatch. Dispatch the review round on the current ref (`npx -y @oscaner-skills/cdd-engine@latest review --type plan --plan <path>`); every later hop follows the engine's `next:` face. Fixes dispatch via the fix round — never an in-place edit as a substitute; a BLOCKED/TIMEOUT round's carried reason is reported, never overridden. Closed waves are history: when a finding lands on the content face of an already-closed task block, amend the document to align with the delivered split — never carry work into or out of a closed task, and never dispatch a fix for a finding that would rewrite the historical split.
- **Read**: the full stdout — the review conclusion, the findings handoff path, and the engine's `next:` face
- **Exit**: each fix pass re-enters this hub while that route keeps the loop alive (the `until next is terminal` self-loop); a route that leaves the loop ends this skill's flow
- **Fail**: Re-running a review after a closure conclusion → violates Review Convergence (stop + report)
## Invariants
| # | Invariant |
|---|---|
| I1 | **Review Convergence** — a review closes by its conclusion (APPROVED / CHANGES_REQUESTED / REVIEW_FIX); the loop advances by the engine's `next:` face, never by orchestrator guesswork. A mid-backfill or a user adjudication that lands governs over the suggestion (current world state wins). Fixes always dispatch via the fix round; the orchestrator must not edit in place as a substitute; a fix commit opens a new review, never a re-run of a closed one |
| I2 | **Plan commit discipline** — the authored plan commits before the first review round; each fix round commits its own changes — approval closes the loop on a committed state; do not wait for dev merge |
| I3 | **Plan write authority** — the plan's writes discriminate by trigger: review findings land through the fix round dispatch only; a user adjudication or durable backfill lands through the orchestrator's own standalone commit, amending the target task's data fields directly; fix/implement agents hold zero plan-structure authority (their content-face amendment right is the write-authority clause above) |
| I4 | **Mid-Flight Backfill** — a user-raised backfill of overall/spec/plan docs surfaced while a dispatch is in flight lands through four ordered steps on the current call's return: (1) **land immediately** — hot context, no deferral; (2) **commit on its own** — a standalone change, never mixed with implementation commits; (3) **pause the loop until clean** — an uncommitted backfill trips the next review's entry gate (dirty → BLOCKED); (4) **audit in-band on resume** — the next review audits the backfill in-band |
| I5 | **Ruling Landing** — when a fix dispatch needs a ruling on a finding, the ruling lands at the sidecar path the engine prints in `next:`; the orchestrator never derives that path itself |
## Failure Modes
| failure | behavior | reason |
|---|---|---|
| review re-run after a closure conclusion (REVIEW_FIX / APPROVED) | Violates I1 (Review Convergence) — stop + report to user | A fix commit opens a new review, never a re-run of a closed one |
| Entering review with an un-backfilled drift | Violates the design-backfill rule — stop + backfill first | Spec and plan must agree before review |
| Git commit error | report + fail-open | Do not block user plan review |
| Completed round with no `next:` line (not BLOCKED/TIMEOUT) | HARD_ERROR — report the carried reason, re-run the same command to continue | No dispatchable next |