@garygentry/feature-forge 0.3.1 → 0.3.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 (421) hide show
  1. package/adapters/claude/.feature-forge-bundle.json +1 -1
  2. package/adapters/claude/agents/forge-verifier.md +3 -1
  3. package/adapters/claude/references/decisions/single-writer-threat-model.md +53 -0
  4. package/adapters/claude/references/epic-manifest-schema.json +6 -1
  5. package/adapters/claude/references/epic-state-schema.json +50 -0
  6. package/adapters/claude/references/forge-config-schema.json +19 -1
  7. package/adapters/claude/references/forge-decisions-schema.json +33 -0
  8. package/adapters/claude/references/pipeline-state-schema.json +38 -4
  9. package/adapters/claude/references/ralph-loop-contract.md +6 -3
  10. package/adapters/claude/references/shared-conventions.md +77 -3
  11. package/adapters/claude/references/stage-exit-protocol.md +391 -143
  12. package/adapters/claude/scripts/epic-manifest.py +495 -91
  13. package/adapters/claude/scripts/fix-sweep.py +1180 -0
  14. package/adapters/claude/scripts/forge-bootstrap.py +57 -5
  15. package/adapters/claude/scripts/forge-session.py +4241 -146
  16. package/adapters/claude/scripts/validate-traceability.py +86 -5
  17. package/adapters/claude/skills/forge/SKILL.md +10 -9
  18. package/adapters/claude/skills/forge/references/pipeline-state-schema.json +38 -4
  19. package/adapters/claude/skills/forge/references/shared-conventions.md +77 -3
  20. package/adapters/claude/skills/forge/references/stage-exit-protocol.md +391 -143
  21. package/adapters/claude/skills/forge-0-epic/SKILL.md +7 -2
  22. package/adapters/claude/skills/forge-0-epic/references/edit-mode.md +29 -25
  23. package/adapters/claude/skills/forge-0-epic/references/epic-manifest-subcommands.md +5 -0
  24. package/adapters/claude/skills/forge-0-epic/references/pipeline-state-schema.json +38 -4
  25. package/adapters/claude/skills/forge-0-epic/references/shared-conventions.md +77 -3
  26. package/adapters/claude/skills/forge-0-epic/references/stage-exit-protocol.md +391 -143
  27. package/adapters/claude/skills/forge-1-prd/SKILL.md +17 -4
  28. package/adapters/claude/skills/forge-1-prd/references/shared-conventions.md +77 -3
  29. package/adapters/claude/skills/forge-1-prd/references/stage-exit-protocol.md +391 -143
  30. package/adapters/claude/skills/forge-2-tech/SKILL.md +18 -4
  31. package/adapters/claude/skills/forge-2-tech/references/shared-conventions.md +77 -3
  32. package/adapters/claude/skills/forge-2-tech/references/stage-exit-protocol.md +391 -143
  33. package/adapters/claude/skills/forge-3-specs/SKILL.md +9 -3
  34. package/adapters/claude/skills/forge-3-specs/references/shared-conventions.md +77 -3
  35. package/adapters/claude/skills/forge-3-specs/references/spec-archetypes.md +9 -0
  36. package/adapters/claude/skills/forge-3-specs/references/stage-exit-protocol.md +391 -143
  37. package/adapters/claude/skills/forge-4-backlog/SKILL.md +56 -5
  38. package/adapters/claude/skills/forge-4-backlog/references/shared-conventions.md +77 -3
  39. package/adapters/claude/skills/forge-4-backlog/references/stage-exit-protocol.md +391 -143
  40. package/adapters/claude/skills/forge-5-loop/SKILL.md +67 -69
  41. package/adapters/claude/skills/forge-5-loop/references/agent-selection.md +16 -0
  42. package/adapters/claude/skills/forge-5-loop/references/ralph-loop-contract.md +6 -3
  43. package/adapters/claude/skills/forge-5-loop/references/recovery-procedure.md +349 -0
  44. package/adapters/claude/skills/forge-5-loop/references/result-reporting.md +101 -33
  45. package/adapters/claude/skills/forge-5-loop/references/runner-contract.md +26 -6
  46. package/adapters/claude/skills/forge-5-loop/references/shared-conventions.md +77 -3
  47. package/adapters/claude/skills/forge-5-loop/references/stage-exit-protocol.md +391 -143
  48. package/adapters/claude/skills/forge-6-docs/SKILL.md +75 -8
  49. package/adapters/claude/skills/forge-6-docs/references/shared-conventions.md +77 -3
  50. package/adapters/claude/skills/forge-6-docs/references/stage-exit-protocol.md +516 -0
  51. package/adapters/claude/skills/forge-fix/SKILL.md +119 -33
  52. package/adapters/claude/skills/forge-fix/references/shared-conventions.md +77 -3
  53. package/adapters/claude/skills/forge-fix/references/stage-exit-protocol.md +391 -143
  54. package/adapters/claude/skills/forge-guide/references/forge-config-schema.json +19 -1
  55. package/adapters/claude/skills/forge-guide/references/ralph-loop-contract.md +6 -3
  56. package/adapters/claude/skills/forge-guide/references/shared-conventions.md +77 -3
  57. package/adapters/claude/skills/forge-verify/SKILL.md +82 -51
  58. package/adapters/claude/skills/forge-verify/references/decisions/single-writer-threat-model.md +53 -0
  59. package/adapters/claude/skills/forge-verify/references/findings-template.md +69 -49
  60. package/adapters/claude/skills/forge-verify/references/shared-conventions.md +77 -3
  61. package/adapters/claude/skills/forge-verify/references/stage-exit-protocol.md +516 -0
  62. package/adapters/claude/skills/forge-verify/references/verification-checklists/backlog.md +73 -0
  63. package/adapters/claude/skills/forge-verify/references/verification-checklists/epic.md +4 -3
  64. package/adapters/claude/skills/forge-verify/references/verification-checklists/impl.md +85 -0
  65. package/adapters/claude/skills/forge-verify/references/verification-checklists/specs.md +45 -1
  66. package/adapters/codex/.feature-forge-bundle.json +1 -1
  67. package/adapters/codex/agents/forge-verifier.toml +3 -1
  68. package/adapters/codex/references/decisions/single-writer-threat-model.md +53 -0
  69. package/adapters/codex/references/epic-manifest-schema.json +6 -1
  70. package/adapters/codex/references/epic-state-schema.json +50 -0
  71. package/adapters/codex/references/forge-config-schema.json +19 -1
  72. package/adapters/codex/references/forge-decisions-schema.json +33 -0
  73. package/adapters/codex/references/pipeline-state-schema.json +38 -4
  74. package/adapters/codex/references/process-overview.md +2 -2
  75. package/adapters/codex/references/ralph-loop-contract.md +6 -3
  76. package/adapters/codex/references/shared-conventions.md +102 -28
  77. package/adapters/codex/references/stage-exit-protocol.md +395 -147
  78. package/adapters/codex/scripts/epic-manifest.py +495 -91
  79. package/adapters/codex/scripts/fix-sweep.py +1180 -0
  80. package/adapters/codex/scripts/forge-bootstrap.py +57 -5
  81. package/adapters/codex/scripts/forge-session.py +4241 -146
  82. package/adapters/codex/scripts/validate-traceability.py +86 -5
  83. package/adapters/codex/skills/forge/SKILL.md +13 -12
  84. package/adapters/codex/skills/forge/references/pipeline-state-schema.json +38 -4
  85. package/adapters/codex/skills/forge/references/process-overview.md +2 -2
  86. package/adapters/codex/skills/forge/references/shared-conventions.md +102 -28
  87. package/adapters/codex/skills/forge/references/stage-exit-protocol.md +395 -147
  88. package/adapters/codex/skills/forge-0-epic/SKILL.md +7 -2
  89. package/adapters/codex/skills/forge-0-epic/references/edit-mode.md +37 -33
  90. package/adapters/codex/skills/forge-0-epic/references/epic-manifest-subcommands.md +8 -3
  91. package/adapters/codex/skills/forge-0-epic/references/pipeline-state-schema.json +38 -4
  92. package/adapters/codex/skills/forge-0-epic/references/shared-conventions.md +102 -28
  93. package/adapters/codex/skills/forge-0-epic/references/stage-exit-protocol.md +395 -147
  94. package/adapters/codex/skills/forge-1-prd/SKILL.md +17 -4
  95. package/adapters/codex/skills/forge-1-prd/references/shared-conventions.md +102 -28
  96. package/adapters/codex/skills/forge-1-prd/references/stage-exit-protocol.md +395 -147
  97. package/adapters/codex/skills/forge-2-tech/SKILL.md +18 -4
  98. package/adapters/codex/skills/forge-2-tech/references/shared-conventions.md +102 -28
  99. package/adapters/codex/skills/forge-2-tech/references/stage-exit-protocol.md +395 -147
  100. package/adapters/codex/skills/forge-3-specs/SKILL.md +9 -3
  101. package/adapters/codex/skills/forge-3-specs/references/shared-conventions.md +102 -28
  102. package/adapters/codex/skills/forge-3-specs/references/spec-archetypes.md +9 -0
  103. package/adapters/codex/skills/forge-3-specs/references/stage-exit-protocol.md +395 -147
  104. package/adapters/codex/skills/forge-4-backlog/SKILL.md +56 -5
  105. package/adapters/codex/skills/forge-4-backlog/references/shared-conventions.md +102 -28
  106. package/adapters/codex/skills/forge-4-backlog/references/stage-exit-protocol.md +395 -147
  107. package/adapters/codex/skills/forge-5-loop/SKILL.md +67 -69
  108. package/adapters/codex/skills/forge-5-loop/references/agent-selection.md +17 -1
  109. package/adapters/codex/skills/forge-5-loop/references/ralph-loop-contract.md +6 -3
  110. package/adapters/codex/skills/forge-5-loop/references/recovery-procedure.md +349 -0
  111. package/adapters/codex/skills/forge-5-loop/references/result-reporting.md +101 -33
  112. package/adapters/codex/skills/forge-5-loop/references/runner-contract.md +30 -10
  113. package/adapters/codex/skills/forge-5-loop/references/shared-conventions.md +102 -28
  114. package/adapters/codex/skills/forge-5-loop/references/stage-exit-protocol.md +395 -147
  115. package/adapters/codex/skills/forge-6-docs/SKILL.md +75 -8
  116. package/adapters/codex/skills/forge-6-docs/references/shared-conventions.md +102 -28
  117. package/adapters/codex/skills/forge-6-docs/references/stage-exit-protocol.md +516 -0
  118. package/adapters/codex/skills/forge-fix/SKILL.md +118 -32
  119. package/adapters/codex/skills/forge-fix/references/shared-conventions.md +102 -28
  120. package/adapters/codex/skills/forge-fix/references/stage-exit-protocol.md +395 -147
  121. package/adapters/codex/skills/forge-guide/SKILL.md +1 -1
  122. package/adapters/codex/skills/forge-guide/references/forge-config-schema.json +19 -1
  123. package/adapters/codex/skills/forge-guide/references/process-overview.md +2 -2
  124. package/adapters/codex/skills/forge-guide/references/ralph-loop-contract.md +6 -3
  125. package/adapters/codex/skills/forge-guide/references/shared-conventions.md +102 -28
  126. package/adapters/codex/skills/forge-init/SKILL.md +1 -1
  127. package/adapters/codex/skills/forge-verify/SKILL.md +82 -51
  128. package/adapters/codex/skills/forge-verify/references/decisions/single-writer-threat-model.md +53 -0
  129. package/adapters/codex/skills/forge-verify/references/findings-template.md +70 -50
  130. package/adapters/codex/skills/forge-verify/references/shared-conventions.md +102 -28
  131. package/adapters/codex/skills/forge-verify/references/stage-exit-protocol.md +516 -0
  132. package/adapters/codex/skills/forge-verify/references/verification-checklists/backlog.md +73 -0
  133. package/adapters/codex/skills/forge-verify/references/verification-checklists/epic.md +5 -4
  134. package/adapters/codex/skills/forge-verify/references/verification-checklists/impl.md +85 -0
  135. package/adapters/codex/skills/forge-verify/references/verification-checklists/specs.md +45 -1
  136. package/adapters/copilot/.feature-forge-bundle.json +1 -1
  137. package/adapters/copilot/agents/forge-verifier.md +3 -1
  138. package/adapters/copilot/references/decisions/single-writer-threat-model.md +53 -0
  139. package/adapters/copilot/references/epic-manifest-schema.json +6 -1
  140. package/adapters/copilot/references/epic-state-schema.json +50 -0
  141. package/adapters/copilot/references/forge-config-schema.json +19 -1
  142. package/adapters/copilot/references/forge-decisions-schema.json +33 -0
  143. package/adapters/copilot/references/pipeline-state-schema.json +38 -4
  144. package/adapters/copilot/references/process-overview.md +2 -2
  145. package/adapters/copilot/references/ralph-loop-contract.md +6 -3
  146. package/adapters/copilot/references/shared-conventions.md +102 -28
  147. package/adapters/copilot/references/stage-exit-protocol.md +395 -147
  148. package/adapters/copilot/scripts/epic-manifest.py +495 -91
  149. package/adapters/copilot/scripts/fix-sweep.py +1180 -0
  150. package/adapters/copilot/scripts/forge-bootstrap.py +57 -5
  151. package/adapters/copilot/scripts/forge-session.py +4241 -146
  152. package/adapters/copilot/scripts/validate-traceability.py +86 -5
  153. package/adapters/copilot/skills/forge/forge.md +13 -12
  154. package/adapters/copilot/skills/forge/references/pipeline-state-schema.json +38 -4
  155. package/adapters/copilot/skills/forge/references/process-overview.md +2 -2
  156. package/adapters/copilot/skills/forge/references/shared-conventions.md +102 -28
  157. package/adapters/copilot/skills/forge/references/stage-exit-protocol.md +395 -147
  158. package/adapters/copilot/skills/forge-0-epic/forge-0-epic.md +7 -2
  159. package/adapters/copilot/skills/forge-0-epic/references/edit-mode.md +37 -33
  160. package/adapters/copilot/skills/forge-0-epic/references/epic-manifest-subcommands.md +8 -3
  161. package/adapters/copilot/skills/forge-0-epic/references/pipeline-state-schema.json +38 -4
  162. package/adapters/copilot/skills/forge-0-epic/references/shared-conventions.md +102 -28
  163. package/adapters/copilot/skills/forge-0-epic/references/stage-exit-protocol.md +395 -147
  164. package/adapters/copilot/skills/forge-1-prd/forge-1-prd.md +17 -4
  165. package/adapters/copilot/skills/forge-1-prd/references/shared-conventions.md +102 -28
  166. package/adapters/copilot/skills/forge-1-prd/references/stage-exit-protocol.md +395 -147
  167. package/adapters/copilot/skills/forge-2-tech/forge-2-tech.md +18 -4
  168. package/adapters/copilot/skills/forge-2-tech/references/shared-conventions.md +102 -28
  169. package/adapters/copilot/skills/forge-2-tech/references/stage-exit-protocol.md +395 -147
  170. package/adapters/copilot/skills/forge-3-specs/forge-3-specs.md +9 -3
  171. package/adapters/copilot/skills/forge-3-specs/references/shared-conventions.md +102 -28
  172. package/adapters/copilot/skills/forge-3-specs/references/spec-archetypes.md +9 -0
  173. package/adapters/copilot/skills/forge-3-specs/references/stage-exit-protocol.md +395 -147
  174. package/adapters/copilot/skills/forge-4-backlog/forge-4-backlog.md +56 -5
  175. package/adapters/copilot/skills/forge-4-backlog/references/shared-conventions.md +102 -28
  176. package/adapters/copilot/skills/forge-4-backlog/references/stage-exit-protocol.md +395 -147
  177. package/adapters/copilot/skills/forge-5-loop/forge-5-loop.md +67 -69
  178. package/adapters/copilot/skills/forge-5-loop/references/agent-selection.md +17 -1
  179. package/adapters/copilot/skills/forge-5-loop/references/ralph-loop-contract.md +6 -3
  180. package/adapters/copilot/skills/forge-5-loop/references/recovery-procedure.md +349 -0
  181. package/adapters/copilot/skills/forge-5-loop/references/result-reporting.md +101 -33
  182. package/adapters/copilot/skills/forge-5-loop/references/runner-contract.md +30 -10
  183. package/adapters/copilot/skills/forge-5-loop/references/shared-conventions.md +102 -28
  184. package/adapters/copilot/skills/forge-5-loop/references/stage-exit-protocol.md +395 -147
  185. package/adapters/copilot/skills/forge-6-docs/forge-6-docs.md +75 -8
  186. package/adapters/copilot/skills/forge-6-docs/references/shared-conventions.md +102 -28
  187. package/adapters/copilot/skills/forge-6-docs/references/stage-exit-protocol.md +516 -0
  188. package/adapters/copilot/skills/forge-fix/forge-fix.md +118 -32
  189. package/adapters/copilot/skills/forge-fix/references/shared-conventions.md +102 -28
  190. package/adapters/copilot/skills/forge-fix/references/stage-exit-protocol.md +395 -147
  191. package/adapters/copilot/skills/forge-guide/forge-guide.md +1 -1
  192. package/adapters/copilot/skills/forge-guide/references/forge-config-schema.json +19 -1
  193. package/adapters/copilot/skills/forge-guide/references/process-overview.md +2 -2
  194. package/adapters/copilot/skills/forge-guide/references/ralph-loop-contract.md +6 -3
  195. package/adapters/copilot/skills/forge-guide/references/shared-conventions.md +102 -28
  196. package/adapters/copilot/skills/forge-init/forge-init.md +1 -1
  197. package/adapters/copilot/skills/forge-verify/forge-verify.md +82 -51
  198. package/adapters/copilot/skills/forge-verify/references/decisions/single-writer-threat-model.md +53 -0
  199. package/adapters/copilot/skills/forge-verify/references/findings-template.md +70 -50
  200. package/adapters/copilot/skills/forge-verify/references/shared-conventions.md +102 -28
  201. package/adapters/copilot/skills/forge-verify/references/stage-exit-protocol.md +516 -0
  202. package/adapters/copilot/skills/forge-verify/references/verification-checklists/backlog.md +73 -0
  203. package/adapters/copilot/skills/forge-verify/references/verification-checklists/epic.md +5 -4
  204. package/adapters/copilot/skills/forge-verify/references/verification-checklists/impl.md +85 -0
  205. package/adapters/copilot/skills/forge-verify/references/verification-checklists/specs.md +45 -1
  206. package/adapters/cursor/.feature-forge-bundle.json +1 -1
  207. package/adapters/cursor/agents/forge-verifier.mdc +3 -1
  208. package/adapters/cursor/references/decisions/single-writer-threat-model.md +53 -0
  209. package/adapters/cursor/references/epic-manifest-schema.json +6 -1
  210. package/adapters/cursor/references/epic-state-schema.json +50 -0
  211. package/adapters/cursor/references/forge-config-schema.json +19 -1
  212. package/adapters/cursor/references/forge-decisions-schema.json +33 -0
  213. package/adapters/cursor/references/pipeline-state-schema.json +38 -4
  214. package/adapters/cursor/references/process-overview.md +2 -2
  215. package/adapters/cursor/references/ralph-loop-contract.md +6 -3
  216. package/adapters/cursor/references/shared-conventions.md +102 -28
  217. package/adapters/cursor/references/stage-exit-protocol.md +395 -147
  218. package/adapters/cursor/scripts/epic-manifest.py +495 -91
  219. package/adapters/cursor/scripts/fix-sweep.py +1180 -0
  220. package/adapters/cursor/scripts/forge-bootstrap.py +57 -5
  221. package/adapters/cursor/scripts/forge-session.py +4241 -146
  222. package/adapters/cursor/scripts/validate-traceability.py +86 -5
  223. package/adapters/cursor/skills/forge/forge.mdc +13 -12
  224. package/adapters/cursor/skills/forge/references/pipeline-state-schema.json +38 -4
  225. package/adapters/cursor/skills/forge/references/process-overview.md +2 -2
  226. package/adapters/cursor/skills/forge/references/shared-conventions.md +102 -28
  227. package/adapters/cursor/skills/forge/references/stage-exit-protocol.md +395 -147
  228. package/adapters/cursor/skills/forge-0-epic/forge-0-epic.mdc +7 -2
  229. package/adapters/cursor/skills/forge-0-epic/references/edit-mode.md +37 -33
  230. package/adapters/cursor/skills/forge-0-epic/references/epic-manifest-subcommands.md +8 -3
  231. package/adapters/cursor/skills/forge-0-epic/references/pipeline-state-schema.json +38 -4
  232. package/adapters/cursor/skills/forge-0-epic/references/shared-conventions.md +102 -28
  233. package/adapters/cursor/skills/forge-0-epic/references/stage-exit-protocol.md +395 -147
  234. package/adapters/cursor/skills/forge-1-prd/forge-1-prd.mdc +17 -4
  235. package/adapters/cursor/skills/forge-1-prd/references/shared-conventions.md +102 -28
  236. package/adapters/cursor/skills/forge-1-prd/references/stage-exit-protocol.md +395 -147
  237. package/adapters/cursor/skills/forge-2-tech/forge-2-tech.mdc +18 -4
  238. package/adapters/cursor/skills/forge-2-tech/references/shared-conventions.md +102 -28
  239. package/adapters/cursor/skills/forge-2-tech/references/stage-exit-protocol.md +395 -147
  240. package/adapters/cursor/skills/forge-3-specs/forge-3-specs.mdc +9 -3
  241. package/adapters/cursor/skills/forge-3-specs/references/shared-conventions.md +102 -28
  242. package/adapters/cursor/skills/forge-3-specs/references/spec-archetypes.md +9 -0
  243. package/adapters/cursor/skills/forge-3-specs/references/stage-exit-protocol.md +395 -147
  244. package/adapters/cursor/skills/forge-4-backlog/forge-4-backlog.mdc +56 -5
  245. package/adapters/cursor/skills/forge-4-backlog/references/shared-conventions.md +102 -28
  246. package/adapters/cursor/skills/forge-4-backlog/references/stage-exit-protocol.md +395 -147
  247. package/adapters/cursor/skills/forge-5-loop/forge-5-loop.mdc +67 -69
  248. package/adapters/cursor/skills/forge-5-loop/references/agent-selection.md +17 -1
  249. package/adapters/cursor/skills/forge-5-loop/references/ralph-loop-contract.md +6 -3
  250. package/adapters/cursor/skills/forge-5-loop/references/recovery-procedure.md +349 -0
  251. package/adapters/cursor/skills/forge-5-loop/references/result-reporting.md +101 -33
  252. package/adapters/cursor/skills/forge-5-loop/references/runner-contract.md +30 -10
  253. package/adapters/cursor/skills/forge-5-loop/references/shared-conventions.md +102 -28
  254. package/adapters/cursor/skills/forge-5-loop/references/stage-exit-protocol.md +395 -147
  255. package/adapters/cursor/skills/forge-6-docs/forge-6-docs.mdc +75 -8
  256. package/adapters/cursor/skills/forge-6-docs/references/shared-conventions.md +102 -28
  257. package/adapters/cursor/skills/forge-6-docs/references/stage-exit-protocol.md +516 -0
  258. package/adapters/cursor/skills/forge-fix/forge-fix.mdc +118 -32
  259. package/adapters/cursor/skills/forge-fix/references/shared-conventions.md +102 -28
  260. package/adapters/cursor/skills/forge-fix/references/stage-exit-protocol.md +395 -147
  261. package/adapters/cursor/skills/forge-guide/forge-guide.mdc +1 -1
  262. package/adapters/cursor/skills/forge-guide/references/forge-config-schema.json +19 -1
  263. package/adapters/cursor/skills/forge-guide/references/process-overview.md +2 -2
  264. package/adapters/cursor/skills/forge-guide/references/ralph-loop-contract.md +6 -3
  265. package/adapters/cursor/skills/forge-guide/references/shared-conventions.md +102 -28
  266. package/adapters/cursor/skills/forge-init/forge-init.mdc +1 -1
  267. package/adapters/cursor/skills/forge-verify/forge-verify.mdc +82 -51
  268. package/adapters/cursor/skills/forge-verify/references/decisions/single-writer-threat-model.md +53 -0
  269. package/adapters/cursor/skills/forge-verify/references/findings-template.md +70 -50
  270. package/adapters/cursor/skills/forge-verify/references/shared-conventions.md +102 -28
  271. package/adapters/cursor/skills/forge-verify/references/stage-exit-protocol.md +516 -0
  272. package/adapters/cursor/skills/forge-verify/references/verification-checklists/backlog.md +73 -0
  273. package/adapters/cursor/skills/forge-verify/references/verification-checklists/epic.md +5 -4
  274. package/adapters/cursor/skills/forge-verify/references/verification-checklists/impl.md +85 -0
  275. package/adapters/cursor/skills/forge-verify/references/verification-checklists/specs.md +45 -1
  276. package/adapters/gemini/.feature-forge-bundle.json +1 -1
  277. package/adapters/gemini/agents/forge-verifier.md +3 -1
  278. package/adapters/gemini/gemini-extension.json +1 -1
  279. package/adapters/gemini/references/decisions/single-writer-threat-model.md +53 -0
  280. package/adapters/gemini/references/epic-manifest-schema.json +6 -1
  281. package/adapters/gemini/references/epic-state-schema.json +50 -0
  282. package/adapters/gemini/references/forge-config-schema.json +19 -1
  283. package/adapters/gemini/references/forge-decisions-schema.json +33 -0
  284. package/adapters/gemini/references/pipeline-state-schema.json +38 -4
  285. package/adapters/gemini/references/process-overview.md +2 -2
  286. package/adapters/gemini/references/ralph-loop-contract.md +6 -3
  287. package/adapters/gemini/references/shared-conventions.md +102 -28
  288. package/adapters/gemini/references/stage-exit-protocol.md +395 -147
  289. package/adapters/gemini/scripts/epic-manifest.py +495 -91
  290. package/adapters/gemini/scripts/fix-sweep.py +1180 -0
  291. package/adapters/gemini/scripts/forge-bootstrap.py +57 -5
  292. package/adapters/gemini/scripts/forge-session.py +4241 -146
  293. package/adapters/gemini/scripts/validate-traceability.py +86 -5
  294. package/adapters/gemini/skills/forge/forge.md +13 -12
  295. package/adapters/gemini/skills/forge/references/pipeline-state-schema.json +38 -4
  296. package/adapters/gemini/skills/forge/references/process-overview.md +2 -2
  297. package/adapters/gemini/skills/forge/references/shared-conventions.md +102 -28
  298. package/adapters/gemini/skills/forge/references/stage-exit-protocol.md +395 -147
  299. package/adapters/gemini/skills/forge-0-epic/forge-0-epic.md +7 -2
  300. package/adapters/gemini/skills/forge-0-epic/references/edit-mode.md +37 -33
  301. package/adapters/gemini/skills/forge-0-epic/references/epic-manifest-subcommands.md +8 -3
  302. package/adapters/gemini/skills/forge-0-epic/references/pipeline-state-schema.json +38 -4
  303. package/adapters/gemini/skills/forge-0-epic/references/shared-conventions.md +102 -28
  304. package/adapters/gemini/skills/forge-0-epic/references/stage-exit-protocol.md +395 -147
  305. package/adapters/gemini/skills/forge-1-prd/forge-1-prd.md +17 -4
  306. package/adapters/gemini/skills/forge-1-prd/references/shared-conventions.md +102 -28
  307. package/adapters/gemini/skills/forge-1-prd/references/stage-exit-protocol.md +395 -147
  308. package/adapters/gemini/skills/forge-2-tech/forge-2-tech.md +18 -4
  309. package/adapters/gemini/skills/forge-2-tech/references/shared-conventions.md +102 -28
  310. package/adapters/gemini/skills/forge-2-tech/references/stage-exit-protocol.md +395 -147
  311. package/adapters/gemini/skills/forge-3-specs/forge-3-specs.md +9 -3
  312. package/adapters/gemini/skills/forge-3-specs/references/shared-conventions.md +102 -28
  313. package/adapters/gemini/skills/forge-3-specs/references/spec-archetypes.md +9 -0
  314. package/adapters/gemini/skills/forge-3-specs/references/stage-exit-protocol.md +395 -147
  315. package/adapters/gemini/skills/forge-4-backlog/forge-4-backlog.md +56 -5
  316. package/adapters/gemini/skills/forge-4-backlog/references/shared-conventions.md +102 -28
  317. package/adapters/gemini/skills/forge-4-backlog/references/stage-exit-protocol.md +395 -147
  318. package/adapters/gemini/skills/forge-5-loop/forge-5-loop.md +67 -69
  319. package/adapters/gemini/skills/forge-5-loop/references/agent-selection.md +17 -1
  320. package/adapters/gemini/skills/forge-5-loop/references/ralph-loop-contract.md +6 -3
  321. package/adapters/gemini/skills/forge-5-loop/references/recovery-procedure.md +349 -0
  322. package/adapters/gemini/skills/forge-5-loop/references/result-reporting.md +101 -33
  323. package/adapters/gemini/skills/forge-5-loop/references/runner-contract.md +30 -10
  324. package/adapters/gemini/skills/forge-5-loop/references/shared-conventions.md +102 -28
  325. package/adapters/gemini/skills/forge-5-loop/references/stage-exit-protocol.md +395 -147
  326. package/adapters/gemini/skills/forge-6-docs/forge-6-docs.md +75 -8
  327. package/adapters/gemini/skills/forge-6-docs/references/shared-conventions.md +102 -28
  328. package/adapters/gemini/skills/forge-6-docs/references/stage-exit-protocol.md +516 -0
  329. package/adapters/gemini/skills/forge-fix/forge-fix.md +118 -32
  330. package/adapters/gemini/skills/forge-fix/references/shared-conventions.md +102 -28
  331. package/adapters/gemini/skills/forge-fix/references/stage-exit-protocol.md +395 -147
  332. package/adapters/gemini/skills/forge-guide/forge-guide.md +1 -1
  333. package/adapters/gemini/skills/forge-guide/references/forge-config-schema.json +19 -1
  334. package/adapters/gemini/skills/forge-guide/references/process-overview.md +2 -2
  335. package/adapters/gemini/skills/forge-guide/references/ralph-loop-contract.md +6 -3
  336. package/adapters/gemini/skills/forge-guide/references/shared-conventions.md +102 -28
  337. package/adapters/gemini/skills/forge-init/forge-init.md +1 -1
  338. package/adapters/gemini/skills/forge-verify/forge-verify.md +82 -51
  339. package/adapters/gemini/skills/forge-verify/references/decisions/single-writer-threat-model.md +53 -0
  340. package/adapters/gemini/skills/forge-verify/references/findings-template.md +70 -50
  341. package/adapters/gemini/skills/forge-verify/references/shared-conventions.md +102 -28
  342. package/adapters/gemini/skills/forge-verify/references/stage-exit-protocol.md +516 -0
  343. package/adapters/gemini/skills/forge-verify/references/verification-checklists/backlog.md +73 -0
  344. package/adapters/gemini/skills/forge-verify/references/verification-checklists/epic.md +5 -4
  345. package/adapters/gemini/skills/forge-verify/references/verification-checklists/impl.md +85 -0
  346. package/adapters/gemini/skills/forge-verify/references/verification-checklists/specs.md +45 -1
  347. package/adapters/pi/.feature-forge-bundle.json +1 -1
  348. package/adapters/pi/agents/forge-verifier.md +3 -1
  349. package/adapters/pi/references/decisions/single-writer-threat-model.md +53 -0
  350. package/adapters/pi/references/epic-manifest-schema.json +6 -1
  351. package/adapters/pi/references/epic-state-schema.json +50 -0
  352. package/adapters/pi/references/forge-config-schema.json +19 -1
  353. package/adapters/pi/references/forge-decisions-schema.json +33 -0
  354. package/adapters/pi/references/pipeline-state-schema.json +38 -4
  355. package/adapters/pi/references/process-overview.md +2 -2
  356. package/adapters/pi/references/ralph-loop-contract.md +6 -3
  357. package/adapters/pi/references/shared-conventions.md +91 -17
  358. package/adapters/pi/references/stage-exit-protocol.md +395 -147
  359. package/adapters/pi/scripts/epic-manifest.py +495 -91
  360. package/adapters/pi/scripts/fix-sweep.py +1180 -0
  361. package/adapters/pi/scripts/forge-bootstrap.py +57 -5
  362. package/adapters/pi/scripts/forge-session.py +4241 -146
  363. package/adapters/pi/scripts/validate-traceability.py +86 -5
  364. package/adapters/pi/skills/forge/SKILL.md +10 -9
  365. package/adapters/pi/skills/forge/references/pipeline-state-schema.json +38 -4
  366. package/adapters/pi/skills/forge/references/process-overview.md +2 -2
  367. package/adapters/pi/skills/forge/references/shared-conventions.md +91 -17
  368. package/adapters/pi/skills/forge/references/stage-exit-protocol.md +395 -147
  369. package/adapters/pi/skills/forge-0-epic/SKILL.md +7 -2
  370. package/adapters/pi/skills/forge-0-epic/references/edit-mode.md +31 -27
  371. package/adapters/pi/skills/forge-0-epic/references/epic-manifest-subcommands.md +6 -1
  372. package/adapters/pi/skills/forge-0-epic/references/pipeline-state-schema.json +38 -4
  373. package/adapters/pi/skills/forge-0-epic/references/shared-conventions.md +91 -17
  374. package/adapters/pi/skills/forge-0-epic/references/stage-exit-protocol.md +395 -147
  375. package/adapters/pi/skills/forge-1-prd/SKILL.md +17 -4
  376. package/adapters/pi/skills/forge-1-prd/references/shared-conventions.md +91 -17
  377. package/adapters/pi/skills/forge-1-prd/references/stage-exit-protocol.md +395 -147
  378. package/adapters/pi/skills/forge-2-tech/SKILL.md +18 -4
  379. package/adapters/pi/skills/forge-2-tech/references/shared-conventions.md +91 -17
  380. package/adapters/pi/skills/forge-2-tech/references/stage-exit-protocol.md +395 -147
  381. package/adapters/pi/skills/forge-3-specs/SKILL.md +9 -3
  382. package/adapters/pi/skills/forge-3-specs/references/shared-conventions.md +91 -17
  383. package/adapters/pi/skills/forge-3-specs/references/spec-archetypes.md +9 -0
  384. package/adapters/pi/skills/forge-3-specs/references/stage-exit-protocol.md +395 -147
  385. package/adapters/pi/skills/forge-4-backlog/SKILL.md +56 -5
  386. package/adapters/pi/skills/forge-4-backlog/references/shared-conventions.md +91 -17
  387. package/adapters/pi/skills/forge-4-backlog/references/stage-exit-protocol.md +395 -147
  388. package/adapters/pi/skills/forge-5-loop/SKILL.md +67 -69
  389. package/adapters/pi/skills/forge-5-loop/references/agent-selection.md +16 -0
  390. package/adapters/pi/skills/forge-5-loop/references/ralph-loop-contract.md +6 -3
  391. package/adapters/pi/skills/forge-5-loop/references/recovery-procedure.md +349 -0
  392. package/adapters/pi/skills/forge-5-loop/references/result-reporting.md +101 -33
  393. package/adapters/pi/skills/forge-5-loop/references/runner-contract.md +29 -9
  394. package/adapters/pi/skills/forge-5-loop/references/shared-conventions.md +91 -17
  395. package/adapters/pi/skills/forge-5-loop/references/stage-exit-protocol.md +395 -147
  396. package/adapters/pi/skills/forge-6-docs/SKILL.md +75 -8
  397. package/adapters/pi/skills/forge-6-docs/references/shared-conventions.md +91 -17
  398. package/adapters/pi/skills/forge-6-docs/references/stage-exit-protocol.md +516 -0
  399. package/adapters/pi/skills/forge-fix/SKILL.md +118 -32
  400. package/adapters/pi/skills/forge-fix/references/shared-conventions.md +91 -17
  401. package/adapters/pi/skills/forge-fix/references/stage-exit-protocol.md +395 -147
  402. package/adapters/pi/skills/forge-guide/references/forge-config-schema.json +19 -1
  403. package/adapters/pi/skills/forge-guide/references/process-overview.md +2 -2
  404. package/adapters/pi/skills/forge-guide/references/ralph-loop-contract.md +6 -3
  405. package/adapters/pi/skills/forge-guide/references/shared-conventions.md +91 -17
  406. package/adapters/pi/skills/forge-verify/SKILL.md +81 -50
  407. package/adapters/pi/skills/forge-verify/references/decisions/single-writer-threat-model.md +53 -0
  408. package/adapters/pi/skills/forge-verify/references/findings-template.md +69 -49
  409. package/adapters/pi/skills/forge-verify/references/shared-conventions.md +91 -17
  410. package/adapters/pi/skills/forge-verify/references/stage-exit-protocol.md +516 -0
  411. package/adapters/pi/skills/forge-verify/references/verification-checklists/backlog.md +73 -0
  412. package/adapters/pi/skills/forge-verify/references/verification-checklists/epic.md +5 -4
  413. package/adapters/pi/skills/forge-verify/references/verification-checklists/impl.md +85 -0
  414. package/adapters/pi/skills/forge-verify/references/verification-checklists/specs.md +45 -1
  415. package/package.json +1 -1
  416. package/adapters/claude/skills/forge-verify/references/pipeline-state-schema.json +0 -191
  417. package/adapters/codex/skills/forge-verify/references/pipeline-state-schema.json +0 -191
  418. package/adapters/copilot/skills/forge-verify/references/pipeline-state-schema.json +0 -191
  419. package/adapters/cursor/skills/forge-verify/references/pipeline-state-schema.json +0 -191
  420. package/adapters/gemini/skills/forge-verify/references/pipeline-state-schema.json +0 -191
  421. package/adapters/pi/skills/forge-verify/references/pipeline-state-schema.json +0 -191
@@ -20,6 +20,8 @@ Read and follow `references/shared-conventions.md` for feature name validation,
20
20
 
21
21
  **Prerequisite check:** Read `{resolvedFeatureDir}/.pipeline-state.json`. If not in force mode, both `forge-1-prd` and `forge-2-tech` must be `complete`. If not, STOP and tell the user which prerequisites are missing.
22
22
 
23
+ **Carried-over note check.** If that state's top-level `notes` is a non-empty string, surface it verbatim before proceeding and treat it as input to this stage — it was persisted for exactly this cross-session handoff (often at the previous stage's exit). It never overrides the PRD, tech spec, or config; raise any conflict instead of silently following either side.
24
+
23
25
  After the prerequisite check, invoke the **Stage-Entry Guard** block in `references/shared-conventions.md` with `{stage}` = `forge-3-specs`. Because this stage writes a suite incrementally, the guard's **interrupted** arm uses the `stages.forge-3-specs.artifacts` array (already updated after each spec file — Step 3) to resume from the first unwritten document rather than regenerating the whole suite.
24
26
 
25
27
  Read both `{resolvedFeatureDir}/PRD.md` and `{resolvedFeatureDir}/tech-spec.md` into context.
@@ -138,6 +140,8 @@ List any gaps or inconsistencies found and resolve them.
138
140
 
139
141
  ## Step 6: Review with User
140
142
 
143
+ This is a **blocking review** — per the **Stage Review Gate** in `references/shared-conventions.md`, do not proceed until the user confirms.
144
+
141
145
  Present a summary of all documents created as text, with key decisions highlighted. Then use the host's question mechanism to collect feedback — do NOT include these questions in your text output:
142
146
 
143
147
  "1. Does the level of detail match what you need? 2. Any areas that need more depth? 3. Any missing subsystems or concerns?"
@@ -147,7 +151,7 @@ Present a summary of all documents created as text, with key decisions highlight
147
151
  Pipeline state is written by the `state-*` verbs — see the Pipeline State Protocol in `references/shared-conventions.md`.
148
152
 
149
153
  1. Record completion by running `state-complete` (below) with `--version`, one `--artifact` per created file including `TRACEABILITY.md`, and `--based-on forge-1-prd=<current version> --based-on forge-2-tech=<current version>`. It sets `status: "complete"`, `completedAt`, the version and `basedOnVersions`, and applies the downstream staleness cascade deterministically, so no downstream status is set by hand.
150
- 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.
154
+ 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 via `state-note` — it **overwrites** the single `notes` string (latest note wins), so fold any still-relevant existing note into the one combined string; otherwise proceed. The next stage's Step 1 reads and surfaces this note.
151
155
  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`.
152
156
  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:
153
157
 
@@ -165,15 +169,17 @@ python3 "$R/scripts/forge-session.py" state-note \
165
169
  --feature "{feature}" --note "<what the user volunteered>" --specs-dir "{specsDir}"
166
170
  ```
167
171
 
172
+ **Determine `--verify-capability` before running the exit** (full rule: `references/stage-exit-protocol.md`; summary: **Verify Capability** in `references/shared-conventions.md`). Pass `interactive` only when a question mechanism equivalent to the host's question mechanism is available **and** a clean-room `forge-verifier` may be dispatched; otherwise pass `manual`. Dispatch capability means **permitted** dispatch, not a listed tool — the test is "may I dispatch `forge-verifier` right now", not "is a dispatch tool in my tool surface". A session that bars *unsolicited* dispatch while offering a question mechanism is therefore **`interactive`, not `manual`**: the gate's affirmative choice is the user request that authorizes the dispatch. Such a bar is never grounds to skip verification, and never grounds to fence the production successor while verification is unresolved — on the `runInStageVerify: true` path the emitted `verifyGate` stays `none`, so reuse the Standard Verify Gate block for consent with **choice 2 omitted**, leaving exactly two choices: *Verify now* (recommended) and *Skip for now*. The clean-room `forge-verifier` is **dispatched on the affirmative choice**, never merely printed for the user to run later; *Skip for now* is persisted as an explicit `skipped` before any advancing block. Add `--epic "{epic}"` to the call below when this feature is an epic member.
173
+
168
174
  **Close this stage with the Scripted Stage Exit** (contract: `references/stage-exit-protocol.md`; do not improvise a "Next steps" list). Run:
169
175
 
170
176
  ```bash
171
177
  R="$(bash -c 'for d in "${FEATURE_FORGE_ROOT:-}" "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/cache/*/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
178
  [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
173
- python3 "$R/scripts/forge-session.py" stage-exit --feature "{feature}" --stage forge-3-specs --specs-dir "{specsDir}" --host generic
179
+ python3 "$R/scripts/forge-session.py" stage-exit --feature "{feature}" --stage forge-3-specs --specs-dir "{specsDir}" --host generic --verify-capability "{verify-capability}"
174
180
  ```
175
181
 
176
- Obey the DIRECTIVES it prints, in order, per the directive contract: `runInStageVerify: true` → dispatch the in-stage clean-room verify now (honoring `autoFixEligible`); `verifyGate: "standard"` → present the Standard Verify Gate; `verifyGate: "manual-print"` → print the `verifyCommand` for the user; non-empty `invalidAutoVerifyKeys` → print a one-line warning. Then **print the NEXT-STEPS block verbatim as your absolute last output — nothing after its sentinel line.**
182
+ Obey the DIRECTIVES it prints, in the consumption order this protocol fixes: surface `invalidAutoVerifyKeys` and every `warnings` entry first; `runInStageVerify: true` → run the in-stage clean-room verify chain now (honoring `autoFixEligible`, and asking through the Standard Verify Gate first when you may not dispatch unsolicited); `verifyGate: "standard"` → present the Standard Verify Gate; `verifyGate: "manual-print"` → print the `verifyCommand` for the user and do **not** dispatch inline. Then, and only when `terminalOwnedBy` is `"self"`, **print the NEXT-STEPS block verbatim as your absolute last output — nothing after its sentinel line.** A `terminalOwnedBy: "outer"` payload carries `nextSteps: null`: return your structured result to the caller and print no terminal block at all.
177
183
 
178
184
  ## Gotchas
179
185
 
@@ -15,11 +15,11 @@ If no feature name is provided:
15
15
 
16
16
  ## User Input Protocol
17
17
 
18
- ### CRITICAL GUARDRAIL: Use AskUserQuestion for All Questions
18
+ ### CRITICAL GUARDRAIL: Use the host's question mechanism for All Questions
19
19
 
20
- You MUST use the `AskUserQuestion` tool whenever you need the user's input before proceeding. This includes yes/no confirmations, choices between options, interview questions, and feedback on artifacts. NEVER output questions as inline prose text — the user may not be prompted and the session will stall.
20
+ You MUST use the host's question mechanism whenever you need the user's input before proceeding. This includes yes/no confirmations, choices between options, interview questions, and feedback on artifacts. NEVER output questions as inline prose text — the user may not be prompted and the session will stall.
21
21
 
22
- **Required turn structure:** Output your analysis, findings, or context as regular text. Then call `AskUserQuestion` with your questions. Do NOT mix questions into your text output.
22
+ **Required turn structure:** Output your analysis, findings, or context as regular text. Then call the host's question mechanism with your questions. Do NOT mix questions into your text output.
23
23
 
24
24
  **WRONG — questions as inline prose (causes stalling):**
25
25
  ```
@@ -31,14 +31,14 @@ I found that the codebase uses React and TanStack Router. Here are my questions:
31
31
  **RIGHT — context as text, questions via tool:**
32
32
  ```
33
33
  I found that the codebase uses React and TanStack Router.
34
- [then call AskUserQuestion with: "1. Where should this component live? 2. Should we use server-side rendering?"]
34
+ [then call the host's question mechanism with: "1. Where should this component live? 2. Should we use server-side rendering?"]
35
35
  ```
36
36
 
37
37
  ### Decision Support: Help the User Choose
38
38
 
39
- When an `AskUserQuestion` carries substantive options (a real choice — not a trivial yes/no confirmation), do not just list them. The interview stages have already done codebase research and integration analysis; surfacing that synthesis at the decision moment is the whole point. For every such question:
39
+ When a question posed through the host's question mechanism carries substantive options (a real choice — not a trivial yes/no confirmation), do not just list them. The interview stages have already done codebase research and integration analysis; surfacing that synthesis at the decision moment is the whole point. For every such question:
40
40
 
41
- - **Lead with a recommended option.** Place it first and label it `(recommended)` (matching the `AskUserQuestion` "(Recommended)" convention).
41
+ - **Lead with a recommended option.** Place it first and label it `(recommended)` (matching the host's question mechanism "(Recommended)" convention).
42
42
  - **Put the trade-off in each option's `description`.** Say why you'd pick it and what you give up versus the alternatives — the cost, not just the benefit.
43
43
  - **State a one-line rationale** in the text before the question for *why* the recommendation wins.
44
44
 
@@ -49,10 +49,21 @@ Two modes, and make clear which one you're in:
49
49
 
50
50
  **The only thing to avoid is false confidence** — recommending as if evidence-backed when it's really preference. Never respond to the absence of a clear winner by going silent: a defaulted recommendation with honest trade-offs always beats a neutral option dump.
51
51
 
52
- For genuinely comparable artifacts (competing module structures, two code snippets, layout variants), use the `AskUserQuestion` `preview` field to show them side-by-side.
52
+ For genuinely comparable artifacts (competing module structures, two code snippets, layout variants), use the host's question mechanism `preview` field to show them side-by-side.
53
53
 
54
54
  The **Branch Setup** block below is the reference pattern: a strong recommendation as the first option, rationale inline, the alternative still available, never a hard-stop.
55
55
 
56
+ ## Stage Review Gate
57
+
58
+ Every authoring stage ends its "Review with User" step in exactly one of two shapes. Which shape a stage uses is declared **here, once** — each stage's review step points at this block by title, and the shape is never re-derived from the surrounding prose or inferred from how sibling stages behave (three stages block and one does not; majority-shape inference is precisely the failure this block exists to prevent):
59
+
60
+ - **Blocking review (gate).** The stage presents the artifact and collects feedback through the host's question mechanism; it does **not** proceed until the user answers, iterating until they confirm. Stages: **forge-1-prd** (Step 5), **forge-2-tech** (Step 6), **forge-3-specs** (Step 6).
61
+ - **Non-blocking review (invitation).** The stage states the artifact is ready and invites adjustments **as a statement, not a question** — and then **proceeds to the next step in the same turn unless the user asks for changes**. The invitation obliges the agent to *continue*: emitting the invitation sentence and stopping treats the non-gate as a gate and strands the stage `in-progress` with its completion step unrun — a defect, not caution. Stage: **forge-4-backlog** (Step 6).
62
+
63
+ **Why the shapes differ.** A blocking review guards an artifact whose content was just authored from open-ended interview or synthesis — the user is the only authority on "complete", so the stage must wait. forge-4's backlog is *derived* from specs the user already approved, was planned interactively in its Step 3, and is machine-validated in its Step 5; a second hard gate would re-ask a settled question, and the loop never launches without forge-5-loop's own Step 2d confirmation anyway. The invitation is a courtesy checkpoint, not an approval gate (removed deliberately in #78's consistency sweep).
64
+
65
+ A stage that changes shape changes it **in this block first**; the per-stage pointer stays a pointer.
66
+
56
67
  ## Configuration Reading
57
68
 
58
69
  Read `forge.config.json` from the project root. If it doesn't exist, use defaults.
@@ -68,10 +79,10 @@ Extract these config values (use defaults if not present):
68
79
  - `branchPerFeature` (default: true)
69
80
  - `branchPrefix` (default: `forge/`)
70
81
  - `loopIterationMultiplier` (default: `1.5`)
71
- - `autoInvokeNextStage` (default: `true` — the `/feature-forge:forge` navigator auto-invokes the next stage via the `Skill` tool after the user confirms; `false` keeps copy-paste behavior. Navigator-only.)
82
+ - `autoInvokeNextStage` (default: `true` — the `/feature-forge:forge` navigator auto-invokes the next stage via the host's skill-invocation mechanism after the user confirms; `false` keeps copy-paste behavior. Navigator-only.)
72
83
  - `contextWindowTokens` (default: `null` — context window used by the navigator's context-usage check; `null` infers from the session model and falls back to 200000. Set to the model's window, e.g. `1000000` on a 1M model. Navigator-only.)
73
84
  - `contextWarnThreshold` (default: `0.7` — fraction of the window past which the navigator recommends a clean session. Navigator-only.)
74
- - `autoVerify` (default: `false` — when `true`, `forge-verify` runs automatically after a stage completes, no prompt. **In-stage-primary:** the just-completed authoring stage runs it itself, in-session, before the exit block (honoring the verify-before-clear principle). The navigator runs it only as a **catch-up** when verify is still pending (a host that could not dispatch a clean-room subagent, or a stage run before this behavior landed). Either way it runs in a fresh clean-room subagent, so it never needs a `/clear` and costs only a compact digest.)
85
+ - `autoVerify` (default: `false` — when `true`, `forge-verify` runs automatically after a stage completes, no prompt. **In-stage-primary:** the just-completed authoring stage runs it itself, in-session, before the exit block (honoring the verify-before-clear principle). The navigator runs it only as a **catch-up** when verify is still pending (a host that could not dispatch a clean-room subagent, or a stage run before this behavior landed). Either way it runs in a fresh clean-room subagent, so it never needs a session clear and costs only a compact digest.)
75
86
  - `autoVerifyStages` (default: `{}` — per-stage overrides for `autoVerify`, e.g. `{"forge-1-prd": false}`. Effective value = `autoVerifyStages[stage]` if present, else `autoVerify`. Keys are constrained to the five verify-capable stages; a typo is a config error surfaced as `invalidAutoVerifyKeys`. Both the in-stage run and the navigator catch-up read this same effective value.)
76
87
  - `autoFix` (default: `false` — when `true`, `forge-fix` is chained after an auto-verify that finds issues — by the in-stage run (primary) or the navigator catch-up — but only when auto-verify is on for that stage AND preconditions hold (zero unresolved decisions, clean tree, passing re-verify); otherwise a digest is surfaced and the gate is presented.)
77
88
  - `loopRunner` (optional object — the loop runner to drive; **defaults to rauf** when absent, with every command templated. See `references/forge-config-schema.json` and `references/ralph-loop-contract.md`.)
@@ -81,7 +92,7 @@ Extract these config values (use defaults if not present):
81
92
  Before any file I/O against a feature's artifacts, resolve its directory through the deterministic helper rather than hardcoding `{specsDir}/{feature}/`. This makes flat (`{specsDir}/{feature}/`) and nested (`{specsDir}/{epic}/{feature}/`) layouts both resolve from a bare feature name (REQ-DIR-03), with standalone features behaving exactly as today.
82
93
 
83
94
  ```bash
84
- R="$(bash -c 'for d in "${CLAUDE_PLUGIN_ROOT:-}" "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/cache/*/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')"
95
+ R="$(bash -c 'for d in "${FEATURE_FORGE_ROOT:-}" "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/cache/*/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')"
85
96
  [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
86
97
  resolvedFeatureDir=$(python3 "$R/scripts/epic-manifest.py" \
87
98
  resolve "<feature>" --specs-dir "<specsDir>")
@@ -96,12 +107,12 @@ In both failure cases, do not fall back to a guessed path.
96
107
  **On `not-found`, check other branches before stopping.** With `branchPerFeature`, the feature's directory (and its `.pipeline-state.json`) may exist only on its topic branch — invisible from the default branch of a fresh clone. Before concluding the pipeline does not exist, run the read-only cross-branch discovery:
97
108
 
98
109
  ```bash
99
- R="$(bash -c 'for d in "${CLAUDE_PLUGIN_ROOT:-}" "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/cache/*/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')"
110
+ R="$(bash -c 'for d in "${FEATURE_FORGE_ROOT:-}" "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/cache/*/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')"
100
111
  [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
101
112
  python3 "$R/scripts/forge-session.py" discover-feature "<feature>" --specs-dir "<specsDir>" --json
102
113
  ```
103
114
 
104
- - **Candidates found** (`candidates` and/or `remoteCandidates` non-empty): summarize them as text (branch, recorded stage, whether the state's own `branch` field matches), then use `AskUserQuestion`: **Switch to `{branch}` (recommended)** — run the candidate's `switchCommand` · **Fetch + switch** — for a `needsFetch` remote candidate, run its `fetchCommand` then `switchCommand` (note its contents were matched by name only, not inspected) · **Treat `{feature}` as new on this branch** · **Stop**. A checkout is a mutation inside an otherwise read-only flow: perform it ONLY on the user's explicit accept AND with a clean working tree (`git status --porcelain` prints nothing) — never auto-switch, never with uncommitted changes. After a successful switch, re-run this Feature Directory Resolution block from the top.
115
+ - **Candidates found** (`candidates` and/or `remoteCandidates` non-empty): summarize them as text (branch, recorded stage, whether the state's own `branch` field matches), then use the host's question mechanism: **Switch to `{branch}` (recommended)** — run the candidate's `switchCommand` · **Fetch + switch** — for a `needsFetch` remote candidate, run its `fetchCommand` then `switchCommand` (note its contents were matched by name only, not inspected) · **Treat `{feature}` as new on this branch** · **Stop**. A checkout is a mutation inside an otherwise read-only flow: perform it ONLY on the user's explicit accept AND with a clean working tree (`git status --porcelain` prints nothing) — never auto-switch, never with uncommitted changes. After a successful switch, re-run this Feature Directory Resolution block from the top.
105
116
  - **Nothing found** (both lists empty): the pipeline genuinely does not exist anywhere discoverable — STOP and surface the original `not-found` stderr line verbatim (or, where the caller offers to start a new pipeline, offer that).
106
117
 
107
118
  **Anti-fabrication guard.** Never describe pipeline state that resolution or discovery did not return: if both come back empty, the pipeline does not exist — say exactly that, and never reconstruct stages, backlogs, or history from conversational memory.
@@ -124,16 +135,16 @@ Whenever a stage creates the specs tree for the first time (the first PRD or epi
124
135
  Run this after creating the feature/epic directory, before the stage's git commit:
125
136
 
126
137
  ```bash
127
- R="$(bash -c 'for d in "${CLAUDE_PLUGIN_ROOT:-}" "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/cache/*/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 "${FEATURE_FORGE_ROOT:-}" "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/cache/*/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')"
128
139
  [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
129
140
  mkdir -p "<specsDir>"
130
141
  [ -f "<specsDir>/AGENTS.md" ] || cp "$R/references/templates/specs-hygiene/AGENTS.md" "<specsDir>/AGENTS.md"
131
142
  ```
132
143
 
133
- If the host is Claude (the `AskUserQuestion` tool is available), also ensure the Claude-framed variant:
144
+ If the host is Claude (the Claude-native question tool is available), also ensure the Claude-framed variant:
134
145
 
135
146
  ```bash
136
- R="$(bash -c 'for d in "${CLAUDE_PLUGIN_ROOT:-}" "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/cache/*/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
+ R="$(bash -c 'for d in "${FEATURE_FORGE_ROOT:-}" "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/cache/*/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')"
137
148
  [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
138
149
  [ -f "<specsDir>/CLAUDE.md" ] || cp "$R/references/templates/specs-hygiene/CLAUDE.md" "<specsDir>/CLAUDE.md"
139
150
  ```
@@ -153,7 +164,7 @@ After resolving the feature directory, check the feature's `.pipeline-state.json
153
164
  To obtain the manifest contracts and the live completion status of each dependency in one deterministic call, run `render-status` and read the per-feature `status` and the `consumes`/`exposes` arrays rather than re-deriving them:
154
165
 
155
166
  ```bash
156
- R="$(bash -c 'for d in "${CLAUDE_PLUGIN_ROOT:-}" "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/cache/*/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')"
167
+ R="$(bash -c 'for d in "${FEATURE_FORGE_ROOT:-}" "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/cache/*/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')"
157
168
  [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
158
169
  python3 "$R/scripts/epic-manifest.py" \
159
170
  render-status "<epic>" --specs-dir "<specsDir>" --json
@@ -168,7 +179,7 @@ If `render-status` fails, proceed with **only** EPIC.md + charter (a corrupt man
168
179
  Defense-in-depth for the split-brain-epic failure (Issue #125). Invoke this block in the authoring stages (`forge-1-prd`..`forge-4-backlog`) once the feature has resolved — right after **Epic Context Injection** for the stages that run it (`forge-1-prd`..`forge-3-specs`), and right after **Feature Directory Resolution** for `forge-4-backlog`. It confirms that a **resolved nested epic member** actually sits on a branch that contains the epic's manifest. Without this, a member reached from a branch cut *before* the epic-manifest commit (or that otherwise lacks it) would author specs against an epic decomposition that is not present — the exact drift that produces a disjoint, split-brain member. **Skip if not a git repo or `branchPerFeature` is false.**
169
180
 
170
181
  ```bash
171
- R="$(bash -c 'for d in "${CLAUDE_PLUGIN_ROOT:-}" "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/cache/*/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')"
182
+ R="$(bash -c 'for d in "${FEATURE_FORGE_ROOT:-}" "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/cache/*/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
183
  [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
173
184
  python3 "$R/scripts/forge-session.py" check-epic-base --feature "{feature}" --specs-dir "{specsDir}" --json
174
185
  ```
@@ -191,6 +202,44 @@ Pipeline state is written by the `state-*` verbs of `scripts/forge-session.py`
191
202
 
192
203
  If a `state-*` verb exits 2, surface the plain `Error:` line from stderr verbatim, do **not** proceed to the next step of the surrounding protocol, and do **not** hand-author the JSON as a workaround. The stage remains resumable because the entry stamp is already on disk — re-run the verb once the cause is fixed.
193
204
 
205
+ **The nine `state-*` verbs.** `state-enter` (Stage-Entry Guard), `state-artifact` (incremental artifact tracking), `state-complete` (Git Commit Protocol), `state-skip` (the deliberate forge-6-docs documentation skip — scoped to that one stage; writes `status: "skipped"` + `skippedAt`, refuses to erase a record of docs that exist, and is the only sanctioned writer of a skipped docs stage), `state-branch` (Branch Setup and Branch Reconciliation), `state-note` (the Immediate Downstream Note below, and the optional completion note at stage closure), `state-decision` (deferred decisions), `state-ecr` (epic change requests), and `state-verify` (one `forge-verify-*` verification transition — below). The `--epic` member requirement and the exit-2 failure protocol above apply to **every** one of them, `state-verify` included; no verify entry is ever hand-authored.
206
+
207
+ ### `state-verify` — verification results and provenance
208
+
209
+ `state-verify` writes exactly one `stages.forge-verify-{token}` entry — the verification result for the production stage named by `--stage` — plus the top-level `updatedAt`, and nothing else. `--stage` takes the **served production stage** (`forge-0-epic` through `forge-5-loop`; `forge-6-docs` has no verification token and is rejected). Add `--epic "{epic}"` when the feature is an epic member — required, per the member rule above. Result mode passes `--status` (`auto-verify-pending`, `passed`, `findings-reported`, `findings-applied`, or `skipped`) with whatever `--findings-file`, `--findings-count`, and `--verified-stage-version` that status requires; contradictory metadata is refused before any write. `passed` may additionally carry `--findings-file` + `--findings-count` together for an **advisory-only** report (`inconsistency`/`improvement` findings only, per forge-verify's severity floor) — the stage resolves without a fix round and the report stays attached:
210
+
211
+ **`auto-verify-pending` is not a skill-facing status.** It is written by `stage-exit`'s scheduling boundary, which records the debt automatically when auto-verify is effective for a stage. The value is accepted on this CLI so the entry stays inspectable and repairable, not so a skill can hand-schedule verification: no skill body and no reference passes it, and none should. Every other status in the list is the recorded *result* of a verification that ran (or was explicitly skipped); this one records that one was *owed*.
212
+
213
+ ```bash
214
+ R="$(bash -c 'for d in "${FEATURE_FORGE_ROOT:-}" "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/cache/*/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')"
215
+ [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
216
+ python3 "$R/scripts/forge-session.py" state-verify \
217
+ --feature "{feature}" --stage "{served-production-stage}" --status "<status>" \
218
+ --specs-dir "{specsDir}"
219
+ ```
220
+
221
+ Provenance follows the same two-commit sequence as `state-complete`: the result transition above writes `commitHash: null`, Commit 1 records the findings document and the state, and a second `state-verify` call records the full 40-hex hash of Commit 1 and touches nothing else (never `--amend`; an abbreviated hash is refused rather than expanded). Add `--epic "{epic}"` for an epic member — required, per the member rule above:
222
+
223
+ ```bash
224
+ R="$(bash -c 'for d in "${FEATURE_FORGE_ROOT:-}" "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/cache/*/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')"
225
+ [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
226
+ python3 "$R/scripts/forge-session.py" state-verify \
227
+ --feature "{feature}" --stage "{served-production-stage}" \
228
+ --commit-hash "$(git rev-parse HEAD)" --specs-dir "{specsDir}"
229
+ ```
230
+
231
+ Epic-scoped verification is the single exception to the member rule: with `--stage forge-0-epic`, `--feature` names the **epic** and `--epic` must be absent or exactly equal to it. That call writes `{specsDir}/{epic}/.epic-state.json` and never a member's `.pipeline-state.json`, and its freshness version is the epic manifest's `revision`, never a member's stage version:
232
+
233
+ ```bash
234
+ R="$(bash -c 'for d in "${FEATURE_FORGE_ROOT:-}" "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/cache/*/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')"
235
+ [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
236
+ python3 "$R/scripts/forge-session.py" state-verify \
237
+ --feature "{epic}" --stage forge-0-epic --status "<status>" \
238
+ --specs-dir "{specsDir}"
239
+ ```
240
+
241
+ On exit 2 the verification result is **not** recorded: surface the `Error:` line verbatim, name the feature (and epic), and do not claim the verification was persisted or advance past it.
242
+
194
243
  ### Staleness Detection (Read-Time)
195
244
 
196
245
  When loading upstream artifacts as prerequisites, check `basedOnVersions` in the pipeline state for this stage. If any upstream stage's current version is newer than the version recorded in `basedOnVersions`, warn the user before proceeding:
@@ -199,6 +248,31 @@ When loading upstream artifacts as prerequisites, check `basedOnVersions` in the
199
248
 
200
249
  Frame the choice with its cost: re-running re-derives this stage from the current upstream (safest, but discards any hand-edits to this stage's artifacts); proceeding stale is faster but risks baking outdated assumptions into everything downstream. Recommend re-running unless the user knows the upstream change doesn't affect this stage.
201
250
 
251
+ ## Immediate Downstream Note (Parking Lot)
252
+
253
+ When an interview raises a concern that belongs to a *later stage of this same feature*, acknowledge it and persist it **immediately, at the moment it is raised** — not at stage closure — by running `state-note` with a concise one-line statement of the concern. Add `--epic "{epic}"` when this feature is an epic member — required, per the Pipeline State Protocol above; omitting it for a member is an error and must never be allowed to fall back to a same-named flat feature.
254
+
255
+ ```bash
256
+ R="$(bash -c 'for d in "${FEATURE_FORGE_ROOT:-}" "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/cache/*/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')"
257
+ [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
258
+ python3 "$R/scripts/forge-session.py" state-note \
259
+ --feature "{feature}" --note "<concise downstream concern>" \
260
+ --specs-dir "{specsDir}"
261
+ ```
262
+
263
+ `state-note` **overwrites** the single top-level `notes` string — it does not append. To preserve an earlier note, read the current `notes` value out of the feature's `.pipeline-state.json` first and pass one combined concise string in a single `--note`; never edit or round-trip the JSON by hand. This interview-time call is separate from the optional completion note offered at stage closure and must not be deferred until then — a session that ends before closure would otherwise lose the concern entirely.
264
+
265
+ On `UsageError`/exit 2, surface the `Error:` line verbatim together with the named feature (and epic) and the recovery instruction, and **stop claiming the concern was recorded** — it was not. Epic *decomposition* changes are not notes: they go through `state-ecr` into `epicChangeRequests`, never into `notes`.
266
+
267
+ ## Verify Capability
268
+
269
+ Skills that close a stage pass `--verify-capability interactive|manual` to `stage-exit`. The full determination rule, the Standard Verify Gate, and the recovery path live in `references/stage-exit-protocol.md`; the two facts that are most often gotten wrong:
270
+
271
+ - **Dispatch capability is *permitted* dispatch, not a listed tool.** The question is "**may I dispatch `forge-verifier` right now**", not "is a subagent-dispatch tool in my tool surface". A session can carry a standing host instruction against dispatching subagents unless the user asked; such instructions are injected by the harness, sit outside this project's control, and outrank skill prose. Classify on permission, up front.
272
+ - **A consent requirement is `interactive`, not `manual`.** When dispatch is barred only *unless the user asked* and a question mechanism is available, pass `interactive`: the gate's own affirmative choice supplies the missing user request. Pass `manual` only when there is **no** question mechanism **and** **no** permitted dispatch.
273
+
274
+ A bar on unsolicited dispatch is never grounds to skip verification, and never grounds to fence the production successor while verification is unresolved. On the `runInStageVerify: true` path the emitted `verifyGate` stays `none`: reuse the Standard Verify Gate block for consent with **choice 2 omitted** (auto-verify is already effective, so "enable auto-verify going forward" is a no-op), leaving exactly two choices: *Verify now* (recommended) and *Skip for now*. The clean-room `forge-verifier` is **dispatched on the affirmative choice**, never merely printed for the user to run later; *Skip for now* is persisted as an explicit `skipped` before any advancing block.
275
+
202
276
  ## Branch Setup
203
277
 
204
278
  Invoke this block at the **very start** of a pipeline entry point — `forge-1-prd` (standalone feature) and `forge-0-epic` (epic) — **before** any directory resolution or interview, so the rest of the run lands on the intended branch. `{label}` is the feature name (forge-1-prd) or epic name (forge-0-epic); `{scope}` is `feature` or `epic` correspondingly.
@@ -212,7 +286,7 @@ Invoke this block at the **very start** of a pipeline entry point — `forge-1-p
212
286
  1. Read the current branch: `git rev-parse --abbrev-ref HEAD`.
213
287
  2. Determine the default branch: `git symbolic-ref --quiet refs/remotes/origin/HEAD` (strip to the last path segment); if that fails, fall back to `main`, else `master` — whichever the repo has.
214
288
  3. **If the current branch is NOT the default branch** (the user is already on a topic/`{branchPrefix}*` branch) → record it (see below) and proceed silently. Do not prompt.
215
- 4. **If the current branch IS the default branch** → use `AskUserQuestion` with a **strong recommendation** (still optional):
289
+ 4. **If the current branch IS the default branch** → use the host's question mechanism with a **strong recommendation** (still optional):
216
290
 
217
291
  > "You're on `{defaultBranch}`. Strongly recommended: create `{branchPrefix}{label}` so this {scope}'s work stays isolated and reviewable as one branch. Create it?"
218
292
  > Options: **Create `{branchPrefix}{label}` (recommended)** · **Stay on `{defaultBranch}`**
@@ -223,7 +297,7 @@ Invoke this block at the **very start** of a pipeline entry point — `forge-1-p
223
297
  **Record the branch.** After this block resolves, record the resulting branch name in the feature's top-level `branch` field by running `state-branch` (create/update it when the state file is first written for this stage). Emit the call **once the feature directory exists** — i.e. after Feature Directory Resolution and the Entry Stamp, **not** at this block: Branch Setup runs at the very start of the entry point, before any directory resolution, and a brand-new standalone feature may have no directory yet. Add `--epic "{epic}"` to the call when this feature is an epic member — required, per the Pipeline State Protocol.
224
298
 
225
299
  ```bash
226
- R="$(bash -c 'for d in "${CLAUDE_PLUGIN_ROOT:-}" "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/cache/*/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')"
300
+ R="$(bash -c 'for d in "${FEATURE_FORGE_ROOT:-}" "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/cache/*/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')"
227
301
  [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
228
302
  python3 "$R/scripts/forge-session.py" state-branch \
229
303
  --feature "{feature}" --branch "<name>" --specs-dir "{specsDir}"
@@ -236,20 +310,20 @@ Downstream stages and `forge-5-loop` read it to detect drift back onto the defau
236
310
  The recorded `branch` is a **self-healing hint, not gospel.** A hosted environment (Claude.ai remote, cloud agents) can impose an arbitrary session branch (e.g. `claude/<slug>`) that Branch Setup silently records; the user may then move the work to the intended topic branch, leaving the recorded field stale. Every branch-aware mechanism (the `forge-5-loop` guard, `discover-feature`) keys off that field, so a stale value actively misleads — the loop would offer to switch you *back* to the imposed branch. Invoke this block from `forge-5-loop`'s pre-flight (and any stage that acts on the recorded branch) to reconcile deterministically. Skip if not a git repo or `branchPerFeature` is false.
237
311
 
238
312
  ```bash
239
- R="$(bash -c 'for d in "${CLAUDE_PLUGIN_ROOT:-}" "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/cache/*/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')"
313
+ R="$(bash -c 'for d in "${FEATURE_FORGE_ROOT:-}" "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/cache/*/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')"
240
314
  [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
241
315
  python3 "$R/scripts/forge-session.py" reconcile-branch --feature "{feature}" --specs-dir "{specsDir}" --json
242
316
  ```
243
317
 
244
318
  Act on the emitted `action` (source of truth is where the state actually resolves, not the recorded field):
245
319
  - **`adopt-current`** — you are on a non-default topic branch where the state resolves, and the recorded `branch` differs (a stale/imposed value). Run `state-branch` (below) to write `newBranch` into the state `branch` field, with a **visible one-line note** ("recorded branch was `{stateBranch}`; work is on `{currentBranch}` — updating to match") — never silently, and **never push the user back** to the recorded branch (offer that only as a plain alternative).
246
- - **`warn-drift`** — you are on the **default** branch and the state records a topic branch. Via `AskUserQuestion`, strongly recommend creating/switching to `{branchPrefix}{feature}` (then record it), still allowing **proceed on the default branch**. Never hard-stop.
320
+ - **`warn-drift`** — you are on the **default** branch and the state records a topic branch. Via the host's question mechanism, strongly recommend creating/switching to `{branchPrefix}{feature}` (then record it), still allowing **proceed on the default branch**. Never hard-stop.
247
321
  - **`none`** / **`not-resolved`** — nothing to do; proceed.
248
322
 
249
323
  The `adopt-current` write, with the portable plugin-root prelude. Add `--epic "{epic}"` when this feature is an epic member — required, per the Pipeline State Protocol:
250
324
 
251
325
  ```bash
252
- R="$(bash -c 'for d in "${CLAUDE_PLUGIN_ROOT:-}" "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/cache/*/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')"
326
+ R="$(bash -c 'for d in "${FEATURE_FORGE_ROOT:-}" "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/cache/*/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')"
253
327
  [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
254
328
  python3 "$R/scripts/forge-session.py" state-branch \
255
329
  --feature "{feature}" --branch "{newBranch}" --specs-dir "{specsDir}"
@@ -275,7 +349,7 @@ When `gitCommitAfterStage` is true, follow this exact order to avoid state incon
275
349
  The two `state-complete` calls, with the portable plugin-root prelude. Add `--epic "{epic}"` to each when this feature is an epic member — required, per the Pipeline State Protocol:
276
350
 
277
351
  ```bash
278
- R="$(bash -c 'for d in "${CLAUDE_PLUGIN_ROOT:-}" "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/cache/*/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')"
352
+ R="$(bash -c 'for d in "${FEATURE_FORGE_ROOT:-}" "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/cache/*/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')"
279
353
  [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
280
354
  # Commit 1 — before `git commit`
281
355
  python3 "$R/scripts/forge-session.py" state-complete \
@@ -297,15 +371,15 @@ Invoke this block at the **start of an authoring stage** (`forge-1-prd`..`forge-
297
371
 
298
372
  2. **Interrupted** (`status: "in-progress"`) — a previous run of THIS stage was interrupted before it committed (the exit commit is what flips it to `complete`, so `in-progress` on entry always means a crash/abandon). Do **not** silently re-author. Instead:
299
373
  - **Inventory on-disk artifacts:** list the files this stage produces that already exist in `{resolvedFeatureDir}/` (e.g. `PRD.md`; `tech-spec.md`; the `##-*.md` suite + `TRACEABILITY.md`; `backlog.json`), and cross-check against the `stages.{stage}.artifacts` array (written incrementally during the previous run).
300
- - **Gate via `AskUserQuestion`** (Decision Support protocol): present the inventory as text, then ask "This {stage} run was interrupted — {N} artifact(s) from the previous run are on disk: {list}. Resume the in-progress draft, or start a new version from scratch?" Options: **Resume (recommended)** — continue from the first artifact not yet written/complete, reusing the existing files; do **not** re-stamp or bump the version. · **Start a new version** — treat it as a fresh authoring pass (proceed to the Entry Stamp; the version increments at exit).
374
+ - **Gate via the host's question mechanism** (Decision Support protocol): present the inventory as text, then ask "This {stage} run was interrupted — {N} artifact(s) from the previous run are on disk: {list}. Resume the in-progress draft, or start a new version from scratch?" Options: **Resume (recommended)** — continue from the first artifact not yet written/complete, reusing the existing files; do **not** re-stamp or bump the version. · **Start a new version** — treat it as a fresh authoring pass (proceed to the Entry Stamp; the version increments at exit).
301
375
  - Skip artifact regeneration for files that already exist and are complete (non-empty, properly structured); continue from the next unwritten artifact.
302
376
 
303
- 3. **Re-authoring** (`status: "complete"` or `"stale"`) — a finished draft exists. Warn via `AskUserQuestion` before overwriting: "A completed {stage} artifact already exists for '{feature}' (v{n}{, marked stale}). Continuing will create a new version. Proceed?" On confirm, proceed to the Entry Stamp and author a new version (the version increments at exit, per that stage's Update-Pipeline-State step).
377
+ 3. **Re-authoring** (`status: "complete"` or `"stale"`) — a finished draft exists. Warn via the host's question mechanism before overwriting: "A completed {stage} artifact already exists for '{feature}' (v{n}{, marked stale}). Continuing will create a new version. Proceed?" On confirm, proceed to the Entry Stamp and author a new version (the version increments at exit, per that stage's Update-Pipeline-State step).
304
378
 
305
379
  **Entry Stamp** (fresh, restart, and re-author paths — NOT the resume path). Before authoring, record the entry stamp by running `state-enter` — one atomic write that sets `stages.{stage}.status` → `"in-progress"`, `stages.{stage}.startedAt` → current ISO-8601 UTC timestamp, top-level `currentStage` → `"{stage}"` (where the pipeline IS, per O1), and refreshes `updatedAt`. Add `--epic "{epic}"` when this feature is an epic member — required, per the Pipeline State Protocol:
306
380
 
307
381
  ```bash
308
- R="$(bash -c 'for d in "${CLAUDE_PLUGIN_ROOT:-}" "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/cache/*/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')"
382
+ R="$(bash -c 'for d in "${FEATURE_FORGE_ROOT:-}" "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/cache/*/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')"
309
383
  [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
310
384
  python3 "$R/scripts/forge-session.py" state-enter \
311
385
  --feature "{feature}" --stage "{stage}" --specs-dir "{specsDir}"
@@ -318,7 +392,7 @@ This write is **left uncommitted**: it is staged and committed as part of this s
318
392
  **Incremental artifact tracking:** When a stage writes multiple files (e.g. forge-3-specs writing a suite of spec documents), run `state-artifact --feature {feature} --stage {stage} --path <file>` after writing each file — not just at stage completion. This is what makes the Interrupted inventory above precise about which files were successfully written. Add `--epic "{epic}"` when this feature is an epic member — required, per the Pipeline State Protocol.
319
393
 
320
394
  ```bash
321
- R="$(bash -c 'for d in "${CLAUDE_PLUGIN_ROOT:-}" "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/cache/*/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')"
395
+ R="$(bash -c 'for d in "${FEATURE_FORGE_ROOT:-}" "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/cache/*/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')"
322
396
  [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
323
397
  python3 "$R/scripts/forge-session.py" state-artifact \
324
398
  --feature "{feature}" --stage "{stage}" --path "<file>" --specs-dir "{specsDir}"
@@ -332,7 +406,7 @@ Invoke this block **at the head of any post-entry step that writes a stage artif
332
406
 
333
407
  1. **Proceed** when `stages.{stage}.status` is `"in-progress"` (this session's Entry Stamp — you are finishing the run you started) or absent/`pending`. Run the write / exit normally.
334
408
 
335
- 2. **Detect-and-refuse** when ALL of these hold: `stages.{stage}.status ∈ {"complete", "stale"}` **AND** the stage's artifacts (incl. `TRACEABILITY.md` for forge-3-specs) exist on disk **AND** a `commitHash` is recorded for the stage **AND** you did **not** author this stage earlier in the current session. This is a stale/replayed continuation of an already-finished, committed stage. Do **not** overwrite the artifact or re-run the exit. Route instead to the **Stage-Entry Guard**'s *Re-authoring* path: surface the same `AskUserQuestion` warning ("A completed {stage} artifact already exists for '{feature}' (v{n}{, marked stale}). Continuing will create a new version. Proceed?"). Only on explicit confirmation re-enter from the Entry Stamp (the version bumps at exit); otherwise **stop** and report that the stage is already complete — cite the recorded `commitHash` and offer `/feature-forge:forge {feature}` to see true state.
409
+ 2. **Detect-and-refuse** when ALL of these hold: `stages.{stage}.status ∈ {"complete", "stale"}` **AND** the stage's artifacts (incl. `TRACEABILITY.md` for forge-3-specs) exist on disk **AND** a `commitHash` is recorded for the stage **AND** you did **not** author this stage earlier in the current session. This is a stale/replayed continuation of an already-finished, committed stage. Do **not** overwrite the artifact or re-run the exit. Route instead to the **Stage-Entry Guard**'s *Re-authoring* path: surface the same warning via the host's question mechanism ("A completed {stage} artifact already exists for '{feature}' (v{n}{, marked stale}). Continuing will create a new version. Proceed?"). Only on explicit confirmation re-enter from the Entry Stamp (the version bumps at exit); otherwise **stop** and report that the stage is already complete — cite the recorded `commitHash` and offer `/feature-forge:forge {feature}` to see true state.
336
410
 
337
411
  When you cannot confirm you authored the current run, treat it as a replay and refuse: a false refuse costs one confirmation click; a false proceed overwrites a committed artifact and re-churns a stage version. `--force` follows Force Mode (skip the gate, treat as a deliberate re-author).
338
412
 
@@ -45,6 +45,15 @@ How to test this feature.
45
45
  - Coverage targets
46
46
  - Test file location conventions
47
47
 
48
+ **Meta-guard norm (anti-churn).** A spec that mandates a meta-guard — a test protecting
49
+ other tests or prose — must give it an **enumerated protection set** and **explicit
50
+ non-goals**, never an open-ended objective ("un-rottable", "regardless of form"): the
51
+ space of ways to evade a guard is not enumerable, so an unbounded objective produces an
52
+ arms race of one-shape-per-round hardening. The guard's contract is the declared set;
53
+ the verifier judges completeness against it and never files guard-incompleteness
54
+ against a declared non-goal (`references/stage-exit-protocol.md` § Re-verify scope,
55
+ decision immunity).
56
+
48
57
  ## Conditionally Required
49
58
 
50
59
  ### ##-{domain-concern}.md (one per major subsystem)