@garygentry/feature-forge 0.3.1 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (421) hide show
  1. package/adapters/claude/.feature-forge-bundle.json +1 -1
  2. package/adapters/claude/agents/forge-verifier.md +3 -1
  3. package/adapters/claude/references/decisions/single-writer-threat-model.md +53 -0
  4. package/adapters/claude/references/epic-manifest-schema.json +6 -1
  5. package/adapters/claude/references/epic-state-schema.json +50 -0
  6. package/adapters/claude/references/forge-config-schema.json +19 -1
  7. package/adapters/claude/references/forge-decisions-schema.json +33 -0
  8. package/adapters/claude/references/pipeline-state-schema.json +38 -4
  9. package/adapters/claude/references/ralph-loop-contract.md +6 -3
  10. package/adapters/claude/references/shared-conventions.md +77 -3
  11. package/adapters/claude/references/stage-exit-protocol.md +391 -143
  12. package/adapters/claude/scripts/epic-manifest.py +495 -91
  13. package/adapters/claude/scripts/fix-sweep.py +1180 -0
  14. package/adapters/claude/scripts/forge-bootstrap.py +57 -5
  15. package/adapters/claude/scripts/forge-session.py +4241 -146
  16. package/adapters/claude/scripts/validate-traceability.py +86 -5
  17. package/adapters/claude/skills/forge/SKILL.md +10 -9
  18. package/adapters/claude/skills/forge/references/pipeline-state-schema.json +38 -4
  19. package/adapters/claude/skills/forge/references/shared-conventions.md +77 -3
  20. package/adapters/claude/skills/forge/references/stage-exit-protocol.md +391 -143
  21. package/adapters/claude/skills/forge-0-epic/SKILL.md +7 -2
  22. package/adapters/claude/skills/forge-0-epic/references/edit-mode.md +29 -25
  23. package/adapters/claude/skills/forge-0-epic/references/epic-manifest-subcommands.md +5 -0
  24. package/adapters/claude/skills/forge-0-epic/references/pipeline-state-schema.json +38 -4
  25. package/adapters/claude/skills/forge-0-epic/references/shared-conventions.md +77 -3
  26. package/adapters/claude/skills/forge-0-epic/references/stage-exit-protocol.md +391 -143
  27. package/adapters/claude/skills/forge-1-prd/SKILL.md +17 -4
  28. package/adapters/claude/skills/forge-1-prd/references/shared-conventions.md +77 -3
  29. package/adapters/claude/skills/forge-1-prd/references/stage-exit-protocol.md +391 -143
  30. package/adapters/claude/skills/forge-2-tech/SKILL.md +18 -4
  31. package/adapters/claude/skills/forge-2-tech/references/shared-conventions.md +77 -3
  32. package/adapters/claude/skills/forge-2-tech/references/stage-exit-protocol.md +391 -143
  33. package/adapters/claude/skills/forge-3-specs/SKILL.md +9 -3
  34. package/adapters/claude/skills/forge-3-specs/references/shared-conventions.md +77 -3
  35. package/adapters/claude/skills/forge-3-specs/references/spec-archetypes.md +9 -0
  36. package/adapters/claude/skills/forge-3-specs/references/stage-exit-protocol.md +391 -143
  37. package/adapters/claude/skills/forge-4-backlog/SKILL.md +56 -5
  38. package/adapters/claude/skills/forge-4-backlog/references/shared-conventions.md +77 -3
  39. package/adapters/claude/skills/forge-4-backlog/references/stage-exit-protocol.md +391 -143
  40. package/adapters/claude/skills/forge-5-loop/SKILL.md +67 -69
  41. package/adapters/claude/skills/forge-5-loop/references/agent-selection.md +16 -0
  42. package/adapters/claude/skills/forge-5-loop/references/ralph-loop-contract.md +6 -3
  43. package/adapters/claude/skills/forge-5-loop/references/recovery-procedure.md +349 -0
  44. package/adapters/claude/skills/forge-5-loop/references/result-reporting.md +101 -33
  45. package/adapters/claude/skills/forge-5-loop/references/runner-contract.md +26 -6
  46. package/adapters/claude/skills/forge-5-loop/references/shared-conventions.md +77 -3
  47. package/adapters/claude/skills/forge-5-loop/references/stage-exit-protocol.md +391 -143
  48. package/adapters/claude/skills/forge-6-docs/SKILL.md +75 -8
  49. package/adapters/claude/skills/forge-6-docs/references/shared-conventions.md +77 -3
  50. package/adapters/claude/skills/forge-6-docs/references/stage-exit-protocol.md +516 -0
  51. package/adapters/claude/skills/forge-fix/SKILL.md +119 -33
  52. package/adapters/claude/skills/forge-fix/references/shared-conventions.md +77 -3
  53. package/adapters/claude/skills/forge-fix/references/stage-exit-protocol.md +391 -143
  54. package/adapters/claude/skills/forge-guide/references/forge-config-schema.json +19 -1
  55. package/adapters/claude/skills/forge-guide/references/ralph-loop-contract.md +6 -3
  56. package/adapters/claude/skills/forge-guide/references/shared-conventions.md +77 -3
  57. package/adapters/claude/skills/forge-verify/SKILL.md +82 -51
  58. package/adapters/claude/skills/forge-verify/references/decisions/single-writer-threat-model.md +53 -0
  59. package/adapters/claude/skills/forge-verify/references/findings-template.md +69 -49
  60. package/adapters/claude/skills/forge-verify/references/shared-conventions.md +77 -3
  61. package/adapters/claude/skills/forge-verify/references/stage-exit-protocol.md +516 -0
  62. package/adapters/claude/skills/forge-verify/references/verification-checklists/backlog.md +73 -0
  63. package/adapters/claude/skills/forge-verify/references/verification-checklists/epic.md +4 -3
  64. package/adapters/claude/skills/forge-verify/references/verification-checklists/impl.md +85 -0
  65. package/adapters/claude/skills/forge-verify/references/verification-checklists/specs.md +45 -1
  66. package/adapters/codex/.feature-forge-bundle.json +1 -1
  67. package/adapters/codex/agents/forge-verifier.toml +3 -1
  68. package/adapters/codex/references/decisions/single-writer-threat-model.md +53 -0
  69. package/adapters/codex/references/epic-manifest-schema.json +6 -1
  70. package/adapters/codex/references/epic-state-schema.json +50 -0
  71. package/adapters/codex/references/forge-config-schema.json +19 -1
  72. package/adapters/codex/references/forge-decisions-schema.json +33 -0
  73. package/adapters/codex/references/pipeline-state-schema.json +38 -4
  74. package/adapters/codex/references/process-overview.md +2 -2
  75. package/adapters/codex/references/ralph-loop-contract.md +6 -3
  76. package/adapters/codex/references/shared-conventions.md +102 -28
  77. package/adapters/codex/references/stage-exit-protocol.md +395 -147
  78. package/adapters/codex/scripts/epic-manifest.py +495 -91
  79. package/adapters/codex/scripts/fix-sweep.py +1180 -0
  80. package/adapters/codex/scripts/forge-bootstrap.py +57 -5
  81. package/adapters/codex/scripts/forge-session.py +4241 -146
  82. package/adapters/codex/scripts/validate-traceability.py +86 -5
  83. package/adapters/codex/skills/forge/SKILL.md +13 -12
  84. package/adapters/codex/skills/forge/references/pipeline-state-schema.json +38 -4
  85. package/adapters/codex/skills/forge/references/process-overview.md +2 -2
  86. package/adapters/codex/skills/forge/references/shared-conventions.md +102 -28
  87. package/adapters/codex/skills/forge/references/stage-exit-protocol.md +395 -147
  88. package/adapters/codex/skills/forge-0-epic/SKILL.md +7 -2
  89. package/adapters/codex/skills/forge-0-epic/references/edit-mode.md +37 -33
  90. package/adapters/codex/skills/forge-0-epic/references/epic-manifest-subcommands.md +8 -3
  91. package/adapters/codex/skills/forge-0-epic/references/pipeline-state-schema.json +38 -4
  92. package/adapters/codex/skills/forge-0-epic/references/shared-conventions.md +102 -28
  93. package/adapters/codex/skills/forge-0-epic/references/stage-exit-protocol.md +395 -147
  94. package/adapters/codex/skills/forge-1-prd/SKILL.md +17 -4
  95. package/adapters/codex/skills/forge-1-prd/references/shared-conventions.md +102 -28
  96. package/adapters/codex/skills/forge-1-prd/references/stage-exit-protocol.md +395 -147
  97. package/adapters/codex/skills/forge-2-tech/SKILL.md +18 -4
  98. package/adapters/codex/skills/forge-2-tech/references/shared-conventions.md +102 -28
  99. package/adapters/codex/skills/forge-2-tech/references/stage-exit-protocol.md +395 -147
  100. package/adapters/codex/skills/forge-3-specs/SKILL.md +9 -3
  101. package/adapters/codex/skills/forge-3-specs/references/shared-conventions.md +102 -28
  102. package/adapters/codex/skills/forge-3-specs/references/spec-archetypes.md +9 -0
  103. package/adapters/codex/skills/forge-3-specs/references/stage-exit-protocol.md +395 -147
  104. package/adapters/codex/skills/forge-4-backlog/SKILL.md +56 -5
  105. package/adapters/codex/skills/forge-4-backlog/references/shared-conventions.md +102 -28
  106. package/adapters/codex/skills/forge-4-backlog/references/stage-exit-protocol.md +395 -147
  107. package/adapters/codex/skills/forge-5-loop/SKILL.md +67 -69
  108. package/adapters/codex/skills/forge-5-loop/references/agent-selection.md +17 -1
  109. package/adapters/codex/skills/forge-5-loop/references/ralph-loop-contract.md +6 -3
  110. package/adapters/codex/skills/forge-5-loop/references/recovery-procedure.md +349 -0
  111. package/adapters/codex/skills/forge-5-loop/references/result-reporting.md +101 -33
  112. package/adapters/codex/skills/forge-5-loop/references/runner-contract.md +30 -10
  113. package/adapters/codex/skills/forge-5-loop/references/shared-conventions.md +102 -28
  114. package/adapters/codex/skills/forge-5-loop/references/stage-exit-protocol.md +395 -147
  115. package/adapters/codex/skills/forge-6-docs/SKILL.md +75 -8
  116. package/adapters/codex/skills/forge-6-docs/references/shared-conventions.md +102 -28
  117. package/adapters/codex/skills/forge-6-docs/references/stage-exit-protocol.md +516 -0
  118. package/adapters/codex/skills/forge-fix/SKILL.md +118 -32
  119. package/adapters/codex/skills/forge-fix/references/shared-conventions.md +102 -28
  120. package/adapters/codex/skills/forge-fix/references/stage-exit-protocol.md +395 -147
  121. package/adapters/codex/skills/forge-guide/SKILL.md +1 -1
  122. package/adapters/codex/skills/forge-guide/references/forge-config-schema.json +19 -1
  123. package/adapters/codex/skills/forge-guide/references/process-overview.md +2 -2
  124. package/adapters/codex/skills/forge-guide/references/ralph-loop-contract.md +6 -3
  125. package/adapters/codex/skills/forge-guide/references/shared-conventions.md +102 -28
  126. package/adapters/codex/skills/forge-init/SKILL.md +1 -1
  127. package/adapters/codex/skills/forge-verify/SKILL.md +82 -51
  128. package/adapters/codex/skills/forge-verify/references/decisions/single-writer-threat-model.md +53 -0
  129. package/adapters/codex/skills/forge-verify/references/findings-template.md +70 -50
  130. package/adapters/codex/skills/forge-verify/references/shared-conventions.md +102 -28
  131. package/adapters/codex/skills/forge-verify/references/stage-exit-protocol.md +516 -0
  132. package/adapters/codex/skills/forge-verify/references/verification-checklists/backlog.md +73 -0
  133. package/adapters/codex/skills/forge-verify/references/verification-checklists/epic.md +5 -4
  134. package/adapters/codex/skills/forge-verify/references/verification-checklists/impl.md +85 -0
  135. package/adapters/codex/skills/forge-verify/references/verification-checklists/specs.md +45 -1
  136. package/adapters/copilot/.feature-forge-bundle.json +1 -1
  137. package/adapters/copilot/agents/forge-verifier.md +3 -1
  138. package/adapters/copilot/references/decisions/single-writer-threat-model.md +53 -0
  139. package/adapters/copilot/references/epic-manifest-schema.json +6 -1
  140. package/adapters/copilot/references/epic-state-schema.json +50 -0
  141. package/adapters/copilot/references/forge-config-schema.json +19 -1
  142. package/adapters/copilot/references/forge-decisions-schema.json +33 -0
  143. package/adapters/copilot/references/pipeline-state-schema.json +38 -4
  144. package/adapters/copilot/references/process-overview.md +2 -2
  145. package/adapters/copilot/references/ralph-loop-contract.md +6 -3
  146. package/adapters/copilot/references/shared-conventions.md +102 -28
  147. package/adapters/copilot/references/stage-exit-protocol.md +395 -147
  148. package/adapters/copilot/scripts/epic-manifest.py +495 -91
  149. package/adapters/copilot/scripts/fix-sweep.py +1180 -0
  150. package/adapters/copilot/scripts/forge-bootstrap.py +57 -5
  151. package/adapters/copilot/scripts/forge-session.py +4241 -146
  152. package/adapters/copilot/scripts/validate-traceability.py +86 -5
  153. package/adapters/copilot/skills/forge/forge.md +13 -12
  154. package/adapters/copilot/skills/forge/references/pipeline-state-schema.json +38 -4
  155. package/adapters/copilot/skills/forge/references/process-overview.md +2 -2
  156. package/adapters/copilot/skills/forge/references/shared-conventions.md +102 -28
  157. package/adapters/copilot/skills/forge/references/stage-exit-protocol.md +395 -147
  158. package/adapters/copilot/skills/forge-0-epic/forge-0-epic.md +7 -2
  159. package/adapters/copilot/skills/forge-0-epic/references/edit-mode.md +37 -33
  160. package/adapters/copilot/skills/forge-0-epic/references/epic-manifest-subcommands.md +8 -3
  161. package/adapters/copilot/skills/forge-0-epic/references/pipeline-state-schema.json +38 -4
  162. package/adapters/copilot/skills/forge-0-epic/references/shared-conventions.md +102 -28
  163. package/adapters/copilot/skills/forge-0-epic/references/stage-exit-protocol.md +395 -147
  164. package/adapters/copilot/skills/forge-1-prd/forge-1-prd.md +17 -4
  165. package/adapters/copilot/skills/forge-1-prd/references/shared-conventions.md +102 -28
  166. package/adapters/copilot/skills/forge-1-prd/references/stage-exit-protocol.md +395 -147
  167. package/adapters/copilot/skills/forge-2-tech/forge-2-tech.md +18 -4
  168. package/adapters/copilot/skills/forge-2-tech/references/shared-conventions.md +102 -28
  169. package/adapters/copilot/skills/forge-2-tech/references/stage-exit-protocol.md +395 -147
  170. package/adapters/copilot/skills/forge-3-specs/forge-3-specs.md +9 -3
  171. package/adapters/copilot/skills/forge-3-specs/references/shared-conventions.md +102 -28
  172. package/adapters/copilot/skills/forge-3-specs/references/spec-archetypes.md +9 -0
  173. package/adapters/copilot/skills/forge-3-specs/references/stage-exit-protocol.md +395 -147
  174. package/adapters/copilot/skills/forge-4-backlog/forge-4-backlog.md +56 -5
  175. package/adapters/copilot/skills/forge-4-backlog/references/shared-conventions.md +102 -28
  176. package/adapters/copilot/skills/forge-4-backlog/references/stage-exit-protocol.md +395 -147
  177. package/adapters/copilot/skills/forge-5-loop/forge-5-loop.md +67 -69
  178. package/adapters/copilot/skills/forge-5-loop/references/agent-selection.md +17 -1
  179. package/adapters/copilot/skills/forge-5-loop/references/ralph-loop-contract.md +6 -3
  180. package/adapters/copilot/skills/forge-5-loop/references/recovery-procedure.md +349 -0
  181. package/adapters/copilot/skills/forge-5-loop/references/result-reporting.md +101 -33
  182. package/adapters/copilot/skills/forge-5-loop/references/runner-contract.md +30 -10
  183. package/adapters/copilot/skills/forge-5-loop/references/shared-conventions.md +102 -28
  184. package/adapters/copilot/skills/forge-5-loop/references/stage-exit-protocol.md +395 -147
  185. package/adapters/copilot/skills/forge-6-docs/forge-6-docs.md +75 -8
  186. package/adapters/copilot/skills/forge-6-docs/references/shared-conventions.md +102 -28
  187. package/adapters/copilot/skills/forge-6-docs/references/stage-exit-protocol.md +516 -0
  188. package/adapters/copilot/skills/forge-fix/forge-fix.md +118 -32
  189. package/adapters/copilot/skills/forge-fix/references/shared-conventions.md +102 -28
  190. package/adapters/copilot/skills/forge-fix/references/stage-exit-protocol.md +395 -147
  191. package/adapters/copilot/skills/forge-guide/forge-guide.md +1 -1
  192. package/adapters/copilot/skills/forge-guide/references/forge-config-schema.json +19 -1
  193. package/adapters/copilot/skills/forge-guide/references/process-overview.md +2 -2
  194. package/adapters/copilot/skills/forge-guide/references/ralph-loop-contract.md +6 -3
  195. package/adapters/copilot/skills/forge-guide/references/shared-conventions.md +102 -28
  196. package/adapters/copilot/skills/forge-init/forge-init.md +1 -1
  197. package/adapters/copilot/skills/forge-verify/forge-verify.md +82 -51
  198. package/adapters/copilot/skills/forge-verify/references/decisions/single-writer-threat-model.md +53 -0
  199. package/adapters/copilot/skills/forge-verify/references/findings-template.md +70 -50
  200. package/adapters/copilot/skills/forge-verify/references/shared-conventions.md +102 -28
  201. package/adapters/copilot/skills/forge-verify/references/stage-exit-protocol.md +516 -0
  202. package/adapters/copilot/skills/forge-verify/references/verification-checklists/backlog.md +73 -0
  203. package/adapters/copilot/skills/forge-verify/references/verification-checklists/epic.md +5 -4
  204. package/adapters/copilot/skills/forge-verify/references/verification-checklists/impl.md +85 -0
  205. package/adapters/copilot/skills/forge-verify/references/verification-checklists/specs.md +45 -1
  206. package/adapters/cursor/.feature-forge-bundle.json +1 -1
  207. package/adapters/cursor/agents/forge-verifier.mdc +3 -1
  208. package/adapters/cursor/references/decisions/single-writer-threat-model.md +53 -0
  209. package/adapters/cursor/references/epic-manifest-schema.json +6 -1
  210. package/adapters/cursor/references/epic-state-schema.json +50 -0
  211. package/adapters/cursor/references/forge-config-schema.json +19 -1
  212. package/adapters/cursor/references/forge-decisions-schema.json +33 -0
  213. package/adapters/cursor/references/pipeline-state-schema.json +38 -4
  214. package/adapters/cursor/references/process-overview.md +2 -2
  215. package/adapters/cursor/references/ralph-loop-contract.md +6 -3
  216. package/adapters/cursor/references/shared-conventions.md +102 -28
  217. package/adapters/cursor/references/stage-exit-protocol.md +395 -147
  218. package/adapters/cursor/scripts/epic-manifest.py +495 -91
  219. package/adapters/cursor/scripts/fix-sweep.py +1180 -0
  220. package/adapters/cursor/scripts/forge-bootstrap.py +57 -5
  221. package/adapters/cursor/scripts/forge-session.py +4241 -146
  222. package/adapters/cursor/scripts/validate-traceability.py +86 -5
  223. package/adapters/cursor/skills/forge/forge.mdc +13 -12
  224. package/adapters/cursor/skills/forge/references/pipeline-state-schema.json +38 -4
  225. package/adapters/cursor/skills/forge/references/process-overview.md +2 -2
  226. package/adapters/cursor/skills/forge/references/shared-conventions.md +102 -28
  227. package/adapters/cursor/skills/forge/references/stage-exit-protocol.md +395 -147
  228. package/adapters/cursor/skills/forge-0-epic/forge-0-epic.mdc +7 -2
  229. package/adapters/cursor/skills/forge-0-epic/references/edit-mode.md +37 -33
  230. package/adapters/cursor/skills/forge-0-epic/references/epic-manifest-subcommands.md +8 -3
  231. package/adapters/cursor/skills/forge-0-epic/references/pipeline-state-schema.json +38 -4
  232. package/adapters/cursor/skills/forge-0-epic/references/shared-conventions.md +102 -28
  233. package/adapters/cursor/skills/forge-0-epic/references/stage-exit-protocol.md +395 -147
  234. package/adapters/cursor/skills/forge-1-prd/forge-1-prd.mdc +17 -4
  235. package/adapters/cursor/skills/forge-1-prd/references/shared-conventions.md +102 -28
  236. package/adapters/cursor/skills/forge-1-prd/references/stage-exit-protocol.md +395 -147
  237. package/adapters/cursor/skills/forge-2-tech/forge-2-tech.mdc +18 -4
  238. package/adapters/cursor/skills/forge-2-tech/references/shared-conventions.md +102 -28
  239. package/adapters/cursor/skills/forge-2-tech/references/stage-exit-protocol.md +395 -147
  240. package/adapters/cursor/skills/forge-3-specs/forge-3-specs.mdc +9 -3
  241. package/adapters/cursor/skills/forge-3-specs/references/shared-conventions.md +102 -28
  242. package/adapters/cursor/skills/forge-3-specs/references/spec-archetypes.md +9 -0
  243. package/adapters/cursor/skills/forge-3-specs/references/stage-exit-protocol.md +395 -147
  244. package/adapters/cursor/skills/forge-4-backlog/forge-4-backlog.mdc +56 -5
  245. package/adapters/cursor/skills/forge-4-backlog/references/shared-conventions.md +102 -28
  246. package/adapters/cursor/skills/forge-4-backlog/references/stage-exit-protocol.md +395 -147
  247. package/adapters/cursor/skills/forge-5-loop/forge-5-loop.mdc +67 -69
  248. package/adapters/cursor/skills/forge-5-loop/references/agent-selection.md +17 -1
  249. package/adapters/cursor/skills/forge-5-loop/references/ralph-loop-contract.md +6 -3
  250. package/adapters/cursor/skills/forge-5-loop/references/recovery-procedure.md +349 -0
  251. package/adapters/cursor/skills/forge-5-loop/references/result-reporting.md +101 -33
  252. package/adapters/cursor/skills/forge-5-loop/references/runner-contract.md +30 -10
  253. package/adapters/cursor/skills/forge-5-loop/references/shared-conventions.md +102 -28
  254. package/adapters/cursor/skills/forge-5-loop/references/stage-exit-protocol.md +395 -147
  255. package/adapters/cursor/skills/forge-6-docs/forge-6-docs.mdc +75 -8
  256. package/adapters/cursor/skills/forge-6-docs/references/shared-conventions.md +102 -28
  257. package/adapters/cursor/skills/forge-6-docs/references/stage-exit-protocol.md +516 -0
  258. package/adapters/cursor/skills/forge-fix/forge-fix.mdc +118 -32
  259. package/adapters/cursor/skills/forge-fix/references/shared-conventions.md +102 -28
  260. package/adapters/cursor/skills/forge-fix/references/stage-exit-protocol.md +395 -147
  261. package/adapters/cursor/skills/forge-guide/forge-guide.mdc +1 -1
  262. package/adapters/cursor/skills/forge-guide/references/forge-config-schema.json +19 -1
  263. package/adapters/cursor/skills/forge-guide/references/process-overview.md +2 -2
  264. package/adapters/cursor/skills/forge-guide/references/ralph-loop-contract.md +6 -3
  265. package/adapters/cursor/skills/forge-guide/references/shared-conventions.md +102 -28
  266. package/adapters/cursor/skills/forge-init/forge-init.mdc +1 -1
  267. package/adapters/cursor/skills/forge-verify/forge-verify.mdc +82 -51
  268. package/adapters/cursor/skills/forge-verify/references/decisions/single-writer-threat-model.md +53 -0
  269. package/adapters/cursor/skills/forge-verify/references/findings-template.md +70 -50
  270. package/adapters/cursor/skills/forge-verify/references/shared-conventions.md +102 -28
  271. package/adapters/cursor/skills/forge-verify/references/stage-exit-protocol.md +516 -0
  272. package/adapters/cursor/skills/forge-verify/references/verification-checklists/backlog.md +73 -0
  273. package/adapters/cursor/skills/forge-verify/references/verification-checklists/epic.md +5 -4
  274. package/adapters/cursor/skills/forge-verify/references/verification-checklists/impl.md +85 -0
  275. package/adapters/cursor/skills/forge-verify/references/verification-checklists/specs.md +45 -1
  276. package/adapters/gemini/.feature-forge-bundle.json +1 -1
  277. package/adapters/gemini/agents/forge-verifier.md +3 -1
  278. package/adapters/gemini/gemini-extension.json +1 -1
  279. package/adapters/gemini/references/decisions/single-writer-threat-model.md +53 -0
  280. package/adapters/gemini/references/epic-manifest-schema.json +6 -1
  281. package/adapters/gemini/references/epic-state-schema.json +50 -0
  282. package/adapters/gemini/references/forge-config-schema.json +19 -1
  283. package/adapters/gemini/references/forge-decisions-schema.json +33 -0
  284. package/adapters/gemini/references/pipeline-state-schema.json +38 -4
  285. package/adapters/gemini/references/process-overview.md +2 -2
  286. package/adapters/gemini/references/ralph-loop-contract.md +6 -3
  287. package/adapters/gemini/references/shared-conventions.md +102 -28
  288. package/adapters/gemini/references/stage-exit-protocol.md +395 -147
  289. package/adapters/gemini/scripts/epic-manifest.py +495 -91
  290. package/adapters/gemini/scripts/fix-sweep.py +1180 -0
  291. package/adapters/gemini/scripts/forge-bootstrap.py +57 -5
  292. package/adapters/gemini/scripts/forge-session.py +4241 -146
  293. package/adapters/gemini/scripts/validate-traceability.py +86 -5
  294. package/adapters/gemini/skills/forge/forge.md +13 -12
  295. package/adapters/gemini/skills/forge/references/pipeline-state-schema.json +38 -4
  296. package/adapters/gemini/skills/forge/references/process-overview.md +2 -2
  297. package/adapters/gemini/skills/forge/references/shared-conventions.md +102 -28
  298. package/adapters/gemini/skills/forge/references/stage-exit-protocol.md +395 -147
  299. package/adapters/gemini/skills/forge-0-epic/forge-0-epic.md +7 -2
  300. package/adapters/gemini/skills/forge-0-epic/references/edit-mode.md +37 -33
  301. package/adapters/gemini/skills/forge-0-epic/references/epic-manifest-subcommands.md +8 -3
  302. package/adapters/gemini/skills/forge-0-epic/references/pipeline-state-schema.json +38 -4
  303. package/adapters/gemini/skills/forge-0-epic/references/shared-conventions.md +102 -28
  304. package/adapters/gemini/skills/forge-0-epic/references/stage-exit-protocol.md +395 -147
  305. package/adapters/gemini/skills/forge-1-prd/forge-1-prd.md +17 -4
  306. package/adapters/gemini/skills/forge-1-prd/references/shared-conventions.md +102 -28
  307. package/adapters/gemini/skills/forge-1-prd/references/stage-exit-protocol.md +395 -147
  308. package/adapters/gemini/skills/forge-2-tech/forge-2-tech.md +18 -4
  309. package/adapters/gemini/skills/forge-2-tech/references/shared-conventions.md +102 -28
  310. package/adapters/gemini/skills/forge-2-tech/references/stage-exit-protocol.md +395 -147
  311. package/adapters/gemini/skills/forge-3-specs/forge-3-specs.md +9 -3
  312. package/adapters/gemini/skills/forge-3-specs/references/shared-conventions.md +102 -28
  313. package/adapters/gemini/skills/forge-3-specs/references/spec-archetypes.md +9 -0
  314. package/adapters/gemini/skills/forge-3-specs/references/stage-exit-protocol.md +395 -147
  315. package/adapters/gemini/skills/forge-4-backlog/forge-4-backlog.md +56 -5
  316. package/adapters/gemini/skills/forge-4-backlog/references/shared-conventions.md +102 -28
  317. package/adapters/gemini/skills/forge-4-backlog/references/stage-exit-protocol.md +395 -147
  318. package/adapters/gemini/skills/forge-5-loop/forge-5-loop.md +67 -69
  319. package/adapters/gemini/skills/forge-5-loop/references/agent-selection.md +17 -1
  320. package/adapters/gemini/skills/forge-5-loop/references/ralph-loop-contract.md +6 -3
  321. package/adapters/gemini/skills/forge-5-loop/references/recovery-procedure.md +349 -0
  322. package/adapters/gemini/skills/forge-5-loop/references/result-reporting.md +101 -33
  323. package/adapters/gemini/skills/forge-5-loop/references/runner-contract.md +30 -10
  324. package/adapters/gemini/skills/forge-5-loop/references/shared-conventions.md +102 -28
  325. package/adapters/gemini/skills/forge-5-loop/references/stage-exit-protocol.md +395 -147
  326. package/adapters/gemini/skills/forge-6-docs/forge-6-docs.md +75 -8
  327. package/adapters/gemini/skills/forge-6-docs/references/shared-conventions.md +102 -28
  328. package/adapters/gemini/skills/forge-6-docs/references/stage-exit-protocol.md +516 -0
  329. package/adapters/gemini/skills/forge-fix/forge-fix.md +118 -32
  330. package/adapters/gemini/skills/forge-fix/references/shared-conventions.md +102 -28
  331. package/adapters/gemini/skills/forge-fix/references/stage-exit-protocol.md +395 -147
  332. package/adapters/gemini/skills/forge-guide/forge-guide.md +1 -1
  333. package/adapters/gemini/skills/forge-guide/references/forge-config-schema.json +19 -1
  334. package/adapters/gemini/skills/forge-guide/references/process-overview.md +2 -2
  335. package/adapters/gemini/skills/forge-guide/references/ralph-loop-contract.md +6 -3
  336. package/adapters/gemini/skills/forge-guide/references/shared-conventions.md +102 -28
  337. package/adapters/gemini/skills/forge-init/forge-init.md +1 -1
  338. package/adapters/gemini/skills/forge-verify/forge-verify.md +82 -51
  339. package/adapters/gemini/skills/forge-verify/references/decisions/single-writer-threat-model.md +53 -0
  340. package/adapters/gemini/skills/forge-verify/references/findings-template.md +70 -50
  341. package/adapters/gemini/skills/forge-verify/references/shared-conventions.md +102 -28
  342. package/adapters/gemini/skills/forge-verify/references/stage-exit-protocol.md +516 -0
  343. package/adapters/gemini/skills/forge-verify/references/verification-checklists/backlog.md +73 -0
  344. package/adapters/gemini/skills/forge-verify/references/verification-checklists/epic.md +5 -4
  345. package/adapters/gemini/skills/forge-verify/references/verification-checklists/impl.md +85 -0
  346. package/adapters/gemini/skills/forge-verify/references/verification-checklists/specs.md +45 -1
  347. package/adapters/pi/.feature-forge-bundle.json +1 -1
  348. package/adapters/pi/agents/forge-verifier.md +3 -1
  349. package/adapters/pi/references/decisions/single-writer-threat-model.md +53 -0
  350. package/adapters/pi/references/epic-manifest-schema.json +6 -1
  351. package/adapters/pi/references/epic-state-schema.json +50 -0
  352. package/adapters/pi/references/forge-config-schema.json +19 -1
  353. package/adapters/pi/references/forge-decisions-schema.json +33 -0
  354. package/adapters/pi/references/pipeline-state-schema.json +38 -4
  355. package/adapters/pi/references/process-overview.md +2 -2
  356. package/adapters/pi/references/ralph-loop-contract.md +6 -3
  357. package/adapters/pi/references/shared-conventions.md +91 -17
  358. package/adapters/pi/references/stage-exit-protocol.md +395 -147
  359. package/adapters/pi/scripts/epic-manifest.py +495 -91
  360. package/adapters/pi/scripts/fix-sweep.py +1180 -0
  361. package/adapters/pi/scripts/forge-bootstrap.py +57 -5
  362. package/adapters/pi/scripts/forge-session.py +4241 -146
  363. package/adapters/pi/scripts/validate-traceability.py +86 -5
  364. package/adapters/pi/skills/forge/SKILL.md +10 -9
  365. package/adapters/pi/skills/forge/references/pipeline-state-schema.json +38 -4
  366. package/adapters/pi/skills/forge/references/process-overview.md +2 -2
  367. package/adapters/pi/skills/forge/references/shared-conventions.md +91 -17
  368. package/adapters/pi/skills/forge/references/stage-exit-protocol.md +395 -147
  369. package/adapters/pi/skills/forge-0-epic/SKILL.md +7 -2
  370. package/adapters/pi/skills/forge-0-epic/references/edit-mode.md +31 -27
  371. package/adapters/pi/skills/forge-0-epic/references/epic-manifest-subcommands.md +6 -1
  372. package/adapters/pi/skills/forge-0-epic/references/pipeline-state-schema.json +38 -4
  373. package/adapters/pi/skills/forge-0-epic/references/shared-conventions.md +91 -17
  374. package/adapters/pi/skills/forge-0-epic/references/stage-exit-protocol.md +395 -147
  375. package/adapters/pi/skills/forge-1-prd/SKILL.md +17 -4
  376. package/adapters/pi/skills/forge-1-prd/references/shared-conventions.md +91 -17
  377. package/adapters/pi/skills/forge-1-prd/references/stage-exit-protocol.md +395 -147
  378. package/adapters/pi/skills/forge-2-tech/SKILL.md +18 -4
  379. package/adapters/pi/skills/forge-2-tech/references/shared-conventions.md +91 -17
  380. package/adapters/pi/skills/forge-2-tech/references/stage-exit-protocol.md +395 -147
  381. package/adapters/pi/skills/forge-3-specs/SKILL.md +9 -3
  382. package/adapters/pi/skills/forge-3-specs/references/shared-conventions.md +91 -17
  383. package/adapters/pi/skills/forge-3-specs/references/spec-archetypes.md +9 -0
  384. package/adapters/pi/skills/forge-3-specs/references/stage-exit-protocol.md +395 -147
  385. package/adapters/pi/skills/forge-4-backlog/SKILL.md +56 -5
  386. package/adapters/pi/skills/forge-4-backlog/references/shared-conventions.md +91 -17
  387. package/adapters/pi/skills/forge-4-backlog/references/stage-exit-protocol.md +395 -147
  388. package/adapters/pi/skills/forge-5-loop/SKILL.md +67 -69
  389. package/adapters/pi/skills/forge-5-loop/references/agent-selection.md +16 -0
  390. package/adapters/pi/skills/forge-5-loop/references/ralph-loop-contract.md +6 -3
  391. package/adapters/pi/skills/forge-5-loop/references/recovery-procedure.md +349 -0
  392. package/adapters/pi/skills/forge-5-loop/references/result-reporting.md +101 -33
  393. package/adapters/pi/skills/forge-5-loop/references/runner-contract.md +29 -9
  394. package/adapters/pi/skills/forge-5-loop/references/shared-conventions.md +91 -17
  395. package/adapters/pi/skills/forge-5-loop/references/stage-exit-protocol.md +395 -147
  396. package/adapters/pi/skills/forge-6-docs/SKILL.md +75 -8
  397. package/adapters/pi/skills/forge-6-docs/references/shared-conventions.md +91 -17
  398. package/adapters/pi/skills/forge-6-docs/references/stage-exit-protocol.md +516 -0
  399. package/adapters/pi/skills/forge-fix/SKILL.md +118 -32
  400. package/adapters/pi/skills/forge-fix/references/shared-conventions.md +91 -17
  401. package/adapters/pi/skills/forge-fix/references/stage-exit-protocol.md +395 -147
  402. package/adapters/pi/skills/forge-guide/references/forge-config-schema.json +19 -1
  403. package/adapters/pi/skills/forge-guide/references/process-overview.md +2 -2
  404. package/adapters/pi/skills/forge-guide/references/ralph-loop-contract.md +6 -3
  405. package/adapters/pi/skills/forge-guide/references/shared-conventions.md +91 -17
  406. package/adapters/pi/skills/forge-verify/SKILL.md +81 -50
  407. package/adapters/pi/skills/forge-verify/references/decisions/single-writer-threat-model.md +53 -0
  408. package/adapters/pi/skills/forge-verify/references/findings-template.md +69 -49
  409. package/adapters/pi/skills/forge-verify/references/shared-conventions.md +91 -17
  410. package/adapters/pi/skills/forge-verify/references/stage-exit-protocol.md +516 -0
  411. package/adapters/pi/skills/forge-verify/references/verification-checklists/backlog.md +73 -0
  412. package/adapters/pi/skills/forge-verify/references/verification-checklists/epic.md +5 -4
  413. package/adapters/pi/skills/forge-verify/references/verification-checklists/impl.md +85 -0
  414. package/adapters/pi/skills/forge-verify/references/verification-checklists/specs.md +45 -1
  415. package/package.json +1 -1
  416. package/adapters/claude/skills/forge-verify/references/pipeline-state-schema.json +0 -191
  417. package/adapters/codex/skills/forge-verify/references/pipeline-state-schema.json +0 -191
  418. package/adapters/copilot/skills/forge-verify/references/pipeline-state-schema.json +0 -191
  419. package/adapters/cursor/skills/forge-verify/references/pipeline-state-schema.json +0 -191
  420. package/adapters/gemini/skills/forge-verify/references/pipeline-state-schema.json +0 -191
  421. package/adapters/pi/skills/forge-verify/references/pipeline-state-schema.json +0 -191
@@ -6,16 +6,9 @@ description: Execute the autonomous coding loop (rauf by default) against a forg
6
6
 
7
7
  # forge-5-loop — Autonomous Loop Executor
8
8
 
9
- Execute the autonomous coding loop against a forge feature's backlog. The loop
10
- spawns a fresh agent session per backlog item, implementing each task with full
11
- verification.
9
+ Execute the autonomous coding loop against a forge feature's backlog. The loop spawns a fresh agent session per backlog item, implementing each task with full verification.
12
10
 
13
- The loop **runner** is configured, not hardcoded. feature-forge talks to it
14
- through the `loopRunner` block in `forge.config.json`; rauf is the default and
15
- reference implementation (see `references/ralph-loop-contract.md`). Every command
16
- below is rendered from `loopRunner` with token substitution — there are no
17
- hardcoded `rauf …` commands in this skill, and even the human log filename is
18
- tokenized as `{loopRunner.logFile}`.
11
+ The loop **runner** is configured, not hardcoded. feature-forge talks to it through the `loopRunner` block in `forge.config.json`; rauf is the default and reference implementation (see `references/ralph-loop-contract.md`). Every command below is rendered from `loopRunner` with token substitution — no hardcoded `rauf …` commands; even the human log filename is tokenized (`{loopRunner.logFile}`).
19
12
 
20
13
  ## Resolve the loop runner
21
14
 
@@ -34,8 +27,7 @@ Token substitution applies to every `*Command` string. Substitute:
34
27
  - `{specsDir}` → `specsDir` from config
35
28
  - `{iterations}` → the computed iteration count (Step 2a)
36
29
 
37
- Whenever this skill says "run the **run command**" / "**status command**" /
38
- etc., it means the corresponding substituted `loopRunner.*Command`.
30
+ Whenever this skill says "run the **run command**" / "**status command**" / etc., it means the corresponding substituted `loopRunner.*Command`.
39
31
 
40
32
  **Turn structure reminder:** Output analysis/context as text, then route ALL questions through the host's question mechanism. Never embed questions in text output — the user will not be prompted and the session will stall.
41
33
 
@@ -49,11 +41,18 @@ Read and follow `references/shared-conventions.md` for feature name validation,
49
41
 
50
42
  Read `{resolvedFeatureDir}/.pipeline-state.json`. If not in force mode, `stages.forge-4-backlog` must be `complete`. If not, STOP and tell the user: "Backlog hasn't been created yet. Run `/feature-forge:forge-4-backlog {feature}` first."
51
43
 
44
+ If the state's `notes` is non-empty, surface it before proceeding and treat it as run input — often backlog-time constraints; it never overrides specs or config (raise any conflict).
45
+
52
46
  ### 1b. Verification Check
53
47
 
54
- Check if `stages.forge-verify-backlog` exists and has status `passed` or `findings-applied`. If not, use the host's question mechanism to warn with the cost of skipping:
48
+ Read `stages.forge-verify-backlog` and branch on its status — **four** cases, in this order (the pending case must be tested *before* the generic one, or owed-and-dropped debt gets reported as never-scheduled):
49
+
50
+ 1. **`passed`** — proceed with no prompt.
51
+ 2. **`findings-applied`** — fixes were applied but nothing re-verified them: this status deliberately clears freshness, so the backlog's verification is still outstanding, not silently satisfied. Use the host's question mechanism to offer: **Re-verify first (recommended)** (`/feature-forge:forge-verify {feature} backlog`) · **Continue without re-verifying**. On continue, write **nothing**: `state-verify` refuses demoting `findings-applied` to `skipped` (#203); the recorded status already says re-verification is outstanding.
52
+ 3. **`auto-verify-pending`** — automatic verification *was* scheduled for the backlog stage and the debt *was* durably recorded; it simply has not run. Say exactly that, naming the served stage and the retry command: *"{feature}: automatic verification is still pending for forge-4-backlog; run `/feature-forge:forge-verify {feature} backlog` to resolve it."* Then use the host's question mechanism to offer the same two choices as case 4. Never report this as "hasn't been verified yet" — "nobody ever asked for this" and "this was owed and dropped" are different facts.
53
+ 4. **Anything else** (absent, `pending`, `skipped`, `findings-reported`) — use the host's question mechanism to warn with the cost of skipping: "Backlog hasn't been verified yet. Recommended: run `/feature-forge:forge-verify {feature}` first — the loop implements items autonomously and commits as it goes, so a bad item (wrong scope, missing dependency, untestable acceptance criteria) is far cheaper to catch now than after several commits build on it. Continue anyway?"
55
54
 
56
- "Backlog hasn't been verified yet. Recommended: run `/feature-forge:forge-verify {feature}` first — the loop implements items autonomously and commits as it goes, so a bad item (wrong scope, missing dependency, untestable acceptance criteria) is far cheaper to catch now than after several commits build on it. Continue anyway?" Offer **Verify first (recommended)** · **Continue without verifying**.
55
+ Cases 3 and 4 offer the same choices: **Verify first (recommended)** · **Continue without verifying**. The proceed-anyway path is unchanged.
57
56
 
58
57
  ### 1b-epic. Epic Dependency Gate
59
58
 
@@ -117,13 +116,17 @@ Verify the file exists on disk. If not, STOP and tell the user: "No backlog.json
117
116
 
118
117
  The runner commits each item onto the current branch. Skip if not a git repo or `branchPerFeature` is false. Otherwise run the **Branch Reconciliation** block in `references/shared-conventions.md` (it runs `reconcile-branch` and, on `warn-drift` — you are on the default branch — strongly recommends creating `{branchPrefix}{feature}` via the host's question mechanism before the loop commits; on `adopt-current` it updates the recorded branch to the current one, never pushing you back to a stale/imposed branch). Never hard-stop.
119
118
 
119
+ ### 1g. Stranded-Work Pre-flight (if using git)
120
+
121
+ Run `git status --porcelain`. If it reports changes **and** `{backlogDir}/{loopRunner.stateDir}/state.json` exists from a previous run, **STOP**: name that run (its `startedAt`, `currentItem`, and `blockedItems` from `state.json`) and point the user at the **Post-Run Tree Reconciliation** section of `references/recovery-procedure.md` to commit / stash / discard the stranded work before relaunch — never auto-pass `--force`. If the tree is dirty with **no** prior-run `state.json`, keep today's behavior (surface it; let the user commit/stash or pass `--force`). A clean tree is silent. rauf's own launch refusal remains the backstop.
122
+
120
123
  ## Step 2: Construct the Loop Command
121
124
 
122
125
  ### 2a. Analyze Backlog
123
126
 
124
- Run the **list command** (`loopRunner.listCommand`, default `rauf backlog list . --backlog {backlogDir} --json`) and count items by status: `pending`, `in_progress`, `done`, `blocked`.
127
+ Run the **list command** (`loopRunner.listCommand`, default `rauf backlog list . --backlog {backlogDir} --json`) and count items by status: `pending`, `in_progress`, `done`, `blocked`. Pipe that same list-command JSON into `backlog-topology --items-stdin --json` (a `forge-session.py` verb — invoke it via Step 3a's `$R` fence) and read `maxChainDepth` to report alongside the iteration count — advisory only: no prompt, no operator decision.
125
128
 
126
- Calculate the iteration count: `ceil((pending + in_progress) * loopIterationMultiplier)` where `loopIterationMultiplier` comes from `forge.config.json` (default: 1.5). This headroom allows retries without exhausting iterations.
129
+ Calculate the iteration count: `ceil((pending + in_progress) * loopIterationMultiplier)` where `loopIterationMultiplier` comes from `forge.config.json` (default: 1.5, headroom for retries).
127
130
 
128
131
  If there are no pending or in_progress items, STOP and tell the user: "All backlog items are already done or blocked. Nothing to run."
129
132
 
@@ -136,8 +139,6 @@ If there are `blocked` items, note them — the user may want `--retry-blocked`.
136
139
  - If `backlogDir` is set in config: use the per-feature subpath `{backlogDir}/{feature}` (matching the 1e composition rule and forge-4-backlog §6.2).
137
140
  - Otherwise: use `{resolvedFeatureDir}` (the directory containing `backlog.json`).
138
141
 
139
- **Example:** If `specsDir` is `./specs` and feature is `auth`, `{backlogDir}` is `specs/auth`.
140
-
141
142
  ### 2c. Build Command
142
143
 
143
144
  Render the **run command** (`loopRunner.runCommand`) with token substitution, e.g. the rauf default becomes:
@@ -161,21 +162,20 @@ Backlog summary:
161
162
  - Done: {done}
162
163
  - Blocked: {blocked}
163
164
  - Iterations: {iterationCount} ({activeItems} items x {loopIterationMultiplier} multiplier)
165
+ - Max chain depth: {maxChainDepth} — depth bounds achievable progress regardless of iteration budget
164
166
 
165
167
  For the model-selection precedence (item.model > --model/options > project default >
166
168
  provider default), read references/runner-contract.md.
167
169
  ```
168
170
 
169
- **Run mode (gated on `loopRunner.name == "rauf"`).** When the runner is rauf, add a **"Run mode"** question to this same the host's question mechanism surface with these options **in this exact order** (do NOT improvise — deterministic ordering is the point): **(1) "Run with review pass (recommended)"** — append `--review`, and this is the default; **(2) "Run without review"** — the bare rendered command; **(3, only when 2a counted blocked items) "Review + retry blocked"** — append `--review --retry-blocked`. the host's question mechanism's built-in "Other" covers ad-hoc flags (`--model`/`--timeout`); add no separate open-ended option. The command line shown above renders `--review` (the recommended default). **When the runner is not rauf**, add NO Run-mode question — present the bare rendered command and let the user adjust via "Other" (byte-identical to today). Verbatim option labels: `## Run mode (Step 2d, rauf)` in `references/runner-contract.md`.
170
-
171
- For the full loop-runner contract — event-stream vs. log-fallback launch, the live-supervision/monitor rules, and the model-selection precedence — read `references/runner-contract.md`. Whichever Run-mode option (or "Other") the user picks, append its flags to the rendered run command before Step 3.
171
+ **Run mode and full loop-runner contract:** follow `## Run mode (Step 2d, rauf)` and the remaining sections in `references/runner-contract.md` verbatim; `loopRunner.reviewMode` (`"always"`/`"never"`) suppresses the Run-mode question — semantics live there.
172
172
 
173
173
  #### Agent selection (gated on `loopRunner.agentArgument`)
174
174
 
175
175
  **Capability gate.** Everything below applies **only when** the effective `loopRunner.agentArgument` is present and non-empty. **When it is absent or empty, Step 2d is exactly the confirmation above — no probe, no agent question, no availability listing, no `Agent:` line — byte-identical to today** (REQ-PLUG-02, REQ-COMPAT-01). The full algorithm, precedence, and verbatim message shapes are in `## Agent selection` of `references/agent-selection.md`; read it. When the gate is on, augment Step 2d in order:
176
176
 
177
177
  - **(a) Probe once.** Before confirming, run `loopRunner.agentsProbeCommand` (default `{bin} agents --json`) **exactly once** (no retries, no second probe); it exits 0 with `{ agents: [...] }`. Parse `agents[]`; build the advertised set `{ row.id }` — this one parsed array drives (b)–(d).
178
- - **(b) Agent question.** Add an **"agent"** question to the same the host's question mechanism surface: **one option per advertised row** labelled `"{displayName} ({id}) — available/not found"`, **plus an explicit `"default (claude-cli)"` choice mapping to `run_selection = None`**. Resolve the pick (run > project, empty/whitespace unset, an explicit runner-default pick collapses to the default path) into `{resolved.agent, resolved.source}`. Precedence: `item.provider > --agent > project defaultAgent > runner default` (forge never reads a backlog item's provider).
178
+ - **(b) Agent question.** Add an **"agent"** question to the same the host's question mechanism surface: **one option per advertised row** labelled `"{displayName} ({id}) — available/not found"`, **plus an explicit `"default (claude-cli)"` choice mapping to `run_selection = None`**. Resolve the pick (run > project, empty/whitespace unset, an explicit runner-default pick collapses to the default path) into `{resolved.agent, resolved.source}`. Precedence: `item.provider > --agent > project defaultAgent > runner default` (forge never reads a backlog item's provider). Under `loopRunner.agentMode: "auto"`, skip this question (`run_selection = None`); (a)/(c)/(d)/(d-model) still run — see `references/agent-selection.md`.
179
179
  - **(c) Availability listing.** From the **same** parsed `agents[]` (no second probe), list `id` / `displayName` / available (`yes`/`no`, `detail` on unavailable rows).
180
180
  - **(d) Verdict** — only for a **non-default** resolved agent (default path `None`/`claude-cli` → no probe, byte-identical to today). Classify by **membership** then `available` (never by exit code): **UNKNOWN** (`∉` set) → **hard-reject BEFORE any loop side-effect**, error lists the **sorted** valid ids, **NO proceed-anyway**; **UNAVAILABLE** (member, `available False`) → warn with `detail`, the host's question mechanism offering **proceed-anyway OR choose-another** (re-presents the same `agents[]`), never silent; **AVAILABLE** → proceed, the validated id fills `{agent}`; **probe failure** (non-zero exit / unparseable / missing or empty `agents[]` / row lacking `id`) → surface it, offer **choose-another OR abort**, **never launch the non-default agent unvalidated** and never silently fall back to the default.
181
181
  - **(d-model) Claude-only model-alias guard.** Runs **only** when the resolved agent is **non-default** (not the default / `claude-cli` path). Read the backlog.json (Step 1e path); collect items whose `model` is a **Claude-specific alias** (tier `opus`/`sonnet`/`haiku` or a `claude-*` id). **If none, skip silently.** Otherwise warn before launch via the host's question mechanism (NOT prose): `item.model` outranks `--agent`, so the alias is forwarded verbatim to `{agent}`, which will likely reject it (e.g. codex 400 *"The 'sonnet' model is not supported…"*) — every spawn exits 1 and rauf circuit-breaks (*"3 consecutive infra failures — halting"*) with no hint of the cause. Offer: **(1) Strip `model` for this run (recommended)** — rewrite backlog.json removing the `model` key from each affected item (persistent edit; re-run forge-4-backlog to restore), then proceed; **(2) Proceed as-is** — only safe if `{agent}` understands the pinned ids. forge touches only `model`, never `provider`. Full rationale: `references/agent-selection.md`.
@@ -198,7 +198,7 @@ Then commit this state write before launching (mandatory). The runner refuses to
198
198
 
199
199
  ### 3b. Launch Background Process
200
200
 
201
- Launch the loop **backgrounded** (the host's background-execution mechanism) so it survives session end and does not block the session. For a runner that **persists its own structured event file** (the default — rauf writes `{stateDir}/events.ndjson` natively and rotates it per run), launch the **plain `runCommand`** with **no stdout redirect** and supervise the runner's **native** `events.ndjson` directly; do **not** redirect `--ndjson` into `{stateDir}` (it is redundant and collides with the runner's own writer — see `references/runner-contract.md`). Only a stdout-only runner (no native event file) uses `eventStreamCommand`, redirected to a file **outside** `{stateDir}`. The background task's exit notification is the single authoritative terminal signal (Step 4). Loop runs can take significant time (minutes to hours depending on backlog size). For the exact launch commands (incl. the `mkdir -p` state-dir guard and the root→`IS_SANDBOX` sandbox guard) and the self-persisting vs. stdout-only detail, read `references/runner-contract.md`.
201
+ Launch the loop **backgrounded** (the host's background-execution mechanism) so it survives session end and does not block the session. For a runner that **persists its own structured event file** (the default — rauf writes `{stateDir}/events.ndjson` natively and rotates it per run), launch the **plain `runCommand`** with **no stdout redirect** and supervise the runner's **native** `events.ndjson` directly; do **not** redirect `--ndjson` into `{stateDir}` (it is redundant and collides with the runner's own writer — see `references/runner-contract.md`). Only a stdout-only runner (no native event file) uses `eventStreamCommand`, redirected to a file **outside** `{stateDir}`. The background task's exit notification is the single authoritative terminal signal (Step 4). For the exact launch commands (incl. the `mkdir -p` state-dir guard and the root→`IS_SANDBOX` sandbox guard) and the self-persisting vs. stdout-only detail, read `references/runner-contract.md`.
202
202
 
203
203
  ### 3c. Inform User
204
204
 
@@ -207,29 +207,16 @@ Follow the **Inform-user output template (Step 3c)** section of `references/runn
207
207
  ### 3d. Arm a Monitor on the event stream, and react to events
208
208
 
209
209
  Arm the **host's monitoring mechanism** on the structured event stream (the NDJSON file, or the
210
- human log as fallback) so events flow back into this session as they happen. Use
211
- **`persistent: true`** — runs can exceed the host's monitoring mechanism's maximum `timeout_ms` (1 hour),
212
- and a bounded timeout would silently stop watching a still-running loop. The filter
213
- MUST match every terminal and exception state, not just the happy path (silence is
214
- not success). Monitor the **structured** surface, never raw `RAUF_*` tokens.
215
-
216
- Each Monitor event arrives as a message; react per type — surface `needs_human` /
217
- `loop_error` immediately with a `PushNotification`, coalesce `item_completed` into
218
- milestones, and treat `llm_stuck_warning` as a hang warning. A `needs_human` /
219
- `blocked` signal does **not** pause the loop — the runner sets the item aside and
220
- keeps going.
221
-
222
- For the exact Monitor commands (NDJSON `jq` filter and the log-fallback `grep`
223
- prefixes), the coverage-complete filter event list, and the full per-event reaction
224
- rules, read `references/runner-contract.md`.
210
+ human log as fallback) with **`persistent: true`**, a coverage-complete filter
211
+ matching every terminal and exception state (silence is not success), and react to
212
+ each event as it arrives. The exact Monitor commands, the filter event list, and the
213
+ full per-event reaction rules (`needs_human` / `loop_error` surfaced immediately with
214
+ a `PushNotification`, `item_completed` coalesced into milestones, `llm_stuck_warning`
215
+ as a hang warning) are in `references/runner-contract.md` — follow them verbatim.
225
216
 
226
217
  ### 3f. Reach completion
227
218
 
228
- Step 4 is reached when the backgrounded process exits (its completion notification is
229
- authoritative); the `loop_completed` / `loop_error` / `loop_cancelled` event is the live
230
- heads-up that it's imminent. Stop the Monitor (it ends on its own when `tail` sees the
231
- process-ended log, or via `TaskStop`) and proceed to Step 4. Do NOT foreground-sleep
232
- or poll — the harness drives both the Monitor events and the completion notification.
219
+ Step 4 is reached when the backgrounded process exits (its completion notification is authoritative); the `loop_completed` / `loop_error` / `loop_cancelled` event is the live heads-up that it's imminent. Stop the Monitor (it ends on its own when `tail` sees the process-ended log, or via `TaskStop`) and proceed to Step 4. Do NOT foreground-sleep or poll — the harness drives both the Monitor events and the completion notification.
233
220
 
234
221
  ## Step 4: Check Results
235
222
 
@@ -241,14 +228,16 @@ Run the **status-json command** (`loopRunner.statusJsonCommand`) and read
241
228
  `backlogSummary` for the authoritative counts — it separates the three non-done
242
229
  outcomes: genuine `blocked`, `needsHuman`, and runner-`deferred` ("false blocks").
243
230
  Fall back to the **list command** (`loopRunner.listCommand`) if `statusJsonCommand`
244
- is not configured. You will already have most of this from the live tally in 3e. If the run used a review flag (e.g. rauf's `--review`), also read any `review_completed` event (event stream, or `{loopRunner.stateDir}/events.ndjson`) for its `itemsCreated`/`summary` to surface in 4b — see `references/result-reporting.md`.
231
+ is not configured. If the run used a review flag (e.g. rauf's `--review`), also read any `review_completed` event (event stream, or `{loopRunner.stateDir}/events.ndjson`) for its `itemsCreated`/`summary` to surface in 4b — see `references/result-reporting.md`.
245
232
 
246
233
  ### 4b. Report Results
247
234
 
248
235
  Present a summary to the user. Pick **every** branch that applies (a run can be both
249
- blocked and needs-human) and render its report. The five verbatim result-report
250
- output templates — **all-done**, **needs-human**, **blocked**, **deferred**, and
251
- **pending** (iteration limit reached) — are in `references/result-reporting.md`.
236
+ blocked and needs-human) and render its report. The five verbatim result-report output templates — **all-done**, **needs-human**, **blocked**, **deferred**, and **pending** (with a conditional cause) — are in `references/result-reporting.md`, together with the Step 7 `LoopOutcome` ladder these same counts feed. The reports are descriptive only: they carry no next command, and the run does not end here. If the authoritative counts cannot be obtained at all (4a failed or its output does not parse), follow **Operational failure before the counts are known** in that same file: surface the failure and its recovery, and close nothing — no outcome, no stage exit, no terminal block.
237
+
238
+ ### 4c. Post-Run Recovery Pass (unconditional)
239
+
240
+ Run the **Post-Run Recovery Procedure** (`references/recovery-procedure.md`) now — on **every** run close, before Step 5 writes state, so the tree it inspects is exactly what the run left. The live `needs_human` handler (3d) collects answers early but is **not** the entry condition: a run that emitted no event still enters here — this is what makes the plain-blocked unblock reachable on blocked-only runs. With nothing to decide, its step 1 skips straight to the §4 tree reconciliation — silent on a clean tree. A run can strand uncommitted work with no signal (items failing a shared final acceptance criterion are never committed); this pass reconciles it — 1g's pre-flight is only the next-launch backstop. Its step-7 gate feeds Step 7's `resolved` rung; the stage still closes exactly once, in Step 7.
252
241
 
253
242
  ## Step 5: Update Pipeline State
254
243
 
@@ -264,43 +253,52 @@ python3 "$R/scripts/forge-session.py" state-complete --feature "{feature}" --sta
264
253
 
265
254
  ## Step 5b: Offer Impl-Verify (standalone path)
266
255
 
267
- **Gate:** run only if (a) the feature's `.pipeline-state.json` has **no** `epic` key **and** (b) Step 5 set `stages.forge-5-loop.status` to `complete`. Otherwise **skip** — partial runs end as today, and epic members get the equivalent offer in Step 6.1 (do **not** prompt twice). This standalone counterpart to Step 6.1 nudges verification interactively rather than via the easily-missed "Next steps" text. Use the host's question mechanism (NOT inline prose) to offer: *"{feature}'s loop is complete. Recommended: run `/feature-forge:forge-verify {feature} impl` to audit the implementation before generating docs. Run it now, or skip to forge-6-docs?"* On **run**, hand off to `/feature-forge:forge-verify {feature} impl`. On **skip**, record `stages.forge-verify-impl.status` as `"skipped"` (mirrors `forge-4-backlog`'s skip handling) and point the user at `/feature-forge:forge-6-docs {feature}` — the forge-6-docs backstop re-surfaces the skip.
256
+ **Gate:** run only if (a) the feature's `.pipeline-state.json` has **no** `epic` key **and** (b) Step 5 set `stages.forge-5-loop.status` to `complete`. Otherwise **skip** straight to Step 7 — a non-complete run has nothing to verify yet, and epic members get the equivalent offer in Step 6.1 (do **not** prompt twice). This standalone counterpart to Step 6.1 nudges verification interactively. Use the host's question mechanism (NOT inline prose) to offer: *"{feature}'s loop is complete. Recommended: run `/feature-forge:forge-verify {feature} impl` to audit the implementation before generating docs. Run it now, or skip to forge-6-docs?"* On **run**, invoke `feature-forge:forge-verify {feature} impl` with the literal `owner: nested` token in the dispatching prompt — this dispatch happens inside the loop stage, so **you** remain the sole terminal owner and the branch skill returns its structured result and prints no terminal block of its own (see "Branch ownership" and "Caller-side resumption" in `references/stage-exit-protocol.md`; a delegate-and-resume site — on return, control resumes here). A verifier return without its report structure is a dropped digest, not a result (issue #183) — apply "Truncated Verifier Returns" in forge-verify's `findings-template.md` reference (resume or re-dispatch) before recording anything. On **skip**, persist the skip through `state-verify` using the fence below (mirrors `forge-4-backlog`'s skip handling) — the forge-6-docs backstop re-surfaces the skip. Either way, do **not** name a next command here: Step 7 routes, and it routes differently depending on what this step recorded.
257
+
258
+ **The skip is written by `state-verify`, never by hand — and never over a resolved entry** (`passed`/`findings-applied`: the verb refuses that demotion, #203 — skip the fence and continue). Add `--epic "{epic}"` when this feature is an epic member — required, per the Pipeline State Protocol in `references/shared-conventions.md`. On exit 2, surface the plain `Error:` line verbatim and stop: the skip is not persisted, so Step 7 would route on state that is not on disk.
259
+
260
+ ```bash
261
+ 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')"
262
+ [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
263
+ python3 "$R/scripts/forge-session.py" state-verify --feature "{feature}" --stage forge-5-loop --status skipped --specs-dir "{specsDir}"
264
+ ```
268
265
 
269
266
  ## Step 6: Epic Handoff
270
267
 
271
- **Gate:** only run this step if (a) the resolved feature's `.pipeline-state.json` has an `epic` key **and** (b) Step 5 set `stages.forge-5-loop.status` to `complete` (all backlog items done). If either is false, **skip** — standalone completed features are handled by Step 5b, and partial runs end as today (REQ-COMPAT-01).
268
+ **Gate:** only run this step if (a) the resolved feature's `.pipeline-state.json` has an `epic` key **and** (b) Step 5 set `stages.forge-5-loop.status` to `complete` (all backlog items done). If either is false, **skip** straight to Step 7 — standalone completed features are handled by Step 5b, and a non-complete run has no handoff to make (REQ-COMPAT-01).
272
269
 
273
- 1. **Offer impl-verify first (recommended, skippable).** Per the completion rule (`00-core-definitions.md §7`), a feature whose `forge-verify-impl.status == findings-reported` does **not** unblock dependents. Use the host's question mechanism (NOT inline prose) to offer: *"{feature}'s loop is done. Recommended: run `/feature-forge:forge-verify {feature} impl` before unblocking dependents. Run it now, or skip and continue the handoff?"* The user may skip (then completion is judged on the §7 rule with impl-verify absent).
270
+ 1. **Offer impl-verify first (recommended, skippable).** Per the completion rule (`00-core-definitions.md §7`), a feature whose `forge-verify-impl.status == findings-reported` does **not** unblock dependents. Use the host's question mechanism (NOT inline prose) to offer: *"{feature}'s loop is done. Recommended: run `/feature-forge:forge-verify {feature} impl` before unblocking dependents. Run it now, or skip and continue the handoff?"* On **run**, dispatch exactly as Step 5b does — the same literal `owner: nested` token in the dispatching prompt (you remain the sole terminal owner), the same truncated-return guard before recording anything, and the same declared resume (control returns here; the handoff continues at 2). On **skip**, persist the skip through `state-verify --status skipped` using Step 5b's fence (add `--epic "{epic}"` — required for members) so the Step 7 exit reads a recorded decision instead of re-asking the question the user just answered; completion is then judged on the §7 rule with impl-verify explicitly skipped.
274
271
  2. **Recompute and announce.** Run `render-status "{epic}" --specs-dir "{specsDir}" --json`. Announce the feature's completion and the epic rollup (e.g. "2/4 features complete") — derived live from disk, never re-computed in prose.
275
- 3. **Identify the next actionable feature(s).** Read `render-status`'s `actionable` set (every dependency now complete, not itself complete) and `nextCommand`. **None actionable:** say so — if `rollup.total > 0` **AND** `rollup.complete == rollup.total`, suggest `/feature-forge:forge-6-docs {feature}` and note the epic-level documentation offer (§10) (the `rollup.total > 0` guard prevents an **empty epic** `0 == 0` from reading as complete); otherwise list what is still blocked and on which dependencies, then end (do not prompt to start a feature that cannot start). **One or more actionable:** use the host's question mechanism presenting **each actionable feature** as an option (plus "stop here"). Execution is **serial** — the user picks exactly one (REQ-ORCH-03); do **not** autonomously chain into the next pipeline.
276
- 4. **Begin the chosen feature.** **PRD absent** (no `PRD.md`, or `stages.forge-1-prd` not complete): offer to author it now — "Start `/feature-forge:forge-1-prd {chosen}`?" (REQ-ORCH-02); on yes, hand off to forge-1-prd (which injects epic context per §5.1). **PRD present:** point the user at the chosen feature's `nextCommand` from render-status.
277
- 5. **Commit (REQ-OBS-01).** When `gitCommitAfterStage` is true, commit the Step 5 completion write (and any manifest `updatedAt` bump) via the shared-conventions **Git Commit Protocol**, staging the epic subtree so the member state change commits atomically: `git add {specsDir}/{epic}/` then `{commitPrefix}({feature}): complete loop`. If `gitCommitAfterStage` is false, skip the commit.
278
- 6. **Close the handoff with the Stage Exit Protocol.** Finishing feature `{feature}` → starting the picked feature `{chosen}`'s PRD is a **cold** stage boundary (single-sourced in `references/stage-exit-protocol.md`). Feature `{feature}`'s impl-verify was already offered in Step 6.1, so step 1's gate self-suppresses when it ran or was skipped — the block collapses to clear your session / start a fresh session → next-command. Present it only when the chosen feature's PRD is absent (a PRD-present pick just runs its `nextCommand`):
272
+ 3. **Announce what is actionable — do not route.** Read `render-status`'s `actionable` set (every dependency now complete, not itself complete) and say plainly which members can start now, or which are still blocked and on which dependencies. This is context for the user, not a handoff: the Step 7 exit consumes the same live payload and fences the one authoritative next command itself, so do **not** present a next-feature picker, offer to author a member's PRD, or repeat a member's `nextCommand` here. Two competing actions is exactly the ambiguity the scripted exit removes.
273
+ 4. **Commit (REQ-OBS-01).** When `gitCommitAfterStage` is true, commit the Step 5 completion write (and any manifest `updatedAt` bump) via the shared-conventions **Git Commit Protocol**, staging the epic subtree so the member state change commits atomically: `git add {specsDir}/{epic}/` then `{commitPrefix}({feature}): complete loop`. If `gitCommitAfterStage` is false, skip the commit. Then fall through to Step 7 — the epic handoff closes there, once, like every other path.
279
274
 
280
- **This stage is done — walk the user through the Stage Exit Protocol** before moving on. The order is fixed, and step 2 is something only the user can do:
275
+ ## Step 7: Close the Stage
281
276
 
282
- 1. **Verify feature {feature}'s loop first — if it isn't already verified.** If verify already ran in this session — via the in-stage auto-verify on the authoring stages, or the interactive impl-verify offered above on the loop — or is already fresh on record, or the stage was explicitly skipped, say so and go straight to step 2. Only when `autoVerify` is off for this stage **and** verify is **missing or stale** do you present the **Standard Verify Gate**: verify **now, before clearing**, using the host's question mechanism with exactly these three options — but only when the host has a question mechanism **and** the clean-room path is available (the host's subagent mechanism plus a dispatchable `forge-verifier` subagent):
283
- - **Verify feature {feature}'s loop now** *(recommended)* — dispatch the clean-room `forge-verifier` subagent from this session in require-clean mode; the digest returns here so any fix decision keeps its context. One-time — it does **not** change config.
284
- - **Verify now + enable auto-verify going forward** — verify now **and** patch `"autoVerify": true` into `forge.config.json` in place (preserve formatting and every other key) so future stages verify automatically, no prompt. This complements the `forge-init` opt-in. **Do not auto-commit this config change** — treat it like `notes`: a user-facing edit the user commits on their own cadence, never folded into a stage's artifact commit.
285
- - **Skip for now** — go straight to clear your session / start a fresh session and the next command without verifying. Record this stage's verify status as `"skipped"` in pipeline state (mirroring the existing skip handling) **only** on an explicit skip — a skip does not go stale.
277
+ Every loop run ends here, and ends here **exactly once** — standalone or epic member, complete or not.
286
278
 
287
- **Host / clean-room fallback (not a user-selectable option):** if the question mechanism, the host's subagent mechanism, or the `forge-verifier` subagent is unavailable, do **not** run clean-room — degrade to printing `/feature-forge:forge-verify {feature} impl` for the user to run inline/manually (mirroring `autoInvokeNextStage`), and offer the auto-verify enable as plain text only if a config write is possible.
288
- 2. **Then clear your session / start a fresh session.** Recommended **unconditionally** at this boundary for a clean start — independent of how full the context window is. Every artifact is on disk, so the work survives the clear. **I can't clear your session / start a fresh session for you — you have to run it yourself.**
289
- 3. **Then run the next command** in the fresh session — or re-run `/feature-forge:forge` to let the navigator resume from disk:
279
+ First select the single `LoopOutcome` with the ladder in `references/result-reporting.md` (`resolved` → `needs-human` → `blocked` → `deferred` → `partial` → `complete`, first match wins), reading it from Step 4a's authoritative counts and never from the runner's process exit code. If those counts were never obtained, follow that file's operational-failure rule instead: report the failure and its recovery and run no exit at all.
290
280
 
291
- ```
292
- /feature-forge:forge-1-prd {chosen}
293
- ```
281
+ **Close this stage with the Scripted Stage Exit** (contract: `references/stage-exit-protocol.md`; do not improvise a "Next steps" list). Run:
282
+
283
+ ```bash
284
+ 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')"
285
+ [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
286
+ python3 "$R/scripts/forge-session.py" stage-exit --feature "{feature}" --stage forge-5-loop --outcome "{LoopOutcome}" --specs-dir "{specsDir}" --host generic --verify-capability "{verify-capability}"
287
+ ```
288
+
289
+ Obey the DIRECTIVES it prints, in the consumption order this protocol fixes: surface `invalidAutoVerifyKeys` and every `warnings` entry first; `runInStageVerify: true` → run the in-stage clean-room verify chain now (honoring `autoFixEligible`, and asking through the Standard Verify Gate first when you may not dispatch unsolicited); `verifyGate: "standard"` → present the Standard Verify Gate; `verifyGate: "manual-print"` → print the `verifyCommand` for the user and do **not** dispatch inline. Then, and only when `terminalOwnedBy` is `"self"`, **print the NEXT-STEPS block verbatim as your absolute last output — nothing after its sentinel line.** A `terminalOwnedBy: "outer"` payload carries `nextSteps: null`: return your structured result to the caller and print no terminal block at all.
290
+
291
+ Add `--epic "{epic}"` when this feature is an epic member — required, per the Pipeline State Protocol in `references/shared-conventions.md`. Determine `{verify-capability}` per the **Host and capability determination** section of `references/stage-exit-protocol.md`: `interactive` needs both a question mechanism and *permission* to dispatch the clean-room `forge-verifier`, and a session that merely needs consent first is still `interactive`. The script owns the routing for every outcome — the loop resume, the navigator recovery, the docs handoff, and the epic's live next member — so append nothing to its block: no retry line, no rollup restated, no "continue to docs". A non-`complete` outcome deliberately fences no downstream work, and re-adding one here would claim readiness the backlog does not support.
294
292
 
295
293
  ## Gotchas
296
294
 
297
- - **Plugin-root discovery (1b-epic helper) covers installed paths, not workspace-dev checkouts.** The `forge-root.sh` search in 1b-epic probes `~/.claude/skills/feature-forge`, `~/.claude/plugins/cache/*/feature-forge/*` (marketplace-cache installs), `~/.claude/plugins/*/feature-forge`, and `./.agents/skills/feature-forge` — the locations of an **installed** plugin. A feature-forge **source checkout** (e.g. `~/workspace/feature-forge`) is not on that list, so the helper exits "cannot locate plugin root." That is expected in a dev environment, not a bug; run the epic-manifest script from the checkout directly (`python3 <checkout>/scripts/epic-manifest.py …`). The bootstrap prelude wraps its candidate loop in `bash -c` so the `~/.claude/plugins/*/feature-forge` glob is zsh-safe: an empty expansion no longer aborts the loop under zsh's `nomatch`.
295
+ - **Plugin-root discovery (1b-epic helper) covers installed paths, not workspace-dev checkouts.** The `forge-root.sh` search probes the locations of an **installed** plugin only, so a feature-forge **source checkout** (e.g. `~/workspace/feature-forge`) exits "cannot locate plugin root." Expected in a dev environment; run the epic-manifest script from the checkout directly (`python3 <checkout>/scripts/epic-manifest.py …`). The bootstrap prelude wraps its candidate loop in `bash -c` so the `~/.claude/plugins/*/feature-forge` glob is zsh-safe: an empty expansion no longer aborts the loop under zsh's `nomatch`.
298
296
  - `{backlogDir}` is a **directory path**, not a file path. Pass `specs/auth`, not `specs/auth/backlog.json`.
299
- - rauf resolves `RAUF.md` with fallback (`{backlogDir}/.rauf/RAUF.md` first, then the project's `.rauf/RAUF.md`) — found as long as the runner is installed in the project. State files (state.json, {loopRunner.logFile}, etc.) are created at `{backlogDir}/{loopRunner.stateDir}/`, within the feature's spec directory (expected) and isolated per backlog dir, so concurrent features don't collide.
300
- - If the session disconnects during a long-running loop, the runner process continues independently — the user can check results later with the status / list commands. If a previous run left a stale lock, the user may need to pass `--force` to clear it (rauf reports this error clearly).
301
- - Never run the run command in the foreground (without the host's background-execution mechanism) — it blocks and will hit the Bash tool timeout for any non-trivial backlog. "Don't block the foreground" is NOT "stay silent": supervise via the host's monitoring mechanism (3d), never `sleep`/poll in the foreground. The host's monitoring mechanism must use `persistent: true` (not a bounded `timeout_ms`), watch the **structured** surface (`events.ndjson`), and never filter on raw `RAUF_*` tokens — they appear in agent prose and false-match. A `needs_human`/`blocked`/`review` signal does **not** pause the loop — the runner sets the item aside and keeps going; surface it live but don't tell the user the loop is waiting. See `references/runner-contract.md` for the full monitoring rules.
297
+ - rauf resolves `RAUF.md` with fallback (`{backlogDir}/.rauf/RAUF.md` first, then the project's `.rauf/RAUF.md`). State files (state.json, {loopRunner.logFile}, etc.) land at `{backlogDir}/{loopRunner.stateDir}/`, isolated per backlog dir, so concurrent features don't collide.
298
+ - If the session disconnects mid-loop, the runner process continues independently — check results later with the status / list commands. A stale lock from a previous run may need `--force` to clear.
299
+ - Never run the run command in the foreground (without the host's background-execution mechanism) — it blocks and will hit the Bash tool timeout for any non-trivial backlog. "Don't block the foreground" is NOT "stay silent": supervise via the host's monitoring mechanism (3d) — `persistent: true`, the **structured** surface (`events.ndjson`), never raw `RAUF_*` tokens (they false-match in agent prose). A `needs_human`/`blocked`/`review` signal does **not** pause the loop — the runner sets the item aside and keeps going; surface it live but don't tell the user the loop is waiting. See `references/runner-contract.md` for the full monitoring rules.
302
300
  - The version gate (1c) uses the `--json` form on purpose; never parse `rauf version`'s human output.
303
- - **Implementation artifacts must not cite specs.** The loop should **read** the specs and `backlog.json` freely — they are the source of truth for what to build, and the backlog rightly references specs for provenance. But the artifacts the loop **writes into the target repo** (source code, generated `SKILL.md`/agent files, configs, code comments) must be **self-contained**: they must NOT reference feature-forge spec files (no `See specs/{feature}/NN-*.md`, no "source spec" provenance notes in shipped output). Specs are pre-implementation inputs that may be archived or deleted once the feature ships; the implementation must stand on its own. This applies only to shipped implementation output — never to the backlog or spec documents, which should keep citing specs.
301
+ - **Implementation artifacts must not cite specs.** The loop should **read** specs and `backlog.json` freely — they are the source of truth, and the backlog rightly cites specs for provenance. But artifacts the loop **writes into the target repo** (source code, generated `SKILL.md`/agent files, configs, code comments) must be **self-contained**: no references to feature-forge spec files (no `See specs/{feature}/NN-*.md`, no "source spec" provenance notes) — specs are pre-implementation inputs that may be archived or deleted once the feature ships. This applies only to shipped implementation output, never to the backlog or spec documents, which keep citing specs.
304
302
 
305
303
  ---
306
304
 
@@ -21,6 +21,22 @@ Step 3c are byte-identical to today (capability gate;
21
21
  item.provider > --agent (run selection) > loopRunner.defaultAgent (project) > runner default (claude-cli)
22
22
  ```
23
23
 
24
+ **`loopRunner.agentMode` gate (`"prompt"` default | `"auto"`).** `"prompt"`
25
+ presents the Step 2d agent question (SKILL sub-step b) — byte-identical to today.
26
+ `"auto"` suppresses **only the interactive pick**: skip the agent question and
27
+ resolve as if the user made no per-run selection (`run_selection = None`, so
28
+ `defaultAgent` — or the runner default when unset — applies). Everything else on
29
+ this surface **still runs under `"auto"`**: the single probe, the availability
30
+ listing, the verdict classification below (UNKNOWN hard-reject before any loop
31
+ side-effect, UNAVAILABLE with its proceed-anyway/choose-another question,
32
+ probe-failure handling), and the Claude-only model-alias guard — those questions
33
+ are safety surfaces, not the pick, and are never suppressed. The resolved
34
+ `Agent: {id} (source: …)` line still shows in the confirmation and the Step 3c
35
+ template, so the choice is never hidden. Meaningless when
36
+ `loopRunner.agentArgument` is absent — the capability gate above already removes
37
+ the entire surface, and `agentMode` adds no second gate. An unrecognized value
38
+ behaves as `"prompt"`.
39
+
24
40
  **Run-layer mapping — why forge never re-implements rauf's resolver.** forge owns
25
41
  **only** its run and project layers and collapses them into **one** value
26
42
  (`resolve()`: `run_selection or defaultAgent or none`), which it emits as a single
@@ -78,7 +94,7 @@ supported when using Codex with a ChatGPT account."* — so **every** spawn exit
78
94
  rauf reports *"Circuit breaker: 3 consecutive infra failures — halting"* with no hint
79
95
  of the real cause. forge-5-loop therefore detects Claude-specific `model` aliases in
80
96
  the backlog (tier aliases `opus`/`sonnet`/`haiku` or `claude-*` ids) and, before
81
- launch, **warns** and offers (via `AskUserQuestion`) to **strip `model` for this run**
97
+ launch, **warns** and offers (via the host's question mechanism) to **strip `model` for this run**
82
98
  (remove the key from each affected item so each spawn uses the agent's own default) or
83
99
  **proceed as-is**. forge only ever touches the `model` field — never `provider`. The
84
100
  default / `claude-cli` path skips this guard (the aliases are valid there).
@@ -58,9 +58,12 @@ defined authoritatively in rauf's
58
58
  > item aside and **keeps working other runnable items to completion** (rauf:
59
59
  > `runner.ts` needs_human handler). So a supervising session can surface those
60
60
  > events live (visibility) and cancel early, but it cannot inject an answer and
61
- > resume the set-aside item mid-run — resolution is a follow-up retry pass. A
62
- > first-class pause/resume-with-answer capability is a desirable runner
63
- > enhancement (see `plans/rauf-enhancement-recommendations.md`).
61
+ > resume the set-aside item mid-run — resolution is the **Post-Run Recovery
62
+ > Procedure** (`skills/forge-5-loop/references/recovery-procedure.md`): record the
63
+ > answer via `decision-record` at the moment of collection, then drive recovery
64
+ > from the record after the run ends. A first-class pause/resume-with-answer
65
+ > capability is a desirable runner enhancement (see
66
+ > `plans/rauf-enhancement-recommendations.md`).
64
67
 
65
68
  ## rauf is the default and reference implementation
66
69