@houseofwolvesllc/claude-scrum-skill 1.6.0 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -103,7 +103,12 @@ All configuration lives in `skills/shared/config.json`:
103
103
  "paths": {
104
104
  "specs": ".claude-scrum-skill/specs",
105
105
  "adr": ".claude-scrum-skill/adr",
106
- "backlog": ".claude-scrum-skill/backlog"
106
+ "backlog": ".claude-scrum-skill/backlog",
107
+ "context": ".claude-scrum-skill/context"
108
+ },
109
+ "scaffold": {
110
+ "two_pass_threshold_words": 5000,
111
+ "design_spike_enabled": true
107
112
  },
108
113
  "jira": {
109
114
  "project_key": ""
@@ -123,6 +128,40 @@ All configuration lives in `skills/shared/config.json`:
123
128
  | `jira` | Jira Cloud issues, epics, and sprints | Env vars |
124
129
  | `trello` | Trello boards, lists, and cards | Env vars |
125
130
 
131
+ ### Two-Pass Mode
132
+
133
+ For large PRDs, `/project-scaffold` automatically switches from single-pass to **two-pass** scaffolding. Pass 1 extracts only the epic skeleton (one agent reads the whole PRD); Pass 2 spawns one focused subagent per epic to elaborate that epic's stories. Per-epic context stays tight regardless of PRD size, so the last epic's stories are as well-specified as the first.
134
+
135
+ **Triggers** (first match wins):
136
+
137
+ 1. PRD frontmatter `scaffold_mode: single-pass | two-pass` (explicit override)
138
+ 2. CLI flag `--mode single-pass | two-pass`
139
+ 3. PRD word count exceeds `scaffold.two_pass_threshold_words` (default `5000`)
140
+
141
+ If Pass 1 finds ≤ 2 epics, scaffolding auto-downgrades to single-pass elaboration since the two-pass overhead isn't justified at that scale. Failures retry once and degrade gracefully — Pass 1 falls back to single-pass; Pass 2 marks the affected epic's stories `needs-context` and lets sibling subagents continue.
142
+
143
+ The chosen mode and reasoning are announced before scaffolding begins, so you always know why a given path was taken.
144
+
145
+ ### Design-Spike Epic
146
+
147
+ When `/project-scaffold` runs two-pass on a multi-epic PRD, it auto-injects a research-driven **design-spike epic** at the head of the project. This epic's stories (all `persona: research`) produce:
148
+
149
+ - One foundational **ADR** at `<paths.adr>/NNNN-<slug>.md`
150
+ - One per-implementation-epic **CONTEXT.md** at `<paths.context>/<epic-slug>/CONTEXT.md`
151
+
152
+ Implementation epics are gated on the design-spike epic via the existing `blocked_by` mechanism, so no implementation story enters a sprint until its CONTEXT.md exists. During execution, `/project-orchestrate` subagents read `CONTEXT.md` in addition to `CLAUDE.md` before writing code — its naming, file layout, types, and patterns sections override generic CLAUDE.md conventions for that epic. This gives every parallel subagent a shared anchor, eliminating the cross-story drift that otherwise compounds before the sprint review gate.
153
+
154
+ **Triggers** (first match wins):
155
+
156
+ 1. PRD frontmatter `design_spike: true | false`
157
+ 2. CLI flag `--design-spike | --no-design-spike`
158
+ 3. `scaffold.design_spike_enabled` config (default `true`)
159
+ 4. Auto-trigger: two-pass mode + > 1 implementation epic
160
+
161
+ Artifacts are committed to the `development` branch via the filesystem in **all** backends — git is the universal substrate. Remote backends may surface links via milestone/epic descriptions but the committed files are the single source of truth.
162
+
163
+ Detection signal is the `type:design-spike` label (GitHub/Trello/Jira) or `epic_type: design-spike` frontmatter field (local). The default epic title is "Architecture & Design" but the title is not load-bearing.
164
+
126
165
  ### Configurable Paths
127
166
 
128
167
  | Path | Default | Purpose |
@@ -130,9 +169,17 @@ All configuration lives in `skills/shared/config.json`:
130
169
  | `paths.specs` | `.claude-scrum-skill/specs` | Spec documents from `/spec` |
131
170
  | `paths.adr` | `.claude-scrum-skill/adr` | Architecture Decision Records |
132
171
  | `paths.backlog` | `.claude-scrum-skill/backlog` | Local backlog files (local mode only) |
172
+ | `paths.context` | `.claude-scrum-skill/context` | Per-epic CONTEXT.md files produced by the design-spike epic |
133
173
 
134
174
  To check these files into version control (e.g., `docs/adr`), change the path and it won't be covered by the `.gitignore` entry for `.claude-scrum-skill`.
135
175
 
176
+ ### Scaffolding Behavior
177
+
178
+ | Key | Default | Purpose |
179
+ |-----|---------|---------|
180
+ | `scaffold.two_pass_threshold_words` | `5000` | PRD word count above which two-pass scaffolding auto-triggers |
181
+ | `scaffold.design_spike_enabled` | `true` | Global enable switch for the design-spike pre-epic |
182
+
136
183
  ---
137
184
 
138
185
  ## Quick Start
@@ -141,6 +188,18 @@ To check these files into version control (e.g., `docs/adr`), change the path an
141
188
 
142
189
  1. **Write a PRD** — Create a markdown file describing your project, epics, and stories.
143
190
 
191
+ Optionally include YAML frontmatter to override the auto-detected scaffolding behavior:
192
+
193
+ ```yaml
194
+ ---
195
+ title: My Project
196
+ scaffold_mode: two-pass # force two-pass even for a small PRD
197
+ design_spike: false # suppress the design-spike epic even when triggered
198
+ ---
199
+ ```
200
+
201
+ Both fields are optional — omit them to use the word-count heuristic and the auto-injection rules described in [Two-Pass Mode](#two-pass-mode) and [Design-Spike Epic](#design-spike-epic).
202
+
144
203
  2. **Scaffold the project:**
145
204
  ```
146
205
  /project-scaffold path/to/prd.md
@@ -320,9 +379,9 @@ During sprint planning, personas are assigned automatically based on story label
320
379
 
321
380
  ### Phase 1 — Epic Completion Loop
322
381
 
323
- 1. Scaffolds the PRD (if provided) or reads existing backlog
324
- 2. Plans sprints via `/sprint-plan`
325
- 3. Executes `executor:claude` stories in parallel via subagents with persona routing
382
+ 1. Scaffolds the PRD (if provided) or reads existing backlog. On large or multi-epic PRDs, scaffolding runs in [two-pass mode](#two-pass-mode) and auto-injects a [design-spike epic](#design-spike-epic) at position 0
383
+ 2. Plans sprints via `/sprint-plan` — the design-spike epic (when present) executes first, producing the ADR and per-epic `CONTEXT.md` files that seed the implementation epics
384
+ 3. Executes `executor:claude` stories in parallel via subagents with persona routing — implementation subagents read their epic's `CONTEXT.md` in addition to `CLAUDE.md` before writing code
326
385
  4. Releases via `/sprint-release`
327
386
  5. Runs automated review gate (using the `review` persona)
328
387
  6. Merges to `development` and cleans up branches
@@ -404,6 +463,7 @@ skills/shared/
404
463
  - **Run `/project-cleanup --fix` after major changes** to enforce build/lint cleanliness and test coverage.
405
464
  - **Chunk large epics** into multiple sprints for natural review gates.
406
465
  - **Jira/Trello users:** If no project key or board ID is configured, `/project-scaffold` creates one automatically (Scrum template for Jira).
466
+ - **Author large PRDs with explicit architectural intent.** Sections describing shared types, naming conventions, file layout boundaries, and cross-cutting patterns give the [design-spike epic](#design-spike-epic) concrete material to lift into the project's foundational ADR and per-epic `CONTEXT.md` files — the better your PRD spells these out, the more consistent your parallel implementation subagents will be.
407
467
 
408
468
  ---
409
469
 
package/package.json CHANGED
@@ -1,8 +1,11 @@
1
1
  {
2
2
  "name": "@houseofwolvesllc/claude-scrum-skill",
3
- "version": "1.6.0",
3
+ "version": "1.7.0",
4
4
  "description": "Claude Code skills for scrum project management — PRD to production release pipeline with project scaffolding, sprint planning, status tracking, sprint releases, full-project emulation testing, autonomous orchestration, and project cleanup.",
5
5
  "bin": {},
6
+ "publishConfig": {
7
+ "access": "public"
8
+ },
6
9
  "scripts": {
7
10
  "postinstall": "node bin/install.js"
8
11
  },
@@ -11,8 +11,8 @@ Fully autonomous project lifecycle driver. Plans sprints, executes stories via p
11
11
 
12
12
  ## Before You Start
13
13
 
14
- 1. Read `../shared/references/CONVENTIONS.md` for all project management standards. Follow these conventions exactly.
15
- 2. Read `../shared/config.json` to determine the scaffolding mode (`scaffolding` key: `"local"`, `"github"`, `"jira"`, or `"trello"`, default: `"local"`). If `"local"`, also read the `paths.backlog` value. Read `../shared/references/PROVIDERS.md` for provider-specific API commands when using a remote provider.
14
+ 1. Read `../shared/references/CONVENTIONS.md` for all project management standards. Follow these conventions exactly. Pay particular attention to **Epic Structure → Design-Spike Epic** — orchestration honors the design-spike epic's gating, so implementation work in a scoped run does not begin until the design-spike epic completes.
15
+ 2. Read `../shared/config.json` to determine the scaffolding mode (`scaffolding` key: `"local"`, `"github"`, `"jira"`, or `"trello"`, default: `"local"`). If `"local"`, also read the `paths.backlog` and `paths.context` values (`paths.context` defaults to `.claude-scrum-skill/context` and is where Step 3 subagents look for per-epic CONTEXT.md files). Read `../shared/references/PROVIDERS.md` for provider-specific API commands when using a remote provider.
16
16
  3. Read the project's `CLAUDE.md` (if it exists) for project-specific rules. **All subagents you spawn must also read and follow `CLAUDE.md`** — include this instruction explicitly in every subagent prompt.
17
17
  4. Read `../shared/references/PERSONAS.md` for role preambles. When spawning
18
18
  subagents, select the persona matching each story's `persona:*` label (GitHub mode)
@@ -40,6 +40,38 @@ The following actions are NEVER authorized:
40
40
 
41
41
  ---
42
42
 
43
+ ## Default Operating Mode
44
+
45
+ `/project-orchestrate` defaults to **fully autonomous execution**. When invoked with a PRD path or repo identifier, run the full lifecycle — Phase 1 (Epic Completion) → Phase 2 (Emulation Hardening) → Phase 3 (Project Cleanup) → Step 16 (ADR Update) → Step 17 (State Cleanup) — end-to-end without pausing for routine confirmation.
46
+
47
+ ### What autonomous means
48
+
49
+ - **No routine confirmation prompts.** Accept the skill's prescribed default at every decision point: sprint plans, story execution order, branch creation, merges to `development`, branch cleanup. The Standing Authorizations above cover the full set; do not re-ask for them.
50
+ - **All phases run.** Phase 2 (Emulation Hardening) and Phase 3 (Project Cleanup) are **mandatory** quality gates — they execute even when Phase 1 produces a small or clean change set. Skipping them defeats the orchestration's quality model.
51
+ - **State file handling is automatic — never prompt the user.**
52
+ - `Status: running` → resume from the recorded position.
53
+ - `Status: paused` → resume from the recorded position. The original pause cause should already be addressed before the user re-invokes; if it isn't, the run will pause again on the same issue and surface it fresh.
54
+ - `Status: completed` → rename the prior file to `orchestration-state.previous.md` and start a fresh run.
55
+ - No file → initialize a new state file.
56
+ - **Scaffolding decisions fire per their own trigger logic.** Two-pass mode and design-spike epic injection are governed by `project-scaffold/SKILL.md` → Mode Detection and Design-Spike Epic. The orchestrator does NOT add a separate confirmation prompt on top of those triggers — if the scaffold spec says inject, the orchestrator lets it inject.
57
+
58
+ ### When pausing IS allowed
59
+
60
+ Only the four genuine safety gates pause the run. These exist because they require human judgment that no default can satisfy:
61
+
62
+ 1. **Unresolvable merge conflict.** Auto-rebase attempted first; if it fails, pause and surface the conflicting files (per Step 5c and Error Handling → Merge Conflicts).
63
+ 2. **Critical findings in the review gate.** The `review` persona's recommendation of `block` / `revert` pauses orchestration so the user can decide how to proceed (per Step 5b).
64
+ 3. **3rd consecutive hardening run still produces critical/warning findings.** The safety valve at Step 13 — three rounds of automated hardening without convergence suggests the remaining issues need human triage.
65
+ 4. **Rate-limit exhaustion.** After exponential-backoff retries fail (per Error Handling → Rate Limiting), pause rather than burn through quota.
66
+
67
+ All four are infrequent and indicate real problems. None can be defaulted away. Every other pause point in this document — sprint plan confirmation, state file resume confirmation, phase transition confirmation, completion confirmation — is removed by the autonomous default.
68
+
69
+ ### Overriding the default
70
+
71
+ If the user explicitly requests interactive mode for the current run (e.g., "let me approve each sprint plan", "pause between phases", "stop after Phase 1"), honor that for the current invocation. The skill's default remains autonomous; the override is per-invocation and does not change the default.
72
+
73
+ ---
74
+
43
75
  ## Input
44
76
 
45
77
  `$ARGUMENTS` can be:
@@ -112,11 +144,12 @@ Orchestration state is persisted to `.claude-scrum-skill/orchestration-state.md`
112
144
 
113
145
  ### State Operations
114
146
 
115
- **On startup**, check for an existing `.claude-scrum-skill/orchestration-state.md`:
116
- - If found and `Status: running` → resume from the recorded position
117
- - If found and `Status: paused` → ask the user whether to resume or restart
118
- - If found and `Status: completed` → ask the user whether to start a fresh run
119
- - If not found initialize a new state file
147
+ **On startup**, check for an existing `.claude-scrum-skill/orchestration-state.md`. The autonomous default handles all four cases without prompting the user — see Default Operating Mode → State file handling for the full decision table. Briefly:
148
+
149
+ - `Status: running` → resume from the recorded position.
150
+ - `Status: paused` → resume from the recorded position (the pause cause should already be addressed; if not, the run will pause again on the same issue).
151
+ - `Status: completed`rename to `orchestration-state.previous.md` and start fresh.
152
+ - No file → initialize a new state file.
120
153
 
121
154
  **During execution**, update the state file:
122
155
  - After every sprint plan, story completion, release, and phase transition
@@ -197,6 +230,14 @@ Invoke the `/sprint-plan` skill:
197
230
 
198
231
  **If PRD-scoped:** Ensure the sprint plan only pulls from the scoped stories (recorded in the state file). If `/sprint-plan` proposes stories outside the scope, exclude them — they belong to other work and should not be mixed into this orchestration run.
199
232
 
233
+ **Blocked-by gate:** Before selecting stories for the sprint, exclude any
234
+ story whose `blocked_by` list contains an open (not yet `done`) story. This
235
+ naturally gates implementation epics on the design-spike epic when one
236
+ exists: implementation stories list the design-spike CONTEXT.md story as a
237
+ blocker, so they cannot enter a sprint until that story completes. The
238
+ existing dependency mechanism in `/sprint-plan` already honors this; this
239
+ note is an explicit affirmation, not a new requirement.
240
+
200
241
  Since this is autonomous mode, accept the default sprint plan without waiting for user confirmation — the skill's proposed sprint based on priority ordering and velocity target is the plan.
201
242
 
202
243
  After planning completes, update the state file with the sprint stories and their dependency map.
@@ -231,6 +272,14 @@ You are executing story #<number> for repo <owner/repo>.
231
272
  follow all instructions in it. CLAUDE.md is authoritative for stack,
232
273
  patterns, and style — it overrides any general guidance in this preamble.
233
274
 
275
+ **IMPORTANT:** Before writing any code, if `<paths.context>/<epic-slug>/CONTEXT.md`
276
+ exists, read it in full. Treat its Naming Conventions, File Layout, Shared
277
+ Types & Interfaces, Patterns to Follow, and Patterns to Avoid sections as
278
+ binding for this epic — they override generic conventions in CLAUDE.md when
279
+ in conflict, and you should follow them even when CLAUDE.md is silent. The
280
+ `<paths.context>` and `<epic-slug>` values are substituted from the resolved
281
+ config and the story's epic at spawn time.
282
+
234
283
  **Story:** <title>
235
284
  **Acceptance criteria:** <from issue body or story file>
236
285
  **Branch strategy:** Create branch `story/<number>-<slug>` from
@@ -477,6 +526,8 @@ Transitioning to Phase 2 — Emulation Hardening.
477
526
 
478
527
  Validate the **entire codebase** through emulation, fix discovered issues, and repeat until clean. This phase always covers the full project regardless of whether Phase 1 was PRD-scoped — new code must integrate cleanly with the existing codebase.
479
528
 
529
+ **Phase 2 is mandatory.** Do not skip it under any circumstance, even when Phase 1 produced a small or clean change set. The emulation pass is the quality gate that catches integration drift, layer contract mismatches, and cross-story inconsistency that per-story review cannot. Skipping it defeats the orchestration's quality model. See Default Operating Mode.
530
+
480
531
  ### Step 8: Run Emulation
481
532
 
482
533
  Invoke the project emulation skill:
@@ -588,6 +639,8 @@ Options:
588
639
 
589
640
  After emulation hardening is clean (or accepted), run a final mechanical hygiene pass to ensure the codebase builds, lints, and tests cleanly.
590
641
 
642
+ **Phase 3 is mandatory.** Like Phase 2, it always runs at the tail of every orchestration even when the codebase appears clean. For projects with no traditional toolchain (e.g., a markdown skill suite), `project-cleanup` reports SKIP for the non-applicable phases — that is the correct outcome, not a reason to omit the phase. See Default Operating Mode.
643
+
591
644
  ### Step 14: Run Project Cleanup
592
645
 
593
646
  Invoke the cleanup skill in fix mode:
@@ -671,15 +724,20 @@ Read the ADR output path from `../shared/config.json` (key: `paths.adr`,
671
724
  default: `.claude-scrum-skill/adr`).
672
725
 
673
726
  1. Read all existing ADRs in the configured ADR directory to understand what's
674
- already documented and the numbering/format convention in use.
727
+ already documented and the numbering/format convention in use. Compute
728
+ the next sequential ADR number as `max(existing_numbers) + 1`. This
729
+ shared numbering pool applies regardless of whether prior ADRs were
730
+ created by a design-spike epic in this run, by a previous orchestration
731
+ run, or hand-authored — they all share one sequence.
675
732
  2. Review the epics completed, hardening fixes applied, and any significant
676
733
  technical choices made during orchestration (e.g., new libraries adopted,
677
734
  patterns introduced, infrastructure changes, security model decisions).
678
735
  3. For each decision that is **non-obvious, hard to reverse, or would
679
736
  surprise a future contributor**, create a new ADR following the existing
680
737
  format and numbering sequence.
681
- 4. Skip decisions that are already covered by an existing ADR or that are
682
- trivial/self-evident from the code.
738
+ 4. Skip decisions that are already covered by an existing ADR (including
739
+ any ADR produced by a design-spike epic earlier in this run) or that
740
+ are trivial/self-evident from the code.
683
741
 
684
742
  Print a summary:
685
743
 
@@ -10,7 +10,10 @@ Scaffold a complete GitHub Project from one or more PRD or spec documents, or ad
10
10
  ## Before You Start
11
11
 
12
12
  1. Read `../shared/references/CONVENTIONS.md` for all project management standards including label taxonomy, branch strategy, issue templates, custom fields, and executor assignment guidelines. Follow these conventions exactly.
13
- 2. Read `../shared/config.json` to determine the scaffolding mode (`scaffolding` key: `"local"`, `"github"`, `"jira"`, or `"trello"`, default: `"local"`). If `"local"`, also read the `paths.backlog` value (default: `.claude-scrum-skill/backlog`).
13
+ 2. Read `../shared/config.json` to determine the scaffolding mode (`scaffolding` key: `"local"`, `"github"`, `"jira"`, or `"trello"`, default: `"local"`). If `"local"`, also read the `paths.backlog` value (default: `.claude-scrum-skill/backlog`). Also read these scaffolding-control keys (fall back to defaults silently if missing):
14
+ - `scaffold.two_pass_threshold_words` (default `5000`) — PRD word count above which two-pass mode auto-triggers. See Mode Detection.
15
+ - `scaffold.design_spike_enabled` (default `true`) — global enable switch for the design-spike pre-epic. See Design-Spike Epic.
16
+ - `paths.context` (default `.claude-scrum-skill/context`) — where per-epic CONTEXT.md files written by the design-spike epic live.
14
17
  3. Read `../shared/references/PROVIDERS.md` for provider-specific API commands when operating in remote mode (GitHub, Jira, or Trello).
15
18
  4. **Terminology:** Always refer to milestones as **"epics"** in all user-facing text, summaries, and conversational output. The word "milestone" should only appear in API commands and code — never in communication with the user.
16
19
  5. **If `scaffolding: "github"`:** Confirm the `gh` CLI is authenticated by running `gh auth status`. Identify the target repository. If the user doesn't specify, ask which repo to use.
@@ -24,6 +27,333 @@ The user provides `$ARGUMENTS` which should be one or more file paths to PRD or
24
27
 
25
28
  Read all provided documents thoroughly before proceeding.
26
29
 
30
+ ### PRD Frontmatter Overrides
31
+
32
+ PRD authors can preempt the auto-detected scaffolding behavior via YAML
33
+ frontmatter at the top of the PRD document:
34
+
35
+ ```yaml
36
+ ---
37
+ title: My Project
38
+ scaffold_mode: two-pass # force two-pass even for a small PRD
39
+ design_spike: false # suppress the design-spike epic even when triggered
40
+ ---
41
+ ```
42
+
43
+ Allowed values:
44
+
45
+ - `scaffold_mode`: `single-pass` | `two-pass` (omit to use the word-count
46
+ heuristic in Mode Detection)
47
+ - `design_spike`: `true` | `false` (omit to use the auto-injection rules
48
+ in Design-Spike Epic)
49
+
50
+ ### CLI Flags
51
+
52
+ Equivalent flags can be passed alongside the PRD path:
53
+
54
+ - `--mode single-pass` / `--mode two-pass` — overrides any frontmatter or
55
+ word-count heuristic for the scaffolding mode.
56
+ - `--design-spike` / `--no-design-spike` — overrides any frontmatter or
57
+ auto-injection rule for the design-spike epic.
58
+
59
+ There is no formal CLI argument parser — Claude Code skills receive a
60
+ single free-text `$ARGUMENTS` string. The executing agent scans
61
+ `$ARGUMENTS` for these flag strings (exact match) and treats each
62
+ recognized flag as a trigger source at the precedence noted below.
63
+ Invalid or empty flag values (e.g., `--mode` with no value, or
64
+ `--mode three-pass`) are ignored, and the next trigger source in
65
+ precedence applies.
66
+
67
+ Trigger precedence (highest first): CLI flag → PRD frontmatter → config /
68
+ heuristic. Whatever wins is announced before scaffolding begins so the
69
+ user understands why a given path was taken.
70
+
71
+ ## Mode Detection
72
+
73
+ Before invoking any per-backend procedure, decide whether to run scaffolding
74
+ in **single-pass** mode (the original behavior — one agent reads the whole
75
+ PRD and produces all epics + stories) or **two-pass** mode (skeleton
76
+ extraction followed by per-epic elaboration subagents). Two-pass mode keeps
77
+ per-epic context tight on large PRDs, so the last epic's stories are as
78
+ well-specified as the first.
79
+
80
+ ### Trigger Evaluation (in order, first match wins)
81
+
82
+ 1. **CLI flag:**
83
+ - `--mode single-pass` → force single-pass
84
+ - `--mode two-pass` → force two-pass
85
+ 2. **PRD frontmatter override:**
86
+ - `scaffold_mode: single-pass` → force single-pass
87
+ - `scaffold_mode: two-pass` → force two-pass
88
+ 3. **Word count heuristic:**
89
+ - Count words in the PRD body (whitespace-delimited; exclude frontmatter).
90
+ - Read `scaffold.two_pass_threshold_words` from `../shared/config.json`
91
+ (default `5000`; if the key is missing, use the default silently).
92
+ - If word count exceeds the threshold → two-pass.
93
+ - Otherwise → single-pass.
94
+
95
+ ### Announce the Decision
96
+
97
+ Before proceeding to any procedure, announce the mode and the trigger
98
+ reason so the user understands why the heuristic chose what it chose:
99
+
100
+ ```
101
+ PRD analysis:
102
+ Word count: 8,420 (threshold: 5000) → triggering two-pass mode
103
+
104
+ Pass 1: extracting epic skeleton...
105
+ ```
106
+
107
+ If an override forced the decision, mention that explicitly:
108
+
109
+ ```
110
+ PRD analysis:
111
+ Frontmatter override: scaffold_mode: single-pass → forcing single-pass
112
+ ```
113
+
114
+ ### Routing
115
+
116
+ - **Single-pass** → continue to the per-backend procedure (Local / Jira /
117
+ Trello / GitHub) and run its existing Parse the PRD step against the
118
+ whole PRD.
119
+ - **Two-pass** → run the Two-Pass Procedure (below) first, then continue
120
+ to the per-backend procedure with the assembled story list.
121
+
122
+ ## Two-Pass Procedure
123
+
124
+ When Mode Detection selects two-pass, run this procedure before the
125
+ per-backend creation steps. The output is the same shape as a single-pass
126
+ parse would produce: an assembled list of epics + their stories, ready for
127
+ the backend to create issues/files. Backends consume the same shape, so the
128
+ per-backend creation logic does not change.
129
+
130
+ ### Pass 1 — Skeleton Extraction
131
+
132
+ A single agent reads the whole PRD and produces a structured manifest. The
133
+ manifest is held in orchestrator context — it is NOT persisted to disk.
134
+
135
+ **Manifest shape (YAML):**
136
+
137
+ ```yaml
138
+ project:
139
+ name: <string>
140
+ description: <string>
141
+ global_preamble: |
142
+ <multi-line markdown excerpt — project overview, glossary,
143
+ cross-cutting non-functional requirements that every epic should know>
144
+ non_functional_requirements: [<string>]
145
+ epics:
146
+ - name: <string>
147
+ slug: <kebab-case string>
148
+ description: <one-paragraph string>
149
+ slice:
150
+ start_line: <int>
151
+ end_line: <int>
152
+ depends_on: [<epic-slug>]
153
+ shared_design_concerns:
154
+ - <string describing naming/layout/type/pattern this epic introduces
155
+ that other epics may consume>
156
+ ```
157
+
158
+ Pass 1 produces NO story-level detail. Its job is structural — identify
159
+ epic boundaries, capture inter-epic dependencies, and extract the shared
160
+ global context that every Pass 2 subagent will need. The
161
+ `shared_design_concerns` list feeds the Design-Spike Epic procedure when
162
+ that is triggered.
163
+
164
+ ### Auto-Downgrade
165
+
166
+ After Pass 1 completes, evaluate the epic count:
167
+
168
+ - **≤ 2 epics** → downgrade to single-pass elaboration: spawn one Pass 2
169
+ subagent that handles all epics together. The two-pass overhead is not
170
+ justified at this scale, and inter-epic coordination is easier in a
171
+ single context. Announce the downgrade.
172
+ - **> 2 epics** → proceed to per-epic Pass 2 spawning.
173
+
174
+ ### Pass 2 — Per-Epic Elaboration
175
+
176
+ Spawn one subagent per epic. Each subagent receives a focused context:
177
+
178
+ - The **global preamble** from Pass 1 (project overview, glossary, NFRs)
179
+ - Its **assigned epic's PRD slice**, extracted using `slice.start_line`
180
+ and `slice.end_line` from the manifest
181
+ - A **skeleton summary** of sibling epics (name, slug, one-paragraph
182
+ description, dependencies) — for cross-epic dependency awareness, NOT
183
+ for elaboration
184
+
185
+ Each Pass 2 subagent produces the complete story list for its epic:
186
+
187
+ - Story titles
188
+ - Acceptance criteria
189
+ - Technical context
190
+ - Story points (per CONVENTIONS.md guidelines)
191
+ - Executor assignment (per CONVENTIONS.md guidelines)
192
+ - Persona designation (local mode: the `persona` frontmatter field; GitHub/Jira/Trello modes: a `persona:*` label — see CONVENTIONS.md "Persona Labels" and PERSONAS.md for the canonical set)
193
+ - Dependency declarations (`blocked_by`, `blocks`)
194
+ - All other required frontmatter fields
195
+
196
+ **Concurrency cap:** Up to 3 Pass 2 subagents in parallel (matches
197
+ `/project-orchestrate` Step 3 convention). Additional epics queue and
198
+ start as earlier ones complete.
199
+
200
+ ### Story Assembly
201
+
202
+ After all Pass 2 subagents return, assemble their outputs into a single
203
+ backlog before handing off to the per-backend creation logic:
204
+
205
+ 1. **Collect** every story from every Pass 2 output, preserving each
206
+ story's epic association.
207
+ 2. **Detect slug collisions** by exact string match across all stories.
208
+ If two or more stories share a slug, rename all-but-the-first by
209
+ prepending the epic slug: `<epic-slug>-<original-slug>`. Log every
210
+ rename so the user sees the resolution.
211
+ 3. **Resolve cross-epic dependencies** declared in story `blocked_by`
212
+ and `blocks` fields. If a dependency references a slug that was
213
+ renamed in step 2, update the reference.
214
+ 4. **Emit the assembled list** in the same shape a single-pass parse
215
+ would have produced. The per-backend creation logic consumes this
216
+ shape unchanged.
217
+
218
+ ### Failure Handling
219
+
220
+ Scaffolding must degrade gracefully — it must never abort on a Pass 1 or
221
+ Pass 2 failure.
222
+
223
+ **Pass 1 failure:**
224
+
225
+ 1. Retry once with identical input.
226
+ 2. If the second attempt fails, log the failure and fall back to
227
+ single-pass scaffolding: run the per-backend procedure's Parse the PRD
228
+ step against the whole PRD as if two-pass had never been triggered.
229
+ 3. Announce the fallback clearly:
230
+
231
+ ```
232
+ Pass 1 failed twice; falling back to single-pass scaffolding for this PRD.
233
+ ```
234
+
235
+ **Pass 2 subagent failure:**
236
+
237
+ 1. Retry the failed subagent once with the original prompt plus the failure
238
+ context appended.
239
+ 2. If the second attempt fails, do NOT abort the whole scaffold:
240
+ - Write the affected epic's epic-level metadata (`_epic.md` in local
241
+ mode, milestone in remote modes) using the Pass 1 skeleton data.
242
+ - Generate placeholder stories for the affected epic with
243
+ `status: needs-context` and a note explaining the Pass 2 failure.
244
+ Use the existing `needs-context` status signal label from
245
+ CONVENTIONS.md.
246
+ - Sibling Pass 2 subagents continue unaffected.
247
+ 3. Surface every retry attempt and final outcome (success / fallback /
248
+ needs-context) in the skill's user-facing output so the user knows what
249
+ landed cleanly versus what needs hand-completion.
250
+
251
+ ## Design-Spike Epic
252
+
253
+ A **design-spike epic** is a research-driven pre-epic that produces written
254
+ design artifacts (an ADR + per-implementation-epic CONTEXT.md files) before
255
+ any implementation work begins. It auto-injects at position 0 of the
256
+ scaffold when triggered, giving every subsequent implementation subagent a
257
+ shared anchor for naming, file layout, types, and patterns. See
258
+ CONVENTIONS.md → Epic Structure → Design-Spike Epic for the broader rationale.
259
+
260
+ ### Trigger Evaluation (in order, first match wins)
261
+
262
+ 1. **CLI flag:**
263
+ - `--no-design-spike` → suppress.
264
+ - `--design-spike` → force.
265
+ 2. **PRD frontmatter override:**
266
+ - `design_spike: false` → suppress the design-spike epic.
267
+ - `design_spike: true` → force it.
268
+ 3. **Global enable switch:**
269
+ - Read `scaffold.design_spike_enabled` from `../shared/config.json`
270
+ (default `true`; missing key falls back to default silently).
271
+ - If `false` globally, skip the design-spike regardless of remaining
272
+ signals (the CLI flag and frontmatter overrides above already won
273
+ before reaching this rule if either was set).
274
+ 4. **Auto-trigger:**
275
+ - Two-pass mode was selected AND Pass 1 produced more than one
276
+ implementation epic → auto-inject.
277
+
278
+ If none of the above fire, skip the design-spike epic.
279
+
280
+ ### Idempotency Check
281
+
282
+ Before injecting, check whether a design-spike epic already exists in the
283
+ target project. Detection is by canonical signal (label/field), not by
284
+ title — the title is configurable but the signal is fixed.
285
+
286
+ - **Local mode:** Scan `<paths.backlog>/*/[_]epic.md` frontmatter for
287
+ `epic_type: design-spike`.
288
+ - **GitHub mode:** Query open milestones whose issues carry the
289
+ `type:design-spike` label.
290
+ - **Jira mode:** Query Epic-type issues labeled `type:design-spike`.
291
+ - **Trello mode:** Query lists whose cards carry the `type:design-spike`
292
+ label.
293
+
294
+ If an existing design-spike epic is found, skip injection and reuse it
295
+ for `blocked_by` references on the new implementation stories.
296
+
297
+ ### Skeleton Augmentation
298
+
299
+ When the design-spike epic is to be injected, modify the skeleton produced
300
+ by Pass 1 (or, in single-pass mode, the parsed epic list) before per-epic
301
+ elaboration runs:
302
+
303
+ 1. **Prepend a new epic at position 0** with:
304
+ - Default title: `Architecture & Design` (overridable; not load-bearing).
305
+ - Detection signal: label `type:design-spike` (remote backends) and
306
+ `epic_type: design-spike` in `_epic.md` frontmatter (local mode).
307
+ - Description sourced from the project description + the union of all
308
+ implementation epics' `shared_design_concerns` (from the Pass 1
309
+ manifest).
310
+ 2. **Generate the design-spike stories** to be elaborated by a Pass 2
311
+ subagent with `persona: research`:
312
+ - One **ADR-authoring story** producing the project's foundational ADR
313
+ at `<paths.adr>/NNNN-<slug>.md`. The ADR number is the next available
314
+ in the existing ADR sequence (see `/project-orchestrate` Step 16 for
315
+ the shared numbering pool).
316
+ - One **CONTEXT.md-authoring story per implementation epic**, each
317
+ producing `<paths.context>/<epic-slug>/CONTEXT.md` from the template
318
+ at `shared/templates/CONTEXT-template.md`. The story body lists the
319
+ `shared_design_concerns` for that epic so the research subagent has
320
+ concrete inputs.
321
+ 3. **Wire `blocked_by` references** on every implementation story:
322
+ - Each implementation story gets `blocked_by` references to the
323
+ design-spike story that produces its epic's CONTEXT.md.
324
+ - Sprint planning then naturally excludes implementation stories until
325
+ their CONTEXT.md exists — no additional gate logic required.
326
+
327
+ ### Artifact Storage
328
+
329
+ ADR and CONTEXT.md files are committed to the `development` branch via
330
+ the filesystem in ALL four backends. Git is the universal substrate; this
331
+ keeps the artifact location uniform regardless of which backend the
332
+ backlog lives in.
333
+
334
+ - ADR location: `<paths.adr>/NNNN-<slug>.md`
335
+ - CONTEXT.md location: `<paths.context>/<epic-slug>/CONTEXT.md`
336
+
337
+ Remote backends (GitHub, Jira, Trello) MAY additionally surface links to
338
+ these files via milestone/epic descriptions for discoverability — but the
339
+ committed files are the single source of truth. If the description link
340
+ becomes stale (e.g., file renamed), the filesystem path wins.
341
+
342
+ ### Auto-Injection of References
343
+
344
+ When the design-spike epic is part of the scaffold, every implementation
345
+ story's Technical Context section receives an appended line referencing
346
+ the artifacts that will be produced:
347
+
348
+ ```
349
+ See [<paths.context>/<epic-slug>/CONTEXT.md] and [<paths.adr>/NNNN-<slug>.md] for shared architectural decisions.
350
+ ```
351
+
352
+ The paths use the resolved `paths.context` and `paths.adr` config values
353
+ (not hardcoded strings) and the ADR number assigned during skeleton
354
+ augmentation. Auto-injection happens during Story Assembly, after Pass 2
355
+ produces stories but before per-backend creation runs.
356
+
27
357
  ## Scaffold Procedure
28
358
 
29
359
  Read `../shared/config.json` to determine mode. If `scaffolding` is `"local"`,
@@ -39,8 +369,13 @@ instead of GitHub issues, milestones, and project boards.
39
369
 
40
370
  ### Local Step 1: Parse the PRD
41
371
 
42
- Same as GitHub Step 1 extract project name, epics, stories, dependencies,
43
- and technical context. Present the summary and ask the user to confirm.
372
+ **If two-pass mode was selected** (see Mode Detection), the Two-Pass
373
+ Procedure has already produced the assembled epic + story list. Skip this
374
+ step's parsing work and proceed to Step 2 with the assembled list as input.
375
+
376
+ **If single-pass mode was selected**, do this step as before: extract
377
+ project name, epics, stories, dependencies, and technical context. Present
378
+ the summary and ask the user to confirm.
44
379
 
45
380
  ### Local Step 2: Detect Existing Backlog
46
381
 
@@ -187,7 +522,10 @@ and sprints. Refer to `../shared/references/PROVIDERS.md` for all API calls.
187
522
 
188
523
  ### Jira Step 1: Parse the PRD
189
524
 
190
- Same as Local Step 1 / GitHub Step 1.
525
+ Same routing as Local Step 1: if two-pass mode was selected, the Two-Pass
526
+ Procedure has already produced the assembled list — proceed to Step 2 with
527
+ that list. If single-pass mode, parse the PRD inline as in Local Step 1 /
528
+ GitHub Step 1.
191
529
 
192
530
  ### Jira Step 2: Ensure Project Exists
193
531
 
@@ -290,7 +628,10 @@ all API calls.
290
628
 
291
629
  ### Trello Step 1: Parse the PRD
292
630
 
293
- Same as Local Step 1 / GitHub Step 1.
631
+ Same routing as Local Step 1: if two-pass mode was selected, the Two-Pass
632
+ Procedure has already produced the assembled list — proceed to Step 2 with
633
+ that list. If single-pass mode, parse the PRD inline as in Local Step 1 /
634
+ GitHub Step 1.
294
635
 
295
636
  ### Trello Step 2: Ensure Board Exists
296
637
 
@@ -418,7 +759,12 @@ Ask the user to choose and, if option 2 or 3, which epic(s) to target.
418
759
 
419
760
  ### Step 1: Parse the PRD
420
761
 
421
- Extract the following from the PRD document(s):
762
+ **If two-pass mode was selected** (see Mode Detection), the Two-Pass
763
+ Procedure has already produced the assembled epic + story list. Skip the
764
+ inline parsing below and proceed to Step 2 with that list as input.
765
+
766
+ **If single-pass mode was selected**, extract the following from the PRD
767
+ document(s):
422
768
 
423
769
  - **Project name** — used for the GitHub Project title (if creating new)
424
770
  - **Epics** — major bodies of work; each becomes a milestone (unless mapped to an existing one)
@@ -3,7 +3,12 @@
3
3
  "paths": {
4
4
  "specs": ".claude-scrum-skill/specs",
5
5
  "adr": ".claude-scrum-skill/adr",
6
- "backlog": ".claude-scrum-skill/backlog"
6
+ "backlog": ".claude-scrum-skill/backlog",
7
+ "context": ".claude-scrum-skill/context"
8
+ },
9
+ "scaffold": {
10
+ "two_pass_threshold_words": 5000,
11
+ "design_spike_enabled": true
7
12
  },
8
13
  "jira": {
9
14
  "project_key": ""
@@ -58,6 +58,7 @@ Create these views on every project board:
58
58
  - `type:spike` — Research/exploration task with defined timebox
59
59
  - `type:infra` — Infrastructure, CI/CD, tooling, DevOps
60
60
  - `type:chore` — Maintenance, cleanup, refactoring, documentation
61
+ - `type:design-spike` — Research-driven epic that produces design artifacts (ADR + per-implementation-epic CONTEXT.md files) consumed by implementation epics. Auto-injected by `/project-scaffold` for large/multi-epic PRDs; see Epic Structure → Design-Spike Epic.
61
62
 
62
63
  ### Priority Labels
63
64
 
@@ -197,6 +198,49 @@ Both are set at issue creation time. The label is what scrum teams see day-to-da
197
198
 
198
199
  **Backward compatibility:** Existing milestones named `Phase N: <Name>` are treated as epics without renaming. If an existing project has no `epic:*` labels, the skills create them when adding new stories.
199
200
 
201
+ ### Design-Spike Epic
202
+
203
+ A **design-spike epic** is a research-driven pre-epic that produces written design artifacts before any implementation work begins. It auto-injects at the head of the project when triggered, giving every subsequent implementation subagent a shared anchor for naming, file layout, types, and patterns.
204
+
205
+ **When it auto-injects:**
206
+
207
+ - Two-pass scaffolding was triggered AND the resulting skeleton has more than one implementation epic, OR
208
+ - PRD frontmatter contains `design_spike: true`, OR
209
+ - User explicitly passes `--design-spike` to `/project-scaffold`.
210
+
211
+ `design_spike: false` in PRD frontmatter suppresses the epic even when other triggers fire. The global enable switch is `scaffold.design_spike_enabled` in `config.json` (default `true`).
212
+
213
+ **What it contains:**
214
+
215
+ - One ADR-authoring story (`persona: research`, `executor: claude`) producing the project's foundational ADR at `<paths.adr>/NNNN-<slug>.md`.
216
+ - One CONTEXT.md-authoring story per implementation epic (`persona: research`, `executor: claude`) producing `<paths.context>/<epic-slug>/CONTEXT.md` from the shared template at `skills/shared/templates/CONTEXT-template.md`.
217
+
218
+ **How it gates implementation:**
219
+
220
+ Every implementation story receives a `blocked_by` reference to the design-spike story that produces its epic's CONTEXT.md. Sprint planning then naturally excludes implementation stories until the design-spike epic completes — no special gate logic required, the existing dependency mechanism handles it.
221
+
222
+ **Where artifacts live:**
223
+
224
+ ADR and CONTEXT.md files are committed to the `development` branch via the filesystem in ALL four backends (local, GitHub, Jira, Trello). Git is the universal substrate; remote backends additionally surface links via milestone/epic descriptions but the committed files are the single source of truth.
225
+
226
+ **Detection signal:**
227
+
228
+ The canonical signal that an epic is a design-spike is the `type:design-spike` label (GitHub/Trello) or `epic_type: design-spike` frontmatter field (local). The default epic title is "Architecture & Design" but the title is not load-bearing — detection always uses the label/field, never the title.
229
+
230
+ ## Frontmatter Fields (Local Mode)
231
+
232
+ In local-mode backlogs (`scaffolding: "local"`), epic and story files use YAML frontmatter for metadata. Beyond the per-file fields documented in their respective templates, these fields apply to the epic-level `_epic.md`:
233
+
234
+ | Field | Type | Allowed Values | Purpose |
235
+ |-------|------|----------------|---------|
236
+ | `title` | string | any | Display name of the epic |
237
+ | `slug` | string | kebab-case | Directory name and ID |
238
+ | `status` | string | `open`, `closed` | Epic completion state |
239
+ | `created` | string | ISO timestamp | Creation time |
240
+ | `epic_type` | string | `design-spike` (omit for implementation epics) | Marks the epic as the design-spike pre-epic for detection by orchestration |
241
+
242
+ Absence of `epic_type` means a standard implementation epic — this preserves backward compatibility with existing `_epic.md` files.
243
+
200
244
  ## Sprint Cadence
201
245
 
202
246
  - Default sprint length: **2 weeks** (configurable per project)
@@ -0,0 +1,36 @@
1
+ # ADR-NNNN: <Short Title of the Decision>
2
+
3
+ - **Status:** Proposed | Accepted | Deprecated | Superseded by ADR-NNNN
4
+ - **Date:** YYYY-MM-DD
5
+ - **Deciders:** <names or roles>
6
+
7
+ ## Context
8
+
9
+ <What is the issue motivating this decision? What forces are at play? What constraints apply?>
10
+
11
+ ## Decision
12
+
13
+ <What did we decide to do, in active voice and present tense.>
14
+
15
+ ## Consequences
16
+
17
+ ### Positive
18
+ - <Good thing that follows from this decision>
19
+
20
+ ### Negative
21
+ - <Trade-off or cost being accepted>
22
+
23
+ ### Neutral
24
+ - <Side-effect that is neither clearly good nor bad>
25
+
26
+ ## Alternatives Considered
27
+
28
+ ### <Alternative 1>
29
+ <What it was and why it was rejected>
30
+
31
+ ### <Alternative 2>
32
+ <What it was and why it was rejected>
33
+
34
+ ## References
35
+
36
+ - <Links to related ADRs, specs, issues, docs>
@@ -0,0 +1,96 @@
1
+ # <Epic Name> — Shared Context
2
+
3
+ > Authored once per implementation epic by a `persona: research` subagent during the design-spike epic. Every implementation subagent for this epic reads this file in full before writing code. Sections below are required — keep them present even if briefly populated.
4
+
5
+ ## Overview
6
+
7
+ <1–2 sentence summary of what this epic builds and how its stories fit together.>
8
+
9
+ Example: "Implements the authentication subsystem. Each story adds one piece — credential storage, session issuance, middleware, refresh flow — and they compose into a single auth pipeline consumed by every protected route."
10
+
11
+ ## Naming Conventions
12
+
13
+ <Domain terms, prefixes, suffixes, casing rules specific to this epic. These override generic conventions in CLAUDE.md when in conflict.>
14
+
15
+ Example:
16
+ - All endpoint handler functions prefix with `handle_` (e.g., `handle_login`, `handle_refresh`)
17
+ - Event names use past tense (`UserCreated`, `SessionExpired` — never `CreateUser`, `ExpireSession`)
18
+ - Database column names use `snake_case`; corresponding TypeScript fields use `camelCase`
19
+ - Repository methods that return one row use singular nouns (`findUser`); those that return many use plural (`findUsers`)
20
+
21
+ ## File Layout
22
+
23
+ <Where new files for this epic's stories live. Include full paths.>
24
+
25
+ Example:
26
+ - Repository implementations: `src/data/<entity>/postgres_<entity>_repository.ts`
27
+ - API controllers: `src/api/<entity>/<entity>_controller.ts`
28
+ - Domain types: `src/core/<entity>/types.ts`
29
+ - Tests colocated with source: `<file>.test.ts` next to `<file>.ts`
30
+ - Migrations: `migrations/NNNN_<description>.sql` (numbered sequentially)
31
+
32
+ ## Shared Types & Interfaces
33
+
34
+ <Code blocks with type/interface/struct definitions stories must IMPORT rather than redefine. If two stories need the same type, define it here and reference the location.>
35
+
36
+ Example:
37
+
38
+ ```typescript
39
+ // src/core/auth/types.ts
40
+ export type SessionId = string & { readonly __brand: "SessionId" };
41
+
42
+ export interface Credentials {
43
+ email: string;
44
+ password: string;
45
+ }
46
+
47
+ export interface Session {
48
+ id: SessionId;
49
+ userId: UserId;
50
+ expiresAt: Date;
51
+ }
52
+ ```
53
+
54
+ Stories MUST import these from the canonical location, not re-declare structurally identical types.
55
+
56
+ ## Patterns to Follow
57
+
58
+ <Code-level patterns with concrete examples. Cover error handling, logging, pagination, validation, transaction boundaries, etc. Each pattern should include a one-line "why" so reviewers can judge edge cases.>
59
+
60
+ Example:
61
+
62
+ **Error handling at controller boundaries:**
63
+
64
+ ```typescript
65
+ try {
66
+ const result = await service.doThing(input);
67
+ return ok(result);
68
+ } catch (e) {
69
+ if (e instanceof DomainError) return badRequest(e.message);
70
+ logger.error("unexpected", { e });
71
+ return internalServerError();
72
+ }
73
+ ```
74
+
75
+ Why: Domain errors are caller-visible; unknown errors must not leak internals.
76
+
77
+ **Pagination:** Cursor-based, never offset. Use `{ cursor, limit }` query params; return `{ items, nextCursor }`. Why: stable ordering across concurrent writes.
78
+
79
+ ## Patterns to Avoid
80
+
81
+ <Anti-patterns specific to this epic with rationale. These are NOT a generic "best practices" list — they are concrete things that have caused problems or that violate the epic's design.>
82
+
83
+ Example:
84
+
85
+ - **Don't share a database client between modules.** Each repository constructs its own. Why: makes mocking and per-test isolation trivial.
86
+ - **Don't catch generic `Error` in middleware.** Catch specific subtypes only. Why: a broad catch swallows programmer errors that should crash loudly in dev.
87
+ - **Don't add new auth-related env vars without updating `src/config/env_schema.ts`.** Why: the schema is the validation layer — env vars not in it are silently undefined.
88
+
89
+ ## External References
90
+
91
+ <Links to upstream docs, related ADRs, CLAUDE.md sections this epic depends on.>
92
+
93
+ - ADR: `<paths.adr>/NNNN-<slug>.md`
94
+ - CLAUDE.md sections: `Architecture`, `Code Quality`, `Testing`
95
+ - Upstream docs: `<url to library/framework docs if any>`
96
+ - Related epics: `<epic-slug>` (consumes the types defined here)