@garygentry/feature-forge 0.3.0 → 0.3.2

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 (404) hide show
  1. package/adapters/claude/.feature-forge-bundle.json +1 -1
  2. package/adapters/claude/agents/forge-verifier.md +1 -1
  3. package/adapters/claude/references/epic-manifest-schema.json +6 -1
  4. package/adapters/claude/references/forge-config-schema.json +1 -1
  5. package/adapters/claude/references/pipeline-state-schema.json +5 -3
  6. package/adapters/claude/references/shared-conventions.md +125 -12
  7. package/adapters/claude/references/stage-exit-protocol.md +358 -144
  8. package/adapters/claude/references/vendor-construct-inventory.md +1 -1
  9. package/adapters/claude/scripts/epic-manifest.py +459 -90
  10. package/adapters/claude/scripts/forge-bootstrap.py +57 -5
  11. package/adapters/claude/scripts/forge-session.py +4346 -201
  12. package/adapters/claude/scripts/validate-traceability.py +92 -6
  13. package/adapters/claude/skills/forge/SKILL.md +18 -11
  14. package/adapters/claude/skills/forge/references/pipeline-state-schema.json +5 -3
  15. package/adapters/claude/skills/forge/references/shared-conventions.md +125 -12
  16. package/adapters/claude/skills/forge/references/stage-exit-protocol.md +358 -144
  17. package/adapters/claude/skills/forge-0-epic/SKILL.md +8 -3
  18. package/adapters/claude/skills/forge-0-epic/references/edit-mode.md +24 -24
  19. package/adapters/claude/skills/forge-0-epic/references/pipeline-state-schema.json +5 -3
  20. package/adapters/claude/skills/forge-0-epic/references/shared-conventions.md +125 -12
  21. package/adapters/claude/skills/forge-0-epic/references/stage-exit-protocol.md +358 -144
  22. package/adapters/claude/skills/forge-1-prd/SKILL.md +39 -11
  23. package/adapters/claude/skills/forge-1-prd/references/shared-conventions.md +125 -12
  24. package/adapters/claude/skills/forge-1-prd/references/stage-exit-protocol.md +358 -144
  25. package/adapters/claude/skills/forge-2-tech/SKILL.md +38 -10
  26. package/adapters/claude/skills/forge-2-tech/references/shared-conventions.md +125 -12
  27. package/adapters/claude/skills/forge-2-tech/references/stage-exit-protocol.md +358 -144
  28. package/adapters/claude/skills/forge-3-specs/SKILL.md +28 -9
  29. package/adapters/claude/skills/forge-3-specs/references/shared-conventions.md +125 -12
  30. package/adapters/claude/skills/forge-3-specs/references/spec-archetypes.md +9 -0
  31. package/adapters/claude/skills/forge-3-specs/references/stage-exit-protocol.md +358 -144
  32. package/adapters/claude/skills/forge-4-backlog/SKILL.md +39 -10
  33. package/adapters/claude/skills/forge-4-backlog/references/shared-conventions.md +125 -12
  34. package/adapters/claude/skills/forge-4-backlog/references/stage-exit-protocol.md +358 -144
  35. package/adapters/claude/skills/forge-5-loop/SKILL.md +65 -67
  36. package/adapters/claude/skills/forge-5-loop/references/agent-selection.md +116 -0
  37. package/adapters/claude/skills/forge-5-loop/references/result-reporting.md +70 -31
  38. package/adapters/claude/skills/forge-5-loop/references/runner-contract.md +18 -109
  39. package/adapters/claude/skills/forge-5-loop/references/shared-conventions.md +125 -12
  40. package/adapters/claude/skills/forge-5-loop/references/stage-exit-protocol.md +358 -144
  41. package/adapters/claude/skills/forge-6-docs/SKILL.md +59 -9
  42. package/adapters/claude/skills/forge-6-docs/references/shared-conventions.md +125 -12
  43. package/adapters/claude/skills/forge-6-docs/references/stage-exit-protocol.md +472 -0
  44. package/adapters/claude/skills/forge-fix/SKILL.md +85 -33
  45. package/adapters/claude/skills/forge-fix/references/shared-conventions.md +125 -12
  46. package/adapters/claude/skills/forge-fix/references/stage-exit-protocol.md +358 -144
  47. package/adapters/claude/skills/forge-guide/references/forge-config-schema.json +1 -1
  48. package/adapters/claude/skills/forge-guide/references/shared-conventions.md +125 -12
  49. package/adapters/claude/skills/forge-verify/SKILL.md +86 -44
  50. package/adapters/claude/skills/forge-verify/references/findings-template.md +147 -0
  51. package/adapters/claude/skills/forge-verify/references/shared-conventions.md +125 -12
  52. package/adapters/claude/skills/forge-verify/references/stage-exit-protocol.md +472 -0
  53. package/adapters/claude/skills/forge-verify/references/verification-checklists/backlog.md +97 -0
  54. package/adapters/claude/skills/forge-verify/references/verification-checklists/epic.md +80 -0
  55. package/adapters/claude/skills/forge-verify/references/verification-checklists/impl.md +48 -0
  56. package/adapters/claude/skills/forge-verify/references/verification-checklists/prd.md +31 -0
  57. package/adapters/claude/skills/forge-verify/references/verification-checklists/specs.md +66 -0
  58. package/adapters/claude/skills/forge-verify/references/verification-checklists/tech.md +35 -0
  59. package/adapters/codex/.feature-forge-bundle.json +1 -1
  60. package/adapters/codex/agents/forge-verifier.toml +1 -1
  61. package/adapters/codex/references/epic-manifest-schema.json +6 -1
  62. package/adapters/codex/references/forge-config-schema.json +1 -1
  63. package/adapters/codex/references/pipeline-state-schema.json +5 -3
  64. package/adapters/codex/references/shared-conventions.md +125 -12
  65. package/adapters/codex/references/stage-exit-protocol.md +358 -144
  66. package/adapters/codex/references/vendor-construct-inventory.md +1 -1
  67. package/adapters/codex/scripts/epic-manifest.py +459 -90
  68. package/adapters/codex/scripts/forge-bootstrap.py +57 -5
  69. package/adapters/codex/scripts/forge-session.py +4346 -201
  70. package/adapters/codex/scripts/validate-traceability.py +92 -6
  71. package/adapters/codex/skills/forge/SKILL.md +18 -11
  72. package/adapters/codex/skills/forge/references/pipeline-state-schema.json +5 -3
  73. package/adapters/codex/skills/forge/references/shared-conventions.md +125 -12
  74. package/adapters/codex/skills/forge/references/stage-exit-protocol.md +358 -144
  75. package/adapters/codex/skills/forge-0-epic/SKILL.md +8 -3
  76. package/adapters/codex/skills/forge-0-epic/references/edit-mode.md +24 -24
  77. package/adapters/codex/skills/forge-0-epic/references/pipeline-state-schema.json +5 -3
  78. package/adapters/codex/skills/forge-0-epic/references/shared-conventions.md +125 -12
  79. package/adapters/codex/skills/forge-0-epic/references/stage-exit-protocol.md +358 -144
  80. package/adapters/codex/skills/forge-1-prd/SKILL.md +39 -11
  81. package/adapters/codex/skills/forge-1-prd/references/shared-conventions.md +125 -12
  82. package/adapters/codex/skills/forge-1-prd/references/stage-exit-protocol.md +358 -144
  83. package/adapters/codex/skills/forge-2-tech/SKILL.md +38 -10
  84. package/adapters/codex/skills/forge-2-tech/references/shared-conventions.md +125 -12
  85. package/adapters/codex/skills/forge-2-tech/references/stage-exit-protocol.md +358 -144
  86. package/adapters/codex/skills/forge-3-specs/SKILL.md +28 -9
  87. package/adapters/codex/skills/forge-3-specs/references/shared-conventions.md +125 -12
  88. package/adapters/codex/skills/forge-3-specs/references/spec-archetypes.md +9 -0
  89. package/adapters/codex/skills/forge-3-specs/references/stage-exit-protocol.md +358 -144
  90. package/adapters/codex/skills/forge-4-backlog/SKILL.md +39 -10
  91. package/adapters/codex/skills/forge-4-backlog/references/shared-conventions.md +125 -12
  92. package/adapters/codex/skills/forge-4-backlog/references/stage-exit-protocol.md +358 -144
  93. package/adapters/codex/skills/forge-5-loop/SKILL.md +65 -67
  94. package/adapters/codex/skills/forge-5-loop/references/agent-selection.md +116 -0
  95. package/adapters/codex/skills/forge-5-loop/references/result-reporting.md +70 -31
  96. package/adapters/codex/skills/forge-5-loop/references/runner-contract.md +18 -109
  97. package/adapters/codex/skills/forge-5-loop/references/shared-conventions.md +125 -12
  98. package/adapters/codex/skills/forge-5-loop/references/stage-exit-protocol.md +358 -144
  99. package/adapters/codex/skills/forge-6-docs/SKILL.md +59 -9
  100. package/adapters/codex/skills/forge-6-docs/references/shared-conventions.md +125 -12
  101. package/adapters/codex/skills/forge-6-docs/references/stage-exit-protocol.md +472 -0
  102. package/adapters/codex/skills/forge-fix/SKILL.md +84 -32
  103. package/adapters/codex/skills/forge-fix/references/shared-conventions.md +125 -12
  104. package/adapters/codex/skills/forge-fix/references/stage-exit-protocol.md +358 -144
  105. package/adapters/codex/skills/forge-guide/references/forge-config-schema.json +1 -1
  106. package/adapters/codex/skills/forge-guide/references/shared-conventions.md +125 -12
  107. package/adapters/codex/skills/forge-verify/SKILL.md +85 -43
  108. package/adapters/codex/skills/forge-verify/references/findings-template.md +147 -0
  109. package/adapters/codex/skills/forge-verify/references/shared-conventions.md +125 -12
  110. package/adapters/codex/skills/forge-verify/references/stage-exit-protocol.md +472 -0
  111. package/adapters/codex/skills/forge-verify/references/verification-checklists/backlog.md +97 -0
  112. package/adapters/codex/skills/forge-verify/references/verification-checklists/epic.md +80 -0
  113. package/adapters/codex/skills/forge-verify/references/verification-checklists/impl.md +48 -0
  114. package/adapters/codex/skills/forge-verify/references/verification-checklists/prd.md +31 -0
  115. package/adapters/codex/skills/forge-verify/references/verification-checklists/specs.md +66 -0
  116. package/adapters/codex/skills/forge-verify/references/verification-checklists/tech.md +35 -0
  117. package/adapters/copilot/.feature-forge-bundle.json +1 -1
  118. package/adapters/copilot/agents/forge-verifier.md +1 -1
  119. package/adapters/copilot/references/epic-manifest-schema.json +6 -1
  120. package/adapters/copilot/references/forge-config-schema.json +1 -1
  121. package/adapters/copilot/references/pipeline-state-schema.json +5 -3
  122. package/adapters/copilot/references/shared-conventions.md +125 -12
  123. package/adapters/copilot/references/stage-exit-protocol.md +358 -144
  124. package/adapters/copilot/references/vendor-construct-inventory.md +1 -1
  125. package/adapters/copilot/scripts/epic-manifest.py +459 -90
  126. package/adapters/copilot/scripts/forge-bootstrap.py +57 -5
  127. package/adapters/copilot/scripts/forge-session.py +4346 -201
  128. package/adapters/copilot/scripts/validate-traceability.py +92 -6
  129. package/adapters/copilot/skills/forge/forge.md +18 -11
  130. package/adapters/copilot/skills/forge/references/pipeline-state-schema.json +5 -3
  131. package/adapters/copilot/skills/forge/references/shared-conventions.md +125 -12
  132. package/adapters/copilot/skills/forge/references/stage-exit-protocol.md +358 -144
  133. package/adapters/copilot/skills/forge-0-epic/forge-0-epic.md +8 -3
  134. package/adapters/copilot/skills/forge-0-epic/references/edit-mode.md +24 -24
  135. package/adapters/copilot/skills/forge-0-epic/references/pipeline-state-schema.json +5 -3
  136. package/adapters/copilot/skills/forge-0-epic/references/shared-conventions.md +125 -12
  137. package/adapters/copilot/skills/forge-0-epic/references/stage-exit-protocol.md +358 -144
  138. package/adapters/copilot/skills/forge-1-prd/forge-1-prd.md +39 -11
  139. package/adapters/copilot/skills/forge-1-prd/references/shared-conventions.md +125 -12
  140. package/adapters/copilot/skills/forge-1-prd/references/stage-exit-protocol.md +358 -144
  141. package/adapters/copilot/skills/forge-2-tech/forge-2-tech.md +38 -10
  142. package/adapters/copilot/skills/forge-2-tech/references/shared-conventions.md +125 -12
  143. package/adapters/copilot/skills/forge-2-tech/references/stage-exit-protocol.md +358 -144
  144. package/adapters/copilot/skills/forge-3-specs/forge-3-specs.md +28 -9
  145. package/adapters/copilot/skills/forge-3-specs/references/shared-conventions.md +125 -12
  146. package/adapters/copilot/skills/forge-3-specs/references/spec-archetypes.md +9 -0
  147. package/adapters/copilot/skills/forge-3-specs/references/stage-exit-protocol.md +358 -144
  148. package/adapters/copilot/skills/forge-4-backlog/forge-4-backlog.md +39 -10
  149. package/adapters/copilot/skills/forge-4-backlog/references/shared-conventions.md +125 -12
  150. package/adapters/copilot/skills/forge-4-backlog/references/stage-exit-protocol.md +358 -144
  151. package/adapters/copilot/skills/forge-5-loop/forge-5-loop.md +65 -67
  152. package/adapters/copilot/skills/forge-5-loop/references/agent-selection.md +116 -0
  153. package/adapters/copilot/skills/forge-5-loop/references/result-reporting.md +70 -31
  154. package/adapters/copilot/skills/forge-5-loop/references/runner-contract.md +18 -109
  155. package/adapters/copilot/skills/forge-5-loop/references/shared-conventions.md +125 -12
  156. package/adapters/copilot/skills/forge-5-loop/references/stage-exit-protocol.md +358 -144
  157. package/adapters/copilot/skills/forge-6-docs/forge-6-docs.md +59 -9
  158. package/adapters/copilot/skills/forge-6-docs/references/shared-conventions.md +125 -12
  159. package/adapters/copilot/skills/forge-6-docs/references/stage-exit-protocol.md +472 -0
  160. package/adapters/copilot/skills/forge-fix/forge-fix.md +84 -32
  161. package/adapters/copilot/skills/forge-fix/references/shared-conventions.md +125 -12
  162. package/adapters/copilot/skills/forge-fix/references/stage-exit-protocol.md +358 -144
  163. package/adapters/copilot/skills/forge-guide/references/forge-config-schema.json +1 -1
  164. package/adapters/copilot/skills/forge-guide/references/shared-conventions.md +125 -12
  165. package/adapters/copilot/skills/forge-verify/forge-verify.md +85 -43
  166. package/adapters/copilot/skills/forge-verify/references/findings-template.md +147 -0
  167. package/adapters/copilot/skills/forge-verify/references/shared-conventions.md +125 -12
  168. package/adapters/copilot/skills/forge-verify/references/stage-exit-protocol.md +472 -0
  169. package/adapters/copilot/skills/forge-verify/references/verification-checklists/backlog.md +97 -0
  170. package/adapters/copilot/skills/forge-verify/references/verification-checklists/epic.md +80 -0
  171. package/adapters/copilot/skills/forge-verify/references/verification-checklists/impl.md +48 -0
  172. package/adapters/copilot/skills/forge-verify/references/verification-checklists/prd.md +31 -0
  173. package/adapters/copilot/skills/forge-verify/references/verification-checklists/specs.md +66 -0
  174. package/adapters/copilot/skills/forge-verify/references/verification-checklists/tech.md +35 -0
  175. package/adapters/cursor/.feature-forge-bundle.json +1 -1
  176. package/adapters/cursor/agents/forge-verifier.mdc +1 -1
  177. package/adapters/cursor/references/epic-manifest-schema.json +6 -1
  178. package/adapters/cursor/references/forge-config-schema.json +1 -1
  179. package/adapters/cursor/references/pipeline-state-schema.json +5 -3
  180. package/adapters/cursor/references/shared-conventions.md +125 -12
  181. package/adapters/cursor/references/stage-exit-protocol.md +358 -144
  182. package/adapters/cursor/references/vendor-construct-inventory.md +1 -1
  183. package/adapters/cursor/scripts/epic-manifest.py +459 -90
  184. package/adapters/cursor/scripts/forge-bootstrap.py +57 -5
  185. package/adapters/cursor/scripts/forge-session.py +4346 -201
  186. package/adapters/cursor/scripts/validate-traceability.py +92 -6
  187. package/adapters/cursor/skills/forge/forge.mdc +18 -11
  188. package/adapters/cursor/skills/forge/references/pipeline-state-schema.json +5 -3
  189. package/adapters/cursor/skills/forge/references/shared-conventions.md +125 -12
  190. package/adapters/cursor/skills/forge/references/stage-exit-protocol.md +358 -144
  191. package/adapters/cursor/skills/forge-0-epic/forge-0-epic.mdc +8 -3
  192. package/adapters/cursor/skills/forge-0-epic/references/edit-mode.md +24 -24
  193. package/adapters/cursor/skills/forge-0-epic/references/pipeline-state-schema.json +5 -3
  194. package/adapters/cursor/skills/forge-0-epic/references/shared-conventions.md +125 -12
  195. package/adapters/cursor/skills/forge-0-epic/references/stage-exit-protocol.md +358 -144
  196. package/adapters/cursor/skills/forge-1-prd/forge-1-prd.mdc +39 -11
  197. package/adapters/cursor/skills/forge-1-prd/references/shared-conventions.md +125 -12
  198. package/adapters/cursor/skills/forge-1-prd/references/stage-exit-protocol.md +358 -144
  199. package/adapters/cursor/skills/forge-2-tech/forge-2-tech.mdc +38 -10
  200. package/adapters/cursor/skills/forge-2-tech/references/shared-conventions.md +125 -12
  201. package/adapters/cursor/skills/forge-2-tech/references/stage-exit-protocol.md +358 -144
  202. package/adapters/cursor/skills/forge-3-specs/forge-3-specs.mdc +28 -9
  203. package/adapters/cursor/skills/forge-3-specs/references/shared-conventions.md +125 -12
  204. package/adapters/cursor/skills/forge-3-specs/references/spec-archetypes.md +9 -0
  205. package/adapters/cursor/skills/forge-3-specs/references/stage-exit-protocol.md +358 -144
  206. package/adapters/cursor/skills/forge-4-backlog/forge-4-backlog.mdc +39 -10
  207. package/adapters/cursor/skills/forge-4-backlog/references/shared-conventions.md +125 -12
  208. package/adapters/cursor/skills/forge-4-backlog/references/stage-exit-protocol.md +358 -144
  209. package/adapters/cursor/skills/forge-5-loop/forge-5-loop.mdc +65 -67
  210. package/adapters/cursor/skills/forge-5-loop/references/agent-selection.md +116 -0
  211. package/adapters/cursor/skills/forge-5-loop/references/result-reporting.md +70 -31
  212. package/adapters/cursor/skills/forge-5-loop/references/runner-contract.md +18 -109
  213. package/adapters/cursor/skills/forge-5-loop/references/shared-conventions.md +125 -12
  214. package/adapters/cursor/skills/forge-5-loop/references/stage-exit-protocol.md +358 -144
  215. package/adapters/cursor/skills/forge-6-docs/forge-6-docs.mdc +59 -9
  216. package/adapters/cursor/skills/forge-6-docs/references/shared-conventions.md +125 -12
  217. package/adapters/cursor/skills/forge-6-docs/references/stage-exit-protocol.md +472 -0
  218. package/adapters/cursor/skills/forge-fix/forge-fix.mdc +84 -32
  219. package/adapters/cursor/skills/forge-fix/references/shared-conventions.md +125 -12
  220. package/adapters/cursor/skills/forge-fix/references/stage-exit-protocol.md +358 -144
  221. package/adapters/cursor/skills/forge-guide/references/forge-config-schema.json +1 -1
  222. package/adapters/cursor/skills/forge-guide/references/shared-conventions.md +125 -12
  223. package/adapters/cursor/skills/forge-verify/forge-verify.mdc +85 -43
  224. package/adapters/cursor/skills/forge-verify/references/findings-template.md +147 -0
  225. package/adapters/cursor/skills/forge-verify/references/shared-conventions.md +125 -12
  226. package/adapters/cursor/skills/forge-verify/references/stage-exit-protocol.md +472 -0
  227. package/adapters/cursor/skills/forge-verify/references/verification-checklists/backlog.md +97 -0
  228. package/adapters/cursor/skills/forge-verify/references/verification-checklists/epic.md +80 -0
  229. package/adapters/cursor/skills/forge-verify/references/verification-checklists/impl.md +48 -0
  230. package/adapters/cursor/skills/forge-verify/references/verification-checklists/prd.md +31 -0
  231. package/adapters/cursor/skills/forge-verify/references/verification-checklists/specs.md +66 -0
  232. package/adapters/cursor/skills/forge-verify/references/verification-checklists/tech.md +35 -0
  233. package/adapters/gemini/.feature-forge-bundle.json +1 -1
  234. package/adapters/gemini/agents/forge-verifier.md +1 -1
  235. package/adapters/gemini/gemini-extension.json +1 -1
  236. package/adapters/gemini/references/epic-manifest-schema.json +6 -1
  237. package/adapters/gemini/references/forge-config-schema.json +1 -1
  238. package/adapters/gemini/references/pipeline-state-schema.json +5 -3
  239. package/adapters/gemini/references/shared-conventions.md +125 -12
  240. package/adapters/gemini/references/stage-exit-protocol.md +358 -144
  241. package/adapters/gemini/references/vendor-construct-inventory.md +1 -1
  242. package/adapters/gemini/scripts/epic-manifest.py +459 -90
  243. package/adapters/gemini/scripts/forge-bootstrap.py +57 -5
  244. package/adapters/gemini/scripts/forge-session.py +4346 -201
  245. package/adapters/gemini/scripts/validate-traceability.py +92 -6
  246. package/adapters/gemini/skills/forge/forge.md +18 -11
  247. package/adapters/gemini/skills/forge/references/pipeline-state-schema.json +5 -3
  248. package/adapters/gemini/skills/forge/references/shared-conventions.md +125 -12
  249. package/adapters/gemini/skills/forge/references/stage-exit-protocol.md +358 -144
  250. package/adapters/gemini/skills/forge-0-epic/forge-0-epic.md +8 -3
  251. package/adapters/gemini/skills/forge-0-epic/references/edit-mode.md +24 -24
  252. package/adapters/gemini/skills/forge-0-epic/references/pipeline-state-schema.json +5 -3
  253. package/adapters/gemini/skills/forge-0-epic/references/shared-conventions.md +125 -12
  254. package/adapters/gemini/skills/forge-0-epic/references/stage-exit-protocol.md +358 -144
  255. package/adapters/gemini/skills/forge-1-prd/forge-1-prd.md +39 -11
  256. package/adapters/gemini/skills/forge-1-prd/references/shared-conventions.md +125 -12
  257. package/adapters/gemini/skills/forge-1-prd/references/stage-exit-protocol.md +358 -144
  258. package/adapters/gemini/skills/forge-2-tech/forge-2-tech.md +38 -10
  259. package/adapters/gemini/skills/forge-2-tech/references/shared-conventions.md +125 -12
  260. package/adapters/gemini/skills/forge-2-tech/references/stage-exit-protocol.md +358 -144
  261. package/adapters/gemini/skills/forge-3-specs/forge-3-specs.md +28 -9
  262. package/adapters/gemini/skills/forge-3-specs/references/shared-conventions.md +125 -12
  263. package/adapters/gemini/skills/forge-3-specs/references/spec-archetypes.md +9 -0
  264. package/adapters/gemini/skills/forge-3-specs/references/stage-exit-protocol.md +358 -144
  265. package/adapters/gemini/skills/forge-4-backlog/forge-4-backlog.md +39 -10
  266. package/adapters/gemini/skills/forge-4-backlog/references/shared-conventions.md +125 -12
  267. package/adapters/gemini/skills/forge-4-backlog/references/stage-exit-protocol.md +358 -144
  268. package/adapters/gemini/skills/forge-5-loop/forge-5-loop.md +65 -67
  269. package/adapters/gemini/skills/forge-5-loop/references/agent-selection.md +116 -0
  270. package/adapters/gemini/skills/forge-5-loop/references/result-reporting.md +70 -31
  271. package/adapters/gemini/skills/forge-5-loop/references/runner-contract.md +18 -109
  272. package/adapters/gemini/skills/forge-5-loop/references/shared-conventions.md +125 -12
  273. package/adapters/gemini/skills/forge-5-loop/references/stage-exit-protocol.md +358 -144
  274. package/adapters/gemini/skills/forge-6-docs/forge-6-docs.md +59 -9
  275. package/adapters/gemini/skills/forge-6-docs/references/shared-conventions.md +125 -12
  276. package/adapters/gemini/skills/forge-6-docs/references/stage-exit-protocol.md +472 -0
  277. package/adapters/gemini/skills/forge-fix/forge-fix.md +84 -32
  278. package/adapters/gemini/skills/forge-fix/references/shared-conventions.md +125 -12
  279. package/adapters/gemini/skills/forge-fix/references/stage-exit-protocol.md +358 -144
  280. package/adapters/gemini/skills/forge-guide/references/forge-config-schema.json +1 -1
  281. package/adapters/gemini/skills/forge-guide/references/shared-conventions.md +125 -12
  282. package/adapters/gemini/skills/forge-verify/forge-verify.md +85 -43
  283. package/adapters/gemini/skills/forge-verify/references/findings-template.md +147 -0
  284. package/adapters/gemini/skills/forge-verify/references/shared-conventions.md +125 -12
  285. package/adapters/gemini/skills/forge-verify/references/stage-exit-protocol.md +472 -0
  286. package/adapters/gemini/skills/forge-verify/references/verification-checklists/backlog.md +97 -0
  287. package/adapters/gemini/skills/forge-verify/references/verification-checklists/epic.md +80 -0
  288. package/adapters/gemini/skills/forge-verify/references/verification-checklists/impl.md +48 -0
  289. package/adapters/gemini/skills/forge-verify/references/verification-checklists/prd.md +31 -0
  290. package/adapters/gemini/skills/forge-verify/references/verification-checklists/specs.md +66 -0
  291. package/adapters/gemini/skills/forge-verify/references/verification-checklists/tech.md +35 -0
  292. package/adapters/pi/.feature-forge-bundle.json +1 -1
  293. package/adapters/pi/agents/forge-verifier.md +1 -1
  294. package/adapters/pi/references/epic-manifest-schema.json +6 -1
  295. package/adapters/pi/references/forge-config-schema.json +1 -1
  296. package/adapters/pi/references/pipeline-state-schema.json +5 -3
  297. package/adapters/pi/references/shared-conventions.md +125 -12
  298. package/adapters/pi/references/stage-exit-protocol.md +358 -144
  299. package/adapters/pi/references/vendor-construct-inventory.md +1 -1
  300. package/adapters/pi/scripts/epic-manifest.py +459 -90
  301. package/adapters/pi/scripts/forge-bootstrap.py +57 -5
  302. package/adapters/pi/scripts/forge-session.py +4346 -201
  303. package/adapters/pi/scripts/validate-traceability.py +92 -6
  304. package/adapters/pi/skills/forge/SKILL.md +18 -11
  305. package/adapters/pi/skills/forge/references/pipeline-state-schema.json +5 -3
  306. package/adapters/pi/skills/forge/references/shared-conventions.md +125 -12
  307. package/adapters/pi/skills/forge/references/stage-exit-protocol.md +358 -144
  308. package/adapters/pi/skills/forge-0-epic/SKILL.md +8 -3
  309. package/adapters/pi/skills/forge-0-epic/references/edit-mode.md +24 -24
  310. package/adapters/pi/skills/forge-0-epic/references/pipeline-state-schema.json +5 -3
  311. package/adapters/pi/skills/forge-0-epic/references/shared-conventions.md +125 -12
  312. package/adapters/pi/skills/forge-0-epic/references/stage-exit-protocol.md +358 -144
  313. package/adapters/pi/skills/forge-1-prd/SKILL.md +39 -11
  314. package/adapters/pi/skills/forge-1-prd/references/shared-conventions.md +125 -12
  315. package/adapters/pi/skills/forge-1-prd/references/stage-exit-protocol.md +358 -144
  316. package/adapters/pi/skills/forge-2-tech/SKILL.md +38 -10
  317. package/adapters/pi/skills/forge-2-tech/references/shared-conventions.md +125 -12
  318. package/adapters/pi/skills/forge-2-tech/references/stage-exit-protocol.md +358 -144
  319. package/adapters/pi/skills/forge-3-specs/SKILL.md +28 -9
  320. package/adapters/pi/skills/forge-3-specs/references/shared-conventions.md +125 -12
  321. package/adapters/pi/skills/forge-3-specs/references/spec-archetypes.md +9 -0
  322. package/adapters/pi/skills/forge-3-specs/references/stage-exit-protocol.md +358 -144
  323. package/adapters/pi/skills/forge-4-backlog/SKILL.md +39 -10
  324. package/adapters/pi/skills/forge-4-backlog/references/shared-conventions.md +125 -12
  325. package/adapters/pi/skills/forge-4-backlog/references/stage-exit-protocol.md +358 -144
  326. package/adapters/pi/skills/forge-5-loop/SKILL.md +65 -67
  327. package/adapters/pi/skills/forge-5-loop/references/agent-selection.md +116 -0
  328. package/adapters/pi/skills/forge-5-loop/references/result-reporting.md +70 -31
  329. package/adapters/pi/skills/forge-5-loop/references/runner-contract.md +18 -109
  330. package/adapters/pi/skills/forge-5-loop/references/shared-conventions.md +125 -12
  331. package/adapters/pi/skills/forge-5-loop/references/stage-exit-protocol.md +358 -144
  332. package/adapters/pi/skills/forge-6-docs/SKILL.md +59 -9
  333. package/adapters/pi/skills/forge-6-docs/references/shared-conventions.md +125 -12
  334. package/adapters/pi/skills/forge-6-docs/references/stage-exit-protocol.md +472 -0
  335. package/adapters/pi/skills/forge-fix/SKILL.md +84 -32
  336. package/adapters/pi/skills/forge-fix/references/shared-conventions.md +125 -12
  337. package/adapters/pi/skills/forge-fix/references/stage-exit-protocol.md +358 -144
  338. package/adapters/pi/skills/forge-guide/references/forge-config-schema.json +1 -1
  339. package/adapters/pi/skills/forge-guide/references/shared-conventions.md +125 -12
  340. package/adapters/pi/skills/forge-verify/SKILL.md +85 -43
  341. package/adapters/pi/skills/forge-verify/references/findings-template.md +147 -0
  342. package/adapters/pi/skills/forge-verify/references/shared-conventions.md +125 -12
  343. package/adapters/pi/skills/forge-verify/references/stage-exit-protocol.md +472 -0
  344. package/adapters/pi/skills/forge-verify/references/verification-checklists/backlog.md +97 -0
  345. package/adapters/pi/skills/forge-verify/references/verification-checklists/epic.md +80 -0
  346. package/adapters/pi/skills/forge-verify/references/verification-checklists/impl.md +48 -0
  347. package/adapters/pi/skills/forge-verify/references/verification-checklists/prd.md +31 -0
  348. package/adapters/pi/skills/forge-verify/references/verification-checklists/specs.md +66 -0
  349. package/adapters/pi/skills/forge-verify/references/verification-checklists/tech.md +35 -0
  350. package/package.json +1 -1
  351. package/adapters/claude/skills/forge-1-prd/references/pipeline-state-schema.json +0 -191
  352. package/adapters/claude/skills/forge-2-tech/references/pipeline-state-schema.json +0 -191
  353. package/adapters/claude/skills/forge-3-specs/references/pipeline-state-schema.json +0 -191
  354. package/adapters/claude/skills/forge-4-backlog/references/forge-config-schema.json +0 -236
  355. package/adapters/claude/skills/forge-4-backlog/references/pipeline-state-schema.json +0 -191
  356. package/adapters/claude/skills/forge-5-loop/references/forge-config-schema.json +0 -236
  357. package/adapters/claude/skills/forge-6-docs/references/pipeline-state-schema.json +0 -191
  358. package/adapters/claude/skills/forge-verify/references/pipeline-state-schema.json +0 -191
  359. package/adapters/claude/skills/forge-verify/references/verification-checklists.md +0 -477
  360. package/adapters/codex/skills/forge-1-prd/references/pipeline-state-schema.json +0 -191
  361. package/adapters/codex/skills/forge-2-tech/references/pipeline-state-schema.json +0 -191
  362. package/adapters/codex/skills/forge-3-specs/references/pipeline-state-schema.json +0 -191
  363. package/adapters/codex/skills/forge-4-backlog/references/forge-config-schema.json +0 -236
  364. package/adapters/codex/skills/forge-4-backlog/references/pipeline-state-schema.json +0 -191
  365. package/adapters/codex/skills/forge-5-loop/references/forge-config-schema.json +0 -236
  366. package/adapters/codex/skills/forge-6-docs/references/pipeline-state-schema.json +0 -191
  367. package/adapters/codex/skills/forge-verify/references/pipeline-state-schema.json +0 -191
  368. package/adapters/codex/skills/forge-verify/references/verification-checklists.md +0 -477
  369. package/adapters/copilot/skills/forge-1-prd/references/pipeline-state-schema.json +0 -191
  370. package/adapters/copilot/skills/forge-2-tech/references/pipeline-state-schema.json +0 -191
  371. package/adapters/copilot/skills/forge-3-specs/references/pipeline-state-schema.json +0 -191
  372. package/adapters/copilot/skills/forge-4-backlog/references/forge-config-schema.json +0 -236
  373. package/adapters/copilot/skills/forge-4-backlog/references/pipeline-state-schema.json +0 -191
  374. package/adapters/copilot/skills/forge-5-loop/references/forge-config-schema.json +0 -236
  375. package/adapters/copilot/skills/forge-6-docs/references/pipeline-state-schema.json +0 -191
  376. package/adapters/copilot/skills/forge-verify/references/pipeline-state-schema.json +0 -191
  377. package/adapters/copilot/skills/forge-verify/references/verification-checklists.md +0 -477
  378. package/adapters/cursor/skills/forge-1-prd/references/pipeline-state-schema.json +0 -191
  379. package/adapters/cursor/skills/forge-2-tech/references/pipeline-state-schema.json +0 -191
  380. package/adapters/cursor/skills/forge-3-specs/references/pipeline-state-schema.json +0 -191
  381. package/adapters/cursor/skills/forge-4-backlog/references/forge-config-schema.json +0 -236
  382. package/adapters/cursor/skills/forge-4-backlog/references/pipeline-state-schema.json +0 -191
  383. package/adapters/cursor/skills/forge-5-loop/references/forge-config-schema.json +0 -236
  384. package/adapters/cursor/skills/forge-6-docs/references/pipeline-state-schema.json +0 -191
  385. package/adapters/cursor/skills/forge-verify/references/pipeline-state-schema.json +0 -191
  386. package/adapters/cursor/skills/forge-verify/references/verification-checklists.md +0 -477
  387. package/adapters/gemini/skills/forge-1-prd/references/pipeline-state-schema.json +0 -191
  388. package/adapters/gemini/skills/forge-2-tech/references/pipeline-state-schema.json +0 -191
  389. package/adapters/gemini/skills/forge-3-specs/references/pipeline-state-schema.json +0 -191
  390. package/adapters/gemini/skills/forge-4-backlog/references/forge-config-schema.json +0 -236
  391. package/adapters/gemini/skills/forge-4-backlog/references/pipeline-state-schema.json +0 -191
  392. package/adapters/gemini/skills/forge-5-loop/references/forge-config-schema.json +0 -236
  393. package/adapters/gemini/skills/forge-6-docs/references/pipeline-state-schema.json +0 -191
  394. package/adapters/gemini/skills/forge-verify/references/pipeline-state-schema.json +0 -191
  395. package/adapters/gemini/skills/forge-verify/references/verification-checklists.md +0 -477
  396. package/adapters/pi/skills/forge-1-prd/references/pipeline-state-schema.json +0 -191
  397. package/adapters/pi/skills/forge-2-tech/references/pipeline-state-schema.json +0 -191
  398. package/adapters/pi/skills/forge-3-specs/references/pipeline-state-schema.json +0 -191
  399. package/adapters/pi/skills/forge-4-backlog/references/forge-config-schema.json +0 -236
  400. package/adapters/pi/skills/forge-4-backlog/references/pipeline-state-schema.json +0 -191
  401. package/adapters/pi/skills/forge-5-loop/references/forge-config-schema.json +0 -236
  402. package/adapters/pi/skills/forge-6-docs/references/pipeline-state-schema.json +0 -191
  403. package/adapters/pi/skills/forge-verify/references/pipeline-state-schema.json +0 -191
  404. package/adapters/pi/skills/forge-verify/references/verification-checklists.md +0 -477
@@ -164,6 +164,7 @@ sequence, **not** a dependency ordering). Preserve the C2 order unless the user
164
164
  Compose the full `epic-manifest.json` per the 00 §2 schema, setting:
165
165
 
166
166
  - `schemaVersion`: `1`
167
+ - `revision`: `1` — the canonical artifact revision epic-scoped verification freshness compares against. Creation always writes `1`; every later mutation bumps it exactly once via the helper mutators. Never hand-edit it.
167
168
  - `epic`: `"{epic}"`
168
169
  - `description`: from C1
169
170
  - `status`: `"active"`
@@ -230,7 +231,7 @@ so the navigator and resolver can see them before any stage runs. For each `feat
230
231
  standalone feature. **No per-feature `status` beyond the stage entry** — the member state
231
232
  holds derived stage progress only.
232
233
 
233
- For an example member state, read `references/edit-mode.md` (Member State Example section).
234
+ For an example member state, read `references/edit-mode.md` (Member State Example section). This stub is written by hand rather than by a `state-*` verb — deliberately: no verb writes the `epic` back-pointer a brand-new member needs, so this is a sanctioned exception to the Pipeline State Protocol.
234
235
 
235
236
  The member subtree holds the **same** artifact set a standalone feature holds; only
236
237
  `.pipeline-state.json` exists at creation. No PRD/specs are authored here. The epic subtree is
@@ -247,15 +248,17 @@ now self-contained: manifest + EPIC.md + one subdirectory per member.
247
248
 
248
249
  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):
249
250
 
251
+ Determine `{verify-capability}` per the **Host and capability determination** section of `references/stage-exit-protocol.md`: `interactive` needs both a question mechanism and *permission* to dispatch the clean-room `forge-verifier`, and a session that merely needs consent first is still `interactive`.
252
+
250
253
  **Close this stage with the Scripted Stage Exit** (contract: `references/stage-exit-protocol.md`; do not improvise a "Next steps" list). Run:
251
254
 
252
255
  ```bash
253
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')"
254
257
  [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
255
- python3 "$R/scripts/forge-session.py" stage-exit --feature "{epic}" --stage forge-0-epic --next-feature "{first-actionable-feature}" --specs-dir "{specsDir}" --host generic
258
+ python3 "$R/scripts/forge-session.py" stage-exit --feature "{epic}" --stage forge-0-epic --next-feature "{first-actionable-feature}" --specs-dir "{specsDir}" --host generic --verify-capability "{verify-capability}"
256
259
  ```
257
260
 
258
- 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.**
261
+ 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.
259
262
 
260
263
  ---
261
264
 
@@ -274,6 +277,8 @@ EPIC.md patch rule, and the E6 Observability / Pipeline State & Commit machinery
274
277
  `references/edit-mode.md`. For the exact `epic-manifest.py` mutator flag surface and
275
278
  per-subcommand exit-code (`0`/`1`/`2`) handling, read `references/epic-manifest-subcommands.md`.
276
279
 
280
+ An edit-mode mutation closes through the **same** Scripted Stage Exit command Step C8 runs — there is one scripted exit for this skill, not one per branch. Only the argument differs: edit mode re-reads live epic status **after** the mutation and its commit, passes the resulting concrete member as `--next-feature`, and **omits that flag entirely** when no member is actionable (so the router hands back to the epic dashboard instead of naming a member it cannot resolve). Those substitution rules, the `render-status` failure path, and the script's member fallback warning are all in `references/edit-mode.md` — do not improvise a closing pointer here.
281
+
277
282
  ---
278
283
 
279
284
  ## Error Handling
@@ -163,29 +163,15 @@ For the initial creation write (C5) the skill sets `createdAt == updatedAt`.
163
163
  - **Edit mode:** edits mutate the **manifest**, not member pipeline states — except the
164
164
  newly-created subdir for `add-feature`, which follows C7 (create the member subdir + back-pointer
165
165
  state). The skill does **not** rewrite existing members' `stages` on an edit.
166
- - **`.epic-state.json` (lazily created, written by skills — NOT the helper):** epic-*scoped* stage
166
+ - **`.epic-state.json` (lazily created, written by `state-verify`):** epic-*scoped* stage
167
167
  entries that belong to no single member — currently only `forge-verify-epic` — are persisted in a
168
168
  dedicated `{specsDir}/{epic}/.epic-state.json`. It holds **only** epic-scoped stage entries,
169
169
  never derived per-feature status (so it does not violate REQ-STATE-02). `forge-0-epic` does
170
170
  **not** create this file — no epic-scoped stage runs during creation or edit; it appears only once
171
- `forge-verify` epic mode runs. When a skill does write it (e.g. forge-verify epic mode), it writes
172
- **directly** using an atomic temp-file + `os.replace` pattern — the helper exposes no subcommand
173
- for it. On I/O failure the skill reports and leaves any prior file intact (never a partial write).
174
- Minimal schema:
175
-
176
- ```jsonc
177
- {
178
- "epic": "auth-overhaul", // matches manifest `epic`
179
- "stages": {
180
- "forge-verify-epic": {
181
- "status": "findings-reported", // "findings-reported" | "passed" | "findings-applied"
182
- "findingsFile": ".verification/VERIFY-epic-2026-06-12.md",
183
- "findingsCount": 3,
184
- "verifiedAt": "2026-06-12T00:00:00Z"
185
- }
186
- }
187
- }
188
- ```
171
+ `forge-verify` epic mode runs, and that skill records the result through `state-verify --stage
172
+ forge-0-epic` (the sanctioned epic writer, per the Pipeline State Protocol in
173
+ `references/shared-conventions.md`). No skill ever hand-authors this file, and its minimal shape
174
+ is documented once, alongside that call, in `skills/forge-verify/references/findings-template.md`.
189
175
 
190
176
  The git-commit step below stages the whole epic subtree, so `.epic-state.json` is captured
191
177
  automatically when present.
@@ -210,13 +196,27 @@ follow the Git Commit Protocol in shared-conventions:
210
196
  Because every mutation is committed, the git history of `epic-manifest.json` is the audit trail; no
211
197
  separate in-manifest audit log is kept.
212
198
 
213
- ### Closing message
199
+ ### Closing the stage — fresh live status, then the Scripted Stage Exit
200
+
201
+ After a successful **creation**, close with Step C8's Scripted Stage Exit, exactly as specified there.
202
+
203
+ After a successful **edit-mode mutation** — the mutator returned exit `0` **and** the E6 commit above landed — confirm the change in one line (`Epic {epic} updated (<action>).`) and then close with the **same** Scripted Stage Exit. Do **not** hand-write a dashboard pointer, a "Next steps" list, or any other next command: the script owns edit-mode routing end to end, and a second hand-written command can only disagree with it.
204
+
205
+ **Read live status again first.** The E4 `render-status` snapshot is stale by the time you get here — it was taken *before* the mutation, so a member the edit just unblocked (or just blocked) is misreported, and the whole point of routing from live state is lost. Re-read it **after** the mutation and the commit:
206
+
207
+ ```bash
208
+ 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')"
209
+ [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
210
+ python3 "$R/scripts/epic-manifest.py" render-status "{epic}" --specs-dir "{specsDir}" --json
211
+ ```
212
+
213
+ Choosing the `--next-feature` argument from that **fresh** payload is the only routing decision this step makes; every other one belongs to the script:
214
214
 
215
- After a successful **creation**, present the next-steps message (already specified in C8). After a
216
- successful **edit-mode mutation**, confirm the change and re-surface the dashboard pointer:
215
+ - **`actionable` is non-empty** → `{first-actionable-feature}` is its **first** entry, a concrete member name. Pass it as `--next-feature "{first-actionable-feature}"`. The script then resolves that member's own `.pipeline-state.json` and routes to its **first incomplete production stage**, so a member whose PRD is already written resumes at tech/specs/backlog/loop/docs — it is never sent back to `forge-1-prd`. Do **not** derive that stage yourself and do **not** read the member's state to second-guess the script.
216
+ - **`actionable` is empty** → there is no member to hand off to. **Omit `--next-feature` entirely**; the script routes to the epic dashboard/completion view. Never substitute a stand-in for the flag value — not the literal `{first-actionable-feature}`, not the epic name, not an arbitrary member off `features[]`. An unresolved placeholder is not a member name, and the script rejects an unsafe value with exit `2`.
217
+ - **`render-status` exits `≥ 1`, or its payload is malformed or missing a required field** → surface every `findings[]` entry **verbatim**, then take the same no-member path: close with the epic stage exit carrying **no** `--next-feature`, so recovery lands on the epic dashboard. A failed status read is never grounds to guess a follow-up member.
217
218
 
218
- > Epic `{epic}` updated (`<action>`). Run `/feature-forge:forge {epic}` to see the refreshed
219
- > dashboard, or re-run `/feature-forge:forge-0-epic {epic}` to make another change.
219
+ **Surface the script's warnings before the block.** `warnings` is part of the directive contract. When the selected member's pipeline state is missing, unreadable, malformed, or not a member of this epic, the script emits a named warning naming that member and the recovery command, and degrades **only** to `forge-1-prd {member}` on its own. Print that warning ahead of the terminal block exactly as emitted, and leave the routing where the script put it — do **not** "correct" the fallback to a later stage you inferred, and do **not** re-read the member's state to override it.
220
220
 
221
221
  ## EPIC.md Mirror Template (creation C6 / edit E5)
222
222
 
@@ -33,7 +33,7 @@
33
33
  "currentStage": {
34
34
  "type": "string",
35
35
  "enum": ["forge-1-prd", "forge-2-tech", "forge-3-specs", "forge-4-backlog", "forge-5-loop", "forge-6-docs", "complete", "forge-verify-prd", "forge-verify-tech", "forge-verify-specs", "forge-verify-backlog", "forge-verify-impl", "forge-0-epic", "forge-verify-epic"],
36
- "description": "Where the pipeline IS: the most recently started stage — its `stages[<currentStage>].status` is `in-progress` while that stage is being authored, then `complete` once its artifacts are committed. A stage skill sets this to its own id when it starts. This is deliberately NOT 'the next stage to run': the next stage is DERIVED, never stored — it is the first production stage whose `stages[].status` is not `complete` (see `next_stage()` in forge-session.py, surfaced as the navigator/doctor `nextStage`). Consumers that need 'what runs next' compute it from `stages[].status`, not from this field. `complete` here means the whole pipeline is done. (Legacy/absent value: tools fall back to the derived next stage for display only — `build_rows` in forge-session.py.)"
36
+ "description": "Where the pipeline IS: the most recently started stage — its `stages[<currentStage>].status` is `in-progress` while that stage is being authored, then `complete` once its artifacts are committed. A stage skill sets this to its own id when it starts. This is deliberately NOT 'the next stage to run': the next stage is DERIVED, never stored — it is the first production stage whose `stages[].status` is not `complete` (see `next_stage()` in forge-session.py, surfaced as the navigator/doctor `nextStage`). Consumers that need 'what runs next' compute it from `stages[].status`, not from this field. `complete` is a LEGACY enum value, retained so pre-0.14 state files still validate: no writer produces it (the `state-*` verbs are the only writers, and only `state-enter` touches this field, setting it to the stage being entered). A finished pipeline therefore records the last stage it started — `forge-6-docs` — and 'the whole pipeline is done' is DERIVED too: `next_stage()` returns null (surfaced as `nextStage: null` / `complete: true`). Never test this field against `complete` to decide whether a pipeline finished. (Legacy/absent value: tools fall back to the derived next stage for display only — `build_rows` in forge-session.py.)"
37
37
  },
38
38
  "notes": {
39
39
  "type": "string",
@@ -171,7 +171,7 @@
171
171
  "properties": {
172
172
  "status": {
173
173
  "type": "string",
174
- "enum": ["pending", "passed", "findings-reported", "findings-applied", "skipped"]
174
+ "enum": ["pending", "auto-verify-pending", "passed", "findings-reported", "findings-applied", "skipped"]
175
175
  },
176
176
  "findingsFile": {
177
177
  "type": ["string", "null"],
@@ -184,7 +184,9 @@
184
184
  "verifiedAt": { "type": ["string", "null"], "format": "date-time" },
185
185
  "fixedAt": { "type": ["string", "null"], "format": "date-time" },
186
186
  "commitHash": { "type": ["string", "null"], "description": "Git commit SHA of the verify/fix artifact commit. Recorded via the two-commit Git Commit Protocol (shared-conventions.md) so it points at the artifact commit, never an orphaned amend." },
187
- "verifiedStageVersion": { "type": ["integer", "null"], "description": "The production stage's `version` at the moment this verify was resolved. The navigator's freshness ledger compares it to the stage's current `version`: equal means the verify is fresh; a mismatch (artifact revised since) or an absent field (legacy state) means stale, so auto-verify re-fires. Recorded by forge-verify/forge-fix when writing a passed/findings-applied status." }
187
+ "verifiedStageVersion": { "type": ["integer", "null"], "description": "The production stage's `version` at the moment this verify was resolved. The navigator's freshness ledger compares it to the stage's current `version`: equal means the verify is fresh; a mismatch (artifact revised since) or an absent field (legacy state) means stale, so auto-verify re-fires. Recorded by forge-verify/forge-fix when writing a passed/findings-applied status." },
188
+ "scheduledAt": { "type": ["string", "null"], "format": "date-time", "description": "UTC ISO-8601 timestamp at which unattended in-stage verification was scheduled for this entry. Written alongside the `auto-verify-pending` status and DELETED (not nulled) by any terminal result, so an absent field means 'not scheduled'." },
189
+ "scheduledStageVersion": { "type": ["integer", "null"], "minimum": 1, "description": "The artifact revision current when verification was scheduled — the production stage's `version` for a feature, the epic manifest's `revision` for an epic. Makes rescheduling idempotent (an identical revision does not rewrite the entry) and lets a read tell debt owed on the current artifact from debt stranded on an older one. Deleted by any terminal result." }
188
190
  }
189
191
  }
190
192
  }
@@ -133,6 +133,8 @@ mkdir -p "<specsDir>"
133
133
  If the host is Claude (the `AskUserQuestion` tool is available), also ensure the Claude-framed variant:
134
134
 
135
135
  ```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')"
137
+ [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
136
138
  [ -f "<specsDir>/CLAUDE.md" ] || cp "$R/references/templates/specs-hygiene/CLAUDE.md" "<specsDir>/CLAUDE.md"
137
139
  ```
138
140
 
@@ -183,7 +185,49 @@ If the helper is unavailable (a non-Claude host without the resolver), skip this
183
185
 
184
186
  ## Pipeline State Protocol
185
187
 
186
- Write pipeline state conforming to `references/pipeline-state-schema.json`. Always update `updatedAt` when modifying pipeline state.
188
+ Pipeline state is written by the `state-*` verbs of `scripts/forge-session.py` — never by hand. Each verb writes `{resolvedFeatureDir}/.pipeline-state.json` atomically, conforms to `references/pipeline-state-schema.json` by construction, and refreshes `updatedAt` for you, so no stage needs to read the schema in order to author state.
189
+
190
+ **Epic members MUST pass `--epic`.** Every `state-*` verb takes an optional `--epic "{epic}"`, and it is **required** whenever the feature is an epic member (its resolved directory is `{specsDir}/{epic}/{feature}/`, i.e. its state carries an `epic` back-pointer) — append it to **every** `state-*` call in this file and in every skill body, exactly as the `state-ecr` calls already do. Omit it only for a standalone feature. Without it the verb resolves the bare name itself and, mirroring `epic-manifest.py resolve`, refuses with exit 2 whenever more than one directory carries a state file rather than guessing which feature to write — so a same-named standalone feature can never be mutated in a member's place.
191
+
192
+ 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
+
194
+ **The eight `state-*` verbs.** `state-enter` (Stage-Entry Guard), `state-artifact` (incremental artifact tracking), `state-complete` (Git Commit Protocol), `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.
195
+
196
+ ### `state-verify` — verification results and provenance
197
+
198
+ `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:
199
+
200
+ **`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*.
201
+
202
+ ```bash
203
+ 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')"
204
+ [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
205
+ python3 "$R/scripts/forge-session.py" state-verify \
206
+ --feature "{feature}" --stage "{served-production-stage}" --status "<status>" \
207
+ --specs-dir "{specsDir}"
208
+ ```
209
+
210
+ 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:
211
+
212
+ ```bash
213
+ 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')"
214
+ [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
215
+ python3 "$R/scripts/forge-session.py" state-verify \
216
+ --feature "{feature}" --stage "{served-production-stage}" \
217
+ --commit-hash "$(git rev-parse HEAD)" --specs-dir "{specsDir}"
218
+ ```
219
+
220
+ 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:
221
+
222
+ ```bash
223
+ 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')"
224
+ [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
225
+ python3 "$R/scripts/forge-session.py" state-verify \
226
+ --feature "{epic}" --stage forge-0-epic --status "<status>" \
227
+ --specs-dir "{specsDir}"
228
+ ```
229
+
230
+ 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.
187
231
 
188
232
  ### Staleness Detection (Read-Time)
189
233
 
@@ -193,6 +237,31 @@ When loading upstream artifacts as prerequisites, check `basedOnVersions` in the
193
237
 
194
238
  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.
195
239
 
240
+ ## Immediate Downstream Note (Parking Lot)
241
+
242
+ 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.
243
+
244
+ ```bash
245
+ 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')"
246
+ [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
247
+ python3 "$R/scripts/forge-session.py" state-note \
248
+ --feature "{feature}" --note "<concise downstream concern>" \
249
+ --specs-dir "{specsDir}"
250
+ ```
251
+
252
+ `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.
253
+
254
+ 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`.
255
+
256
+ ## Verify Capability
257
+
258
+ 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:
259
+
260
+ - **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.
261
+ - **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.
262
+
263
+ 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.
264
+
196
265
  ## Branch Setup
197
266
 
198
267
  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.
@@ -214,7 +283,16 @@ Invoke this block at the **very start** of a pipeline entry point — `forge-1-p
214
283
  - **Create** → `git switch -c {branchPrefix}{label}` (or `git checkout -b` if `switch` is unavailable). If the branch already exists, `git switch {branchPrefix}{label}`.
215
284
  - **Stay** → proceed on the default branch; note that subsequent commits (and any `forge-5-loop` run) will land directly on `{defaultBranch}`.
216
285
 
217
- **Record the branch.** After this block resolves, write the resulting branch name to the feature's `.pipeline-state.json` top-level `branch` field (create/update it when the state file is first written for this stage). Downstream stages and `forge-5-loop` read it to detect drift back onto the default branch.
286
+ **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.
287
+
288
+ ```bash
289
+ 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')"
290
+ [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
291
+ python3 "$R/scripts/forge-session.py" state-branch \
292
+ --feature "{feature}" --branch "<name>" --specs-dir "{specsDir}"
293
+ ```
294
+
295
+ Downstream stages and `forge-5-loop` read it to detect drift back onto the default branch.
218
296
 
219
297
  ## Branch Reconciliation
220
298
 
@@ -227,10 +305,19 @@ python3 "$R/scripts/forge-session.py" reconcile-branch --feature "{feature}" --s
227
305
  ```
228
306
 
229
307
  Act on the emitted `action` (source of truth is where the state actually resolves, not the recorded field):
230
- - **`adopt-current`** — you are on a non-default topic branch where the state resolves, and the recorded `branch` differs (a stale/imposed value). 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).
308
+ - **`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).
231
309
  - **`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.
232
310
  - **`none`** / **`not-resolved`** — nothing to do; proceed.
233
311
 
312
+ 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:
313
+
314
+ ```bash
315
+ 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')"
316
+ [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
317
+ python3 "$R/scripts/forge-session.py" state-branch \
318
+ --feature "{feature}" --branch "{newBranch}" --specs-dir "{specsDir}"
319
+ ```
320
+
234
321
  If the helper is unavailable (non-Claude host without the resolver), fall back to the manual check: current branch differs from recorded → adopt the current branch unless it is the default, in which case recommend creating `{branchPrefix}{feature}`.
235
322
 
236
323
  ## Git Commit Protocol
@@ -240,14 +327,29 @@ When `gitCommitAfterStage` is true, follow this exact order to avoid state incon
240
327
  **Why two commits.** The stage's `.pipeline-state.json` is itself part of the staged commit, but the stage's `commitHash` cannot be known until *after* that commit is made. Recording it *inside* the same commit is a chicken-and-egg with no single-commit solution. Resolve it with a **deterministic two-commit sequence**, and **never** with `git commit --amend`: amending rewrites HEAD, so a hash captured before the amend points at an orphaned commit that is not in the final history (the exact defect this protocol exists to prevent).
241
328
 
242
329
  1. **Stage specific files only:** `git add {specsDir}/{feature}/` — never use `git add -A` or `git add .`
243
- 2. **Commit 1 — artifacts + state, hash not yet known:** In `.pipeline-state.json`, set this stage's `status: "complete"` and `commitHash: null`, then `git commit -m "{commitPrefix}({feature}): <action>"`. This is the stage's **artifact commit**; its hash is the provenance hash callers rely on.
244
- 3. **If Commit 1 succeeds — Commit 2 records the hash:** Capture the hash of Commit 1 (`git rev-parse HEAD`). Write it into this stage's `commitHash` in `.pipeline-state.json`, then commit only that one-line change: `git add {specsDir}/{feature}/.pipeline-state.json && git commit -m "{commitPrefix}({feature}): record stage commit hash"`. The stored `commitHash` now points at the artifact commit (Commit 1) — never at Commit 2, and never at an orphaned amend. The working tree is clean afterward, so the next stage's dirty-tree check passes.
245
- 4. **If Commit 1 fails:** do NOT update pipeline state to complete. Report the error to the user and leave state as `in-progress` so the stage can be resumed. Common failure causes:
330
+ 2. **Commit 1 — artifacts + state, hash not yet known:** Run `state-complete --feature {feature} --stage {stage} --version N …` (which sets this stage's `status: "complete"`, `completedAt`, `version`, `basedOnVersions`, `artifacts` and `commitHash: null`, and applies the downstream staleness cascade), then `git commit -m "{commitPrefix}({feature}): <action>"`. This is the stage's **artifact commit**; its hash is the provenance hash callers rely on.
331
+ 3. **If Commit 1 succeeds — Commit 2 records the hash:** Capture the hash of Commit 1 (`git rev-parse HEAD`) by running `state-complete --feature {feature} --stage {stage} --version N --commit-hash $(git rev-parse HEAD)`, which writes it into this stage's `commitHash` and touches nothing else, then commit only that one-line change: `git add {specsDir}/{feature}/.pipeline-state.json && git commit -m "{commitPrefix}({feature}): record stage commit hash"`. The stored `commitHash` now points at the artifact commit (Commit 1) — never at Commit 2, and never at an orphaned amend. The working tree is clean afterward, so the next stage's dirty-tree check passes.
332
+ 4. **If Commit 1 fails:** do NOT update pipeline state to complete. Report the error to the user and leave state as `in-progress` so the stage can be resumed. Do that with `state-complete --feature {feature} --stage {stage} --version N --resumable`, which records **only** `status` — no `completedAt`, no version bump, no `basedOnVersions`/`artifacts`, no `commitHash` reset, and no staleness cascade, so the stage stays resumable. (`--version` is still REQUIRED by argparse and must be passed even though `--resumable` does not write it; omitting it makes the recovery command exit 2 every time.) Common failure causes:
246
333
  - **Pre-commit hook failure:** Report the hook output. Never use `--no-verify` to bypass. Help the user fix the underlying issue.
247
334
  - **Merge conflicts:** Report conflicting files. Suggest resolution steps appropriate to the conflict.
248
- - **Nothing to commit:** If all artifacts were already committed, this is fine — mark the stage `complete`, leave `commitHash` at its existing value (or `null` if there was never an artifact commit), and skip Commit 2. There is no new artifact commit to record.
335
+ - **Nothing to commit:** If all artifacts were already committed, this is fine — mark the stage `complete`, leave `commitHash` at its existing value (or `null` if there was never an artifact commit), and skip Commit 2. Pass `--preserve-commit-hash` on the Commit-1 `state-complete` call so the recorded hash is left alone instead of being reset to `null`. There is no new artifact commit to record.
249
336
  5. **Never** use `git add -A`, `--amend`, `--no-verify`, or `--force` flags
250
337
 
338
+ 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:
339
+
340
+ ```bash
341
+ 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')"
342
+ [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
343
+ # Commit 1 — before `git commit`
344
+ python3 "$R/scripts/forge-session.py" state-complete \
345
+ --feature "{feature}" --stage "{stage}" --version {n} \
346
+ --based-on "<upstream>=<n>" --artifact "<file>" --specs-dir "{specsDir}"
347
+ # Commit 2 — after Commit 1 lands, so its hash exists
348
+ python3 "$R/scripts/forge-session.py" state-complete \
349
+ --feature "{feature}" --stage "{stage}" --version {n} \
350
+ --commit-hash "$(git rev-parse HEAD)" --specs-dir "{specsDir}"
351
+ ```
352
+
251
353
  ## Stage-Entry Guard
252
354
 
253
355
  Invoke this block at the **start of an authoring stage** (`forge-1-prd`..`forge-4-backlog`), **after** Feature Directory Resolution and **before** any interview or (re-)authoring. It prevents a re-entered stage — an injected skill body or a re-invoked `Skill` — from blindly re-running the interview over an in-progress or already-complete draft. `{stage}` is the invoking skill's id (e.g. `forge-2-tech`).
@@ -263,16 +365,27 @@ Invoke this block at the **start of an authoring stage** (`forge-1-prd`..`forge-
263
365
 
264
366
  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).
265
367
 
266
- **Entry Stamp** (fresh, restart, and re-author paths — NOT the resume path). Before authoring, write to `{resolvedFeatureDir}/.pipeline-state.json` and update `updatedAt`:
267
- - `stages.{stage}.status` → `"in-progress"`
268
- - `stages.{stage}.startedAt` → current ISO-8601 UTC timestamp
269
- - top-level `currentStage` → `"{stage}"` (where the pipeline IS, per O1)
368
+ **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:
369
+
370
+ ```bash
371
+ 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')"
372
+ [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
373
+ python3 "$R/scripts/forge-session.py" state-enter \
374
+ --feature "{feature}" --stage "{stage}" --specs-dir "{specsDir}"
375
+ ```
270
376
 
271
377
  This write is **left uncommitted**: it is staged and committed as part of this stage's existing exit commit (Git Commit Protocol), so no extra commit is needed at entry. If the run is interrupted after the stamp but before the exit commit, the marker survives on disk (uncommitted) and the next entry classifies as **Interrupted** — which is exactly the intent.
272
378
 
273
379
  **Force Mode.** When `--force` is passed, skip the interactive gate: do not prompt for resume-vs-restart or the re-author warning. Treat entry as a fresh restart — apply the Entry Stamp and author. (`--force` already skips prerequisite checks; here it likewise bypasses the self-stage gate. Existing on-disk artifacts are still loaded per Force Mode.)
274
380
 
275
- **Incremental artifact tracking:** When a stage writes multiple files (e.g. forge-3-specs writing a suite of spec documents), update the `stages.{stage}.artifacts` array in `.pipeline-state.json` after writing each file — not just at stage completion. This is what makes the Interrupted inventory above precise about which files were successfully written.
381
+ **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.
382
+
383
+ ```bash
384
+ 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')"
385
+ [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
386
+ python3 "$R/scripts/forge-session.py" state-artifact \
387
+ --feature "{feature}" --stage "{stage}" --path "<file>" --specs-dir "{specsDir}"
388
+ ```
276
389
 
277
390
  ## Stage-Completion Re-check
278
391