@garygentry/feature-forge 0.2.2 → 0.2.4

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.
Files changed (154) hide show
  1. package/README.md +6 -1
  2. package/adapters/GENERATION-REPORT.md +5 -1
  3. package/adapters/claude/references/forge-config-schema.json +43 -4
  4. package/adapters/claude/references/pipeline-state-schema.json +3 -2
  5. package/adapters/claude/references/portable-root.md +2 -2
  6. package/adapters/claude/references/process-overview.md +10 -0
  7. package/adapters/claude/references/shared-conventions.md +17 -9
  8. package/adapters/claude/references/stage-exit-protocol.md +99 -0
  9. package/adapters/claude/scripts/epic-manifest.py +10 -0
  10. package/adapters/claude/scripts/forge-bootstrap.py +94 -16
  11. package/adapters/claude/scripts/forge-init.sh +13 -1
  12. package/adapters/claude/scripts/forge-session.py +636 -0
  13. package/adapters/claude/skills/forge/SKILL.md +60 -4
  14. package/adapters/claude/skills/forge-0-epic/SKILL.md +20 -15
  15. package/adapters/claude/skills/forge-0-epic/references/edit-mode.md +6 -4
  16. package/adapters/claude/skills/forge-0-epic/references/epic-manifest-subcommands.md +1 -1
  17. package/adapters/claude/skills/forge-1-prd/SKILL.md +14 -4
  18. package/adapters/claude/skills/forge-2-tech/SKILL.md +14 -3
  19. package/adapters/claude/skills/forge-3-specs/SKILL.md +14 -3
  20. package/adapters/claude/skills/forge-4-backlog/SKILL.md +16 -5
  21. package/adapters/claude/skills/forge-5-loop/SKILL.md +20 -21
  22. package/adapters/claude/skills/forge-5-loop/references/result-reporting.md +10 -5
  23. package/adapters/claude/skills/forge-5-loop/references/runner-contract.md +41 -15
  24. package/adapters/claude/skills/forge-6-docs/SKILL.md +6 -6
  25. package/adapters/claude/skills/forge-bootstrap/SKILL.md +4 -4
  26. package/adapters/claude/skills/forge-fix/SKILL.md +27 -6
  27. package/adapters/claude/skills/forge-guide/SKILL.md +179 -0
  28. package/adapters/claude/skills/forge-init/SKILL.md +31 -1
  29. package/adapters/claude/skills/forge-verify/SKILL.md +46 -15
  30. package/adapters/claude/skills/forge-verify/references/verification-checklists.md +1 -1
  31. package/adapters/codex/references/forge-config-schema.json +43 -4
  32. package/adapters/codex/references/pipeline-state-schema.json +3 -2
  33. package/adapters/codex/references/portable-root.md +2 -2
  34. package/adapters/codex/references/process-overview.md +10 -0
  35. package/adapters/codex/references/shared-conventions.md +17 -9
  36. package/adapters/codex/references/stage-exit-protocol.md +99 -0
  37. package/adapters/codex/scripts/epic-manifest.py +10 -0
  38. package/adapters/codex/scripts/forge-bootstrap.py +94 -16
  39. package/adapters/codex/scripts/forge-init.sh +13 -1
  40. package/adapters/codex/scripts/forge-session.py +636 -0
  41. package/adapters/codex/skills/forge/SKILL.md +60 -4
  42. package/adapters/codex/skills/forge-0-epic/SKILL.md +21 -16
  43. package/adapters/codex/skills/forge-0-epic/references/edit-mode.md +6 -4
  44. package/adapters/codex/skills/forge-0-epic/references/epic-manifest-subcommands.md +1 -1
  45. package/adapters/codex/skills/forge-1-prd/SKILL.md +14 -4
  46. package/adapters/codex/skills/forge-2-tech/SKILL.md +15 -4
  47. package/adapters/codex/skills/forge-3-specs/SKILL.md +14 -3
  48. package/adapters/codex/skills/forge-4-backlog/SKILL.md +16 -5
  49. package/adapters/codex/skills/forge-5-loop/SKILL.md +22 -23
  50. package/adapters/codex/skills/forge-5-loop/references/result-reporting.md +10 -5
  51. package/adapters/codex/skills/forge-5-loop/references/runner-contract.md +41 -15
  52. package/adapters/codex/skills/forge-6-docs/SKILL.md +6 -6
  53. package/adapters/codex/skills/forge-bootstrap/SKILL.md +4 -4
  54. package/adapters/codex/skills/forge-fix/SKILL.md +27 -6
  55. package/adapters/codex/skills/forge-guide/SKILL.md +188 -0
  56. package/adapters/codex/skills/forge-init/SKILL.md +31 -1
  57. package/adapters/codex/skills/forge-verify/SKILL.md +45 -14
  58. package/adapters/codex/skills/forge-verify/references/verification-checklists.md +1 -1
  59. package/adapters/copilot/references/forge-config-schema.json +43 -4
  60. package/adapters/copilot/references/pipeline-state-schema.json +3 -2
  61. package/adapters/copilot/references/portable-root.md +2 -2
  62. package/adapters/copilot/references/process-overview.md +10 -0
  63. package/adapters/copilot/references/shared-conventions.md +17 -9
  64. package/adapters/copilot/references/stage-exit-protocol.md +99 -0
  65. package/adapters/copilot/scripts/epic-manifest.py +10 -0
  66. package/adapters/copilot/scripts/forge-bootstrap.py +94 -16
  67. package/adapters/copilot/scripts/forge-init.sh +13 -1
  68. package/adapters/copilot/scripts/forge-session.py +636 -0
  69. package/adapters/copilot/skills/forge/forge.md +60 -4
  70. package/adapters/copilot/skills/forge-0-epic/forge-0-epic.md +21 -16
  71. package/adapters/copilot/skills/forge-0-epic/references/edit-mode.md +6 -4
  72. package/adapters/copilot/skills/forge-0-epic/references/epic-manifest-subcommands.md +1 -1
  73. package/adapters/copilot/skills/forge-1-prd/forge-1-prd.md +14 -4
  74. package/adapters/copilot/skills/forge-2-tech/forge-2-tech.md +15 -4
  75. package/adapters/copilot/skills/forge-3-specs/forge-3-specs.md +14 -3
  76. package/adapters/copilot/skills/forge-4-backlog/forge-4-backlog.md +16 -5
  77. package/adapters/copilot/skills/forge-5-loop/forge-5-loop.md +22 -23
  78. package/adapters/copilot/skills/forge-5-loop/references/result-reporting.md +10 -5
  79. package/adapters/copilot/skills/forge-5-loop/references/runner-contract.md +41 -15
  80. package/adapters/copilot/skills/forge-6-docs/forge-6-docs.md +6 -6
  81. package/adapters/copilot/skills/forge-bootstrap/forge-bootstrap.md +4 -4
  82. package/adapters/copilot/skills/forge-fix/forge-fix.md +27 -6
  83. package/adapters/copilot/skills/forge-guide/forge-guide.md +188 -0
  84. package/adapters/copilot/skills/forge-init/forge-init.md +31 -1
  85. package/adapters/copilot/skills/forge-verify/forge-verify.md +45 -14
  86. package/adapters/copilot/skills/forge-verify/references/verification-checklists.md +1 -1
  87. package/adapters/cursor/references/forge-config-schema.json +43 -4
  88. package/adapters/cursor/references/pipeline-state-schema.json +3 -2
  89. package/adapters/cursor/references/portable-root.md +2 -2
  90. package/adapters/cursor/references/process-overview.md +10 -0
  91. package/adapters/cursor/references/shared-conventions.md +17 -9
  92. package/adapters/cursor/references/stage-exit-protocol.md +99 -0
  93. package/adapters/cursor/scripts/epic-manifest.py +10 -0
  94. package/adapters/cursor/scripts/forge-bootstrap.py +94 -16
  95. package/adapters/cursor/scripts/forge-init.sh +13 -1
  96. package/adapters/cursor/scripts/forge-session.py +636 -0
  97. package/adapters/cursor/skills/forge/forge.mdc +60 -4
  98. package/adapters/cursor/skills/forge-0-epic/forge-0-epic.mdc +21 -16
  99. package/adapters/cursor/skills/forge-0-epic/references/edit-mode.md +6 -4
  100. package/adapters/cursor/skills/forge-0-epic/references/epic-manifest-subcommands.md +1 -1
  101. package/adapters/cursor/skills/forge-1-prd/forge-1-prd.mdc +14 -4
  102. package/adapters/cursor/skills/forge-2-tech/forge-2-tech.mdc +15 -4
  103. package/adapters/cursor/skills/forge-3-specs/forge-3-specs.mdc +14 -3
  104. package/adapters/cursor/skills/forge-4-backlog/forge-4-backlog.mdc +16 -5
  105. package/adapters/cursor/skills/forge-5-loop/forge-5-loop.mdc +22 -23
  106. package/adapters/cursor/skills/forge-5-loop/references/result-reporting.md +10 -5
  107. package/adapters/cursor/skills/forge-5-loop/references/runner-contract.md +41 -15
  108. package/adapters/cursor/skills/forge-6-docs/forge-6-docs.mdc +6 -6
  109. package/adapters/cursor/skills/forge-bootstrap/forge-bootstrap.mdc +4 -4
  110. package/adapters/cursor/skills/forge-fix/forge-fix.mdc +27 -6
  111. package/adapters/cursor/skills/forge-guide/forge-guide.mdc +189 -0
  112. package/adapters/cursor/skills/forge-init/forge-init.mdc +31 -1
  113. package/adapters/cursor/skills/forge-verify/forge-verify.mdc +45 -14
  114. package/adapters/cursor/skills/forge-verify/references/verification-checklists.md +1 -1
  115. package/adapters/gemini/gemini-extension.json +4 -0
  116. package/adapters/gemini/references/forge-config-schema.json +43 -4
  117. package/adapters/gemini/references/pipeline-state-schema.json +3 -2
  118. package/adapters/gemini/references/portable-root.md +2 -2
  119. package/adapters/gemini/references/process-overview.md +10 -0
  120. package/adapters/gemini/references/shared-conventions.md +17 -9
  121. package/adapters/gemini/references/stage-exit-protocol.md +99 -0
  122. package/adapters/gemini/scripts/epic-manifest.py +10 -0
  123. package/adapters/gemini/scripts/forge-bootstrap.py +94 -16
  124. package/adapters/gemini/scripts/forge-init.sh +13 -1
  125. package/adapters/gemini/scripts/forge-session.py +636 -0
  126. package/adapters/gemini/skills/forge/forge.md +60 -4
  127. package/adapters/gemini/skills/forge-0-epic/forge-0-epic.md +21 -16
  128. package/adapters/gemini/skills/forge-0-epic/references/edit-mode.md +6 -4
  129. package/adapters/gemini/skills/forge-0-epic/references/epic-manifest-subcommands.md +1 -1
  130. package/adapters/gemini/skills/forge-1-prd/forge-1-prd.md +14 -4
  131. package/adapters/gemini/skills/forge-2-tech/forge-2-tech.md +15 -4
  132. package/adapters/gemini/skills/forge-3-specs/forge-3-specs.md +14 -3
  133. package/adapters/gemini/skills/forge-4-backlog/forge-4-backlog.md +16 -5
  134. package/adapters/gemini/skills/forge-5-loop/forge-5-loop.md +22 -23
  135. package/adapters/gemini/skills/forge-5-loop/references/result-reporting.md +10 -5
  136. package/adapters/gemini/skills/forge-5-loop/references/runner-contract.md +41 -15
  137. package/adapters/gemini/skills/forge-6-docs/forge-6-docs.md +6 -6
  138. package/adapters/gemini/skills/forge-bootstrap/forge-bootstrap.md +4 -4
  139. package/adapters/gemini/skills/forge-fix/forge-fix.md +27 -6
  140. package/adapters/gemini/skills/forge-guide/forge-guide.md +188 -0
  141. package/adapters/gemini/skills/forge-init/forge-init.md +31 -1
  142. package/adapters/gemini/skills/forge-verify/forge-verify.md +45 -14
  143. package/adapters/gemini/skills/forge-verify/references/verification-checklists.md +1 -1
  144. package/dist/apply.js +34 -8
  145. package/dist/cli.js +40 -4
  146. package/dist/fsutil.d.ts +0 -12
  147. package/dist/fsutil.js +10 -1
  148. package/dist/manifest.d.ts +1 -1
  149. package/dist/plan.js +22 -2
  150. package/dist/rauf.d.ts +4 -4
  151. package/dist/rauf.js +3 -3
  152. package/dist/report.js +1 -1
  153. package/dist/types.d.ts +1 -1
  154. package/package.json +1 -1
@@ -29,13 +29,20 @@ For pipeline architecture details, read `references/process-overview.md`.
29
29
 
30
30
  1. **Epics first.** Identify epic directories as any `{specsDir}/*/` that directly contains an `epic-manifest.json` **and no `.pipeline-state.json` of its own** (an epic root is never itself a feature). For each epic, run:
31
31
  ```bash
32
- R="$(for d in "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done)"
32
+ R="$(bash -c 'for d in "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done')"
33
33
  [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
34
34
  python3 "$R/scripts/epic-manifest.py" render-status "{epic}" --specs-dir "{specsDir}" --json
35
35
  ```
36
36
  and show one rollup line: `{epic} — {complete}/{total} complete, next: {nextCommand}`.
37
37
  2. **Standalone features below.** Scan the remaining `{specsDir}/*/` that directly contain a `.pipeline-state.json` **without** an `epic` back-pointer. A nested member's `.pipeline-state.json` is **attributed to its epic (Tier 1), never listed as a standalone feature**.
38
- - Within this standalone tier the existing logic still applies: if exactly one active (non-complete) standalone pipeline exists, show its dashboard; if multiple exist, list them with a one-line summary each and use the host's question mechanism to ask which to focus on.
38
+ - **Rank by recency.** Run the recency ranker so the most-recently-touched active feature is the default — the user rarely has to type a name (especially on mobile after a clear your session / start a fresh session):
39
+ ```bash
40
+ R="$(bash -c 'for d in "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done')"
41
+ [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
42
+ python3 "$R/scripts/forge-session.py" rank-features --specs-dir "{specsDir}" --json
43
+ ```
44
+ This returns `{active: [...], counts: {...}}` with active features sorted by `updatedAt` **descending** (row 0 is the most recent). Each row carries `currentStage`, `nextStage`, `nextCommand`, `verifyPending`, `verifyCommand`, `verifyStage`, `verifyState` (`fresh`/`stale`/`failing`/`never`/`none`), `autoVerify` (the effective per-stage setting), and `autoFix` (the single source of stage order). A top-level `invalidAutoVerifyKeys` array appears when `forge.config.json` has `autoVerifyStages` keys outside the five verify-capable stages — surface it as a one-line warning. The `active` list excludes nested epic members surfaced in Tier 1 — but the ranker scans them too, so ignore rows whose `epic` is non-null here (they belong to the epic rollup).
45
+ - **Pick the feature:** if exactly one active standalone pipeline exists, show its dashboard. If multiple exist, use the host's question mechanism — **list the most-recently-updated first, labeled `(recommended)`**, each option's description showing its `currentStage` and a relative age ("updated 2h ago"). Always include a free-form escape ("A different feature / something else") so the user is never boxed in. Then render the chosen feature's dashboard.
39
46
 
40
47
  If no epics and no standalone features exist, say: "No active feature pipelines found. Start one with `/feature-forge:forge-1-prd <feature-name>` or group several with `/feature-forge:forge-0-epic <epic-name>`."
41
48
 
@@ -78,12 +85,55 @@ Use these status indicators:
78
85
  - ⏭️ = verification skipped (user chose to proceed without verifying)
79
86
  - ⚠️ = stale (built against an older version of an upstream artifact)
80
87
 
88
+ ### 3b. Drive to the Next Stage
89
+
90
+ After rendering a **per-feature** dashboard for an **active** pipeline (skip this for paused/abandoned pipelines and for the Epic Dashboard), don't stop at a text suggestion — actively offer to start the next stage. This removes the copy-paste-after-clear your session / start a fresh session chore that makes long, multi-stage runs painful (especially on mobile).
91
+
92
+ **1. Read the next step.** From the `rank-features --json` output (above), find this feature's row and read its `nextStage`, `nextCommand`, `verifyPending`, `verifyCommand`, `verifyStage`, `verifyState`, `autoVerify`, and `autoFix`. If the feature is not in the `active` list (paused/abandoned), or `nextStage` is `null` (every production stage complete), skip the drive prompt — instead congratulate the user and, if `forge-6-docs` has not run, offer it; otherwise note the pipeline is complete. If the payload has a non-empty `invalidAutoVerifyKeys`, print a one-line warning first (e.g. "⚠️ forge.config.json `autoVerifyStages` has unknown keys: … — they are ignored; fix the typo").
93
+
94
+ **2. Check the context window.** Run the context-usage helper so you can advise whether to continue here or start the next stage in a fresh session:
95
+ ```bash
96
+ R="$(bash -c 'for d in "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done')"
97
+ [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
98
+ python3 "$R/scripts/forge-session.py" context-usage --json
99
+ ```
100
+ - `{"available": true, ...}` → note `pct` (e.g. "context ~68% full") and `overThreshold`. Window/threshold come from `contextWindowTokens` / `contextWarnThreshold` in `forge.config.json` (the helper defaults to a 200k window and 0.7 threshold, and auto-bumps the assumed window to 1M once observed usage exceeds 200k; **on a 1M-context model set `contextWindowTokens: 1000000` so the percentage is accurate below 200k too** — 1M can't be detected from the transcript until usage crosses 200k).
101
+ - `{"available": false, ...}` → omit context advice silently (non-Claude host, or a fresh session with no transcript). Never treat this as an error.
102
+
103
+ **2b. Auto-verify branch (when `verifyPending` is true).** Before offering the advance gate, decide whether verify runs automatically:
104
+
105
+ - **`autoVerify` is true for the just-completed `verifyStage`** → **skip the verify question entirely** and run verify now, *provided it can run clean-room*. Auto-verify is safe to run unattended only because verify executes in a fresh `forge-verifier` subagent that inherits none of this session's context (so no clear your session / start a fresh session is needed and only a compact digest returns). Guard the clean-room assumption: proceed unattended **only when the host's subagent mechanism + `forge-verifier` subagent are available**. Invoke `feature-forge:forge-verify` via the host's skill-invocation mechanism in **require-clean (`auto`) mode** — in that mode forge-verify refuses to run inline and returns a sentinel if the subagent is not dispatchable (see `skills/forge-verify/SKILL.md`). Then:
106
+ - **Sentinel returned (clean-room unavailable)** → do **not** run verify inline. Degrade to the manual gate: fall through to step 3 with the **"Verify `{stage}` first (manual)"** option included, and if `overThreshold`, recommend "clear your session / start a fresh session, then verify in a clean session." Verify state stays outstanding; the stage is never advanced on false assurance.
107
+ - **Verify passed / no findings** → proceed to the normal advance gate (step 3), no verify option.
108
+ - **Verify found findings** →
109
+ - **`autoFix` is true AND preconditions hold** — the findings document has **zero unresolved decision points** and the **working tree is clean** → invoke `feature-forge:forge-fix` via the host's skill-invocation mechanism, then run a **mandatory re-verify** (require-clean mode). Advance only if the re-verify passes. On **any** precondition miss (decisions required, dirty tree), a forge-fix early stop, or a red re-verify → fall back to the digest + prompt below (never a silent partial mutation).
110
+ - **`autoFix` is false (default), or preconditions failed** → present a **compact findings digest** as text, then the host's question mechanism: *Apply fixes now (forge-fix)* / *Review findings* / *Skip & advance*.
111
+ - **`autoVerify` is false/unconfigured** → do not auto-run; use the advance gate in step 3, which gains the folded opt-in verify options ("Verify `{stage}` now" and "Verify `{stage}` now + enable auto-verify going forward").
112
+
113
+ **3. Offer the next step via the host's question mechanism.** (Reached when auto-verify did not fully resolve the step, or `verifyPending` is false.) Output the dashboard + a one-line context note as text, then ask (per the Decision Support protocol in `references/shared-conventions.md`). This is the same **Stage Exit Protocol** the stage skills stamp (`references/stage-exit-protocol.md`) — a clean session at the boundary is recommended on its own merits, and `overThreshold` only modulates *how emphatically*, never *whether*. Options, in this order:
114
+ - **Start `{nextStage}` in a clean session** — **recommended, unconditionally**, at every boundary. A clean session is the right default for the next stage on its own merits, independent of window size. The work survives a clear because all state is on disk: instruct the user to clear your session / start a fresh session, then re-run `/feature-forge:forge {feature}` (or run `{nextCommand}` directly) in the fresh session. Note plainly that you cannot clear your session / start a fresh session for them. **When `overThreshold` is true**, strengthen this wording (the window is also genuinely full) and add mid-stage compaction advice; **when the window is healthy**, still recommend the clean session — `overThreshold` is a *secondary, additive* modifier here, not the clear on/off switch.
115
+ - **Continue in this session** — the always-available alternative, reasonable when the window is nearly empty and the user would rather not clear. Not the default.
116
+ - **Verify `{stage}` now** — include **only when `verifyPending` is true and `autoVerify` is false**, and the clean-room path is available. **Recommended**, since verify is clean-room and rarely worth skipping. Runs verify now (require-clean mode); **does not** change config.
117
+ - **Verify `{stage}` now + enable auto-verify going forward** — same trigger as the option above; runs verify now **and** patches `autoVerify: true` into `forge.config.json` in place (preserve formatting and other keys) so every future stage verifies automatically without prompting. This is the **folded** config-enable — it replaces the old post-hoc "make auto-verify the default?" follow-up. No silent config writes: the config changes **only** when the user picks this option.
118
+ - **Verify `{stage}` first (manual)** — include **only when `verifyPending` is true** and the clean-room path is unavailable (the Tier-2 degradation above), or the host lacks the host's skill-invocation and subagent mechanisms; selecting it runs `{verifyCommand}` (inline / manual). Offer the "enable auto-verify" choice as text only if a config write is possible.
119
+ - **Pick a different stage** — free-form escape to any stage or other action.
120
+
121
+ **4. Act on the choice.**
122
+ - **Clean session** (the default) → give the exact next command and the clear your session / start a fresh session-then-re-run instruction; do not invoke anything (you cannot clear your session / start a fresh session for the user).
123
+ - **Continue in this session** → if `autoInvokeNextStage` is true (default) **and** the host's skill-invocation mechanism is available, invoke the chosen stage **via the host's skill-invocation mechanism** in this same session (e.g. `skill: "feature-forge:forge-3-specs"`, `args: "{feature}"`) — no retyping, no paste. If `autoInvokeNextStage` is false, or the host's skill-invocation mechanism is unavailable (a non-Claude host), fall back to printing `{nextCommand}` prominently for the user to run.
124
+ - **Verify now / Verify now + enable auto-verify** → invoke `feature-forge:forge-verify` via the host's skill-invocation mechanism (require-clean mode). For the **enable-auto-verify** variant, additionally patch `autoVerify: true` into `forge.config.json` in place (preserve formatting and other keys) — never a silent write. On a non-Claude host or when degrading to the manual/inline gate, print `{verifyCommand}` instead.
125
+ - **Different stage** → honor the free-form request.
126
+
127
+ **Host fallback.** On a non-Claude host or when the host's skill-invocation and subagent mechanisms are unavailable, auto-verify never runs unattended — fall back to printing `{verifyCommand}` exactly as today, mirroring `autoInvokeNextStage`.
128
+
129
+ This applies whether the feature was named explicitly (`/feature-forge:forge {feature}`) or resolved from the recency default.
130
+
81
131
  ### Epic Dashboard
82
132
 
83
133
  When the named argument is an epic (`{specsDir}/{name}/epic-manifest.json` exists), render the epic dashboard instead of a per-feature one. Run:
84
134
 
85
135
  ```bash
86
- R="$(for d in "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done)"
136
+ R="$(bash -c 'for d in "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done')"
87
137
  [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
88
138
  python3 "$R/scripts/epic-manifest.py" render-status "{epic}" --specs-dir "{specsDir}" --json
89
139
  ```
@@ -143,12 +193,18 @@ Support these sub-commands for pipeline lifecycle management:
143
193
  - `/feature-forge:forge pause {feature}` — Set `pipelineStatus` to `"paused"`. Do NOT modify `currentStage` or any stage statuses. The pipeline freezes exactly as-is. Show a confirmation.
144
194
  - `/feature-forge:forge resume {feature}` — Set `pipelineStatus` back to `"active"`. Calculate how long the feature was paused (from `updatedAt` to now). If paused for more than 24 hours, show a hint: "This feature was paused for {duration}. Session context may have been lost — consider re-running `/feature-forge:forge-{currentStage} {feature}` to rebuild context."
145
195
  - `/feature-forge:forge abandon {feature}` — Set `pipelineStatus` to `"abandoned"`. Use the host's question mechanism to confirm first, and state what's reversible: abandoning does not delete artifacts and can be undone with `/feature-forge:forge resume {feature}`, so the cost is low — but if the user really means "stop and discard," point out that `pause` is the better choice when they're only setting it aside. Offer **Abandon** · **Pause instead** · **Cancel**.
196
+ - `/feature-forge:forge run [{feature}]` — **Opt-in auto-advance.** Drive the feature through consecutive stages in one session instead of confirming each boundary. This is a convenience wrapper over **3b. Drive to the Next Stage** — same stage order, same context gate — just looped:
197
+ 1. Resolve the feature (if omitted, use the recency default from `rank-features`; if multiple are equally plausible, ask once via the host's question mechanism).
198
+ 2. **Before each stage,** run `forge-session.py context-usage`. If `overThreshold` is true, **stop** and recommend a clean session (give the exact `{nextCommand}` and the clear your session / start a fresh session-then-re-run instruction) — never auto-clear your session / start a fresh session.
199
+ 3. Otherwise invoke the next stage's skill via the host's skill-invocation mechanism, let it run to its natural stopping point, then re-read state and continue from step 2.
200
+ 4. **Stop conditions:** the next stage is an interview/decision point that calls the host's question mechanism (PRD and tech inherently pause for input — let them); `nextStage` is `null` (pipeline complete); context over threshold; or a stage signals it needs human input / is blocked. Always report where the loop stopped and why.
201
+ Per-stage confirmation (3b) remains the default — `run` is only used when the user explicitly asks to "run" / "drive" / "auto-advance" the pipeline. On a non-Claude host where the host's skill-invocation mechanism is unavailable, fall back to printing the ordered list of commands to run.
146
202
 
147
203
  **Epic lifecycle.** When the argument names an **epic** (`{specsDir}/{name}/epic-manifest.json` exists), `pause` / `resume` / `abandon` operate on the epic manifest, not a `.pipeline-state.json`:
148
204
 
149
205
  - Set the manifest's top-level `status` (`paused` / `active` / `abandoned`) via the helper's `set-status` mutator — an atomic write that also bumps `updatedAt`:
150
206
  ```bash
151
- R="$(for d in "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done)"
207
+ R="$(bash -c 'for d in "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done')"
152
208
  [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
153
209
  python3 "$R/scripts/epic-manifest.py" set-status "{epic}" --status paused --specs-dir "{specsDir}"
154
210
  ```
@@ -20,7 +20,7 @@ question in inline prose — every question goes through the host's question mec
20
20
 
21
21
  Read and follow `references/shared-conventions.md` for:
22
22
  - the **Feature Name Requirement** (applied here to the *epic* name — see below),
23
- - the **User Input Protocol** (the the host's question mechanism guardrail — all questions go through the tool),
23
+ - the **User Input Protocol** (the host's question mechanism guardrail — all questions go through the tool),
24
24
  - **Configuration Reading**, and
25
25
  - the **Git Commit Protocol**.
26
26
 
@@ -39,7 +39,7 @@ checks but still load any on-disk artifacts.
39
39
  plugin path and the configured specs dir:
40
40
 
41
41
  ```bash
42
- R="$(for d in "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done)"
42
+ R="$(bash -c 'for d in "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done')"
43
43
  [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
44
44
  python3 "$R/scripts/epic-manifest.py" <subcommand> ... --specs-dir "{specsDir}"
45
45
  ```
@@ -73,14 +73,14 @@ Resolve the epic subtree path `{specsDir}/{epic}/` and decide which branch to ru
73
73
  epic, confirm the epic name itself does not collide with any existing feature or epic:
74
74
 
75
75
  ```bash
76
- R="$(for d in "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done)"
76
+ R="$(bash -c 'for d in "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done')"
77
77
  [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
78
78
  python3 "$R/scripts/epic-manifest.py" check-name "{epic}" --specs-dir "{specsDir}"
79
79
  ```
80
80
 
81
81
  - Exit `0` → the name is free; proceed to C1.
82
82
  - Exit `1` (`duplicate-name`) → STOP and surface the helper's finding **verbatim**; ask
83
- (via the host's question mechanism) for a different epic name, then re-run check-name.
83
+ for a different epic name, then re-run check-name.
84
84
  - Exit `2` (unsafe name) → STOP and surface the finding; ask for a corrected name.
85
85
 
86
86
  ---
@@ -117,14 +117,14 @@ For **each** proposed feature name, before accepting it into the set, enforce gl
117
117
  and name safety via the helper:
118
118
 
119
119
  ```bash
120
- R="$(for d in "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done)"
120
+ R="$(bash -c 'for d in "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done')"
121
121
  [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
122
122
  python3 "$R/scripts/epic-manifest.py" check-name "{feature}" --specs-dir "{specsDir}"
123
123
  ```
124
124
 
125
125
  - Exit `0` → accept the name.
126
126
  - Exit `1` (`duplicate-name`) → reject that name; surface the finding verbatim and re-prompt
127
- (via the host's question mechanism) for a different name.
127
+ for a different name.
128
128
  - Exit `2` (`unsafe-name`) → reject; surface the finding and re-prompt.
129
129
 
130
130
  Never accept a feature name that has not passed `check-name` exit 0.
@@ -177,7 +177,7 @@ For the *initial* creation write the skill writes the file directly — atomic g
177
177
  required for in-place mutation, which is the helper mutators' job. Creating the epic dir first creates `{specsDir}/`, so after writing the manifest invoke the **Specs Directory Hygiene** block in `references/shared-conventions.md` (idempotent; stage anything it writes with this stage's commit). Then validate:
178
178
 
179
179
  ```bash
180
- R="$(for d in "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done)"
180
+ R="$(bash -c 'for d in "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done')"
181
181
  [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
182
182
  python3 "$R/scripts/epic-manifest.py" validate "{epic}" --specs-dir "{specsDir}" --json
183
183
  ```
@@ -248,18 +248,23 @@ now self-contained: manifest + EPIC.md + one subdirectory per member.
248
248
  captures `epic-manifest.json`, `EPIC.md`, and all member `.pipeline-state.json` files
249
249
  atomically.
250
250
  - Commit with message `"{commitPrefix}({epic}): create epic with {N} features"`.
251
- - On success, capture the commit hash. On failure (pre-commit hook, conflict), report and do
252
- not mark complete; never use `--no-verify`/`--force`.
251
+ - On success, capture the commit hash for the closing message only — the epic manifest has no
252
+ `commitHash` field, so nothing is written back into a committed file and the two-commit step of
253
+ the Git Commit Protocol does not apply here. On failure (pre-commit hook, conflict), report and
254
+ do not mark complete; never use `--amend`/`--no-verify`/`--force`.
253
255
 
254
- 3. **Closing message.** After a successful creation, tell the user the next steps:
256
+ 3. **Closing message — the Stage Exit Protocol.** Congratulate the user ("Epic `{epic}` created with {N} features."), then close with the Stage Exit Protocol below (single-sourced in `references/stage-exit-protocol.md`; the epic → first-PRD boundary is a full stage boundary — do not improvise a "Next steps" list). `{first-actionable-feature}` = any feature with empty `dependsOn` (or the first entry of `render-status`'s `actionable` set):
255
257
 
256
- > Epic `{epic}` created with {N} features. Next steps:
257
- > - `/feature-forge:forge {epic}` to see the epic dashboard
258
- > - `/feature-forge:forge-verify {epic}` to verify the epic
259
- > - `/feature-forge:forge-1-prd {first-actionable-feature}` to start the first feature
258
+ **This stage is done — walk the user through the Stage Exit Protocol** before moving on. The order is fixed, and step 2 is something only the user can do:
260
259
 
261
- The first-actionable feature is any feature with empty `dependsOn` (or the first entry of
262
- `render-status`'s `actionable` set).
260
+ 1. **Verify the epic decomposition first — if it isn't already verified.** When this stage has no fresh verification on record (`verifyState` is **missing or stale**) **and** `autoVerify` is off for it, verify **now, before clearing**. If verify already ran, is pending under auto-verify, or the stage was explicitly skipped, say so and go straight to step 2. Present the **Standard Verify Gate** using the host's question mechanism with exactly these three options — but only when the host has a question mechanism **and** the clean-room path is available (the host's subagent mechanism plus a dispatchable `forge-verifier` subagent):
261
+ - **Verify the epic decomposition now** *(recommended)* — dispatch the clean-room `forge-verifier` subagent from this session in require-clean mode; the digest returns here so any fix decision keeps its context. One-time — it does **not** change config.
262
+ - **Verify now + enable auto-verify going forward** — verify now **and** patch `"autoVerify": true` into `forge.config.json` in place (preserve formatting and every other key) so future stages verify automatically, no prompt. This complements the `forge-init` opt-in. **Do not auto-commit this config change** — treat it like `notes`: a user-facing edit the user commits on their own cadence, never folded into a stage's artifact commit.
263
+ - **Skip for now** — go straight to clear your session / start a fresh session and the next command without verifying. Record this stage's verify status as `"skipped"` in pipeline state (mirroring the existing skip handling) **only** on an explicit skip — a skip does not go stale.
264
+
265
+ **Host / clean-room fallback (not a user-selectable option):** if the question mechanism, the host's subagent mechanism, or the `forge-verifier` subagent is unavailable, do **not** run clean-room — degrade to printing `/feature-forge:forge-verify {epic}` for the user to run inline/manually (mirroring `autoInvokeNextStage`), and offer the auto-verify enable as plain text only if a config write is possible.
266
+ 2. **Then clear your session / start a fresh session.** Recommended **unconditionally** at this boundary for a clean start — independent of how full the context window is. Every artifact is on disk, so the work survives the clear. **I can't clear your session / start a fresh session for you — you have to run it yourself.**
267
+ 3. **Then run `/feature-forge:forge-1-prd {first-actionable-feature}`** in the fresh session — or re-run `/feature-forge:forge` to let the navigator resume from disk.
263
268
 
264
269
  ---
265
270
 
@@ -16,7 +16,7 @@ question goes through `AskUserQuestion`.
16
16
  Before offering any edit, validate the existing manifest:
17
17
 
18
18
  ```bash
19
- R="$(for d in "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done)"
19
+ R="$(bash -c 'for d in "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done')"
20
20
  [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
21
21
  python3 "$R/scripts/epic-manifest.py" validate "{epic}" --specs-dir "{specsDir}" --json
22
22
  ```
@@ -77,7 +77,7 @@ status is **not** `not-started`, warn the user. Read the **live** status (never
77
77
  completion in prose):
78
78
 
79
79
  ```bash
80
- R="$(for d in "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done)"
80
+ R="$(bash -c 'for d in "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done')"
81
81
  [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
82
82
  python3 "$R/scripts/epic-manifest.py" render-status "{epic}" --specs-dir "{specsDir}" --json
83
83
  ```
@@ -160,8 +160,10 @@ follow the Git Commit Protocol in shared-conventions:
160
160
  `"forge({epic}): create epic with 4 features"`, `"forge({epic}): add feature api-gateway"`,
161
161
  `"forge({epic}): remove feature legacy-session"`, `"forge({epic}): reorder features"`,
162
162
  `"forge({epic}): set dependency on token-service"`, or `"forge({epic}): set status paused"`.
163
- 3. On success, capture the commit hash. On failure (pre-commit hook, conflict), report and do
164
- **not** mark complete; never use `--no-verify`/`--force`.
163
+ 3. On success, capture the commit hash for reporting only — the epic manifest has no `commitHash`
164
+ field, so nothing is written back into a committed file and the two-commit step of the Git Commit
165
+ Protocol does not apply here. On failure (pre-commit hook, conflict), report and do **not** mark
166
+ complete; never use `--amend`/`--no-verify`/`--force`.
165
167
 
166
168
  Because every mutation is committed, the git history of `epic-manifest.json` is the audit trail; no
167
169
  separate in-manifest audit log is kept.
@@ -12,7 +12,7 @@ the write if it would introduce a cycle, dangling ref, duplicate, or schema viol
12
12
  flag surface (owned by 02 §7):
13
13
 
14
14
  ```bash
15
- R="$(for d in "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done)"
15
+ R="$(bash -c 'for d in "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done')"
16
16
  [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
17
17
  # Add a feature — seeds EMPTY exposes/consumes; contracts are populated below.
18
18
  python3 "$R/scripts/epic-manifest.py" add-feature "{epic}" "{feature}" \
@@ -110,10 +110,20 @@ Write pipeline state conforming to `references/pipeline-state-schema.json`.
110
110
  - Record `artifacts`, `completedAt`
111
111
  - Set `stages.forge-1-prd.basedOnVersions` to `{}` (no upstream dependencies)
112
112
  - Check downstream stages (`forge-2-tech`, `forge-3-specs`, `forge-4-backlog`, `forge-5-loop`, `forge-6-docs`). If any have `basedOnVersions` referencing an older version of `forge-1-prd`, set their status to `stale`.
113
- 2. Use the host's question mechanism to ask: "Anything you want to note before we wrap? (preserved across sessions)"
114
- - If yes, store in the `notes` field
115
- 3. If `gitCommitAfterStage` is true, follow the Git Commit Protocol in `references/shared-conventions.md`: stage files (including `{specsDir}/AGENTS.md` / `{specsDir}/CLAUDE.md` if the Specs Directory Hygiene step just wrote them), attempt commit with message `"{commitPrefix}({feature}): complete PRD v{n}"`, then set `stages.forge-1-prd.status` to `complete` with commit hash only on success. If commit fails, leave status as `in-progress`.
116
- 5. Tell the user: "PRD complete. Next steps:\n - `/feature-forge:forge-verify {feature}` to verify the PRD\n - `/feature-forge:forge-2-tech {feature}` to start the tech spec\n - `/feature-forge:forge {feature}` to see full pipeline status"
113
+ 2. **Offer a note — don't force one.** As a statement (not a blocking question), let the user know they can jot anything worth preserving across sessions and you'll store it in the `notes` field. If they volunteer something, store it; otherwise proceed.
114
+ 3. If `gitCommitAfterStage` is true, follow the Git Commit Protocol in `references/shared-conventions.md`: stage files (including `{specsDir}/AGENTS.md` / `{specsDir}/CLAUDE.md` if the Specs Directory Hygiene step just wrote them), attempt commit with message `"{commitPrefix}({feature}): complete PRD v{n}"` (marking `stages.forge-1-prd.status` `complete` with `commitHash: null` in that commit), then record the artifact-commit hash via the protocol's two-commit follow-up (never `--amend`) only on success. If commit fails, leave status as `in-progress`.
115
+ 4. **Close with the Stage Exit Protocol** (single-sourced in `references/stage-exit-protocol.md`; do not improvise a "Next steps" list):
116
+
117
+ **This stage is done — walk the user through the Stage Exit Protocol** before moving on. The order is fixed, and step 2 is something only the user can do:
118
+
119
+ 1. **Verify the PRD first — if it isn't already verified.** When this stage has no fresh verification on record (`verifyState` is **missing or stale**) **and** `autoVerify` is off for it, verify **now, before clearing**. If verify already ran, is pending under auto-verify, or the stage was explicitly skipped, say so and go straight to step 2. Present the **Standard Verify Gate** using the host's question mechanism with exactly these three options — but only when the host has a question mechanism **and** the clean-room path is available (the host's subagent mechanism plus a dispatchable `forge-verifier` subagent):
120
+ - **Verify the PRD now** *(recommended)* — dispatch the clean-room `forge-verifier` subagent from this session in require-clean mode; the digest returns here so any fix decision keeps its context. One-time — it does **not** change config.
121
+ - **Verify now + enable auto-verify going forward** — verify now **and** patch `"autoVerify": true` into `forge.config.json` in place (preserve formatting and every other key) so future stages verify automatically, no prompt. This complements the `forge-init` opt-in. **Do not auto-commit this config change** — treat it like `notes`: a user-facing edit the user commits on their own cadence, never folded into a stage's artifact commit.
122
+ - **Skip for now** — go straight to clear your session / start a fresh session and the next command without verifying. Record this stage's verify status as `"skipped"` in pipeline state (mirroring the existing skip handling) **only** on an explicit skip — a skip does not go stale.
123
+
124
+ **Host / clean-room fallback (not a user-selectable option):** if the question mechanism, the host's subagent mechanism, or the `forge-verifier` subagent is unavailable, do **not** run clean-room — degrade to printing `/feature-forge:forge-verify {feature}` for the user to run inline/manually (mirroring `autoInvokeNextStage`), and offer the auto-verify enable as plain text only if a config write is possible.
125
+ 2. **Then clear your session / start a fresh session.** Recommended **unconditionally** at this boundary for a clean start — independent of how full the context window is. Every artifact is on disk, so the work survives the clear. **I can't clear your session / start a fresh session for you — you have to run it yourself.**
126
+ 3. **Then run `/feature-forge:forge-2-tech {feature}`** in the fresh session — or re-run `/feature-forge:forge` to let the navigator resume from disk.
117
127
 
118
128
  ## Gotchas
119
129
 
@@ -88,7 +88,7 @@ Interview the user about technology decisions. Unlike the PRD interview, here yo
88
88
  - Recommend approaches consistent with the established stack, and say *why* the convention favors it (evidence-backed mode). Where the choice is genuine taste (e.g. folder layout, naming), give a default but flag it as preference.
89
89
  - Challenge over-engineering: does the feature need this, or is a simpler approach sufficient? Frame the simpler option's trade-off (less flexibility now vs. less to maintain).
90
90
  - Ask about every integration point and how the feature interacts with existing modules.
91
- - For competing module structures or code-shape choices, use the the host's question mechanism `preview` field to show the candidates side-by-side.
91
+ - For competing module structures or code-shape choices, use the host's question mechanism `preview` field to show the candidates side-by-side.
92
92
 
93
93
  **Parking lot:** If the user raises a concern that belongs to a different pipeline stage (e.g., backlog granularity, documentation format), acknowledge it and note it in the pipeline state's `notes` field: "Good point — I've noted that for the [specs/backlog/docs stage]. Let's continue with the tech spec."
94
94
 
@@ -187,9 +187,20 @@ Write pipeline state conforming to `references/pipeline-state-schema.json`.
187
187
  - Record `artifacts`, `completedAt`, `version`
188
188
  - Set `stages.forge-2-tech.basedOnVersions` to `{"forge-1-prd": <current forge-1-prd version>}`
189
189
  - Check downstream stages (forge-3-specs, forge-4-backlog, forge-5-loop, forge-6-docs). If any have `basedOnVersions` referencing an older version of forge-2-tech, set their status to `stale`
190
- 2. Use the host's question mechanism to ask about notes to persist
191
- 3. If `gitCommitAfterStage` is true, follow the Git Commit Protocol in `references/shared-conventions.md`: stage files, attempt commit with message `"{commitPrefix}({feature}): complete tech-spec v{n}"`, then set `stages.forge-2-tech.status` to `complete` with commit hash only on success. If commit fails, leave status as `in-progress`.
192
- 5. Tell the user: "Tech spec complete. Next steps:\n - `/feature-forge:forge-verify {feature}` to verify the tech spec\n - `/feature-forge:forge-3-specs {feature}` to create implementation specs\n - `/feature-forge:forge {feature}` to see full pipeline status"
190
+ 2. **Offer a note — don't force one.** As a statement (not a blocking question), let the user know they can jot anything worth preserving across sessions and you'll store it in the `notes` field. If they volunteer something, store it; otherwise proceed.
191
+ 3. If `gitCommitAfterStage` is true, follow the Git Commit Protocol in `references/shared-conventions.md`: stage files, attempt commit with message `"{commitPrefix}({feature}): complete tech-spec v{n}"` (marking `stages.forge-2-tech.status` `complete` with `commitHash: null` in that commit), then record the artifact-commit hash via the protocol's two-commit follow-up (never `--amend`) only on success. If commit fails, leave status as `in-progress`.
192
+ 4. **Close with the Stage Exit Protocol** (single-sourced in `references/stage-exit-protocol.md`; do not improvise a "Next steps" list):
193
+
194
+ **This stage is done — walk the user through the Stage Exit Protocol** before moving on. The order is fixed, and step 2 is something only the user can do:
195
+
196
+ 1. **Verify the tech spec first — if it isn't already verified.** When this stage has no fresh verification on record (`verifyState` is **missing or stale**) **and** `autoVerify` is off for it, verify **now, before clearing**. If verify already ran, is pending under auto-verify, or the stage was explicitly skipped, say so and go straight to step 2. Present the **Standard Verify Gate** using the host's question mechanism with exactly these three options — but only when the host has a question mechanism **and** the clean-room path is available (the host's subagent mechanism plus a dispatchable `forge-verifier` subagent):
197
+ - **Verify the tech spec now** *(recommended)* — dispatch the clean-room `forge-verifier` subagent from this session in require-clean mode; the digest returns here so any fix decision keeps its context. One-time — it does **not** change config.
198
+ - **Verify now + enable auto-verify going forward** — verify now **and** patch `"autoVerify": true` into `forge.config.json` in place (preserve formatting and every other key) so future stages verify automatically, no prompt. This complements the `forge-init` opt-in. **Do not auto-commit this config change** — treat it like `notes`: a user-facing edit the user commits on their own cadence, never folded into a stage's artifact commit.
199
+ - **Skip for now** — go straight to clear your session / start a fresh session and the next command without verifying. Record this stage's verify status as `"skipped"` in pipeline state (mirroring the existing skip handling) **only** on an explicit skip — a skip does not go stale.
200
+
201
+ **Host / clean-room fallback (not a user-selectable option):** if the question mechanism, the host's subagent mechanism, or the `forge-verifier` subagent is unavailable, do **not** run clean-room — degrade to printing `/feature-forge:forge-verify {feature}` for the user to run inline/manually (mirroring `autoInvokeNextStage`), and offer the auto-verify enable as plain text only if a config write is possible.
202
+ 2. **Then clear your session / start a fresh session.** Recommended **unconditionally** at this boundary for a clean start — independent of how full the context window is. Every artifact is on disk, so the work survives the clear. **I can't clear your session / start a fresh session for you — you have to run it yourself.**
203
+ 3. **Then run `/feature-forge:forge-3-specs {feature}`** in the fresh session — or re-run `/feature-forge:forge` to let the navigator resume from disk.
193
204
 
194
205
  ## Gotchas
195
206
 
@@ -141,9 +141,20 @@ Write pipeline state conforming to `references/pipeline-state-schema.json`.
141
141
  - Record all created files in `artifacts`, including `TRACEABILITY.md`
142
142
  - Set `stages.forge-3-specs.basedOnVersions` to `{"forge-1-prd": <current version>, "forge-2-tech": <current version>}`
143
143
  - Check downstream stages (forge-4-backlog, forge-5-loop, forge-6-docs). If any have `basedOnVersions` referencing older versions, set their status to `stale`
144
- 2. Use the host's question mechanism to ask about notes to persist
145
- 3. If `gitCommitAfterStage` is true, follow the Git Commit Protocol in `references/shared-conventions.md`: stage files, attempt commit with message `"{commitPrefix}({feature}): complete implementation specs v{n}"`, then set `stages.forge-3-specs.status` to `complete` with commit hash only on success. If commit fails, leave status as `in-progress`.
146
- 5. Tell the user: "Implementation specs complete. Next steps:\n - `/feature-forge:forge-verify {feature}` to verify the specs (strongly recommended)\n - `/feature-forge:forge-4-backlog {feature}` to generate the backlog\n - `/feature-forge:forge {feature}` to see full pipeline status"
144
+ 2. **Offer a note — don't force one.** As a statement (not a blocking question), let the user know they can jot anything worth preserving across sessions and you'll store it in the `notes` field. If they volunteer something, store it; otherwise proceed.
145
+ 3. If `gitCommitAfterStage` is true, follow the Git Commit Protocol in `references/shared-conventions.md`: stage files, attempt commit with message `"{commitPrefix}({feature}): complete implementation specs v{n}"` (marking `stages.forge-3-specs.status` `complete` with `commitHash: null` in that commit), then record the artifact-commit hash via the protocol's two-commit follow-up (never `--amend`) only on success. If commit fails, leave status as `in-progress`.
146
+ 4. **Close with the Stage Exit Protocol** (single-sourced in `references/stage-exit-protocol.md`; do not improvise a "Next steps" list). Specs feed every downstream stage, so the verify gate matters here:
147
+
148
+ **This stage is done — walk the user through the Stage Exit Protocol** before moving on. The order is fixed, and step 2 is something only the user can do:
149
+
150
+ 1. **Verify the implementation specs first — if it isn't already verified.** When this stage has no fresh verification on record (`verifyState` is **missing or stale**) **and** `autoVerify` is off for it, verify **now, before clearing**. If verify already ran, is pending under auto-verify, or the stage was explicitly skipped, say so and go straight to step 2. Present the **Standard Verify Gate** using the host's question mechanism with exactly these three options — but only when the host has a question mechanism **and** the clean-room path is available (the host's subagent mechanism plus a dispatchable `forge-verifier` subagent):
151
+ - **Verify the implementation specs now** *(recommended)* — dispatch the clean-room `forge-verifier` subagent from this session in require-clean mode; the digest returns here so any fix decision keeps its context. One-time — it does **not** change config.
152
+ - **Verify now + enable auto-verify going forward** — verify now **and** patch `"autoVerify": true` into `forge.config.json` in place (preserve formatting and every other key) so future stages verify automatically, no prompt. This complements the `forge-init` opt-in. **Do not auto-commit this config change** — treat it like `notes`: a user-facing edit the user commits on their own cadence, never folded into a stage's artifact commit.
153
+ - **Skip for now** — go straight to clear your session / start a fresh session and the next command without verifying. Record this stage's verify status as `"skipped"` in pipeline state (mirroring the existing skip handling) **only** on an explicit skip — a skip does not go stale.
154
+
155
+ **Host / clean-room fallback (not a user-selectable option):** if the question mechanism, the host's subagent mechanism, or the `forge-verifier` subagent is unavailable, do **not** run clean-room — degrade to printing `/feature-forge:forge-verify {feature}` for the user to run inline/manually (mirroring `autoInvokeNextStage`), and offer the auto-verify enable as plain text only if a config write is possible.
156
+ 2. **Then clear your session / start a fresh session.** Recommended **unconditionally** at this boundary for a clean start — independent of how full the context window is. Every artifact is on disk, so the work survives the clear. **I can't clear your session / start a fresh session for you — you have to run it yourself.**
157
+ 3. **Then run `/feature-forge:forge-4-backlog {feature}`** in the fresh session — or re-run `/feature-forge:forge` to let the navigator resume from disk.
147
158
 
148
159
  ## Gotchas
149
160
 
@@ -39,7 +39,7 @@ Resolve the **loop runner** from the `loopRunner` block in `forge.config.json`,
39
39
 
40
40
  **Prerequisite check:** Read `{resolvedFeatureDir}/.pipeline-state.json`. If not in force mode, stages `forge-1-prd`, `forge-2-tech`, and `forge-3-specs` must all be `complete`. If not, STOP and tell the user which prerequisites are missing.
41
41
 
42
- **Strongly recommended:** Check if specs have been verified. If not, use the host's question mechanism to warn with the cost of skipping: "Specs haven't been verified yet. Recommended: run `/feature-forge:forge-verify {feature}` first — unverified specs can carry gaps or contradictions that get baked into backlog items and only surface mid-loop, where they're far more expensive to fix. Continue anyway?" Offer **Verify first (recommended)** · **Continue without verifying**.
42
+ **Verification check.** Check whether the specs have been verified. If not, use the host's question mechanism to warn with the cost of skipping: "Specs haven't been verified yet. Recommended: run `/feature-forge:forge-verify {feature}` first — unverified specs can carry gaps or contradictions that get baked into backlog items and only surface mid-loop, where they're far more expensive to fix. Continue anyway?" Offer **Verify first (recommended)** · **Continue without verifying**.
43
43
 
44
44
  ## Step 2: Load All Specs
45
45
 
@@ -123,7 +123,7 @@ Interpret the result:
123
123
 
124
124
  Present a summary: total items N, dependency-chain depth, estimated loop iterations (`ceil(pendingItems * loopIterationMultiplier)`). Note whether validation passed or was skipped (runner not yet available).
125
125
 
126
- Use the host's question mechanism to ask: "Ready to proceed, or any adjustments needed?"
126
+ State that the backlog is ready and invite adjustments before committing — a statement, not a forced gate: "Backlog is ready. Tell me if you want any items split, merged, or reordered; otherwise I'll record state and commit." Proceed to Step 7 unless the user asks for changes.
127
127
 
128
128
  ## Step 7: Update Pipeline State and Commit
129
129
 
@@ -134,10 +134,21 @@ Write pipeline state conforming to `references/pipeline-state-schema.json`. Foll
134
134
  - Set `stages.forge-4-backlog.basedOnVersions` to `{"forge-1-prd": <current version>, "forge-2-tech": <current version>, "forge-3-specs": <current version>}`
135
135
  - Set `currentStage` to `forge-5-loop`
136
136
  - Check downstream stages (`forge-5-loop`, `forge-6-docs`). If any have `basedOnVersions` referencing an older version of `forge-4-backlog`, set their status to `stale`.
137
- 2. Use the host's question mechanism to ask about notes to persist
138
- 3. If `gitCommitAfterStage` is true, follow the Git Commit Protocol: stage files, attempt commit, then set status to `complete` with commit hash only on success. If commit fails, leave status as `in-progress`.
137
+ 2. **Offer a note — don't force one.** As a statement (not a blocking question), let the user know they can jot anything worth preserving across sessions and you'll store it in the `notes` field. If they volunteer something, store it; otherwise proceed.
138
+ 3. If `gitCommitAfterStage` is true, follow the Git Commit Protocol: stage files, attempt commit (marking `stages.forge-4-backlog.status` `complete` with `commitHash: null` in that commit), then record the artifact-commit hash via the protocol's two-commit follow-up (never `--amend`) only on success. If commit fails, leave status as `in-progress`.
139
139
  4. If verification was available but the user chose to skip it, record `stages.forge-verify-backlog.status` as `"skipped"` in pipeline state.
140
- 5. Tell user: "Backlog complete with {N} items. Next steps:\n - `/feature-forge:forge-verify {feature}` to verify the backlog\n - `/feature-forge:forge-5-loop {feature}` to run the loop\n - `/feature-forge:forge {feature}` to see full pipeline status"
140
+ 5. **Close with the Stage Exit Protocol** (single-sourced in `references/stage-exit-protocol.md`; do not improvise a "Next steps" list). Lead with the item count ("Backlog complete with {N} items."), then:
141
+
142
+ **This stage is done — walk the user through the Stage Exit Protocol** before moving on. The order is fixed, and step 2 is something only the user can do:
143
+
144
+ 1. **Verify the backlog first — if it isn't already verified.** When this stage has no fresh verification on record (`verifyState` is **missing or stale**) **and** `autoVerify` is off for it, verify **now, before clearing**. If verify already ran, is pending under auto-verify, or the stage was explicitly skipped, say so and go straight to step 2. Present the **Standard Verify Gate** using the host's question mechanism with exactly these three options — but only when the host has a question mechanism **and** the clean-room path is available (the host's subagent mechanism plus a dispatchable `forge-verifier` subagent):
145
+ - **Verify the backlog now** *(recommended)* — dispatch the clean-room `forge-verifier` subagent from this session in require-clean mode; the digest returns here so any fix decision keeps its context. One-time — it does **not** change config.
146
+ - **Verify now + enable auto-verify going forward** — verify now **and** patch `"autoVerify": true` into `forge.config.json` in place (preserve formatting and every other key) so future stages verify automatically, no prompt. This complements the `forge-init` opt-in. **Do not auto-commit this config change** — treat it like `notes`: a user-facing edit the user commits on their own cadence, never folded into a stage's artifact commit.
147
+ - **Skip for now** — go straight to clear your session / start a fresh session and the next command without verifying. Record this stage's verify status as `"skipped"` in pipeline state (mirroring the existing skip handling) **only** on an explicit skip — a skip does not go stale.
148
+
149
+ **Host / clean-room fallback (not a user-selectable option):** if the question mechanism, the host's subagent mechanism, or the `forge-verifier` subagent is unavailable, do **not** run clean-room — degrade to printing `/feature-forge:forge-verify {feature}` for the user to run inline/manually (mirroring `autoInvokeNextStage`), and offer the auto-verify enable as plain text only if a config write is possible.
150
+ 2. **Then clear your session / start a fresh session.** Recommended **unconditionally** at this boundary for a clean start — independent of how full the context window is. Every artifact is on disk, so the work survives the clear. **I can't clear your session / start a fresh session for you — you have to run it yourself.**
151
+ 3. **Then run `/feature-forge:forge-5-loop {feature}`** in the fresh session — or re-run `/feature-forge:forge` to let the navigator resume from disk.
141
152
 
142
153
  ## Gotchas
143
154
 
@@ -50,7 +50,7 @@ Read `{resolvedFeatureDir}/.pipeline-state.json`. If not in force mode, `stages.
50
50
 
51
51
  ### 1b. Verification Check
52
52
 
53
- Check if `stages.forge-verify-backlog` exists and has status `passed` or `findings-applied`. If not, use the host's question mechanism to warn:
53
+ Check if `stages.forge-verify-backlog` exists and has status `passed` or `findings-applied`. If not, use the host's question mechanism to warn with the cost of skipping:
54
54
 
55
55
  "Backlog hasn't been verified yet. Recommended: run `/feature-forge:forge-verify {feature}` first — the loop implements items autonomously and commits as it goes, so a bad item (wrong scope, missing dependency, untestable acceptance criteria) is far cheaper to catch now than after several commits build on it. Continue anyway?" Offer **Verify first (recommended)** · **Continue without verifying**.
56
56
 
@@ -61,7 +61,7 @@ Read the resolved feature's `.pipeline-state.json`. **If it has no `epic` key, s
61
61
  1. Run `render-status "{epic}" --specs-dir "{specsDir}" --json` via the helper:
62
62
 
63
63
  ```bash
64
- R="$(for d in "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done)"
64
+ R="$(bash -c 'for d in "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done')"
65
65
  [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
66
66
  python3 "$R/scripts/epic-manifest.py" \
67
67
  render-status "{epic}" --specs-dir "{specsDir}" --json
@@ -197,7 +197,7 @@ Then commit this state write before launching (mandatory). The runner refuses to
197
197
 
198
198
  ### 3b. Launch Background Process
199
199
 
200
- Launch the loop **backgrounded** (the host's background-execution mechanism) so it survives session end and does not block the session, and prefer the machine-readable event stream (`loopRunner.eventStreamCommand`, default for rauf) redirected to a stable `events.ndjson` so the session can supervise it live; fall back to the plain `runCommand` (tailing the human log) when no `eventStreamCommand` is configured. The background task's exit notification is the single authoritative terminal signal (Step 4). Loop runs can take significant time (minutes to hours depending on backlog size). For the exact launch commands (incl. the `mkdir -p` state-dir guard) and the event-stream vs. log-fallback detail, read `references/runner-contract.md`.
200
+ Launch the loop **backgrounded** (the host's background-execution mechanism) so it survives session end and does not block the session. For a runner that **persists its own structured event file** (the default — rauf writes `{stateDir}/events.ndjson` natively and rotates it per run), launch the **plain `runCommand`** with **no stdout redirect** and supervise the runner's **native** `events.ndjson` directly; do **not** redirect `--ndjson` into `{stateDir}` (it is redundant and collides with the runner's own writer — see `references/runner-contract.md`). Only a stdout-only runner (no native event file) uses `eventStreamCommand`, redirected to a file **outside** `{stateDir}`. The background task's exit notification is the single authoritative terminal signal (Step 4). Loop runs can take significant time (minutes to hours depending on backlog size). For the exact launch commands (incl. the `mkdir -p` state-dir guard) and the self-persisting vs. stdout-only detail, read `references/runner-contract.md`.
201
201
 
202
202
  ### 3c. Inform User
203
203
 
@@ -211,7 +211,7 @@ verbatim "Loop started…" inform-user output template is in
211
211
 
212
212
  ### 3d. Arm a Monitor on the event stream, and react to events
213
213
 
214
- Arm the **the host's monitoring mechanism** on the structured event stream (the NDJSON file, or the
214
+ Arm the **host's monitoring mechanism** on the structured event stream (the NDJSON file, or the
215
215
  human log as fallback) so events flow back into this session as they happen. Use
216
216
  **`persistent: true`** — runs can exceed the host's monitoring mechanism's maximum `timeout_ms` (1 hour),
217
217
  and a bounded timeout would silently stop watching a still-running loop. The filter
@@ -259,11 +259,7 @@ output templates — **all-done**, **needs-human**, **blocked**, **deferred**, a
259
259
 
260
260
  Update `{resolvedFeatureDir}/.pipeline-state.json`:
261
261
 
262
- 1. Set `stages.forge-5-loop`:
263
- - `status`: `"complete"` if all backlog items are `done`, otherwise `"in-progress"`
264
- - `completedAt`: current ISO timestamp (only if complete)
265
- - `basedOnVersions`: `{"forge-4-backlog": <current version from pipeline state>}`
266
- - `artifacts`: `["{backlogDir}/{loopRunner.stateDir}/state.json"]`
262
+ 1. Set `stages.forge-5-loop`: `status` = `"complete"` if all backlog items are `done`, else `"in-progress"`; `completedAt` = current ISO timestamp (only if complete); `basedOnVersions` = `{"forge-4-backlog": <current version from pipeline state>}`; `artifacts` = `["{backlogDir}/{loopRunner.stateDir}/state.json"]`.
267
263
  2. If all items complete: set `currentStage` to `"forge-6-docs"`
268
264
  3. Update `updatedAt`
269
265
 
@@ -277,29 +273,32 @@ Update `{resolvedFeatureDir}/.pipeline-state.json`:
277
273
 
278
274
  **Gate:** only run this step if (a) the resolved feature's `.pipeline-state.json` has an `epic` key **and** (b) Step 5 set `stages.forge-5-loop.status` to `complete` (all backlog items done). If either is false, **skip** — standalone completed features are handled by Step 5b, and partial runs end as today (REQ-COMPAT-01).
279
275
 
280
- 1. **Offer impl-verify first (recommended, skippable).** Per the completion rule (`00-core-definitions.md §7`), a feature whose `forge-verify-impl.status == findings-reported` does **not** unblock dependents. Use the host's question mechanism (NOT inline prose) to offer:
281
-
282
- > "{feature}'s loop is done. Recommended: run `/feature-forge:forge-verify {feature} impl` before unblocking dependents. Run it now, or skip and continue the handoff?"
283
-
284
- The user may skip (then completion is judged on the §7 rule with impl-verify absent).
276
+ 1. **Offer impl-verify first (recommended, skippable).** Per the completion rule (`00-core-definitions.md §7`), a feature whose `forge-verify-impl.status == findings-reported` does **not** unblock dependents. Use the host's question mechanism (NOT inline prose) to offer: *"{feature}'s loop is done. Recommended: run `/feature-forge:forge-verify {feature} impl` before unblocking dependents. Run it now, or skip and continue the handoff?"* The user may skip (then completion is judged on the §7 rule with impl-verify absent).
285
277
  2. **Recompute and announce.** Run `render-status "{epic}" --specs-dir "{specsDir}" --json`. Announce the feature's completion and the epic rollup (e.g. "2/4 features complete") — derived live from disk, never re-computed in prose.
286
- 3. **Identify the next actionable feature(s).** Read `render-status`'s `actionable` set (features whose every dependency is now complete and that are not themselves complete) and `nextCommand`.
287
- - **None actionable** (everything done, or remaining features still blocked): say so.
288
- - If `rollup.total > 0` **AND** `rollup.complete == rollup.total`, suggest `/feature-forge:forge-6-docs {feature}` and note the epic-level documentation offer (§10). The `rollup.total > 0` guard prevents an **empty epic** (`0 == 0`) from being reported complete.
289
- - Otherwise, list what is still blocked and on which dependencies. End — do not prompt to start a feature that cannot start.
290
- - **One or more actionable:** use the host's question mechanism presenting **each actionable feature** as an option (plus "stop here"). Execution is **serial** — the user picks exactly one (REQ-ORCH-03). Do **not** autonomously chain into the next pipeline.
291
- 4. **Begin the chosen feature.** For the picked feature:
292
- - **PRD absent** (no `PRD.md`, or `stages.forge-1-prd` not complete): offer to author it now — "Start `/feature-forge:forge-1-prd {chosen}`?" (REQ-ORCH-02). On yes, hand off to forge-1-prd (which injects epic context per §5.1).
293
- - **PRD present:** point the user at the chosen feature's `nextCommand` from render-status.
278
+ 3. **Identify the next actionable feature(s).** Read `render-status`'s `actionable` set (every dependency now complete, not itself complete) and `nextCommand`. **None actionable:** say so — if `rollup.total > 0` **AND** `rollup.complete == rollup.total`, suggest `/feature-forge:forge-6-docs {feature}` and note the epic-level documentation offer (§10) (the `rollup.total > 0` guard prevents an **empty epic** `0 == 0` from reading as complete); otherwise list what is still blocked and on which dependencies, then end (do not prompt to start a feature that cannot start). **One or more actionable:** use the host's question mechanism presenting **each actionable feature** as an option (plus "stop here"). Execution is **serial** — the user picks exactly one (REQ-ORCH-03); do **not** autonomously chain into the next pipeline.
279
+ 4. **Begin the chosen feature.** **PRD absent** (no `PRD.md`, or `stages.forge-1-prd` not complete): offer to author it now — "Start `/feature-forge:forge-1-prd {chosen}`?" (REQ-ORCH-02); on yes, hand off to forge-1-prd (which injects epic context per §5.1). **PRD present:** point the user at the chosen feature's `nextCommand` from render-status.
294
280
  5. **Commit (REQ-OBS-01).** When `gitCommitAfterStage` is true, commit the Step 5 completion write (and any manifest `updatedAt` bump) via the shared-conventions **Git Commit Protocol**, staging the epic subtree so the member state change commits atomically: `git add {specsDir}/{epic}/` then `{commitPrefix}({feature}): complete loop`. If `gitCommitAfterStage` is false, skip the commit.
281
+ 6. **Close the handoff with the Stage Exit Protocol.** Finishing feature `{feature}` → starting the picked feature `{chosen}`'s PRD is a **cold** stage boundary (single-sourced in `references/stage-exit-protocol.md`). Feature `{feature}`'s impl-verify was already offered in Step 6.1, so step 1's gate self-suppresses when it ran or was skipped — the block collapses to clear your session / start a fresh session → next-command. Present it only when the chosen feature's PRD is absent (a PRD-present pick just runs its `nextCommand`):
282
+
283
+ **This stage is done — walk the user through the Stage Exit Protocol** before moving on. The order is fixed, and step 2 is something only the user can do:
284
+
285
+ 1. **Verify feature {feature}'s loop first — if it isn't already verified.** When this stage has no fresh verification on record (`verifyState` is **missing or stale**) **and** `autoVerify` is off for it, verify **now, before clearing**. If verify already ran, is pending under auto-verify, or the stage was explicitly skipped, say so and go straight to step 2. Present the **Standard Verify Gate** using the host's question mechanism with exactly these three options — but only when the host has a question mechanism **and** the clean-room path is available (the host's subagent mechanism plus a dispatchable `forge-verifier` subagent):
286
+ - **Verify feature {feature}'s loop now** *(recommended)* — dispatch the clean-room `forge-verifier` subagent from this session in require-clean mode; the digest returns here so any fix decision keeps its context. One-time — it does **not** change config.
287
+ - **Verify now + enable auto-verify going forward** — verify now **and** patch `"autoVerify": true` into `forge.config.json` in place (preserve formatting and every other key) so future stages verify automatically, no prompt. This complements the `forge-init` opt-in. **Do not auto-commit this config change** — treat it like `notes`: a user-facing edit the user commits on their own cadence, never folded into a stage's artifact commit.
288
+ - **Skip for now** — go straight to clear your session / start a fresh session and the next command without verifying. Record this stage's verify status as `"skipped"` in pipeline state (mirroring the existing skip handling) **only** on an explicit skip — a skip does not go stale.
289
+
290
+ **Host / clean-room fallback (not a user-selectable option):** if the question mechanism, the host's subagent mechanism, or the `forge-verifier` subagent is unavailable, do **not** run clean-room — degrade to printing `/feature-forge:forge-verify {feature} impl` for the user to run inline/manually (mirroring `autoInvokeNextStage`), and offer the auto-verify enable as plain text only if a config write is possible.
291
+ 2. **Then clear your session / start a fresh session.** Recommended **unconditionally** at this boundary for a clean start — independent of how full the context window is. Every artifact is on disk, so the work survives the clear. **I can't clear your session / start a fresh session for you — you have to run it yourself.**
292
+ 3. **Then run `/feature-forge:forge-1-prd {chosen}`** in the fresh session — or re-run `/feature-forge:forge` to let the navigator resume from disk.
295
293
 
296
294
  ## Gotchas
297
295
 
296
+ - **Plugin-root discovery (1b-epic helper) covers installed paths, not workspace-dev checkouts.** The `forge-root.sh` search in 1b-epic probes `~/.claude/skills/feature-forge`, `~/.claude/plugins/*/feature-forge`, and `./.agents/skills/feature-forge` — the locations of an **installed** plugin. A feature-forge **source checkout** (e.g. `~/workspace/feature-forge`) is not on that list, so the helper exits "cannot locate plugin root." That is expected in a dev environment, not a bug; run the epic-manifest script from the checkout directly (`python3 <checkout>/scripts/epic-manifest.py …`). The bootstrap prelude wraps its candidate loop in `bash -c` so the `~/.claude/plugins/*/feature-forge` glob is zsh-safe: an empty expansion no longer aborts the loop under zsh's `nomatch`.
298
297
  - `{backlogDir}` is a **directory path**, not a file path. Pass `specs/auth`, not `specs/auth/backlog.json`.
299
298
  - rauf resolves `RAUF.md` with fallback: checks `{backlogDir}/.rauf/RAUF.md` first, then the project's `.rauf/RAUF.md`. As long as the runner is installed in the project, the prompt template will be found.
300
299
  - State files (state.json, {loopRunner.logFile}, etc.) are created at `{backlogDir}/{loopRunner.stateDir}/` — this is within the feature's spec directory and is expected. State is isolated per backlog dir, so concurrent features don't collide.
301
300
  - If the session disconnects during a long-running loop, the runner process continues independently. The user can check results later with the status / list commands.
302
- - Never run the run command in the foreground (without the host's background-execution mechanism) — it blocks and will hit the Bash tool timeout for any non-trivial backlog. "Don't block the foreground" is NOT "stay silent": supervise via the host's monitoring mechanism (3d), never `sleep`/poll in the foreground. The the host's monitoring mechanism must use `persistent: true` (not a bounded `timeout_ms`), watch the **structured** surface (`events.ndjson`), and never filter on raw `RAUF_*` tokens — they appear in agent prose and false-match. A `needs_human`/`blocked`/`review` signal does **not** pause the loop — the runner sets the item aside and keeps going; surface it live but don't tell the user the loop is waiting. See `references/runner-contract.md` for the full monitoring rules.
301
+ - Never run the run command in the foreground (without the host's background-execution mechanism) — it blocks and will hit the Bash tool timeout for any non-trivial backlog. "Don't block the foreground" is NOT "stay silent": supervise via the host's monitoring mechanism (3d), never `sleep`/poll in the foreground. The host's monitoring mechanism must use `persistent: true` (not a bounded `timeout_ms`), watch the **structured** surface (`events.ndjson`), and never filter on raw `RAUF_*` tokens — they appear in agent prose and false-match. A `needs_human`/`blocked`/`review` signal does **not** pause the loop — the runner sets the item aside and keeps going; surface it live but don't tell the user the loop is waiting. See `references/runner-contract.md` for the full monitoring rules.
303
302
  - If a previous loop run left a stale lock, the user may need to pass `--force` to clear it. rauf will report this error clearly.
304
303
  - The version gate (1c) uses the `--json` form on purpose; never parse `rauf version`'s human output.
305
304
  - **Implementation artifacts must not cite specs.** The loop should **read** the specs and `backlog.json` freely — they are the source of truth for what to build, and the backlog rightly references specs for provenance. But the artifacts the loop **writes into the target repo** (source code, generated `SKILL.md`/agent files, configs, code comments) must be **self-contained**: they must NOT reference feature-forge spec files (no `See specs/{feature}/NN-*.md`, no "source spec" provenance notes in shipped output). Specs are pre-implementation inputs that may be archived or deleted once the feature ships; the implementation must stand on its own. This applies only to shipped implementation output — never to the backlog or spec documents, which should keep citing specs.
@@ -4,15 +4,20 @@ These are the five verbatim result-report output templates for **Step 4b** of
4
4
  `forge-5-loop/SKILL.md`. Pick **every** branch that applies (a run can be both
5
5
  blocked and needs-human) and render its report.
6
6
 
7
- **All items done:**
7
+ **All items done.** Print the completion summary, then close with the **warm-acceptable
8
+ variant** of the Stage Exit Protocol (single-sourced in
9
+ `references/stage-exit-protocol.md`) — the `forge-5-loop → forge-6-docs` boundary is the
10
+ one place where clearing before the next stage is optional:
8
11
  ```
9
12
  Loop completed for {feature}. All {N} items implemented successfully.
10
-
11
- Next steps:
12
- - /feature-forge:forge-verify {feature} impl Verify the implementation
13
- - /feature-forge:forge-6-docs {feature} Generate architecture docs
14
13
  ```
15
14
 
15
+ **The loop is complete — this is the one boundary where clearing before the next stage is optional.**
16
+
17
+ 1. **Verify is already offered above.** Impl-verify is offered interactively right after this report (Step 5b for a standalone feature, Step 6.1 for an epic member) — run it there rather than as a second gate. It runs clean-room, so it needs no fresh session.
18
+ 2. **Clearing is optional here — warm is fine.** `forge-6-docs` benefits from the still-warm context of what the loop actually did, so continuing in this same session is the easy default. A cold start also works — every artifact is on disk — but there is no need to force it.
19
+ 3. **Then run `/feature-forge:forge-6-docs {feature}`** — in this warm session, or a fresh one if you prefer.
20
+
16
21
  **Runner review pass.** A review flag (e.g. rauf's `--review`) makes the runner run
17
22
  a post-loop review that **auto-creates and implements fix items** rather than handing
18
23
  findings to the user — distinct from `forge-verify impl` (a clean-context audit that