@houseofwolvesllc/claude-scrum-skill 1.7.1 → 1.8.1

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
@@ -66,12 +66,16 @@ PRD (optional) --> /project-orchestrate
66
66
  # Global install — available in all projects
67
67
  npm install -g @houseofwolvesllc/claude-scrum-skill
68
68
 
69
- # Local install — this project only
70
- npm install @houseofwolvesllc/claude-scrum-skill
69
+ # Local install — this project only (developer tooling → devDependencies)
70
+ npm install --save-dev @houseofwolvesllc/claude-scrum-skill
71
+ # or the shorthand:
72
+ npm install -D @houseofwolvesllc/claude-scrum-skill
71
73
  ```
72
74
 
73
75
  Global install copies skills to `~/.claude/skills/`. Local install copies them to `<project>/.claude/skills/` and adds `.claude-scrum-skill` to your `.gitignore`.
74
76
 
77
+ > **Why `--save-dev`?** This package is developer tooling — the skills are consumed by Claude Code at planning/build/iteration time, never by your application's runtime. Saving to `devDependencies` (instead of `dependencies`) keeps it out of production installs (`npm ci --production`, `NODE_ENV=production`, Docker production layers), avoids running the postinstall script in environments where `~/.claude/skills/` doesn't exist, and accurately reflects that the package isn't a runtime requirement. Same category as `eslint`, `prettier`, `vitest`, etc.
78
+
75
79
  Skills surface in Claude Code with their plain names: `/project-scaffold`, `/project-orchestrate`, `/sprint-plan`, etc.
76
80
 
77
81
  > **Heads-up on re-installs:** the postinstall script overwrites every file under `<install-dir>/skills/` with the package's shipped version. If you've customized `<install-dir>/skills/shared/config.json` (e.g., changed `paths.specs` or `paths.adr`), back it up before re-running `npm install` and restore your values afterward. Skill files outside the shipped set are left alone — only files that exist in the package are overwritten.
@@ -385,6 +389,36 @@ During sprint planning, personas are assigned automatically based on story label
385
389
 
386
390
  `/project-orchestrate` chains all skills into a fully autonomous pipeline.
387
391
 
392
+ ### Invocation Patterns
393
+
394
+ | Form | Behavior |
395
+ |------|----------|
396
+ | `/project-orchestrate` | Orchestrates all open epics in the existing backlog. |
397
+ | `/project-orchestrate spec.md` | Single-spec orchestration. Scaffolds the spec, runs the full lifecycle. |
398
+ | `/project-orchestrate spec-1.md spec-2.md spec-3.md` | **Sequential multi-path mode.** Each spec receives its own complete orchestration (Phase 1 → Phase 2 → Phase 3 → ADR → state cleanup) end-to-end before the next begins. Each spec gets its own design-spike (if triggered), emulation pass, cleanup, and ADR. |
399
+ | `/project-orchestrate owner/repo` | GitHub mode — orchestrates the named repo's open epics. |
400
+ | `/project-orchestrate spec.md owner/repo` | GitHub mode — scaffolds the spec into the named repo, then orchestrates only that PRD's epics. |
401
+ | `/project-orchestrate --merged spec-1.md spec-2.md` | Opt-in merged mode. Treats inputs as one combined project with best-effort legacy behavior. Emits a warning that formal merged semantics are deferred to a follow-up spec — prefer the sequential default unless you need merged. |
402
+
403
+ #### Multi-Path Flags
404
+
405
+ - **`--skip-on-pause`** (default off) — when a spec's orchestration pauses on a safety gate, mark it skipped and advance to the next spec instead of pausing the queue. Use with caution; safety gates exist for a reason.
406
+ - **`--merged`** (default off) — see the table above; opts into the legacy unified-multi-spec behavior.
407
+
408
+ #### Inter-Spec Dependencies
409
+
410
+ PRD documents can declare optional `depends_on` frontmatter to override the default argument-order execution:
411
+
412
+ ```yaml
413
+ ---
414
+ title: Spec B
415
+ depends_on:
416
+ - spec-a.md # ensure spec-a runs before this one
417
+ ---
418
+ ```
419
+
420
+ `/project-orchestrate` resolves the dependency graph at run start (topological sort, ties broken by argument order) and aborts before any spec executes if a cycle or missing dependency is detected. See `CONVENTIONS.md` → Frontmatter Fields → PRD Document Frontmatter for the full convention.
421
+
388
422
  ### Phase 1 — Epic Completion Loop
389
423
 
390
424
  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
@@ -472,6 +506,7 @@ skills/shared/
472
506
  - **Chunk large epics** into multiple sprints for natural review gates.
473
507
  - **Jira/Trello users:** If no project key or board ID is configured, `/project-scaffold` creates one automatically (Scrum template for Jira).
474
508
  - **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.
509
+ - **For related specs, declare `depends_on` in PRD frontmatter** rather than relying on argument order. `/project-orchestrate` will topologically sort the queue and abort on cycles or missing deps before any spec runs — catches ordering mistakes up front instead of mid-orchestration.
475
510
 
476
511
  ---
477
512
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@houseofwolvesllc/claude-scrum-skill",
3
- "version": "1.7.1",
3
+ "version": "1.8.1",
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
6
  "publishConfig": {
@@ -11,7 +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. 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.
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. Also note **Frontmatter Fields → PRD Document Frontmatter** — the `depends_on` field controls inter-spec execution order in sequential multi-path mode.
15
+ 1a. **Multi-path mode and new flags:** when invoked with 2+ existing-file paths, `/project-orchestrate` runs in sequential multi-path mode (each spec receives its own complete orchestration end-to-end). Two new flags are accepted: `--skip-on-pause` (default off; advance the queue when a spec hits a safety gate instead of pausing) and `--merged` (default off; treat multi-path inputs as one combined legacy multi-spec project with a deprecation warning). See **Input Parsing and Mode Detection** for the full classification and **Sequential Multi-Path Mode** for execution details.
15
16
  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
17
  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
18
  4. Read `../shared/references/PERSONAS.md` for role preambles. When spawning
@@ -66,8 +67,7 @@ Run autonomously on invocation. Standing Authorizations cover the normal lifecyc
66
67
  2. **A repo identifier** (e.g., `owner/repo`, GitHub mode only) — orchestrate **all open epics and stories** already on the project board. No scaffolding step.
67
68
  3. **A PRD file path + repo identifier** (e.g., `path/to/prd.md owner/repo`, GitHub mode only) — scaffold the PRD into the specified repo, then orchestrate only those epics/stories.
68
69
  4. **Nothing** — GitHub mode: detect the repo from the current git remote and orchestrate all open epics/stories. Local mode: orchestrate all open epics/stories in the configured backlog directory.
69
-
70
- **How to distinguish:** If an argument is a path to an existing file, treat it as a PRD. Otherwise treat it as a repo identifier (GitHub mode only).
70
+ 5. **Multiple PRD paths** (e.g., `spec-1.md spec-2.md spec-3.md`) — sequential per-spec orchestration. Each spec receives its own complete orchestration (Phase 1 → Phase 2 → Phase 3 → ADR → state cleanup) end-to-end before the next begins. See **Input Parsing and Mode Detection** below.
71
71
 
72
72
  ### Scope Rules
73
73
 
@@ -76,6 +76,157 @@ Run autonomously on invocation. Standing Authorizations cover the normal lifecyc
76
76
 
77
77
  ---
78
78
 
79
+ ## Input Parsing and Mode Detection
80
+
81
+ Before any orchestration work begins, classify the invocation into one of the modes below and announce the decision. The classification depends on how many tokens are in `$ARGUMENTS` and how many of them resolve to existing files on disk.
82
+
83
+ ### Mode Classification
84
+
85
+ **Pre-classification step:** Before applying the table below, separate **flag tokens** (those starting with `--`, e.g., `--skip-on-pause`, `--merged`) from **argument tokens**. Count and classify only the argument tokens. Flags are validated and consumed separately by the Flag Parsing subsection below; they do not contribute to the token count or the file/non-file determination.
86
+
87
+ Apply these rules in order; the first match wins.
88
+
89
+ | Argument token count | All resolve to files? | Mixed? | Mode |
90
+ |----------------------|----------------------|--------|------|
91
+ | 0 | — | — | **No-arg mode** (existing v1.7.1) — orchestrate open epics in the backlog. |
92
+ | 1 | yes | — | **Single-spec mode** (existing v1.7.1) — scaffold + orchestrate this one PRD. |
93
+ | 1 | no | — | **Repo-identifier mode** (existing v1.7.1, GitHub only) — orchestrate the repo's open epics. |
94
+ | Exactly 2 | exactly one is a file, the other is not | — | **Single-spec + repo mode** (existing v1.7.1, GitHub only) — scaffold the PRD into the named repo, orchestrate only that PRD's epics. |
95
+ | 2+ | yes (all tokens are paths to existing files) | — | **Sequential multi-path mode** (new) — see "Sequential Multi-Path Mode" section. |
96
+ | 2+ | no (all tokens are non-files) | — | **ERROR.** Multi-repo invocation is unsupported. Abort with a message listing the repo identifiers offered and noting that exactly one repo identifier is permitted per invocation. |
97
+ | 2+ | mixed (some files, some non-files, AND not the exactly-2 single-spec+repo case above) | yes | **ERROR.** Abort with a clear message listing which tokens are paths and which are not. Mixed argument lists outside the single-spec+repo shape are unsupported. |
98
+
99
+ ### Flag Parsing
100
+
101
+ `/project-orchestrate` accepts the following flags. They may appear in any position within `$ARGUMENTS`:
102
+
103
+ - **`--skip-on-pause`** (default off) — in sequential multi-path mode, a spec whose orchestration pauses on a safety gate is marked `skipped`, its in-progress state file is archived with `.skipped.md` suffix, and the queue advances to the next spec. Without this flag (the default), the queue pauses and waits for the user to resolve the gate before re-invocation.
104
+ - **`--merged`** (default off) — when set with 2+ PRD paths, treat the inputs as one combined multi-spec project using legacy best-effort behavior. Emits a deprecation warning that formal merged semantics are not yet specified. Prefer the sequential default unless merged behavior is explicitly required.
105
+
106
+ The flags are orthogonal: pass either, both, or neither.
107
+
108
+ Unknown flags or invalid flag values MUST cause the skill to abort with an error BEFORE starting any orchestration work. Example: `--mode=fast` is unknown; abort and list the supported flags.
109
+
110
+ ### Glob Expansion
111
+
112
+ Modern shells expand globs (e.g., `docs/specs/*.md`) before passing to Claude Code, so the skill typically sees pre-expanded paths. If `$ARGUMENTS` arrives with literal glob characters (`*`, `?`, `[...]`) still present, the skill MUST expand the glob itself BEFORE applying mode classification.
113
+
114
+ ### Announcement (Mandatory)
115
+
116
+ Before any orchestration work begins, announce the chosen mode and the count of specs (for multi-path) so the user understands what's about to happen:
117
+
118
+ ```
119
+ Multi-path orchestration mode: 3 specs detected.
120
+
121
+ Dependency graph: no depends_on declarations — using argument order.
122
+ Execution order:
123
+ 1. spec-1.md
124
+ 2. spec-2.md
125
+ 3. spec-3.md
126
+
127
+ Flags: none.
128
+
129
+ Starting Spec 1/3 — spec-1.md
130
+ ```
131
+
132
+ For single-spec, repo-identifier, or no-arg modes, the announcement is the existing v1.7.1 startup summary; no new format required.
133
+
134
+ ### Routing
135
+
136
+ - **Sequential multi-path mode** → run Dependency Resolution (next subsection), then invoke the per-spec wrapper documented in **Sequential Multi-Path Mode**.
137
+ - **Merged mode** (with `--merged`) → see **Sequential Multi-Path Mode → Merged Mode (Opt-In)**.
138
+ - **All other modes** → continue with the existing State Management and Phase 1 sections unchanged.
139
+
140
+ ### Dependency Resolution
141
+
142
+ Applies only to sequential multi-path mode (and merged mode if dependencies need to inform internal ordering). Runs after Mode Classification but BEFORE any spec executes.
143
+
144
+ #### `depends_on` Frontmatter
145
+
146
+ Each PRD/spec MAY declare an optional `depends_on` field in its YAML frontmatter. The value is a YAML list of paths or basenames. See `CONVENTIONS.md` → Frontmatter Fields → PRD Document Frontmatter for the full convention.
147
+
148
+ ```yaml
149
+ ---
150
+ title: My Spec
151
+ depends_on:
152
+ - other-spec.md # basename match against other args
153
+ - subdir/another-spec.md # path match relative to this spec's directory
154
+ ---
155
+ ```
156
+
157
+ #### Path Resolution
158
+
159
+ For each entry in a spec's `depends_on` list:
160
+
161
+ 1. Try interpreting the entry as a path relative to the declaring spec's own directory. If it canonicalizes to one of the specs in the current invocation's argument list (compared by canonical absolute path), the dependency resolves.
162
+ 2. If step 1 fails, try interpreting the entry as a basename match against the basenames (filename without directory) of the argument-list specs. If exactly one spec in the list has a matching basename, the dependency resolves.
163
+ 3. If neither step 1 nor step 2 resolves to a spec in the current invocation's argument list, ABORT the run with a clear error message naming the unresolved entry. Do NOT start any spec. Silent ignoring of unresolved dependencies would lead to subtle wrong-order execution.
164
+
165
+ #### Dependency Graph Construction
166
+
167
+ After resolving every spec's `depends_on` entries, build a directed acyclic graph (DAG):
168
+
169
+ - Nodes: each spec in the argument list.
170
+ - Edges: from depended-upon spec → dependent spec. (If spec-B has `depends_on: [spec-A.md]`, the edge is `spec-A → spec-B`, meaning A must complete before B.)
171
+
172
+ #### Cycle Detection
173
+
174
+ Detect cycles using the standard algorithm (e.g., DFS with a visiting-set). A cycle includes:
175
+
176
+ - Two-node cycles: `A → B → A`.
177
+ - Longer cycles: `A → B → C → A`.
178
+ - Self-loops: a spec declaring `depends_on: [itself.md]`.
179
+
180
+ If any cycle is detected, ABORT with the following error format BEFORE starting any spec:
181
+
182
+ ```
183
+ ERROR: Dependency cycle detected. No specs were started.
184
+
185
+ Cycle members:
186
+ spec-a.md → depends_on: spec-b.md
187
+ spec-b.md → depends_on: spec-a.md
188
+
189
+ Resolve the cycle (remove one of the declarations) and re-run.
190
+ ```
191
+
192
+ #### Missing-Dependency Detection
193
+
194
+ If any `depends_on` entry references a path that does not appear in the current invocation's argument list (after path resolution per the rules above), ABORT with the following error format BEFORE starting any spec:
195
+
196
+ ```
197
+ ERROR: Dependency not in argument list. No specs were started.
198
+
199
+ Missing dependency:
200
+ spec-b.md declares depends_on: [spec-a.md]
201
+ spec-a.md is not present in this invocation.
202
+
203
+ Either add spec-a.md to the invocation, or remove the depends_on declaration in spec-b.md.
204
+ ```
205
+
206
+ #### Topological Sort with Stable Tie-Break
207
+
208
+ Once the graph passes cycle and missing-dependency checks, topologically sort the specs. Tie-break: when two specs have no dependency relationship between them, the one appearing earlier in the original `$ARGUMENTS` order executes first. The sort MUST be stable.
209
+
210
+ #### No-`depends_on` Fallback
211
+
212
+ If NO spec declares `depends_on`, execution order is simply the order tokens appear in `$ARGUMENTS`. No graph construction or topological sort is performed (or, equivalently, an empty graph topo-sorts to the input order).
213
+
214
+ #### Pre-Execution Validation Order
215
+
216
+ All validation runs BEFORE any spec's orchestration begins (NFR-3):
217
+
218
+ 1. Mixed-argument detection (per Mode Classification).
219
+ 2. Flag validation (unknown flags abort).
220
+ 3. Glob expansion (if needed).
221
+ 4. `depends_on` parsing and path resolution.
222
+ 5. Cycle detection.
223
+ 6. Missing-dependency detection.
224
+ 7. Topological sort.
225
+
226
+ Only after all of these pass does the per-spec wrapper start invoking the per-spec orchestration.
227
+
228
+ ---
229
+
79
230
  ## State Management
80
231
 
81
232
  Orchestration state is persisted to `.claude-scrum-skill/orchestration-state.md` so progress survives context compaction, usage caps, and session restarts. This file is human-readable markdown.
@@ -745,6 +896,217 @@ run starts with a clean slate:
745
896
  rm -f .claude-scrum-skill/orchestration-state.md
746
897
  ```
747
898
 
899
+ **In multi-path mode, Step 17 is suppressed.** The multi-path wrapper handles per-spec state file archival with a slug-suffixed name instead — see Sequential Multi-Path Mode → Per-Spec State File Lifecycle.
900
+
901
+ ---
902
+
903
+ ## Sequential Multi-Path Mode
904
+
905
+ Applies when Mode Classification selected sequential multi-path mode (2+ tokens, all paths to existing files, `--merged` not set). This section is the wrapper that invokes the existing single-spec orchestration (Phases 1-3 + Step 16 + Step 17, as documented above) once per spec, in the order determined by Dependency Resolution.
906
+
907
+ ### Per-Spec Loop
908
+
909
+ For each spec in the topologically-sorted execution order:
910
+
911
+ 1. Update the queue state file (see below): mark this spec's row as `in-progress`, record `Started` timestamp.
912
+ 2. Invoke the full single-spec orchestration against this spec. This is the existing v1.7.1 flow — Phase 1 (Epic Completion Loop, including scaffolding via `/project-scaffold`), Phase 2 (Emulation Hardening Loop), Phase 3 (Project Cleanup), Step 16 (ADR Update). Step 17 (state file cleanup) is **suppressed** in multi-path mode; the wrapper handles archival instead.
913
+ 3. On the spec's natural completion: archive `.claude-scrum-skill/orchestration-state.md` to `.claude-scrum-skill/orchestration-state-<spec-slug>.previous.md` BEFORE the next spec begins. Update the queue state file: mark this spec's row as `completed`, record `Completed` timestamp, update aggregate stats.
914
+ 4. On the spec's safety-gate pause:
915
+ - **Without `--skip-on-pause`** (default): the per-spec state file remains at `.claude-scrum-skill/orchestration-state.md` with `Status: paused`. Update the queue state file: mark this spec's row as `paused`, set queue `Status: paused`. Exit the wrapper. The remaining specs in the queue are NOT started. The user resolves the gate, re-invokes `/project-orchestrate` with the same arguments, and the queue resumes from this spec.
916
+ - **With `--skip-on-pause`**: archive `.claude-scrum-skill/orchestration-state.md` to `.claude-scrum-skill/orchestration-state-<spec-slug>.skipped.md`. Update the queue state file: mark this spec's row as `skipped`, record the pause reason. Continue to the next spec.
917
+ 5. Per-spec orchestration runs to completion (or pause) before the next spec begins — no interleaving of sprints, no concurrent execution.
918
+
919
+ ### Spec Slug Derivation
920
+
921
+ A spec's slug is derived from its filename: `basename(path, ".md")`.
922
+
923
+ - `docs/specs/20260527_215752_multi_spec_sequential_orchestration.md` → `20260527_215752_multi_spec_sequential_orchestration`
924
+ - `spec-a.md` → `spec-a`
925
+
926
+ If two specs in the same invocation produce the same slug (e.g., one is `foo/spec.md`, another is `bar/spec.md`), ABORT before starting any spec — slug collisions would clobber each other's archived state files. Error format:
927
+
928
+ ```
929
+ ERROR: Spec slug collision. No specs were started.
930
+
931
+ Colliding specs:
932
+ foo/spec.md → slug "spec"
933
+ bar/spec.md → slug "spec"
934
+
935
+ Rename one of the specs so basenames differ, then re-run.
936
+ ```
937
+
938
+ ### Per-Spec State File Lifecycle
939
+
940
+ | Event | State file action |
941
+ |-------|-------------------|
942
+ | Spec starts | Per-spec orchestration creates `.claude-scrum-skill/orchestration-state.md` (existing v1.7.1 behavior). |
943
+ | Spec completes naturally | Wrapper renames to `.claude-scrum-skill/orchestration-state-<slug>.previous.md`. |
944
+ | Spec pauses, no `--skip-on-pause` | File remains at canonical location with `Status: paused`. Queue exits. |
945
+ | Spec pauses, with `--skip-on-pause` | Wrapper renames to `.claude-scrum-skill/orchestration-state-<slug>.skipped.md`. Queue advances. |
946
+ | Resume from paused state | Per-spec orchestration reads `.claude-scrum-skill/orchestration-state.md` and resumes (existing v1.7.1 behavior). The wrapper resumes the queue from this spec's position based on the queue state file. |
947
+
948
+ Single-spec mode state file lifecycle is unchanged from v1.7.1 — no slug suffix, no queue file. Step 17's `rm -f` runs as it always did. Only multi-path mode uses the slug-suffix archival and suppresses Step 17.
949
+
950
+ ### Queue State File
951
+
952
+ Multi-path mode maintains a queue state file at `.claude-scrum-skill/orchestration-queue-state.md` tracking the entire run. The file is human-readable markdown.
953
+
954
+ **Structure:**
955
+
956
+ ```markdown
957
+ # Orchestration Queue State
958
+
959
+ ## Meta
960
+ - **Mode:** sequential | merged
961
+ - **Status:** running | paused | completed
962
+ - **Started:** <ISO timestamp>
963
+ - **Last Updated:** <ISO timestamp>
964
+ - **Flags:** --skip-on-pause=<true|false>, --merged=<true|false>
965
+
966
+ ## Specs (resolved execution order)
967
+ | # | Spec Path | Slug | Status | Started | Completed | State File Archive |
968
+ |---|-----------|------|--------|---------|-----------|--------------------|
969
+ | 1 | docs/specs/spec-a.md | spec-a | completed | <ts> | <ts> | orchestration-state-spec-a.previous.md |
970
+ | 2 | docs/specs/spec-b.md | spec-b | in-progress | <ts> | — | orchestration-state.md (live) |
971
+ | 3 | docs/specs/spec-c.md | spec-c | pending | — | — | — |
972
+
973
+ ## Dependency Graph
974
+ - spec-c depends_on spec-a
975
+ - spec-b depends_on spec-a
976
+ (or "no dependencies declared" if empty)
977
+
978
+ ## Aggregate (updated as specs complete)
979
+ - **Total specs:** N
980
+ - **Completed:** N
981
+ - **Paused:** N (current: <spec-slug>, if any)
982
+ - **Skipped:** N
983
+ - **Pending:** N
984
+ - **Total stories delivered (across completed specs):** N
985
+ - **Total sprints executed:** N
986
+ - **Total ADRs created:** N
987
+
988
+ ## Log
989
+ - [<ts>] Multi-path run started — 3 specs in scope
990
+ - [<ts>] Dependency graph resolved — execution order: spec-a, spec-b, spec-c
991
+ - [<ts>] Spec 1/3 (spec-a) started
992
+ - [<ts>] Spec 1/3 (spec-a) completed — 12 stories, 3 sprints
993
+ - [<ts>] Spec 2/3 (spec-b) started
994
+ ```
995
+
996
+ **Lifecycle:**
997
+
998
+ - Created at multi-path mode start (after Mode Classification, Flag Parsing, Glob Expansion, and Dependency Resolution all pass).
999
+ - Updated after every spec status transition: pending → in-progress → completed | paused | skipped.
1000
+ - On clean completion (all specs `completed` or `skipped`, none `paused`): renamed to `orchestration-queue-state.previous.md`. The wrapper emits the Cumulative Summary.
1001
+ - On paused run: remains in place with `Status: paused` and the paused spec identified. Resume continues from the paused spec.
1002
+
1003
+ **On startup**, check for an existing `.claude-scrum-skill/orchestration-queue-state.md`:
1004
+
1005
+ - `Status: running` → resume from the recorded position (autonomous default).
1006
+ - `Status: paused` → resume from the recorded position. The paused spec's per-spec state file is read by its own resume logic.
1007
+ - `Status: completed` → rename to `orchestration-queue-state.previous.md` and start a fresh run.
1008
+ - No file → initialize a new queue state file.
1009
+
1010
+ Never prompt. Same autonomous-default discipline as the single-spec state file (see Default Operating Mode).
1011
+
1012
+ ### Safety-Gate Pause Announcements
1013
+
1014
+ **Default (without `--skip-on-pause`):**
1015
+
1016
+ ```
1017
+ [Spec 2/3] spec-b.md — paused on safety gate.
1018
+
1019
+ Pause reason: 3rd consecutive hardening run produced 2 critical findings
1020
+ (see .claude-scrum-skill/reports/emulation-report/ISSUES.md).
1021
+
1022
+ Remaining specs (1) are not started. Queue state preserved at
1023
+ .claude-scrum-skill/orchestration-queue-state.md.
1024
+
1025
+ Resolve the findings and re-invoke /project-orchestrate with the same
1026
+ arguments to resume. The queue picks up at spec-b.md.
1027
+ ```
1028
+
1029
+ **With `--skip-on-pause`:**
1030
+
1031
+ ```
1032
+ [Spec 2/3] spec-b.md — paused on safety gate. --skip-on-pause set; marking skipped.
1033
+
1034
+ Skipped reason: 3rd consecutive hardening run produced 2 critical findings.
1035
+ State archived to .claude-scrum-skill/orchestration-state-spec-b.skipped.md.
1036
+
1037
+ Continuing to Spec 3/3 — spec-c.md
1038
+ ```
1039
+
1040
+ ### Resume Semantics
1041
+
1042
+ A multi-path run paused on a safety gate is resumed by re-invoking `/project-orchestrate` with the same argument list. The queue state file's recorded execution order takes precedence — even if a spec's `depends_on` frontmatter changed between attempts, the resumed run uses the order recorded at the original run's start. This prevents subtle ordering shifts mid-run.
1043
+
1044
+ Completed specs are NOT re-executed on resume. The wrapper skips entries marked `completed` and `skipped`, resumes the entry marked `paused` (handing off to the per-spec orchestration's own resume logic), and continues with `pending` entries afterward.
1045
+
1046
+ ### Cumulative Summary
1047
+
1048
+ At the end of a multi-path run (all specs `completed` or `skipped`, none `paused`), emit a cumulative summary mirroring the existing single-spec completion summary structure, with a per-spec section plus an aggregate header.
1049
+
1050
+ Format:
1051
+
1052
+ ```
1053
+ ## Multi-Spec Orchestration Complete
1054
+
1055
+ ### Aggregate
1056
+ - Specs in queue: 3
1057
+ - Completed: 2 (spec-a, spec-c)
1058
+ - Skipped: 1 (spec-b, paused on 3rd hardening run; archived)
1059
+ - Total stories delivered: 27 (44 story points)
1060
+ - Total sprints: 7
1061
+ - Total ADRs created: 3
1062
+ - Total duration: 4h 12m
1063
+
1064
+ ### Per-Spec
1065
+
1066
+ #### spec-a.md ✅ Completed
1067
+ - 3 sprints, 12 stories, 18 points
1068
+ - Design-spike: yes (ADR-0007, 2 CONTEXT.md files)
1069
+ - Emulation runs: 1 (clean)
1070
+ - Cleanup: PASS
1071
+ - State archive: orchestration-state-spec-a.previous.md
1072
+ - ADR: docs/adrs/0007-spec-a-architecture.md
1073
+
1074
+ #### spec-b.md ⚠️ Skipped (paused, --skip-on-pause)
1075
+ - 2 sprints, 8 stories, 13 points completed before pause
1076
+ - Pause reason: 3rd hardening run produced 2 critical findings
1077
+ - State archive: orchestration-state-spec-b.skipped.md
1078
+ - Report: .claude-scrum-skill/reports/emulation-report/ISSUES.md
1079
+
1080
+ #### spec-c.md ✅ Completed
1081
+ - 4 sprints, 15 stories, 26 points
1082
+ - Design-spike: no (single epic)
1083
+ - Emulation runs: 2 (clean after hardening)
1084
+ - Cleanup: PASS
1085
+ - State archive: orchestration-state-spec-c.previous.md
1086
+ - ADR: docs/adrs/0008-spec-c-architecture.md
1087
+ ```
1088
+
1089
+ After emitting the summary, mark the queue `Status: completed` and rename `orchestration-queue-state.md` → `orchestration-queue-state.previous.md`.
1090
+
1091
+ ### Merged Mode (Opt-In)
1092
+
1093
+ When `--merged` is set alongside 2+ PRD paths, the skill treats the inputs as one combined multi-spec project using legacy best-effort behavior — the pre-v1.8.0 path where the agent improvises merge policy at runtime (one combined scaffold call, one merged design-spike, one combined sprint cycle, one emulation, one cleanup, one ADR pass).
1094
+
1095
+ Emit the following deprecation-style warning BEFORE proceeding:
1096
+
1097
+ ```
1098
+ WARNING: --merged is set. Multi-path inputs will be treated as one combined
1099
+ project with best-effort merge semantics. Formal merged behavior is not
1100
+ yet specified (deferred to a follow-up spec); results may be inconsistent
1101
+ run-to-run.
1102
+
1103
+ If you want predictable per-spec isolation, drop --merged and re-run.
1104
+
1105
+ Proceeding with merged mode...
1106
+ ```
1107
+
1108
+ Then run the legacy unified-multi-spec flow. The queue state file is still created (with `Mode: merged` in Meta) but tracks the merged invocation as a single combined orchestration rather than per-spec entries. Formal merged semantics — shared design-spike strategy, cross-spec dependency resolution, unified state file vs queue file — are deferred to a follow-up spec.
1109
+
748
1110
  ---
749
1111
 
750
1112
  ## Communication Pattern
@@ -241,6 +241,29 @@ In local-mode backlogs (`scaffolding: "local"`), epic and story files use YAML f
241
241
 
242
242
  Absence of `epic_type` means a standard implementation epic — this preserves backward compatibility with existing `_epic.md` files.
243
243
 
244
+ ### PRD Document Frontmatter
245
+
246
+ PRD/spec documents (passed to `/project-scaffold` or `/project-orchestrate`) may declare an optional `depends_on` field at the top of the document. The field is consumed by `/project-orchestrate` when running in sequential multi-path mode to determine inter-spec execution order — see `project-orchestrate/SKILL.md` → Input Parsing and Mode Detection → Dependency Resolution for the full algorithm.
247
+
248
+ | Field | Type | Purpose |
249
+ |-------|------|---------|
250
+ | `depends_on` | list of strings | Other specs in the same multi-path invocation that must complete before this one. Each entry is either a path (relative to this spec's directory) or a basename matching another spec in the argument list. Absence of the field means no inter-spec constraint — execution falls back to argument order. |
251
+
252
+ Example:
253
+
254
+ ```yaml
255
+ ---
256
+ title: My Spec
257
+ depends_on:
258
+ - other-spec.md # basename match against other args
259
+ - subdir/another-spec.md # path match relative to this spec's directory
260
+ ---
261
+ ```
262
+
263
+ `depends_on` is parallel in spirit to the story-level `blocked_by` field, but operates at the spec level. `/project-orchestrate` resolves the dependency graph at run start (topological sort, stable tie-break on argument order) and aborts the run BEFORE any spec executes if a cycle or missing dependency is detected. Cycles include self-references (`depends_on: [this-spec.md]`).
264
+
265
+ The field is ignored in single-path orchestrate invocations and in `/project-scaffold` invocations — it only takes effect when 2+ existing-file paths are passed to `/project-orchestrate`.
266
+
244
267
  ## Sprint Cadence
245
268
 
246
269
  - Default sprint length: **2 weeks** (configurable per project)