@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
@@ -5,12 +5,20 @@ Extracts REQ-XXX-NN identifiers from a PRD file and checks that every
5
5
  requirement is referenced in at least one implementation spec document.
6
6
  Also reports orphaned references (IDs found in specs but not in PRD).
7
7
 
8
+ A suite may legitimately mention a *foreign* requirement id — most often when a
9
+ spec quotes an antecedent feature's test docstrings verbatim, carrying that
10
+ feature's ids into this suite's text. Those are not this suite's requirements and
11
+ are not orphans. Declare them with --allow-orphan, or one id per line in
12
+ <specs-dir>/.traceability-allowlist; allowed ids are reported, never silently
13
+ dropped.
14
+
8
15
  Usage:
9
16
  python validate-traceability.py <prd-path> <specs-dir> [--json]
17
+ [--allow-orphan REQ-ID ...]
10
18
 
11
19
  Exit codes:
12
- 0 = all requirements covered, no orphans
13
- 1 = gaps or orphans found
20
+ 0 = all requirements covered; no orphans other than allowlisted ones
21
+ 1 = uncovered requirements, or orphans that are not allowlisted
14
22
  2 = file not found or read error
15
23
  """
16
24
 
@@ -20,7 +28,18 @@ import re
20
28
  import sys
21
29
  from pathlib import Path
22
30
 
23
- REQ_PATTERN = re.compile(r"REQ-[A-Z]+-\d+")
31
+ #: The category segment may contain digits after its first letter — `REQ-R1-01`,
32
+ #: `REQ-R6-03`. The original `[A-Z]+` could not match those, so whole requirement
33
+ #: families were invisible to this checker and reported as "all covered" while never
34
+ #: having been looked at (context-efficiency: 12 of 29 requirements seen). The first
35
+ #: character stays `[A-Z]` so a lowercase or digit-led token is still not an ID.
36
+ REQ_PATTERN = re.compile(r"REQ-[A-Z][A-Z0-9]*-\d+")
37
+
38
+ #: Optional per-suite allowlist of foreign requirement ids, read from the specs dir.
39
+ #: One id per line; blank lines and `#` comments ignored. Kept beside the suite it
40
+ #: describes rather than hardcoded here, so this validator stays generic across
41
+ #: repos and suites.
42
+ ALLOWLIST_FILENAME = ".traceability-allowlist"
24
43
 
25
44
 
26
45
  def extract_req_ids(text: str) -> set[str]:
@@ -28,6 +47,34 @@ def extract_req_ids(text: str) -> set[str]:
28
47
  return set(REQ_PATTERN.findall(text))
29
48
 
30
49
 
50
+ def read_allowlist_file(specs_dir: Path) -> set[str]:
51
+ """Read <specs-dir>/.traceability-allowlist, if present.
52
+
53
+ A missing file is not an error — most suites have no foreign ids at all.
54
+
55
+ Args:
56
+ specs_dir: The suite's specs directory, searched for the allowlist file.
57
+
58
+ Returns:
59
+ The declared foreign requirement ids; an empty set when the file is
60
+ absent or unreadable.
61
+ """
62
+ allowlist_path = specs_dir / ALLOWLIST_FILENAME
63
+ if not allowlist_path.exists():
64
+ return set()
65
+ try:
66
+ text = allowlist_path.read_text()
67
+ except OSError as e:
68
+ print(f"Warning: Could not read {allowlist_path}: {e}", file=sys.stderr)
69
+ return set()
70
+ ids: set[str] = set()
71
+ for raw_line in text.splitlines():
72
+ line = raw_line.split("#", 1)[0].strip()
73
+ if line:
74
+ ids.add(line)
75
+ return ids
76
+
77
+
31
78
  def main() -> int:
32
79
  parser = argparse.ArgumentParser(
33
80
  description="Validate requirement traceability between PRD and specs"
@@ -37,6 +84,17 @@ def main() -> int:
37
84
  parser.add_argument(
38
85
  "--json", action="store_true", dest="json_output", help="Output as JSON"
39
86
  )
87
+ parser.add_argument(
88
+ "--allow-orphan",
89
+ action="append",
90
+ default=[],
91
+ dest="allow_orphan",
92
+ metavar="REQ-ID",
93
+ help=(
94
+ "Requirement id that may appear in the specs without being defined in "
95
+ f"this suite's PRD (repeatable). Merged with {ALLOWLIST_FILENAME}."
96
+ ),
97
+ )
40
98
  args = parser.parse_args()
41
99
 
42
100
  prd_path = Path(args.prd_path)
@@ -91,9 +149,16 @@ def main() -> int:
91
149
  except OSError:
92
150
  pass
93
151
 
94
- # Analysis
152
+ # Analysis. Allowed foreign ids are subtracted from the orphan set but reported
153
+ # below, so an allowlist entry is always visible rather than an invisible pass.
154
+ allowlist = read_allowlist_file(specs_dir) | set(args.allow_orphan)
95
155
  uncovered = sorted(prd_reqs - all_spec_reqs)
96
- orphaned = sorted(all_spec_reqs - prd_reqs)
156
+ raw_orphaned = all_spec_reqs - prd_reqs
157
+ allowed_orphans = sorted(raw_orphaned & allowlist)
158
+ orphaned = sorted(raw_orphaned - allowlist)
159
+ # An allowlist entry that no longer matches anything is stale — surface it so the
160
+ # list cannot quietly outlive the quotation that justified it.
161
+ unused_allowlist = sorted(allowlist - raw_orphaned)
97
162
 
98
163
  # Per-requirement coverage map
99
164
  coverage: dict[str, list[str]] = {}
@@ -113,6 +178,8 @@ def main() -> int:
113
178
  "total_spec_files": len(spec_files),
114
179
  "uncovered_requirements": uncovered,
115
180
  "orphaned_references": orphaned,
181
+ "allowed_orphans": allowed_orphans,
182
+ "unused_allowlist_entries": unused_allowlist,
116
183
  "coverage": coverage,
117
184
  "valid": not has_issues,
118
185
  }
@@ -137,8 +204,27 @@ def main() -> int:
137
204
  print(f" - {req_id}: found in {', '.join(sources)} but not in PRD")
138
205
  print()
139
206
 
207
+ if allowed_orphans:
208
+ print(f"ALLOWED FOREIGN REFERENCES ({len(allowed_orphans)}):")
209
+ for req_id in allowed_orphans:
210
+ sources = [
211
+ name for name, reqs in spec_reqs.items() if req_id in reqs
212
+ ]
213
+ print(f" - {req_id}: found in {', '.join(sources)}; allowlisted")
214
+ print()
215
+
216
+ if unused_allowlist:
217
+ print(f"STALE ALLOWLIST ENTRIES ({len(unused_allowlist)}):")
218
+ for req_id in unused_allowlist:
219
+ print(
220
+ f" - {req_id}: allowlisted but no longer referenced — remove it "
221
+ f"from <specs-dir>/{ALLOWLIST_FILENAME} "
222
+ f"(advisory; does not fail this check)"
223
+ )
224
+ print()
225
+
140
226
  if not has_issues:
141
- print("All requirements covered. No orphaned references.")
227
+ print("All requirements covered. No unallowlisted orphaned references.")
142
228
  else:
143
229
  total_issues = len(uncovered) + len(orphaned)
144
230
  print(f"Found {total_issues} issue(s).")
@@ -14,10 +14,10 @@ You are the navigator for the feature-forge development pipeline. Your job is to
14
14
 
15
15
  Read and follow `references/shared-conventions.md` for configuration reading (feature name validation, config defaults, force mode).
16
16
 
17
- For pipeline architecture details, read `references/process-overview.md`.
18
-
19
17
  ### 2. Determine Context
20
18
 
19
+ **Only if the user is asking how the pipeline works** — architecture, stage ordering, what a stage does, or "explain forge" — read `references/process-overview.md` for the details before answering. For routine status/dashboard rendering, do **not** read it.
20
+
21
21
  **If a feature name is provided** (e.g., `/feature-forge:forge auth`):
22
22
  - **First test whether the name is an epic:** if `{specsDir}/{name}/epic-manifest.json` exists, render the **Epic Dashboard** (see format below) and stop — do not treat it as a feature.
23
23
  - Otherwise, resolve the name via the **Feature Directory Resolution** block in `references/shared-conventions.md` (so a nested epic-member name finds its dashboard too). On a resolution failure (`not-found` / `ambiguous` at exit 1; `unsafe-name` or a path-containment escape at exit 2), surface it verbatim.
@@ -40,7 +40,7 @@ R="$(bash -c 'for d in "${FEATURE_FORGE_ROOT:-}" "$HOME"/.claude/skills/feature-
40
40
  [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
41
41
  python3 "$R/scripts/forge-session.py" rank-features --specs-dir "{specsDir}" --json
42
42
  ```
43
- This returns `{active: [...], counts: {...}}` with active features sorted by `updatedAt` **descending** (row 0 is the most recent). Each row carries `currentStage`, `nextStage`, `nextCommand`, `verifyPending`, `verifyCommand`, `verifyStage`, `verifyState` (`fresh`/`stale`/`failing`/`never`/`none`), `autoVerify` (the effective per-stage setting), `autoFix` (the single source of stage order), and `verifyGate` (`none`/`auto`/`standard` — the single resolved verify-gate, computed once by the ranker; read it rather than re-deriving from `verifyPending`+`autoVerify`). A top-level `invalidAutoVerifyKeys` array appears when `forge.config.json` has `autoVerifyStages` keys outside the five verify-capable stages — surface it as a one-line warning. The `active` list excludes nested epic members surfaced in Tier 1 — but the ranker scans them too, so ignore rows whose `epic` is non-null here (they belong to the epic rollup).
43
+ This returns `{active: [...], counts: {...}}` with active features sorted by `updatedAt` **descending** (row 0 is the most recent). Each row carries `currentStage`, `nextStage`, `nextCommand`, `verifyPending`, `verifyCommand`, `verifyStage`, `verifyState` (`fresh`/`stale`/`failing`/`never`/`auto-pending`/`none` — `auto-pending` means automatic verification was **scheduled and recorded on disk but has not run yet**: verification is *owed*, never "never verified", and never resolved), `autoVerify` (the effective per-stage setting), `autoFix` (the single source of stage order), and `verifyGate` (`none`/`auto`/`standard` — the single resolved verify-gate, computed once by the ranker; read it rather than re-deriving from `verifyPending`+`autoVerify`). A top-level `invalidAutoVerifyKeys` array appears when `forge.config.json` has `autoVerifyStages` keys outside the five verify-capable stages — surface it as a one-line warning. The `active` list excludes nested epic members surfaced in Tier 1 — but the ranker scans them too, so ignore rows whose `epic` is non-null here (they belong to the epic rollup).
44
44
  - **Pick the feature:** if exactly one active standalone pipeline exists, show its dashboard. If multiple exist, use the host's question mechanism — **list the most-recently-updated first, labeled `(recommended)`**, each option's description showing its `currentStage` and a relative age ("updated 2h ago"). Always include a free-form escape ("A different feature / something else") so the user is never boxed in. Then render the chosen feature's dashboard.
45
45
 
46
46
  If no epics and no standalone features exist **on the current branch**, do not conclude the pipeline is empty yet — the state may live on topic branches (a fresh clone / default-branch session sees nothing on disk). Run `discover-feature --all` (via the standard prelude: `python3 "$R/scripts/forge-session.py" discover-feature --all --specs-dir "{specsDir}" --json`). If it surfaces features, list them with their branches and offer to switch (explicit accept + clean tree only, per the Feature Directory Resolution block), then render that feature's dashboard. Only when `--all` also returns nothing, say: "No active feature pipelines found. Start one with `/feature-forge:forge-1-prd <feature-name>` or group several with `/feature-forge:forge-0-epic <epic-name>`." Never fabricate a dashboard from memory of earlier sessions.
@@ -49,8 +49,6 @@ The feature name must be a single kebab-case token. If the user provides multipl
49
49
 
50
50
  ### 3. Pipeline Status Dashboard
51
51
 
52
- Write pipeline state conforming to `references/pipeline-state-schema.json`.
53
-
54
52
  Display a clear, scannable status for the feature:
55
53
 
56
54
  ```
@@ -83,6 +81,7 @@ Use these status indicators:
83
81
  - ✅🔍 = verified and fixes applied
84
82
  - ⏭️ = verification skipped (user chose to proceed without verifying)
85
83
  - ⚠️ = stale (built against an older version of an upstream artifact)
84
+ - ⏳ = **automatic verification owed** — the row's `verifyState` is `auto-pending`: verification was scheduled at the producing stage's exit and has not run. Annotate the row with the obligation sentence, naming the served stage and the retry command: `{feature}: automatic verification is still pending for {verifyStage}; run {verifyCommand} to resolve it.` (when the recorded scheduled revision differs from the current one, append both revision numbers). Never render an ⏳ row as ⬜/never-verified — the obligation is recorded on disk and is outstanding, not un-attempted. Do not dump or reformat the state file.
86
85
 
87
86
  ### 3b. Drive to the Next Stage
88
87
 
@@ -109,13 +108,13 @@ python3 "$R/scripts/forge-session.py" context-usage --json
109
108
  - `{"available": true, ...}` → note `pct` (e.g. "context ~68% full") and `overThreshold`. Window/threshold come from `contextWindowTokens` / `contextWarnThreshold` in `forge.config.json` (the helper defaults to a 200k window and 0.7 threshold, and auto-bumps the assumed window to 1M once observed usage exceeds 200k; **on a 1M-context model set `contextWindowTokens: 1000000` so the percentage is accurate below 200k too** — 1M can't be detected from the transcript until usage crosses 200k).
110
109
  - `{"available": false, ...}` → omit context advice silently (non-Claude host, or a fresh session with no transcript). Never treat this as an error.
111
110
 
112
- **2b. Auto-verify catch-up (when `verifyPending` is true).** Under this behavior the just-completed authoring stage runs auto-verify **in-stage** (`references/stage-exit-protocol.md`, in-stage verify block), which clears `verifyPending` — so on the normal path this branch does **nothing**. It fires only as a **catch-up**: `verifyPending` is still true because the producing stage could not dispatch a clean-room subagent (non-Claude host), or ran before this behavior landed. When it does fire, decide whether verify runs automatically (identical logic to the in-stage run, so a stage that already verified is never double-verified):
111
+ **2b. Auto-verify catch-up (when `verifyPending` is true).** Under this behavior the just-completed authoring stage runs auto-verify **in-stage** (`references/stage-exit-protocol.md`, in-stage verify block), which clears `verifyPending` — so on the normal path this branch does **nothing**. It fires only as a **catch-up**, for any of three reasons: the producing stage could not dispatch a clean-room subagent (non-Claude host); it ran before this behavior landed; or the stage exit **recorded durable `auto-verify-pending` debt** that was never discharged — the row's `verifyState` is `auto-pending`, meaning verification was scheduled on disk and never ran (a dropped or declined in-stage dispatch, a crash, or a cleared session). **This branch fires on an `auto-pending` row**: the debt is owed and recorded, so treat it exactly like any other outstanding verification and never as "never verified" or as already discharged. Lead with the obligation sentence from the legend before acting. When it does fire, decide whether verify runs automatically (identical logic to the in-stage run, so a stage that already verified is never double-verified):
113
112
 
114
- - **`autoVerify` is true for the just-completed `verifyStage`** → **skip the verify question entirely** and run verify now, *provided it can run clean-room*. Auto-verify is safe to run unattended only because verify executes in a fresh `forge-verifier` subagent that inherits none of this session's context (so no clear your session / start a fresh session is needed and only a compact digest returns). Guard the clean-room assumption: proceed unattended **only when the host's subagent mechanism + `forge-verifier` subagent are available**. Invoke `feature-forge:forge-verify` via the host's skill-invocation mechanism in **require-clean (`auto`) mode** — in that mode forge-verify refuses to run inline and returns a sentinel if the subagent is not dispatchable (see `skills/forge-verify/SKILL.md`). Then:
113
+ - **`autoVerify` is true for the just-completed `verifyStage`** → **skip the verify question entirely** and run verify now, *provided it can run clean-room*. Auto-verify is safe to run unattended only because verify executes in a fresh `forge-verifier` subagent that inherits none of this session's context (so no clear your session / start a fresh session is needed and only a compact digest returns). Guard the clean-room assumption: proceed unattended **only when the host's subagent mechanism + `forge-verifier` subagent are available**. Invoke `feature-forge:forge-verify` via the host's skill-invocation mechanism in **require-clean (`auto`) mode**, passing the literal `owner: nested` token in the invocation prompt — you are the dispatcher here, so **you** are the sole terminal owner and the branch skill prints no terminal block of its own (see "Branch ownership: the `owner:` token" in `references/stage-exit-protocol.md`). In require-clean mode forge-verify refuses to run inline and returns a sentinel if the subagent is not dispatchable (see `skills/forge-verify/SKILL.md`). Then:
115
114
  - **Sentinel returned (clean-room unavailable)** → do **not** run verify inline. Degrade to the manual gate: fall through to step 3 with the **"Verify `{stage}` first (manual)"** option included, and if `overThreshold`, recommend "clear your session / start a fresh session, then verify in a clean session." Verify state stays outstanding; the stage is never advanced on false assurance.
116
115
  - **Verify passed / no findings** → proceed to the normal advance gate (step 3), no verify option.
117
116
  - **Verify found findings** →
118
- - **`autoFix` is true AND preconditions hold** — the findings document has **zero unresolved decision points** and the **working tree is clean** → invoke `feature-forge:forge-fix` via the host's skill-invocation mechanism, then run a **mandatory re-verify** (require-clean mode). Advance only if the re-verify passes. On **any** precondition miss (decisions required, dirty tree), a forge-fix early stop, or a red re-verify → fall back to the digest + prompt below (never a silent partial mutation).
117
+ - **`autoFix` is true AND preconditions hold** — the findings document has **zero unresolved decision points** and the **working tree is clean** → invoke `feature-forge:forge-fix` via the host's skill-invocation mechanism with the literal `owner: nested` token in the invocation prompt, then run a **mandatory re-verify** (require-clean mode, also `owner: nested`). Every call in this catch-up chain is nested and prints no terminal block — you remain the sole terminal owner and print exactly one closing block after the chain settles. Advance only if the re-verify passes. On **any** precondition miss (decisions required, dirty tree), a forge-fix early stop, or a red re-verify → fall back to the digest + prompt below (never a silent partial mutation).
119
118
  - **`autoFix` is false (default), or preconditions failed** → present a **compact findings digest** as text, then the host's question mechanism: *Apply fixes now (forge-fix)* / *Review findings* / *Skip & advance*.
120
119
  - **`autoVerify` is false/unconfigured** → do not auto-run; use the advance gate in step 3, which gains the folded opt-in verify options ("Verify `{stage}` now" and "Verify `{stage}` now + enable auto-verify going forward").
121
120
 
@@ -130,7 +129,7 @@ python3 "$R/scripts/forge-session.py" context-usage --json
130
129
  **4. Act on the choice.**
131
130
  - **Clean session** (the default) → give the exact next command and the clear your session / start a fresh session-then-re-run instruction; do not invoke anything (you cannot clear your session / start a fresh session for the user).
132
131
  - **Continue in this session** → if `autoInvokeNextStage` is true (default) **and** the host's skill-invocation mechanism is available, invoke the chosen stage **via the host's skill-invocation mechanism** in this same session (e.g. `skill: "feature-forge:forge-3-specs"`, `args: "{feature}"`) — no retyping, no paste. If `autoInvokeNextStage` is false, or the host's skill-invocation mechanism is unavailable (a non-Claude host), fall back to printing `{nextCommand}` prominently for the user to run.
133
- - **Verify now / Verify now + enable auto-verify** → invoke `feature-forge:forge-verify` via the host's skill-invocation mechanism (require-clean mode). For the **enable-auto-verify** variant, additionally patch `autoVerify: true` into `forge.config.json` in place (preserve formatting and other keys) — never a silent write. On a non-Claude host or when degrading to the manual/inline gate, print `{verifyCommand}` instead.
132
+ - **Verify now / Verify now + enable auto-verify** → invoke `feature-forge:forge-verify` via the host's skill-invocation mechanism (require-clean mode) with the literal `owner: nested` token. **Every navigator dispatch of `forge-verify`/`forge-fix` — the step 2b catch-up chain, this gate, and the "Apply fixes now" choice of the findings digest — carries `owner: nested`**, so the branch skill returns its structured result and prints no terminal block, and the navigator stays the sole terminal owner. For the **enable-auto-verify** variant, additionally patch `autoVerify: true` into `forge.config.json` in place (preserve formatting and other keys) — never a silent write. On a non-Claude host or when degrading to the manual/inline gate, print `{verifyCommand}` instead.
134
133
  - **Different stage** → honor the free-form request.
135
134
 
136
135
  **Host fallback.** On a non-Claude host or when the host's skill-invocation and subagent mechanisms are unavailable, auto-verify never runs unattended — fall back to printing `{verifyCommand}` exactly as today, mirroring `autoInvokeNextStage`.
@@ -151,7 +150,7 @@ and render from its output:
151
150
 
152
151
  - **Epic header:** name + `status` (active | paused | abandoned | complete).
153
152
  - **Dependency graph:** each feature with its `dependsOn`, as an arrow list or indented tree (the helper guarantees the graph is acyclic).
154
- - **Per-feature rows:** reuse the **existing status indicators** below (✅/✅⚠️/🔄/⬜/❌/✅🔍/⏭️/⚠️), driven by each feature's derived `stage`/`status`. Mark `blocked` features and list their `unmetDeps`.
153
+ - **Per-feature rows:** reuse the **existing status indicators** below (✅/✅⚠️/🔄/⬜/❌/✅🔍/⏭️/⚠️/⏳), driven by each feature's derived `stage`/`status`. Mark `blocked` features and list their `unmetDeps`. `render-status --json` also emits an owed-automatic-verification obligation in its `warnings` array for any member carrying that debt — surface those lines verbatim rather than restating them, and mark those members ⏳, never ⬜.
155
154
  - **Pending epic changes:** for any feature with `openEpicChangeRequests > 0`, append a ⚠️ marker and a hint: *"N pending epic change(s) — run `/feature-forge:forge-0-epic {epic}` to reconcile."* If `blockingEpicChangeRequests > 0`, use a stronger marker (⚠️ **blocking**) and word it *"reconcile the epic **before** writing specs"* — this mirrors the pause-now vs finish-then split that stage-exit already routes on. Take these counts **only** from `render-status --json` (`features[].openEpicChangeRequests` / `.blockingEpicChangeRequests`); do not read member `.pipeline-state.json` directly for them.
156
155
  - **Actionable vs blocked:** list the `actionable` set and the recommended `nextCommand`.
157
156
  - **Rollup:** `{complete}/{total} features complete`.
@@ -181,7 +180,13 @@ All of this is reconstructed **purely from disk** — the manifest plus each mem
181
180
 
182
181
  ### 4. Notes Management
183
182
 
184
- If the user says something like "note: switching to jose for JWT" or "remember: we decided X", update the `notes` field in `.pipeline-state.json`. This helps preserve context across session clears.
183
+ If the user says something like "note: switching to jose for JWT" or "remember: we decided X", update the `notes` field by running `state-note` (below). This helps preserve context across session clears. Add `--epic "{epic}"` when the feature is an epic member — required, per the Pipeline State Protocol in `references/shared-conventions.md`.
184
+
185
+ ```bash
186
+ 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')"
187
+ [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
188
+ python3 "$R/scripts/forge-session.py" state-note --feature "{feature}" --note "<what the user said>" --specs-dir "{specsDir}"
189
+ ```
185
190
 
186
191
  ### 5. Available Commands Reference
187
192
 
@@ -200,6 +205,8 @@ Commands:
200
205
 
201
206
  ### 6. Pipeline Lifecycle Commands
202
207
 
208
+ > **Deliberate R4 exclusion.** The `pipelineStatus` writes below (`pause` / `resume` / `abandon`, and the member-pause under **Epic lifecycle**) stay hand-authored on purpose: the `state-*` verbs cover the seven stage and array touch points, and none of them writes `pipelineStatus`. These are the sanctioned exception to the Pipeline State Protocol in `references/shared-conventions.md` — everywhere else, state is written by a verb, never by hand. When authoring one of these `pipelineStatus` writes, conform to `references/pipeline-state-schema.json` — this is the one navigator path that still reads it.
209
+
203
210
  Support these sub-commands for pipeline lifecycle management:
204
211
  - `/feature-forge:forge pause {feature}` — Set `pipelineStatus` to `"paused"`. Do NOT modify `currentStage` or any stage statuses. The pipeline freezes exactly as-is. Show a confirmation.
205
212
  - `/feature-forge:forge resume {feature}` — Set `pipelineStatus` back to `"active"`. Calculate how long the feature was paused (from `updatedAt` to now). If paused for more than 24 hours, show a hint: "This feature was paused for {duration}. Session context may have been lost — consider re-running `/feature-forge:forge-{currentStage} {feature}` to rebuild context."
@@ -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