doccraft — config
When to use
- After
doccraft init: run Analyse mode to tailor the freshly scaffolded
doccraft.json to the project's actual subsystems, surfaces, and themes.
- Any time you want to add or change a config field: run Edit mode with a
plain-English request ("add slice:billing", "set maxStoryFiles to 10").
- Before invoking
doccraft-story or doccraft-queue-audit when skill
output references unfamiliar vocabulary — the config is probably stale.
Schema
The full JSON Schema for doccraft.json is embedded below. Use it for
validation in Edit mode instead of calling any CLI.
{{DOCCRAFT_CONFIG_SCHEMA}}
Modes
Analyse mode (no specific field requested)
- Read the project tree: directory names,
package.json scripts/workspaces,
git remote, conventional-commit scope history if a .git/ dir is present.
- Propose values for each key group with one sentence of reasoning per group:
story.areas — one entry per logical subsystem (aligns with commit scopes).
story.slices — one entry per user-facing product surface; [] for
purely technical tools.
story.themes — recurring cross-cutting concerns from the tree.
story.id.tiers — e.g. [p0,p1,p2] for most projects; more tiers only
when severity levels are meaningfully distinct.
queueAudit.scale — lower thresholds for small repos, higher for large.
sessionWrap.capture — disable categories for folder trees the project
does not maintain.
- Show the proposed
doccraft.json diff (or full file if none exists yet).
- Wait for approval before writing any file.
- On approval: write
doccraft.json at the project root. MUST NOT rewrite
version or $schema — preserve those bytes exactly.
Edit mode (specific change requested)
- Read the current
doccraft.json (use defaults if missing).
- Parse the requested change.
- Validate the proposed new value against the embedded schema above. If
invalid, report the violation and stop — do not write.
- Apply the change surgically: update only the targeted field(s), preserving
all other bytes (key order, whitespace, comments are not present in JSON
but formatting should be preserved).
- Write
doccraft.json and confirm what changed.
Extensions
When doccraft.json declares an extensions: [...] array, each entry points
at a project-local directory containing an extension.yaml manifest. At
doccraft update, doccraft bakes fragments declared by those manifests into
skill bodies at named injection points and scaffolds any declared folders.
The extension framework is the supported way to add project-specific
guidance (additional frontmatter fields, body sections, instructions) to
the four core skills (doccraft-story, doccraft-adr,
doccraft-queue-audit, doccraft-session-wrap) without forking doccraft.
When editing the extensions array:
- Order is significant. Fragments concatenate in declaration order at
each injection point — surface that to the user when adding a new entry.
- Each
path must be a directory relative to the project root, and
the directory must already exist (or be about to be created in the same
change). doccraft does not scaffold extension directories; the user
authors them.
- Validation runs at
doccraft update, not at config write time —
malformed manifests surface on the next update.
Constraints
- NEVER call
npx doccraft@latest — the embedded schema is authoritative
for the installed version. Reaching for @latest could propose fields not
yet supported.
- NEVER rewrite
version or $schema — those are managed by
doccraft update / bumpConfigVersion. Preserve them verbatim.
- Tolerate a missing
doccraft.json — proceed with defaults; offer to
create the file in Analyse mode.
- MUST gate on approval before writing any file in Analyse mode. Edit mode
may apply without a gate for single-field changes unless the change is
destructive (e.g. clearing an entire array).
Pre-execution validation
Before writing or updating doccraft.json, MUST complete these checks:
- Read existing file — if
doccraft.json exists, read it in full
before proposing any changes. NEVER write from assumptions about
current values.
- Schema validation — validate the proposed output against the
embedded schema above. If any field violates the schema, report the
violation and stop — MUST NOT write an invalid file.
- Preserve managed fields — confirm that
version and $schema
are byte-identical to the existing file. If the file is new, omit
both (they are set by doccraft update).
- Extension paths exist — if editing the
extensions array, verify
each path directory exists on disk (or is being created in the same
change). Flag missing directories rather than writing a broken config.
- No duplicate entries — arrays like
story.areas, story.slices,
story.themes MUST NOT contain duplicate values. Deduplicate silently
and note what was removed.
Invalid examples (do not use)
- Calling
npx doccraft@latest llm or any CLI to fetch the schema —
NEVER; the embedded schema is authoritative.
- Overwriting
version or $schema — NEVER; those are managed by
doccraft update.
- Writing
doccraft.json in Analyse mode without user approval —
NEVER; gate on approval first.
- Adding a value to
story.status that duplicates an existing entry
(e.g. adding todo when it already exists) — NEVER; deduplicate.
- Proposing fields not present in the embedded schema — NEVER; unknown
fields will confuse future
doccraft update runs.
- Clearing an entire array in Edit mode without confirmation — NEVER;
destructive changes MUST be gated.
- Setting
extensions[].path to a non-existent directory without
flagging it — NEVER; the user MUST create the directory first.
Done condition
The task is complete when:
- In Analyse mode: proposed values have been shown with reasoning,
user has approved, and
doccraft.json has been written at the project
root with version and $schema preserved.
- In Edit mode: the targeted field has been updated, the full file
validates against the embedded schema, and
doccraft.json has been
written with only the intended change applied.
- The output confirms what changed (field names and old → new values).
Workflow reminders
- After changing
story.areas, story.slices, or story.themes,
existing stories with tags not in the new vocabulary are still valid —
do not retroactively edit story files. The new vocabulary applies to
future stories only.
- After changing
story.status, story.urgency, or story.impact,
verify no existing story uses a value that was removed. If any do,
flag them so the user can update those stories.
- After changing
queueAudit.scale thresholds, the next
doccraft-queue-audit run will use the new limits — no further
action needed.
- After adding or removing an
extensions entry, remind the user to
run doccraft update to bake fragments into skill bodies.
1---2name: doccraft-config-23description: Configure doccraft for this project by tailoring doccraft.json — the vocabulary, id format, queue labels, and session-wrap settings. Two modes: Analyse mode reads the project tree and proposes values for all key fields with reasoning, applying on approval; Edit mode applies a targeted change (e.g. "add area:telemetry") and validates against the embedded schema before writing. Never calls npx — the embedded schema matches the installed doccraft version.4---56# doccraft — config78## When to use910- **After `doccraft init`**: run Analyse mode to tailor the freshly scaffolded11 `doccraft.json` to the project's actual subsystems, surfaces, and themes.12- **Any time you want to add or change a config field**: run Edit mode with a13 plain-English request ("add slice:billing", "set maxStoryFiles to 10").14- **Before invoking `doccraft-story` or `doccraft-queue-audit`** when skill15 output references unfamiliar vocabulary — the config is probably stale.1617## Schema1819The full JSON Schema for `doccraft.json` is embedded below. Use it for20validation in Edit mode instead of calling any CLI.2122```json23{{DOCCRAFT_CONFIG_SCHEMA}}24```2526## Modes2728### Analyse mode (no specific field requested)29301. Read the project tree: directory names, `package.json` scripts/workspaces,31 git remote, conventional-commit scope history if a `.git/` dir is present.322. Propose values for each key group with one sentence of reasoning per group:33 - `story.areas` — one entry per logical subsystem (aligns with commit scopes).34 - `story.slices` — one entry per user-facing product surface; `[]` for35 purely technical tools.36 - `story.themes` — recurring cross-cutting concerns from the tree.37 - `story.id.tiers` — e.g. `[p0,p1,p2]` for most projects; more tiers only38 when severity levels are meaningfully distinct.39 - `queueAudit.scale` — lower thresholds for small repos, higher for large.40 - `sessionWrap.capture` — disable categories for folder trees the project41 does not maintain.423. Show the proposed `doccraft.json` diff (or full file if none exists yet).434. Wait for approval before writing any file.445. On approval: write `doccraft.json` at the project root. MUST NOT rewrite45 `version` or `$schema` — preserve those bytes exactly.4647### Edit mode (specific change requested)48491. Read the current `doccraft.json` (use defaults if missing).502. Parse the requested change.513. Validate the proposed new value against the embedded schema above. If52 invalid, report the violation and stop — do not write.534. Apply the change surgically: update only the targeted field(s), preserving54 all other bytes (key order, whitespace, comments are not present in JSON55 but formatting should be preserved).565. Write `doccraft.json` and confirm what changed.5758## Extensions5960When `doccraft.json` declares an `extensions: [...]` array, each entry points61at a project-local directory containing an `extension.yaml` manifest. At62`doccraft update`, doccraft bakes fragments declared by those manifests into63skill bodies at named injection points and scaffolds any declared folders.64The extension framework is the supported way to add project-specific65guidance (additional frontmatter fields, body sections, instructions) to66the four core skills (`doccraft-story`, `doccraft-adr`,67`doccraft-queue-audit`, `doccraft-session-wrap`) without forking doccraft.6869When editing the `extensions` array:7071- **Order is significant.** Fragments concatenate in declaration order at72 each injection point — surface that to the user when adding a new entry.73- **Each `path` must be a directory** relative to the project root, and74 the directory must already exist (or be about to be created in the same75 change). doccraft does not scaffold extension directories; the user76 authors them.77- **Validation runs at `doccraft update`**, not at config write time —78 malformed manifests surface on the next update.7980## Constraints8182- **NEVER call `npx doccraft@latest`** — the embedded schema is authoritative83 for the installed version. Reaching for `@latest` could propose fields not84 yet supported.85- **NEVER rewrite `version` or `$schema`** — those are managed by86 `doccraft update` / `bumpConfigVersion`. Preserve them verbatim.87- **Tolerate a missing `doccraft.json`** — proceed with defaults; offer to88 create the file in Analyse mode.89- **MUST gate on approval** before writing any file in Analyse mode. Edit mode90 may apply without a gate for single-field changes unless the change is91 destructive (e.g. clearing an entire array).9293## Pre-execution validation9495Before writing or updating `doccraft.json`, MUST complete these checks:96971. **Read existing file** — if `doccraft.json` exists, read it in full98 before proposing any changes. NEVER write from assumptions about99 current values.1002. **Schema validation** — validate the proposed output against the101 embedded schema above. If any field violates the schema, report the102 violation and stop — MUST NOT write an invalid file.1033. **Preserve managed fields** — confirm that `version` and `$schema`104 are byte-identical to the existing file. If the file is new, omit105 both (they are set by `doccraft update`).1064. **Extension paths exist** — if editing the `extensions` array, verify107 each `path` directory exists on disk (or is being created in the same108 change). Flag missing directories rather than writing a broken config.1095. **No duplicate entries** — arrays like `story.areas`, `story.slices`,110 `story.themes` MUST NOT contain duplicate values. Deduplicate silently111 and note what was removed.112113## Invalid examples (do not use)114115- Calling `npx doccraft@latest llm` or any CLI to fetch the schema —116 NEVER; the embedded schema is authoritative.117- Overwriting `version` or `$schema` — NEVER; those are managed by118 `doccraft update`.119- Writing `doccraft.json` in Analyse mode without user approval —120 NEVER; gate on approval first.121- Adding a value to `story.status` that duplicates an existing entry122 (e.g. adding `todo` when it already exists) — NEVER; deduplicate.123- Proposing fields not present in the embedded schema — NEVER; unknown124 fields will confuse future `doccraft update` runs.125- Clearing an entire array in Edit mode without confirmation — NEVER;126 destructive changes MUST be gated.127- Setting `extensions[].path` to a non-existent directory without128 flagging it — NEVER; the user MUST create the directory first.129130## Done condition131132The task is complete when:133134- In **Analyse mode**: proposed values have been shown with reasoning,135 user has approved, and `doccraft.json` has been written at the project136 root with `version` and `$schema` preserved.137- In **Edit mode**: the targeted field has been updated, the full file138 validates against the embedded schema, and `doccraft.json` has been139 written with only the intended change applied.140- The output confirms what changed (field names and old → new values).141142## Workflow reminders143144- After changing `story.areas`, `story.slices`, or `story.themes`,145 existing stories with tags not in the new vocabulary are still valid —146 do not retroactively edit story files. The new vocabulary applies to147 future stories only.148- After changing `story.status`, `story.urgency`, or `story.impact`,149 verify no existing story uses a value that was removed. If any do,150 flag them so the user can update those stories.151- After changing `queueAudit.scale` thresholds, the next152 `doccraft-queue-audit` run will use the new limits — no further153 action needed.154- After adding or removing an `extensions` entry, remind the user to155 run `doccraft update` to bake fragments into skill bodies.