aid-document-decision
Frontmatter
Section titled “Frontmatter”name— aid-document-decisiondescription— Write an ADR in one pass — an architecture decision record: the context, the decision itself, the alternatives considered, and the consequences. Use this skill when you already know the document you need is ADR, and want it drafted now rather than planned. It is grounded in, and accuracy-checked against, the Knowledge Base (.aid/knowledge/) and the project source; aid-tech-writer produces it and aid-reviewer verifies it. It resolves nothing: it drafts, you approve, and only then is the document placed. It never writes into.aid/knowledge/. A thin kind-sibling of/aid-create-document, which defines its full behavior.allowed-tools— Read, Glob, Grep, Bash, Write, Edit, Agentargument-hint— <decision> — the decision to record
Definition: canonical/skills/aid-document-decision/SKILL.md
flowchart TB
classDef aidNode color:#fff
classDef aidEntry fill:#166534,stroke:#14532d,color:#fff
classDef aidExit fill:#991b1b,stroke:#7f1d1d,color:#fff
classDef aidDecision fill:#92400e,stroke:#78350f,color:#fff
classDef aidLoopBack fill:#1e3a8a,stroke:#1e3a8a,color:#fff
classDef aidStep fill:#1a2035,stroke:#d4a853,color:#f1f5f9
n1(["aid-document-decision<br/>{verb: document, artifact: decision}"])
n2(["INTAKE"])
n3["AUTHOR"]
n4["VERIFY"]
n5{"PRESENT"}
n6["PLACE<br/>only on approval"]
n7(["DONE"])
n1 --> n2
n2 --> n3
n3 --> n4
n4 -.-> n3
n4 --> n5
n5 -->|"on approval"| n6
n5 -->|"else"| n7
n6 --> n7
class n1 aidEntry
class n2 aidEntry
class n3 aidStep
class n4 aidLoopBack
class n5 aidDecision
class n6 aidStep
class n7 aidExit
class n1 aidNode
class n2 aidNode
class n3 aidNode
class n4 aidNode
class n5 aidNode
class n6 aidNode
class n7 aidNode
Source fragments
Section titled “Source fragments”Every node in the chart above, in chart order, with the exact canonical/ text it was derived from.
1 · aid-document-decision — {verb: document, artifact: decision} · entry
row (`alias_of: null`, its own `{verb: document, artifact: decision}`), `repurpose: true`Source: canonical/skills/aid-document-decision/SKILL.md#L20
## State: INTAKE
1. **Require a subject.** Empty argument -> ask one bootstrapping question ("What do you want documented, and for whom?") and wait.2. **Resolve format + genre** from the request (or the hint a kind-sibling bound): e.g. "an ADR for X" -> markdown ADR; "a diagram of the pipeline" -> mermaid; "the release notes" -> changelog. Use the genre structures in `document.md`.3. **Pick the path:** **Fast** -- a clear subject + kind -> author now. **Guided** -- vague -> scope subject / audience / kind first.4. **Classify complexity (model + effort):** most docs -> `aid-tech-writer` at **sonnet / medium**; a heavy architecture write-up -> **opus / high**. Verifier tier >= producer.5. **Consult the Work Initiation Gate, then allocate the work folder + STATE.** First run the gate (`canonical/aid/templates/work-initiation-gate.md`): `bash canonical/aid/scripts/works/enumerate-works.sh` (main tree + every git worktree). Empty -> allocate, no prompt. Works exist -> ask new-vs-continuation; on **continuation** route to the chosen work's resume door and STOP (allocate nothing); on **new work**: create and enter the worktree per the gate's `§ 3a` step 2 (`worktree-lifecycle.sh create <work-id> <name>`, STOP on a non-zero exit or empty path, else enter the resolved path), **then** allocate (`pipeline.path: lite`, `initiator: aid-create-document`, `lifecycle: Running`, `active_skill: aid-create-document`; `phase` not driven).6. **Read the design seed, if present.** If `.aid/design/document.md` exists, read it as prior context before drafting; it is an input, never a substitute, and is not modified by this run.Source: canonical/skills/aid-create-document/SKILL.md#L41-L64 · full step: canonical/skills/aid-create-document/SKILL.md#L41-L66
## State: AUTHOR
Dispatch **`aid-tech-writer`** (clean context, tiered) to write the document in the resolvedformat + genre structure, **grounded in and accurate to** the KB + project source(`task-type-rules.md ## DOCUMENT` -- verify accuracy against the current codebase and KB).It drafts into the work folder (not yet placed). Text formats are produced natively(markdown, mermaid, HTML, CSV/tables); for a format it cannot cleanly emit (native`.pptx`/`.xlsx`), it produces the best text form and notes the conversion handoff.Source: canonical/skills/aid-create-document/SKILL.md#L70-L77 · full step: canonical/skills/aid-create-document/SKILL.md#L70-L79
## State: VERIFY
1. **Mechanical grounding check** (no dispatch): claims about the project cite a KB doc or `file:line`; the genre's required structure is present.2. **Adversarial verification** -- clean-context **`aid-reviewer`** checks the draft: accurate against KB + codebase, complete for its genre, no fabricated content. Writes a review-quality ledger to `.aid/.temp/review-pending/<work>-verify.md`.3. **Grade:** `bash canonical/aid/scripts/grade.sh --explain <ledger>`. Not clean -> loop to AUTHOR. Circuit-breaker: 3 cycles -> IMPEDIMENT + `lifecycle: Blocked`.Source: canonical/skills/aid-create-document/SKILL.md#L83-L91 · full step: canonical/skills/aid-create-document/SKILL.md#L83-L93
5 · PRESENT — hard stop — human final say before placing · decision
## State: PRESENT (hard stop -- human final say before placing)
Set `lifecycle: Paused-Awaiting-Input`. Present the drafted document **and the proposedtarget location** (KB-informed: `docs/`, an ADR dir, `CHANGELOG.md`, a runbook path, ...).Await approval. **Never writes `.aid/knowledge/`.**Source: canonical/skills/aid-create-document/SKILL.md#L97-L101 · full step: canonical/skills/aid-create-document/SKILL.md#L97-L103
6 · PLACE — only on approval · step
## State: PLACE (only on approval)
Write the document to its approved target location. **Extra care on overwrite or on thepublished `docs/` tree:** inspect the target first and show the diff -- never silentlyoverwrite an existing doc. Then optionally print handoffs the user may act on: `/aid-update-kb`(if it belongs in the KB), `/aid-create*` (if it describes something not yet built),`/aid-refactor` (an ADR mandating a refactor).Source: canonical/skills/aid-create-document/SKILL.md#L107-L113 · full step: canonical/skills/aid-create-document/SKILL.md#L107-L115
## State: DONE
Set `lifecycle: Completed`, `updated` now, append a `## Lifecycle History` row. Keep thework folder (draft + verify ledger) as the audit record.Source: canonical/skills/aid-create-document/SKILL.md#L119-L122 · full step: canonical/skills/aid-create-document/SKILL.md#L119-L122