@garygentry/feature-forge 0.2.3 → 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 (149) 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 +25 -3
  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 +14 -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 +7 -1
  12. package/adapters/claude/scripts/forge-session.py +175 -30
  13. package/adapters/claude/skills/forge/SKILL.md +28 -14
  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 +19 -21
  22. package/adapters/claude/skills/forge-5-loop/references/result-reporting.md +10 -5
  23. package/adapters/claude/skills/forge-6-docs/SKILL.md +6 -6
  24. package/adapters/claude/skills/forge-bootstrap/SKILL.md +4 -4
  25. package/adapters/claude/skills/forge-fix/SKILL.md +27 -6
  26. package/adapters/claude/skills/forge-guide/SKILL.md +179 -0
  27. package/adapters/claude/skills/forge-init/SKILL.md +28 -1
  28. package/adapters/claude/skills/forge-verify/SKILL.md +46 -15
  29. package/adapters/claude/skills/forge-verify/references/verification-checklists.md +1 -1
  30. package/adapters/codex/references/forge-config-schema.json +25 -3
  31. package/adapters/codex/references/pipeline-state-schema.json +3 -2
  32. package/adapters/codex/references/portable-root.md +2 -2
  33. package/adapters/codex/references/process-overview.md +10 -0
  34. package/adapters/codex/references/shared-conventions.md +14 -9
  35. package/adapters/codex/references/stage-exit-protocol.md +99 -0
  36. package/adapters/codex/scripts/epic-manifest.py +10 -0
  37. package/adapters/codex/scripts/forge-bootstrap.py +94 -16
  38. package/adapters/codex/scripts/forge-init.sh +7 -1
  39. package/adapters/codex/scripts/forge-session.py +175 -30
  40. package/adapters/codex/skills/forge/SKILL.md +33 -19
  41. package/adapters/codex/skills/forge-0-epic/SKILL.md +21 -16
  42. package/adapters/codex/skills/forge-0-epic/references/edit-mode.md +6 -4
  43. package/adapters/codex/skills/forge-0-epic/references/epic-manifest-subcommands.md +1 -1
  44. package/adapters/codex/skills/forge-1-prd/SKILL.md +14 -4
  45. package/adapters/codex/skills/forge-2-tech/SKILL.md +15 -4
  46. package/adapters/codex/skills/forge-3-specs/SKILL.md +14 -3
  47. package/adapters/codex/skills/forge-4-backlog/SKILL.md +16 -5
  48. package/adapters/codex/skills/forge-5-loop/SKILL.md +21 -23
  49. package/adapters/codex/skills/forge-5-loop/references/result-reporting.md +10 -5
  50. package/adapters/codex/skills/forge-6-docs/SKILL.md +6 -6
  51. package/adapters/codex/skills/forge-bootstrap/SKILL.md +4 -4
  52. package/adapters/codex/skills/forge-fix/SKILL.md +27 -6
  53. package/adapters/codex/skills/forge-guide/SKILL.md +188 -0
  54. package/adapters/codex/skills/forge-init/SKILL.md +28 -1
  55. package/adapters/codex/skills/forge-verify/SKILL.md +45 -14
  56. package/adapters/codex/skills/forge-verify/references/verification-checklists.md +1 -1
  57. package/adapters/copilot/references/forge-config-schema.json +25 -3
  58. package/adapters/copilot/references/pipeline-state-schema.json +3 -2
  59. package/adapters/copilot/references/portable-root.md +2 -2
  60. package/adapters/copilot/references/process-overview.md +10 -0
  61. package/adapters/copilot/references/shared-conventions.md +14 -9
  62. package/adapters/copilot/references/stage-exit-protocol.md +99 -0
  63. package/adapters/copilot/scripts/epic-manifest.py +10 -0
  64. package/adapters/copilot/scripts/forge-bootstrap.py +94 -16
  65. package/adapters/copilot/scripts/forge-init.sh +7 -1
  66. package/adapters/copilot/scripts/forge-session.py +175 -30
  67. package/adapters/copilot/skills/forge/forge.md +33 -19
  68. package/adapters/copilot/skills/forge-0-epic/forge-0-epic.md +21 -16
  69. package/adapters/copilot/skills/forge-0-epic/references/edit-mode.md +6 -4
  70. package/adapters/copilot/skills/forge-0-epic/references/epic-manifest-subcommands.md +1 -1
  71. package/adapters/copilot/skills/forge-1-prd/forge-1-prd.md +14 -4
  72. package/adapters/copilot/skills/forge-2-tech/forge-2-tech.md +15 -4
  73. package/adapters/copilot/skills/forge-3-specs/forge-3-specs.md +14 -3
  74. package/adapters/copilot/skills/forge-4-backlog/forge-4-backlog.md +16 -5
  75. package/adapters/copilot/skills/forge-5-loop/forge-5-loop.md +21 -23
  76. package/adapters/copilot/skills/forge-5-loop/references/result-reporting.md +10 -5
  77. package/adapters/copilot/skills/forge-6-docs/forge-6-docs.md +6 -6
  78. package/adapters/copilot/skills/forge-bootstrap/forge-bootstrap.md +4 -4
  79. package/adapters/copilot/skills/forge-fix/forge-fix.md +27 -6
  80. package/adapters/copilot/skills/forge-guide/forge-guide.md +188 -0
  81. package/adapters/copilot/skills/forge-init/forge-init.md +28 -1
  82. package/adapters/copilot/skills/forge-verify/forge-verify.md +45 -14
  83. package/adapters/copilot/skills/forge-verify/references/verification-checklists.md +1 -1
  84. package/adapters/cursor/references/forge-config-schema.json +25 -3
  85. package/adapters/cursor/references/pipeline-state-schema.json +3 -2
  86. package/adapters/cursor/references/portable-root.md +2 -2
  87. package/adapters/cursor/references/process-overview.md +10 -0
  88. package/adapters/cursor/references/shared-conventions.md +14 -9
  89. package/adapters/cursor/references/stage-exit-protocol.md +99 -0
  90. package/adapters/cursor/scripts/epic-manifest.py +10 -0
  91. package/adapters/cursor/scripts/forge-bootstrap.py +94 -16
  92. package/adapters/cursor/scripts/forge-init.sh +7 -1
  93. package/adapters/cursor/scripts/forge-session.py +175 -30
  94. package/adapters/cursor/skills/forge/forge.mdc +33 -19
  95. package/adapters/cursor/skills/forge-0-epic/forge-0-epic.mdc +21 -16
  96. package/adapters/cursor/skills/forge-0-epic/references/edit-mode.md +6 -4
  97. package/adapters/cursor/skills/forge-0-epic/references/epic-manifest-subcommands.md +1 -1
  98. package/adapters/cursor/skills/forge-1-prd/forge-1-prd.mdc +14 -4
  99. package/adapters/cursor/skills/forge-2-tech/forge-2-tech.mdc +15 -4
  100. package/adapters/cursor/skills/forge-3-specs/forge-3-specs.mdc +14 -3
  101. package/adapters/cursor/skills/forge-4-backlog/forge-4-backlog.mdc +16 -5
  102. package/adapters/cursor/skills/forge-5-loop/forge-5-loop.mdc +21 -23
  103. package/adapters/cursor/skills/forge-5-loop/references/result-reporting.md +10 -5
  104. package/adapters/cursor/skills/forge-6-docs/forge-6-docs.mdc +6 -6
  105. package/adapters/cursor/skills/forge-bootstrap/forge-bootstrap.mdc +4 -4
  106. package/adapters/cursor/skills/forge-fix/forge-fix.mdc +27 -6
  107. package/adapters/cursor/skills/forge-guide/forge-guide.mdc +189 -0
  108. package/adapters/cursor/skills/forge-init/forge-init.mdc +28 -1
  109. package/adapters/cursor/skills/forge-verify/forge-verify.mdc +45 -14
  110. package/adapters/cursor/skills/forge-verify/references/verification-checklists.md +1 -1
  111. package/adapters/gemini/gemini-extension.json +4 -0
  112. package/adapters/gemini/references/forge-config-schema.json +25 -3
  113. package/adapters/gemini/references/pipeline-state-schema.json +3 -2
  114. package/adapters/gemini/references/portable-root.md +2 -2
  115. package/adapters/gemini/references/process-overview.md +10 -0
  116. package/adapters/gemini/references/shared-conventions.md +14 -9
  117. package/adapters/gemini/references/stage-exit-protocol.md +99 -0
  118. package/adapters/gemini/scripts/epic-manifest.py +10 -0
  119. package/adapters/gemini/scripts/forge-bootstrap.py +94 -16
  120. package/adapters/gemini/scripts/forge-init.sh +7 -1
  121. package/adapters/gemini/scripts/forge-session.py +175 -30
  122. package/adapters/gemini/skills/forge/forge.md +33 -19
  123. package/adapters/gemini/skills/forge-0-epic/forge-0-epic.md +21 -16
  124. package/adapters/gemini/skills/forge-0-epic/references/edit-mode.md +6 -4
  125. package/adapters/gemini/skills/forge-0-epic/references/epic-manifest-subcommands.md +1 -1
  126. package/adapters/gemini/skills/forge-1-prd/forge-1-prd.md +14 -4
  127. package/adapters/gemini/skills/forge-2-tech/forge-2-tech.md +15 -4
  128. package/adapters/gemini/skills/forge-3-specs/forge-3-specs.md +14 -3
  129. package/adapters/gemini/skills/forge-4-backlog/forge-4-backlog.md +16 -5
  130. package/adapters/gemini/skills/forge-5-loop/forge-5-loop.md +21 -23
  131. package/adapters/gemini/skills/forge-5-loop/references/result-reporting.md +10 -5
  132. package/adapters/gemini/skills/forge-6-docs/forge-6-docs.md +6 -6
  133. package/adapters/gemini/skills/forge-bootstrap/forge-bootstrap.md +4 -4
  134. package/adapters/gemini/skills/forge-fix/forge-fix.md +27 -6
  135. package/adapters/gemini/skills/forge-guide/forge-guide.md +188 -0
  136. package/adapters/gemini/skills/forge-init/forge-init.md +28 -1
  137. package/adapters/gemini/skills/forge-verify/forge-verify.md +45 -14
  138. package/adapters/gemini/skills/forge-verify/references/verification-checklists.md +1 -1
  139. package/dist/apply.js +34 -8
  140. package/dist/cli.js +40 -4
  141. package/dist/fsutil.d.ts +0 -12
  142. package/dist/fsutil.js +10 -1
  143. package/dist/manifest.d.ts +1 -1
  144. package/dist/plan.js +22 -2
  145. package/dist/rauf.d.ts +4 -4
  146. package/dist/rauf.js +3 -3
  147. package/dist/report.js +1 -1
  148. package/dist/types.d.ts +1 -1
  149. package/package.json +1 -1
@@ -19,7 +19,7 @@ question in inline prose — every question goes through the host's question mec
19
19
 
20
20
  Read and follow `references/shared-conventions.md` for:
21
21
  - the **Feature Name Requirement** (applied here to the *epic* name — see below),
22
- - the **User Input Protocol** (the the host's question mechanism guardrail — all questions go through the tool),
22
+ - the **User Input Protocol** (the host's question mechanism guardrail — all questions go through the tool),
23
23
  - **Configuration Reading**, and
24
24
  - the **Git Commit Protocol**.
25
25
 
@@ -38,7 +38,7 @@ checks but still load any on-disk artifacts.
38
38
  plugin path and the configured specs dir:
39
39
 
40
40
  ```bash
41
- 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)"
41
+ 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')"
42
42
  [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
43
43
  python3 "$R/scripts/epic-manifest.py" <subcommand> ... --specs-dir "{specsDir}"
44
44
  ```
@@ -72,14 +72,14 @@ Resolve the epic subtree path `{specsDir}/{epic}/` and decide which branch to ru
72
72
  epic, confirm the epic name itself does not collide with any existing feature or epic:
73
73
 
74
74
  ```bash
75
- 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)"
75
+ 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')"
76
76
  [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
77
77
  python3 "$R/scripts/epic-manifest.py" check-name "{epic}" --specs-dir "{specsDir}"
78
78
  ```
79
79
 
80
80
  - Exit `0` → the name is free; proceed to C1.
81
81
  - Exit `1` (`duplicate-name`) → STOP and surface the helper's finding **verbatim**; ask
82
- (via the host's question mechanism) for a different epic name, then re-run check-name.
82
+ for a different epic name, then re-run check-name.
83
83
  - Exit `2` (unsafe name) → STOP and surface the finding; ask for a corrected name.
84
84
 
85
85
  ---
@@ -116,14 +116,14 @@ For **each** proposed feature name, before accepting it into the set, enforce gl
116
116
  and name safety via the helper:
117
117
 
118
118
  ```bash
119
- 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)"
119
+ 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')"
120
120
  [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
121
121
  python3 "$R/scripts/epic-manifest.py" check-name "{feature}" --specs-dir "{specsDir}"
122
122
  ```
123
123
 
124
124
  - Exit `0` → accept the name.
125
125
  - Exit `1` (`duplicate-name`) → reject that name; surface the finding verbatim and re-prompt
126
- (via the host's question mechanism) for a different name.
126
+ for a different name.
127
127
  - Exit `2` (`unsafe-name`) → reject; surface the finding and re-prompt.
128
128
 
129
129
  Never accept a feature name that has not passed `check-name` exit 0.
@@ -176,7 +176,7 @@ For the *initial* creation write the skill writes the file directly — atomic g
176
176
  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:
177
177
 
178
178
  ```bash
179
- 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)"
179
+ 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')"
180
180
  [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
181
181
  python3 "$R/scripts/epic-manifest.py" validate "{epic}" --specs-dir "{specsDir}" --json
182
182
  ```
@@ -247,18 +247,23 @@ now self-contained: manifest + EPIC.md + one subdirectory per member.
247
247
  captures `epic-manifest.json`, `EPIC.md`, and all member `.pipeline-state.json` files
248
248
  atomically.
249
249
  - Commit with message `"{commitPrefix}({epic}): create epic with {N} features"`.
250
- - On success, capture the commit hash. On failure (pre-commit hook, conflict), report and do
251
- not mark complete; never use `--no-verify`/`--force`.
250
+ - On success, capture the commit hash for the closing message only — the epic manifest has no
251
+ `commitHash` field, so nothing is written back into a committed file and the two-commit step of
252
+ the Git Commit Protocol does not apply here. On failure (pre-commit hook, conflict), report and
253
+ do not mark complete; never use `--amend`/`--no-verify`/`--force`.
252
254
 
253
- 3. **Closing message.** After a successful creation, tell the user the next steps:
255
+ 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):
254
256
 
255
- > Epic `{epic}` created with {N} features. Next steps:
256
- > - `/feature-forge:forge {epic}` to see the epic dashboard
257
- > - `/feature-forge:forge-verify {epic}` to verify the epic
258
- > - `/feature-forge:forge-1-prd {first-actionable-feature}` to start the first feature
257
+ **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:
259
258
 
260
- The first-actionable feature is any feature with empty `dependsOn` (or the first entry of
261
- `render-status`'s `actionable` set).
259
+ 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):
260
+ - **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.
261
+ - **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.
262
+ - **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.
263
+
264
+ **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.
265
+ 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.**
266
+ 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.
262
267
 
263
268
  ---
264
269
 
@@ -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}" \
@@ -109,10 +109,20 @@ Write pipeline state conforming to `references/pipeline-state-schema.json`.
109
109
  - Record `artifacts`, `completedAt`
110
110
  - Set `stages.forge-1-prd.basedOnVersions` to `{}` (no upstream dependencies)
111
111
  - 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`.
112
- 2. Use the host's question mechanism to ask: "Anything you want to note before we wrap? (preserved across sessions)"
113
- - If yes, store in the `notes` field
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}"`, then set `stages.forge-1-prd.status` to `complete` with commit hash only on success. If commit fails, leave status as `in-progress`.
115
- 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"
112
+ 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.
113
+ 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`.
114
+ 4. **Close with the Stage Exit Protocol** (single-sourced in `references/stage-exit-protocol.md`; do not improvise a "Next steps" list):
115
+
116
+ **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:
117
+
118
+ 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):
119
+ - **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.
120
+ - **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.
121
+ - **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.
122
+
123
+ **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.
124
+ 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.**
125
+ 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.
116
126
 
117
127
  ## Gotchas
118
128
 
@@ -87,7 +87,7 @@ Interview the user about technology decisions. Unlike the PRD interview, here yo
87
87
  - 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.
88
88
  - 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).
89
89
  - Ask about every integration point and how the feature interacts with existing modules.
90
- - For competing module structures or code-shape choices, use the the host's question mechanism `preview` field to show the candidates side-by-side.
90
+ - For competing module structures or code-shape choices, use the host's question mechanism `preview` field to show the candidates side-by-side.
91
91
 
92
92
  **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."
93
93
 
@@ -186,9 +186,20 @@ Write pipeline state conforming to `references/pipeline-state-schema.json`.
186
186
  - Record `artifacts`, `completedAt`, `version`
187
187
  - Set `stages.forge-2-tech.basedOnVersions` to `{"forge-1-prd": <current forge-1-prd version>}`
188
188
  - 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`
189
- 2. Use the host's question mechanism to ask about notes to persist
190
- 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`.
191
- 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"
189
+ 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.
190
+ 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`.
191
+ 4. **Close with the Stage Exit Protocol** (single-sourced in `references/stage-exit-protocol.md`; do not improvise a "Next steps" list):
192
+
193
+ **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:
194
+
195
+ 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):
196
+ - **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.
197
+ - **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.
198
+ - **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.
199
+
200
+ **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.
201
+ 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.**
202
+ 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.
192
203
 
193
204
  ## Gotchas
194
205
 
@@ -140,9 +140,20 @@ Write pipeline state conforming to `references/pipeline-state-schema.json`.
140
140
  - Record all created files in `artifacts`, including `TRACEABILITY.md`
141
141
  - Set `stages.forge-3-specs.basedOnVersions` to `{"forge-1-prd": <current version>, "forge-2-tech": <current version>}`
142
142
  - Check downstream stages (forge-4-backlog, forge-5-loop, forge-6-docs). If any have `basedOnVersions` referencing older versions, set their status to `stale`
143
- 2. Use the host's question mechanism to ask about notes to persist
144
- 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`.
145
- 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"
143
+ 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.
144
+ 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`.
145
+ 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:
146
+
147
+ **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:
148
+
149
+ 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):
150
+ - **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.
151
+ - **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.
152
+ - **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.
153
+
154
+ **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.
155
+ 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.**
156
+ 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.
146
157
 
147
158
  ## Gotchas
148
159
 
@@ -38,7 +38,7 @@ Resolve the **loop runner** from the `loopRunner` block in `forge.config.json`,
38
38
 
39
39
  **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.
40
40
 
41
- **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**.
41
+ **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**.
42
42
 
43
43
  ## Step 2: Load All Specs
44
44
 
@@ -122,7 +122,7 @@ Interpret the result:
122
122
 
123
123
  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).
124
124
 
125
- Use the host's question mechanism to ask: "Ready to proceed, or any adjustments needed?"
125
+ 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.
126
126
 
127
127
  ## Step 7: Update Pipeline State and Commit
128
128
 
@@ -133,10 +133,21 @@ Write pipeline state conforming to `references/pipeline-state-schema.json`. Foll
133
133
  - Set `stages.forge-4-backlog.basedOnVersions` to `{"forge-1-prd": <current version>, "forge-2-tech": <current version>, "forge-3-specs": <current version>}`
134
134
  - Set `currentStage` to `forge-5-loop`
135
135
  - 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`.
136
- 2. Use the host's question mechanism to ask about notes to persist
137
- 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`.
136
+ 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.
137
+ 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`.
138
138
  4. If verification was available but the user chose to skip it, record `stages.forge-verify-backlog.status` as `"skipped"` in pipeline state.
139
- 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"
139
+ 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:
140
+
141
+ **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:
142
+
143
+ 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):
144
+ - **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.
145
+ - **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.
146
+ - **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.
147
+
148
+ **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.
149
+ 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.**
150
+ 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.
140
151
 
141
152
  ## Gotchas
142
153
 
@@ -49,7 +49,7 @@ Read `{resolvedFeatureDir}/.pipeline-state.json`. If not in force mode, `stages.
49
49
 
50
50
  ### 1b. Verification Check
51
51
 
52
- Check if `stages.forge-verify-backlog` exists and has status `passed` or `findings-applied`. If not, use the host's question mechanism to warn:
52
+ 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:
53
53
 
54
54
  "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**.
55
55
 
@@ -60,7 +60,7 @@ Read the resolved feature's `.pipeline-state.json`. **If it has no `epic` key, s
60
60
  1. Run `render-status "{epic}" --specs-dir "{specsDir}" --json` via the helper:
61
61
 
62
62
  ```bash
63
- 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)"
63
+ 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')"
64
64
  [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
65
65
  python3 "$R/scripts/epic-manifest.py" \
66
66
  render-status "{epic}" --specs-dir "{specsDir}" --json
@@ -210,7 +210,7 @@ verbatim "Loop started…" inform-user output template is in
210
210
 
211
211
  ### 3d. Arm a Monitor on the event stream, and react to events
212
212
 
213
- Arm the **the host's monitoring mechanism** on the structured event stream (the NDJSON file, or the
213
+ Arm the **host's monitoring mechanism** on the structured event stream (the NDJSON file, or the
214
214
  human log as fallback) so events flow back into this session as they happen. Use
215
215
  **`persistent: true`** — runs can exceed the host's monitoring mechanism's maximum `timeout_ms` (1 hour),
216
216
  and a bounded timeout would silently stop watching a still-running loop. The filter
@@ -258,11 +258,7 @@ output templates — **all-done**, **needs-human**, **blocked**, **deferred**, a
258
258
 
259
259
  Update `{resolvedFeatureDir}/.pipeline-state.json`:
260
260
 
261
- 1. Set `stages.forge-5-loop`:
262
- - `status`: `"complete"` if all backlog items are `done`, otherwise `"in-progress"`
263
- - `completedAt`: current ISO timestamp (only if complete)
264
- - `basedOnVersions`: `{"forge-4-backlog": <current version from pipeline state>}`
265
- - `artifacts`: `["{backlogDir}/{loopRunner.stateDir}/state.json"]`
261
+ 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"]`.
266
262
  2. If all items complete: set `currentStage` to `"forge-6-docs"`
267
263
  3. Update `updatedAt`
268
264
 
@@ -276,30 +272,32 @@ Update `{resolvedFeatureDir}/.pipeline-state.json`:
276
272
 
277
273
  **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).
278
274
 
279
- 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:
280
-
281
- > "{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?"
282
-
283
- The user may skip (then completion is judged on the §7 rule with impl-verify absent).
275
+ 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).
284
276
  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.
285
- 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`.
286
- - **None actionable** (everything done, or remaining features still blocked): say so.
287
- - 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.
288
- - Otherwise, list what is still blocked and on which dependencies. End — do not prompt to start a feature that cannot start.
289
- - **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.
290
- 4. **Begin the chosen feature.** For the picked feature:
291
- - **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).
292
- - **PRD present:** point the user at the chosen feature's `nextCommand` from render-status.
277
+ 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.
278
+ 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.
293
279
  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.
280
+ 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`):
281
+
282
+ **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:
283
+
284
+ 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):
285
+ - **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.
286
+ - **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.
287
+ - **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.
288
+
289
+ **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.
290
+ 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.**
291
+ 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.
294
292
 
295
293
  ## Gotchas
296
294
 
297
- - **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 …`). Note the `~/.claude/plugins/*/feature-forge` glob can also print a zsh "no matches found" line when that dir is empty — harmless.
295
+ - **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
296
  - `{backlogDir}` is a **directory path**, not a file path. Pass `specs/auth`, not `specs/auth/backlog.json`.
299
297
  - 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
298
  - 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
299
  - 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.
300
+ - 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
301
  - 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
302
  - The version gate (1c) uses the `--json` form on purpose; never parse `rauf version`'s human output.
305
303
  - **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
@@ -43,18 +43,18 @@ Check `.pipeline-state.json` for `stages.forge-verify-impl`. If it is **absent**
43
43
  If the resolved feature has an `epic` back-pointer in its `.pipeline-state.json`, run:
44
44
 
45
45
  ```bash
46
- 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)"
46
+ 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')"
47
47
  [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
48
48
  python3 "$R/scripts/epic-manifest.py" render-status "{epic}" --specs-dir "{specsDir}" --json
49
49
  ```
50
50
 
51
51
  If `render-status` fails, skip the epic-level offer and proceed with the per-feature docs only; surface the error per the exit-1/exit-2 split in the **Feature Directory Resolution** block of `references/shared-conventions.md` (exit 1 → parse `{findings[]}` from stdout; exit 2 → surface the plain `Error:` stderr line verbatim).
52
52
 
53
- **Only if `rollup.total > 0 AND rollup.complete == rollup.total`** (every member is complete-for-orchestration; the `total > 0` guard excludes an empty epic), use the host's question mechanism to offer:
53
+ **Only if `rollup.total > 0 AND rollup.complete == rollup.total`** (every member is complete-for-orchestration; the `total > 0` guard excludes an empty epic), offer the extra doc as a statement the user can take or leave — not a forced question:
54
54
 
55
- "All {total} features in the '{epic}' epic are complete. Generate an **epic-level architecture document** spanning the features, in addition to {feature}'s per-feature docs?"
55
+ "All {total} features in the '{epic}' epic are complete. I can also generate an **epic-level architecture document** spanning the features, alongside {feature}'s per-feature docs — say the word and I'll add it."
56
56
 
57
- On yes, synthesize a doc at **`{docsDir}/{epic}/`** sourced from: the `EPIC.md` narrative, each member's per-feature docs, and the manifest contracts (each feature's `exposes`/`consumes`). When the epic-level doc is written, the Step 5 commit also stages `{docsDir}/{epic}/`.
57
+ If the user asks for it, synthesize a doc at **`{docsDir}/{epic}/`** sourced from: the `EPIC.md` narrative, each member's per-feature docs, and the manifest contracts (each feature's `exposes`/`consumes`). When the epic-level doc is written, the Step 5 commit also stages `{docsDir}/{epic}/`.
58
58
 
59
59
  If not all members are complete (or the feature has no `epic` back-pointer), **do not offer** — the per-feature doc flow proceeds unchanged.
60
60
 
@@ -96,7 +96,7 @@ Based on feature complexity and existing doc conventions, propose a doc plan:
96
96
  └── adr-001-*.md — Architecture decision records (if significant decisions were made)
97
97
  ```
98
98
 
99
- Present the plan and use the host's question mechanism to get the user's confirmation.
99
+ Present the plan as a statement and invite edits before writing — not a forced confirmation gate: "Here's the doc plan I'll generate. Tell me if you want to add, remove, or restructure any documents; otherwise I'll proceed." Write the docs unless the user asks for changes.
100
100
 
101
101
  ## Step 3: Write Documentation
102
102
 
@@ -175,7 +175,7 @@ Write pipeline state conforming to `references/pipeline-state-schema.json`.
175
175
  - Set `currentStage` to `complete`
176
176
  - Record `artifacts`
177
177
  - Set `stages.forge-6-docs.basedOnVersions` to include versions for all completed upstream stages. Always include forge-1-prd, forge-2-tech, forge-3-specs. Include forge-4-backlog and forge-5-loop ONLY if they have status `complete`.
178
- 2. If `gitCommitAfterStage` is true, follow the Git Commit Protocol in `references/shared-conventions.md`: stage files (`git add {docsDir}/{feature}/ {resolvedFeatureDir}/` — and **also** `{docsDir}/{epic}/` when an epic-level doc was written in Step 1), attempt commit with message `"{commitPrefix}({feature}): complete architecture docs"`, then set `stages.forge-6-docs.status` to `complete` with commit hash only on success. If commit fails, leave status as `in-progress`.
178
+ 2. If `gitCommitAfterStage` is true, follow the Git Commit Protocol in `references/shared-conventions.md`: stage files (`git add {docsDir}/{feature}/ {resolvedFeatureDir}/` — and **also** `{docsDir}/{epic}/` when an epic-level doc was written in Step 1), attempt commit with message `"{commitPrefix}({feature}): complete architecture docs"` (marking `stages.forge-6-docs.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`.
179
179
  4. Tell user: "Documentation complete. Feature pipeline for '{feature}' is finished!\n `/feature-forge:forge {feature}` to see the final pipeline status."
180
180
 
181
181
  ## Gotchas
@@ -58,7 +58,7 @@ Every bash invocation begins with the byte-identical portable-root prelude, then
58
58
  helper. Pass `--specs-dir ./specs` (the default) so the gate allow-lists the specs directory.
59
59
 
60
60
  ```bash
61
- 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)"
61
+ 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')"
62
62
  [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
63
63
  python3 "$R/scripts/forge-bootstrap.py" check "<target-dir>" --json --specs-dir ./specs
64
64
  ```
@@ -135,7 +135,7 @@ when running under a Claude host (e.g. the host's question mechanism is availabl
135
135
  `CLAUDE.md` only when `host == "claude"`.
136
136
 
137
137
  ```bash
138
- 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)"
138
+ 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')"
139
139
  [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
140
140
  python3 "$R/scripts/forge-bootstrap.py" scaffold "<target-dir>" --json --answers '<Answers JSON>'
141
141
  ```
@@ -143,7 +143,7 @@ python3 "$R/scripts/forge-bootstrap.py" scaffold "<target-dir>" --json --answers
143
143
  ### Step 5 — verify
144
144
 
145
145
  ```bash
146
- 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)"
146
+ 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')"
147
147
  [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
148
148
  python3 "$R/scripts/forge-bootstrap.py" verify "<target-dir>" --json --answers '<Answers JSON>'
149
149
  ```
@@ -169,7 +169,7 @@ and removes the sentinel before staging so it never enters history. Read
169
169
  leave the sentinel in-progress (resumable) — do **not** declare success.
170
170
 
171
171
  ```bash
172
- 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)"
172
+ 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')"
173
173
  [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
174
174
  python3 "$R/scripts/forge-bootstrap.py" commit "<target-dir>" --json --answers '<Answers JSON>' [--stage-only]
175
175
  ```
@@ -8,6 +8,15 @@ description: Apply fixes from the most recent forge-verify findings document. Us
8
8
 
9
9
  Apply fixes from the most recent forge-verify findings document, with step-level tracking for crash recovery.
10
10
 
11
+ Usually invoked by the user, but the `/feature-forge:forge` navigator may also invoke this skill
12
+ automatically when `autoFix: true` is configured **and** its preconditions hold (the findings
13
+ document has zero unresolved decision points, the working tree is clean, and a mandatory re-verify
14
+ passes afterward). The **fix application** below is identical either way — this skill is not
15
+ "auto-aware" about *applying* findings; it always applies the latest findings document. The
16
+ navigator owns the gating decisions, including the closing re-verify: the Step 6 gate is
17
+ presented **only on a direct invocation**, because under an `autoFix` chain the navigator runs the
18
+ mandatory re-verify itself.
19
+
11
20
  ## Prerequisites
12
21
 
13
22
  Read and follow `references/shared-conventions.md` for feature name validation, configuration reading, and force mode handling before proceeding.
@@ -54,14 +63,26 @@ Follow the Git Commit Protocol in `references/shared-conventions.md`.
54
63
  1. Update `{resolvedFeatureDir}/.pipeline-state.json`:
55
64
  - Set the relevant `forge-verify-*` entry status to `findings-applied`
56
65
  - Record `fixedAt` timestamp
57
- 2. If `gitCommitAfterStage` is true, follow the Git Commit Protocol: stage files (`git add {resolvedFeatureDir}/` — or `{specsDir}/{epic}/` for an epic member so the member-state change commits atomically with the epic subtree), attempt commit with message `"{commitPrefix}({feature}): apply {mode} verification fixes"`, then record commit hash only on success.
66
+ - Record `verifiedStageVersion` = the current `version` of the production stage entry
67
+ this verify covers (e.g. fixing `tech` findings → `stages["forge-2-tech"].version`).
68
+ This keeps the navigator's freshness ledger accurate after a fix, so the verified
69
+ stage reads as `fresh` and auto-verify does not needlessly re-fire on an unchanged
70
+ artifact. (If the fix itself bumped the production stage's `version`, use the new
71
+ value so the ledger reflects what was actually verified/fixed.)
72
+ 2. If `gitCommitAfterStage` is true, follow the Git Commit Protocol: stage files (`git add {resolvedFeatureDir}/` — or `{specsDir}/{epic}/` for an epic member so the member-state change commits atomically with the epic subtree), attempt commit with message `"{commitPrefix}({feature}): apply {mode} verification fixes"` (writing `commitHash: null` in that commit), then record the artifact-commit hash via the protocol's two-commit follow-up (never `--amend`) only on success.
73
+
74
+ ## Step 6: Re-verify Gate
75
+
76
+ Fixes are applied and recorded (`findings-applied`), so the stage reads **fresh** in the navigator's ledger (Step 5 set `verifiedStageVersion` to the current version). A re-verify is nonetheless the only thing that *confirms* the fixes actually resolved the findings, so on a **direct/manual** `forge-fix` invocation, **prompt** it rather than leaving it as a passive suggestion — this is the same **Standard Verify Gate** the stage skills stamp (`references/stage-exit-protocol.md`).
77
+
78
+ **Skip this gate when the navigator invoked you as part of an `autoFix` chain** (`skills/forge/SKILL.md` §3b step 2b): there the navigator owns the mandatory re-verify, so a second gate here would block the unattended flow or double the re-verify. Just return and let the navigator proceed.
58
79
 
59
- ## Step 6: Next Steps
80
+ On a direct invocation, present the gate using the host's question mechanism with 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):
81
+ - **Re-verify {feature} now** *(recommended)* — dispatch the clean-room `forge-verifier` subagent from this session in require-clean mode to confirm every finding is resolved; the digest returns here so any remaining issue keeps its context. One-time — it does **not** change config.
82
+ - **Re-verify now + enable auto-verify going forward** — re-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.
83
+ - **Skip for now** — proceed without re-verifying; the fixes are already recorded, so the stage stays `findings-applied` (fresh in the ledger). Run `/feature-forge:forge {feature}` when you want pipeline status.
60
84
 
61
- Tell the user:
62
- "Fixes applied. Next steps:
63
- - Run `/feature-forge:forge-verify {feature}` again to confirm all issues are resolved
64
- - Or `/feature-forge:forge {feature}` to see pipeline status"
85
+ **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.
65
86
 
66
87
  ---
67
88