/kairos:cdd-spec-writerfrom kairos
Writes target specs from design decisions using a node-anchored digraph flow. Handles single-spec, phase-spec, and overall variants with a review-fix loop and commit-before-review discipline.
Ships in kairos. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Writes the target spec from the design decisions the session lands — single-spec / phase-spec / overall under one parameterized flow (the schema target + scope gates + authoring differ by variant; the review-fix rhythm and the Invariants are the single shared skeleton) — commits it before reviewing under the cdd spec 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 spec 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 spec 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 two lanes are one split, and neither borrows the other. The author writes the document; the fix round writes the dispositions. Authoring the spec stays the orchestrator's — it is written in this session, never handed to a subagent that holds only a brief, because the ruling's reasons live in the session while the brief is not part of the document, so a paraphrase that drifts has no reader who could see it; and the author never takes the fix round's half either — a finding is answered in the sidecar and applied by a dispatched fix round, never edited in place as a substitute. A dispatched implement or fix round holds only its own half: it may amend the spec's content face (facts, file lists, steps, acceptance detail, cited line numbers); its structure face (the generated section skeleton) stays as generated — the orchestrator alone reshapes it. Failure face — cross-node failure handling lives in the Failure Modes table below (the single source); node Fail entries keep only local behavior.
flowchart TD
A[author-spec] --> S[run-cdd-docs-review-session]
S --> C[commit-spec]
C --> L[NEXT-LOOP]
L -->|until next is terminal| L
L -->|no next| Z2((BLOCKED))
author-specDo: Write the target spec document from the design decisions landed in this session — overall lands in docs/kairos/overalls/, phase-spec and single-spec in docs/kairos/specs/ — generate the canonical skeleton first for the target type (npx -y @oscaner-skills/cdd-engine@latest schema get <overall|phase-spec|single-spec> --output skeleton <target path>) and fill its slots in place; the structure stays as generated. The landed document carries its identity in the front-matter slug: key (the engine keys the workspace and the board on it, never on the file name); a phase-spec additionally carries program: — the parent overall's slug:, the phase's attribution to its program. Per the target variant:
run-cdd-charter · sync)The target (single-spec / phase-spec / overall) is the session parameter: it selects the schema target, the scope gates and the handoff of the flow.
Before writing the acceptance, name where this phase is tested: prefer a seam that already exists, take the highest one able to reach the behaviour, and keep the seam set as small as it goes — the user confirms those seams through the existing approval gate, never a second confirmation round, and an acceptance line points at its seam.
Registered disciplines bind while filling: facets-before-filling · one-todo-per-sentence · count-is-not-identity.
Every row the run lands follows one discipline — one line asserts, the record explains: the row carries the identity, the single-sentence conclusion, the status and the relation, and the phase and decision records carry the reasoning behind them.
State the condition, never a snapshot of today's tree — three claim shapes, one line each:
line-coordinate)- 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: the design decisions landed in this session + the target's structural contract (phase-spec/overall variants also read the parent overall)
Exit: File written → run-cdd-docs-review-session
Fail: The landed design decisions unusable or write error → BLOCKED (missing design input)
run-cdd-docs-review-session/kairos:cdd-docs-review(pi:/skill:cdd-docs-review) and run its author-side self-check mode over the just-written spec 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) capture — every design decision the session landed is in the spec, every ruling recorded; (2) sufficiency — could the downstream plan author act without guessing? Name each place where a wrong guess would change what gets built; (3) consistency — doc-type / naming / cross-references agree; (4) failure modes — the design addresses the failure modes and edge conditions it implies; (5) proportion — the spec carries decisions, not a transcript of the work. 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).commit-speccommit-specgit add the spec + conventional commit.NEXT-LOOPNEXT-LOOP--type naming the session target's own word — npx -y @oscaner-skills/cdd-engine@latest review --type <single-spec|phase-spec|overall> --spec <path> (a fixed word would have this skill author one kind and review another); 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.next: faceuntil next is terminal self-loop); a route that leaves the loop ends this skill's flow| # | 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 | Spec commit discipline — the authored spec 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 | 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; a backfill rewriting the current task's own plan/spec text routes through the orchestrator's plan write authority |
| I4 | 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 | 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 |
| Git commit error | report + fail-open | Do not block user spec 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 |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
spec-writing, design-documentation, review-loop, digraph-flow
6 skills in this plugin
/cdd-closeIndependent cdd-close orchestrator -- Node-anchored flow with digraph as single control-flow source of truth. Owns its Git finish menu (merge / PR / keep / discard) and gates on the landed finish outcome, then closes related issues. Layers personal rules (no worktrees / conventional commits / typed-discard). Callable standalone; invoke as kairos:cdd-close(pi:/skill:cdd-close)./cdd-designIndependent brainstorm orchestrator -- Node-anchored flow with digraph as single control-flow source of truth. Explores the request's design context in this session, judges which program owns the change and gates on phase registration, runs grilling, and dispatches the parameterized spec-writer(/kairos:cdd-spec-writer) under one template (single-spec / phase-spec / overall charter). Callable standalone; invoke as kairos:cdd-design(pi:/skill:cdd-design)./cdd-npx claudepluginhub oscaner/skills --plugin kairosOther plugins' skills for the same job