@garygentry/feature-forge 0.2.14 → 0.3.0

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 (227) hide show
  1. package/README.md +6 -3
  2. package/adapters/GENERATION-REPORT.md +20 -0
  3. package/adapters/claude/.feature-forge-bundle.json +1 -1
  4. package/adapters/claude/references/forge-config-schema.json +2 -2
  5. package/adapters/claude/scripts/forge-root.sh +47 -3
  6. package/adapters/claude/scripts/forge-session.py +30 -8
  7. package/adapters/claude/skills/forge-4-backlog/references/forge-config-schema.json +2 -2
  8. package/adapters/claude/skills/forge-5-loop/references/forge-config-schema.json +2 -2
  9. package/adapters/claude/skills/forge-guide/references/forge-config-schema.json +2 -2
  10. package/adapters/codex/.feature-forge-bundle.json +1 -1
  11. package/adapters/codex/references/forge-config-schema.json +2 -2
  12. package/adapters/codex/scripts/forge-root.sh +47 -3
  13. package/adapters/codex/scripts/forge-session.py +30 -8
  14. package/adapters/codex/skills/forge-4-backlog/references/forge-config-schema.json +2 -2
  15. package/adapters/codex/skills/forge-5-loop/references/forge-config-schema.json +2 -2
  16. package/adapters/codex/skills/forge-guide/references/forge-config-schema.json +2 -2
  17. package/adapters/copilot/.feature-forge-bundle.json +1 -1
  18. package/adapters/copilot/references/forge-config-schema.json +2 -2
  19. package/adapters/copilot/scripts/forge-root.sh +47 -3
  20. package/adapters/copilot/scripts/forge-session.py +30 -8
  21. package/adapters/copilot/skills/forge-4-backlog/references/forge-config-schema.json +2 -2
  22. package/adapters/copilot/skills/forge-5-loop/references/forge-config-schema.json +2 -2
  23. package/adapters/copilot/skills/forge-guide/references/forge-config-schema.json +2 -2
  24. package/adapters/cursor/.feature-forge-bundle.json +1 -1
  25. package/adapters/cursor/references/forge-config-schema.json +2 -2
  26. package/adapters/cursor/scripts/forge-root.sh +47 -3
  27. package/adapters/cursor/scripts/forge-session.py +30 -8
  28. package/adapters/cursor/skills/forge-4-backlog/references/forge-config-schema.json +2 -2
  29. package/adapters/cursor/skills/forge-5-loop/references/forge-config-schema.json +2 -2
  30. package/adapters/cursor/skills/forge-guide/references/forge-config-schema.json +2 -2
  31. package/adapters/gemini/.feature-forge-bundle.json +1 -1
  32. package/adapters/gemini/gemini-extension.json +1 -1
  33. package/adapters/gemini/references/forge-config-schema.json +2 -2
  34. package/adapters/gemini/scripts/forge-root.sh +47 -3
  35. package/adapters/gemini/scripts/forge-session.py +30 -8
  36. package/adapters/gemini/skills/forge-4-backlog/references/forge-config-schema.json +2 -2
  37. package/adapters/gemini/skills/forge-5-loop/references/forge-config-schema.json +2 -2
  38. package/adapters/gemini/skills/forge-guide/references/forge-config-schema.json +2 -2
  39. package/adapters/pi/.feature-forge-bundle.json +6 -0
  40. package/adapters/pi/agents/forge-researcher.md +139 -0
  41. package/adapters/pi/agents/forge-spec-writer.md +116 -0
  42. package/adapters/pi/agents/forge-verifier.md +126 -0
  43. package/adapters/pi/extensions/ask-user-question/LICENSE +21 -0
  44. package/adapters/pi/extensions/ask-user-question/README.md +91 -0
  45. package/adapters/pi/extensions/ask-user-question/ask-user-question.ts +298 -0
  46. package/adapters/pi/extensions/ask-user-question/config.ts +78 -0
  47. package/adapters/pi/extensions/ask-user-question/events.ts +57 -0
  48. package/adapters/pi/extensions/ask-user-question/index.ts +61 -0
  49. package/adapters/pi/extensions/ask-user-question/locales/de.json +27 -0
  50. package/adapters/pi/extensions/ask-user-question/locales/en.json +27 -0
  51. package/adapters/pi/extensions/ask-user-question/locales/es.json +27 -0
  52. package/adapters/pi/extensions/ask-user-question/locales/fr.json +27 -0
  53. package/adapters/pi/extensions/ask-user-question/locales/pt-BR.json +27 -0
  54. package/adapters/pi/extensions/ask-user-question/locales/pt.json +27 -0
  55. package/adapters/pi/extensions/ask-user-question/locales/ru.json +27 -0
  56. package/adapters/pi/extensions/ask-user-question/locales/uk.json +27 -0
  57. package/adapters/pi/extensions/ask-user-question/locales/zh.json +29 -0
  58. package/adapters/pi/extensions/ask-user-question/reconcile.ts +49 -0
  59. package/adapters/pi/extensions/ask-user-question/rpc-fallback.ts +168 -0
  60. package/adapters/pi/extensions/ask-user-question/state/build-questionnaire.ts +302 -0
  61. package/adapters/pi/extensions/ask-user-question/state/i18n-bridge.ts +53 -0
  62. package/adapters/pi/extensions/ask-user-question/state/key-router.ts +277 -0
  63. package/adapters/pi/extensions/ask-user-question/state/questionnaire-session.ts +234 -0
  64. package/adapters/pi/extensions/ask-user-question/state/row-intent.ts +145 -0
  65. package/adapters/pi/extensions/ask-user-question/state/selectors/contract.ts +26 -0
  66. package/adapters/pi/extensions/ask-user-question/state/selectors/derivations.ts +42 -0
  67. package/adapters/pi/extensions/ask-user-question/state/selectors/focus.ts +19 -0
  68. package/adapters/pi/extensions/ask-user-question/state/selectors/projections.ts +101 -0
  69. package/adapters/pi/extensions/ask-user-question/state/state-reducer.ts +292 -0
  70. package/adapters/pi/extensions/ask-user-question/state/state.ts +55 -0
  71. package/adapters/pi/extensions/ask-user-question/tool/format-answer.ts +31 -0
  72. package/adapters/pi/extensions/ask-user-question/tool/response-envelope.ts +49 -0
  73. package/adapters/pi/extensions/ask-user-question/tool/types.ts +147 -0
  74. package/adapters/pi/extensions/ask-user-question/tool/validate-questionnaire.ts +58 -0
  75. package/adapters/pi/extensions/ask-user-question/vendor-config-shim.ts +65 -0
  76. package/adapters/pi/extensions/ask-user-question/view/component-binding.ts +47 -0
  77. package/adapters/pi/extensions/ask-user-question/view/components/inline-input.ts +98 -0
  78. package/adapters/pi/extensions/ask-user-question/view/components/multi-select-view.ts +193 -0
  79. package/adapters/pi/extensions/ask-user-question/view/components/option-list-view.ts +70 -0
  80. package/adapters/pi/extensions/ask-user-question/view/components/preview/markdown-content-cache.ts +79 -0
  81. package/adapters/pi/extensions/ask-user-question/view/components/preview/preview-block-renderer.ts +111 -0
  82. package/adapters/pi/extensions/ask-user-question/view/components/preview/preview-box-renderer.ts +88 -0
  83. package/adapters/pi/extensions/ask-user-question/view/components/preview/preview-layout-decider.ts +202 -0
  84. package/adapters/pi/extensions/ask-user-question/view/components/preview/preview-pane.ts +228 -0
  85. package/adapters/pi/extensions/ask-user-question/view/components/submit-picker.ts +67 -0
  86. package/adapters/pi/extensions/ask-user-question/view/components/tab-bar.ts +59 -0
  87. package/adapters/pi/extensions/ask-user-question/view/components/wrapping-select.ts +293 -0
  88. package/adapters/pi/extensions/ask-user-question/view/dialog-builder.ts +224 -0
  89. package/adapters/pi/extensions/ask-user-question/view/props-adapter.ts +125 -0
  90. package/adapters/pi/extensions/ask-user-question/view/stateful-view.ts +26 -0
  91. package/adapters/pi/extensions/ask-user-question/view/tab-components.ts +18 -0
  92. package/adapters/pi/extensions/ask-user-question/view/tab-content-strategy.ts +252 -0
  93. package/adapters/pi/package.json +26 -0
  94. package/adapters/pi/references/epic-manifest-schema.json +125 -0
  95. package/adapters/pi/references/forge-config-schema.json +236 -0
  96. package/adapters/pi/references/pipeline-state-schema.json +191 -0
  97. package/adapters/pi/references/portable-root.md +71 -0
  98. package/adapters/pi/references/process-overview.md +143 -0
  99. package/adapters/pi/references/ralph-loop-contract.md +221 -0
  100. package/adapters/pi/references/shared-conventions.md +295 -0
  101. package/adapters/pi/references/skill-frontmatter.schema.json +17 -0
  102. package/adapters/pi/references/stack-resolution.md +54 -0
  103. package/adapters/pi/references/stacks/_generic.md +111 -0
  104. package/adapters/pi/references/stacks/go.md +157 -0
  105. package/adapters/pi/references/stacks/python.md +184 -0
  106. package/adapters/pi/references/stacks/rust.md +170 -0
  107. package/adapters/pi/references/stacks/typescript.md +134 -0
  108. package/adapters/pi/references/stage-exit-protocol.md +258 -0
  109. package/adapters/pi/references/templates/specs-hygiene/AGENTS.md +32 -0
  110. package/adapters/pi/references/templates/specs-hygiene/CLAUDE.md +31 -0
  111. package/adapters/pi/references/vendor-construct-inventory.md +50 -0
  112. package/adapters/pi/scripts/epic-manifest.py +1694 -0
  113. package/adapters/pi/scripts/forge-bootstrap.py +1070 -0
  114. package/adapters/pi/scripts/forge-init.sh +58 -0
  115. package/adapters/pi/scripts/forge-root.sh +179 -0
  116. package/adapters/pi/scripts/forge-session.py +1888 -0
  117. package/adapters/pi/scripts/validate-traceability.py +150 -0
  118. package/adapters/pi/skills/forge/SKILL.md +243 -0
  119. package/adapters/pi/skills/forge/references/pipeline-state-schema.json +191 -0
  120. package/adapters/pi/skills/forge/references/process-overview.md +143 -0
  121. package/adapters/pi/skills/forge/references/shared-conventions.md +295 -0
  122. package/adapters/pi/skills/forge/references/stage-exit-protocol.md +258 -0
  123. package/adapters/pi/skills/forge-0-epic/SKILL.md +308 -0
  124. package/adapters/pi/skills/forge-0-epic/references/edit-mode.md +266 -0
  125. package/adapters/pi/skills/forge-0-epic/references/epic-manifest-subcommands.md +75 -0
  126. package/adapters/pi/skills/forge-0-epic/references/pipeline-state-schema.json +191 -0
  127. package/adapters/pi/skills/forge-0-epic/references/portable-root.md +71 -0
  128. package/adapters/pi/skills/forge-0-epic/references/shared-conventions.md +295 -0
  129. package/adapters/pi/skills/forge-0-epic/references/stage-exit-protocol.md +258 -0
  130. package/adapters/pi/skills/forge-1-prd/SKILL.md +164 -0
  131. package/adapters/pi/skills/forge-1-prd/references/pipeline-state-schema.json +191 -0
  132. package/adapters/pi/skills/forge-1-prd/references/prd-template.md +106 -0
  133. package/adapters/pi/skills/forge-1-prd/references/shared-conventions.md +295 -0
  134. package/adapters/pi/skills/forge-1-prd/references/stage-exit-protocol.md +258 -0
  135. package/adapters/pi/skills/forge-2-tech/SKILL.md +225 -0
  136. package/adapters/pi/skills/forge-2-tech/references/pipeline-state-schema.json +191 -0
  137. package/adapters/pi/skills/forge-2-tech/references/shared-conventions.md +295 -0
  138. package/adapters/pi/skills/forge-2-tech/references/stack-discovery-checklist.md +95 -0
  139. package/adapters/pi/skills/forge-2-tech/references/stack-resolution.md +54 -0
  140. package/adapters/pi/skills/forge-2-tech/references/stacks/_generic.md +111 -0
  141. package/adapters/pi/skills/forge-2-tech/references/stacks/go.md +157 -0
  142. package/adapters/pi/skills/forge-2-tech/references/stacks/python.md +184 -0
  143. package/adapters/pi/skills/forge-2-tech/references/stacks/rust.md +170 -0
  144. package/adapters/pi/skills/forge-2-tech/references/stacks/typescript.md +134 -0
  145. package/adapters/pi/skills/forge-2-tech/references/stage-exit-protocol.md +258 -0
  146. package/adapters/pi/skills/forge-3-specs/SKILL.md +178 -0
  147. package/adapters/pi/skills/forge-3-specs/references/pipeline-state-schema.json +191 -0
  148. package/adapters/pi/skills/forge-3-specs/references/shared-conventions.md +295 -0
  149. package/adapters/pi/skills/forge-3-specs/references/spec-archetypes.md +106 -0
  150. package/adapters/pi/skills/forge-3-specs/references/spec-examples.md +71 -0
  151. package/adapters/pi/skills/forge-3-specs/references/stacks/_generic.md +111 -0
  152. package/adapters/pi/skills/forge-3-specs/references/stacks/go.md +157 -0
  153. package/adapters/pi/skills/forge-3-specs/references/stacks/python.md +184 -0
  154. package/adapters/pi/skills/forge-3-specs/references/stacks/rust.md +170 -0
  155. package/adapters/pi/skills/forge-3-specs/references/stacks/typescript.md +134 -0
  156. package/adapters/pi/skills/forge-3-specs/references/stage-exit-protocol.md +258 -0
  157. package/adapters/pi/skills/forge-4-backlog/SKILL.md +175 -0
  158. package/adapters/pi/skills/forge-4-backlog/references/forge-config-schema.json +236 -0
  159. package/adapters/pi/skills/forge-4-backlog/references/pipeline-state-schema.json +191 -0
  160. package/adapters/pi/skills/forge-4-backlog/references/shared-conventions.md +295 -0
  161. package/adapters/pi/skills/forge-4-backlog/references/stage-exit-protocol.md +258 -0
  162. package/adapters/pi/skills/forge-5-loop/SKILL.md +314 -0
  163. package/adapters/pi/skills/forge-5-loop/references/forge-config-schema.json +236 -0
  164. package/adapters/pi/skills/forge-5-loop/references/ralph-loop-contract.md +221 -0
  165. package/adapters/pi/skills/forge-5-loop/references/result-reporting.md +85 -0
  166. package/adapters/pi/skills/forge-5-loop/references/runner-contract.md +341 -0
  167. package/adapters/pi/skills/forge-5-loop/references/shared-conventions.md +295 -0
  168. package/adapters/pi/skills/forge-5-loop/references/stage-exit-protocol.md +258 -0
  169. package/adapters/pi/skills/forge-6-docs/SKILL.md +202 -0
  170. package/adapters/pi/skills/forge-6-docs/references/doc-conventions.md +126 -0
  171. package/adapters/pi/skills/forge-6-docs/references/pipeline-state-schema.json +191 -0
  172. package/adapters/pi/skills/forge-6-docs/references/shared-conventions.md +295 -0
  173. package/adapters/pi/skills/forge-bootstrap/SKILL.md +250 -0
  174. package/adapters/pi/skills/forge-bootstrap/references/templates/ci/github-actions.yml +12 -0
  175. package/adapters/pi/skills/forge-bootstrap/references/templates/generic/run.sh +3 -0
  176. package/adapters/pi/skills/forge-bootstrap/references/templates/generic/test.sh +13 -0
  177. package/adapters/pi/skills/forge-bootstrap/references/templates/go/go.mod +3 -0
  178. package/adapters/pi/skills/forge-bootstrap/references/templates/go/main.go +12 -0
  179. package/adapters/pi/skills/forge-bootstrap/references/templates/go/main_test.go +11 -0
  180. package/adapters/pi/skills/forge-bootstrap/references/templates/hygiene/AGENTS.md +35 -0
  181. package/adapters/pi/skills/forge-bootstrap/references/templates/hygiene/CLAUDE.md +36 -0
  182. package/adapters/pi/skills/forge-bootstrap/references/templates/hygiene/README.md +11 -0
  183. package/adapters/pi/skills/forge-bootstrap/references/templates/licenses/Apache-2.0/LICENSE +198 -0
  184. package/adapters/pi/skills/forge-bootstrap/references/templates/licenses/MIT/LICENSE +21 -0
  185. package/adapters/pi/skills/forge-bootstrap/references/templates/python/pyproject.toml +24 -0
  186. package/adapters/pi/skills/forge-bootstrap/references/templates/python/src/{{PKG}}/__init__.py +5 -0
  187. package/adapters/pi/skills/forge-bootstrap/references/templates/python/src/{{PKG}}/main.py +13 -0
  188. package/adapters/pi/skills/forge-bootstrap/references/templates/python/tests/test_smoke.py +8 -0
  189. package/adapters/pi/skills/forge-bootstrap/references/templates/rust/Cargo.toml +15 -0
  190. package/adapters/pi/skills/forge-bootstrap/references/templates/rust/src/lib.rs +7 -0
  191. package/adapters/pi/skills/forge-bootstrap/references/templates/rust/src/main.rs +5 -0
  192. package/adapters/pi/skills/forge-bootstrap/references/templates/rust/tests/smoke.rs +6 -0
  193. package/adapters/pi/skills/forge-bootstrap/references/templates/typescript/package.json +15 -0
  194. package/adapters/pi/skills/forge-bootstrap/references/templates/typescript/src/index.ts +4 -0
  195. package/adapters/pi/skills/forge-bootstrap/references/templates/typescript/test/smoke.test.ts +6 -0
  196. package/adapters/pi/skills/forge-bootstrap/references/templates/typescript/tsconfig.json +14 -0
  197. package/adapters/pi/skills/forge-fix/SKILL.md +98 -0
  198. package/adapters/pi/skills/forge-fix/references/shared-conventions.md +295 -0
  199. package/adapters/pi/skills/forge-fix/references/stage-exit-protocol.md +258 -0
  200. package/adapters/pi/skills/forge-guide/SKILL.md +192 -0
  201. package/adapters/pi/skills/forge-guide/references/forge-config-schema.json +236 -0
  202. package/adapters/pi/skills/forge-guide/references/process-overview.md +143 -0
  203. package/adapters/pi/skills/forge-guide/references/ralph-loop-contract.md +221 -0
  204. package/adapters/pi/skills/forge-guide/references/shared-conventions.md +295 -0
  205. package/adapters/pi/skills/forge-guide/references/stack-resolution.md +54 -0
  206. package/adapters/pi/skills/forge-guide/references/stacks/_generic.md +111 -0
  207. package/adapters/pi/skills/forge-guide/references/stacks/go.md +157 -0
  208. package/adapters/pi/skills/forge-guide/references/stacks/python.md +184 -0
  209. package/adapters/pi/skills/forge-guide/references/stacks/rust.md +170 -0
  210. package/adapters/pi/skills/forge-guide/references/stacks/typescript.md +134 -0
  211. package/adapters/pi/skills/forge-init/SKILL.md +72 -0
  212. package/adapters/pi/skills/forge-verify/SKILL.md +273 -0
  213. package/adapters/pi/skills/forge-verify/references/pipeline-state-schema.json +191 -0
  214. package/adapters/pi/skills/forge-verify/references/shared-conventions.md +295 -0
  215. package/adapters/pi/skills/forge-verify/references/verification-checklists.md +477 -0
  216. package/dist/agent-targets.d.ts +1 -1
  217. package/dist/agent-targets.js +23 -3
  218. package/dist/detect.d.ts +1 -1
  219. package/dist/detect.js +2 -1
  220. package/dist/manifest.d.ts +1 -1
  221. package/dist/manifest.js +2 -2
  222. package/dist/placements.js +5 -1
  223. package/dist/rauf.d.ts +4 -4
  224. package/dist/rauf.js +3 -3
  225. package/dist/types.d.ts +31 -6
  226. package/dist/types.js +6 -3
  227. package/package.json +14 -3
@@ -0,0 +1,258 @@
1
+ # Stage Exit Protocol
2
+
3
+ The single source of truth for how every forge **authoring** stage closes. It
4
+ replaces the old ad-hoc "Next steps:" bullet lists with one fixed, correctly-ordered
5
+ sequence: **verify (if missing or stale) → `/clear` → run the next command.**
6
+
7
+ Two principles this protocol encodes (do not relitigate — they are locked product
8
+ decisions):
9
+
10
+ 1. **Clearing is recommended on its own merits at every stage boundary** — a clean
11
+ start for the next stage — *not* as a proxy for a full context window. Window
12
+ fullness only changes *how emphatically* the clear is recommended, never *whether*
13
+ it is.
14
+ 2. **Verify happens before the clear, never after** — in the authoring session, whether
15
+ manual **or** auto. Verify's clean-room subagent is dispatched from the *current*
16
+ session, so the findings digest and any fix decision land where the context to act on
17
+ them still exists. This holds for auto-verify too: the stage skill dispatches the
18
+ clean-room verify (and any autoFix) at stage end, in-session, before the exit — it is
19
+ **not** deferred to the navigator, which runs *after* the `/clear` with none of the
20
+ authoring context. Clearing first throws that context away.
21
+
22
+ ## How this file is used
23
+
24
+ The five authoring stages (`forge-0-epic` … `forge-4-backlog`) close with the
25
+ **Scripted Stage Exit**: a short stamped block (below) that runs
26
+ `forge-session.py stage-exit`, obeys the DIRECTIVES it prints per the **directive
27
+ contract** in this file, and prints the script-emitted NEXT-STEPS block verbatim as the
28
+ absolute last output. All the conditional logic the old prose blocks asked the model to
29
+ compute (effective auto-verify, freshness collapse, gate selection, host wording) now
30
+ lives in the script, deterministically; only genuinely interactive work (clean-room
31
+ subagent dispatch, `AskUserQuestion` gates) remains prose — specified once here, not
32
+ per stage.
33
+
34
+ The loop (`forge-5-loop`) keeps its bespoke exits: it stamps the **standard block**
35
+ (step-6 epic-member handoff) and the **warm variant** (all-done closing) below,
36
+ verbatim. `forge-6-docs` is **terminal** — it stamps no exit block.
37
+
38
+ A drift-guard test (`tests/test_stage_exit_protocol.py`) asserts each stamp site still
39
+ contains its block, so an edit here must be mirrored into every stamp site (and
40
+ vice-versa).
41
+
42
+ ## Stamp sites
43
+
44
+ | Stamp site | Block |
45
+ |---|---|
46
+ | `forge-0-epic` … `forge-4-backlog` | scripted-stage-exit stamp |
47
+ | `forge-5-loop` (step-6 epic-member handoff) | standard |
48
+ | `forge-5-loop` (all-done closing → docs) | warm |
49
+
50
+ The scripted stamp fills one build-time slot, `{stage-exit-args}` — the per-stage
51
+ argument list (e.g. `--feature "{feature}" --stage forge-2-tech`; the epic stage passes
52
+ `--feature "{epic}" --stage forge-0-epic --next-feature "{first-actionable-feature}"`).
53
+ `{feature}` / `{epic}` / `{specsDir}` / `{first-actionable-feature}` remain runtime
54
+ placeholders the skill resolves before running the command, exactly as elsewhere.
55
+
56
+ <!-- BEGIN: scripted-stage-exit-stamp -->
57
+ **Close this stage with the Scripted Stage Exit** (contract: `references/stage-exit-protocol.md`; do not improvise a "Next steps" list). Run:
58
+
59
+ ```bash
60
+ 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')"
61
+ [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
62
+ python3 "$R/scripts/forge-session.py" stage-exit {stage-exit-args} --specs-dir "{specsDir}" --host claude
63
+ ```
64
+
65
+ Obey the DIRECTIVES it prints, in order, per the directive contract: `runInStageVerify: true` → dispatch the in-stage clean-room verify now (honoring `autoFixEligible`); `verifyGate: "standard"` → present the Standard Verify Gate; `verifyGate: "manual-print"` → print the `verifyCommand` for the user; non-empty `invalidAutoVerifyKeys` → print a one-line warning. Then **print the NEXT-STEPS block verbatim as your absolute last output — nothing after its sentinel line.**
66
+ <!-- END: scripted-stage-exit-stamp -->
67
+
68
+ ## Directive contract
69
+
70
+ `stage-exit` emits a DIRECTIVES object and a NEXT-STEPS block. The skill executes the
71
+ directives **in this order**; the script has already computed every conditional, so a
72
+ directive is an instruction, not a question to re-derive.
73
+
74
+ ### `invalidAutoVerifyKeys` (non-empty)
75
+
76
+ Print a one-line warning first (e.g. "⚠️ forge.config.json `autoVerifyStages` has
77
+ unknown keys: … — they are ignored; fix the typo").
78
+
79
+ ### `runInStageVerify: true` — in-stage auto-verify {stageNoun}
80
+
81
+ Auto-verify is effective for this stage and verification is outstanding — verify **now,
82
+ in this session** (principle #2 applied to auto-verify: the digest and any fix decision
83
+ land here, where the authoring context still exists — not deferred to a post-`/clear`
84
+ navigator):
85
+
86
+ 1. **Clean-room verify (require-clean).** Dispatch the clean-room `forge-verifier`
87
+ subagent from this session in require-clean mode — the same path the navigator uses
88
+ (`skills/forge-verify/SKILL.md`). Dispatch it **synchronously and await its digest
89
+ inline** — do **not** run it in the background or announce it as "still running";
90
+ the digest and any fix decision must land in this session. It inherits none of this
91
+ session's context, so no `/clear` is needed and only a compact digest returns.
92
+ **Clean-room unavailable** (no `Agent` tool, `forge-verifier` not dispatchable) **or
93
+ a non-answer returned** (the verifier returned a placeholder / "still running" /
94
+ delegation message instead of a findings block): do **not** run inline and do **not**
95
+ silently accept the non-answer as a pass — leave verify **pending** so the navigator
96
+ catch-up fires on a later Claude-host `/skill:forge`, print the
97
+ `verifyCommand` for the user to run, and continue to the NEXT-STEPS block.
98
+ 2. **Verify passed / no findings** → the fresh verify state is recorded by the
99
+ clean-room run; continue to the NEXT-STEPS block.
100
+ 3. **Verify found findings** →
101
+ - **`autoFixEligible: true` AND the findings document has zero unresolved decision
102
+ points** → chain `feature-forge:forge-fix` in-session (it owns its own commit +
103
+ step tracking), then run a **mandatory re-verify** in require-clean mode. Continue
104
+ to the NEXT-STEPS block only if the re-verify passes. On any precondition miss, a
105
+ forge-fix early stop, or a red re-verify, fall through to the digest gate below —
106
+ never a silent partial mutation. (`autoFixEligible` already folds in the config
107
+ `autoFix` flag and the clean-tree precondition; a dirty tree or
108
+ `gitCommitAfterStage: false` arrives here as `false`.)
109
+ - **`autoFixEligible: false`, or unresolved decision points** → surface a **compact
110
+ findings digest** as text, then present the gate via `AskUserQuestion`: **Run
111
+ `forge-fix` now** *(recommended — you are in-context and the digest is right
112
+ here)* / **Clear + advance anyway** (leave the findings for later) / **Stop
113
+ here**. Do **not** hard-stop and do **not** silently walk past. Act on the choice,
114
+ then continue to the NEXT-STEPS block.
115
+
116
+ ### `verifyGate: "standard"` — the Standard Verify Gate
117
+
118
+ Auto-verify is off for this stage and verification is outstanding (`verifyState` is
119
+ `never`, `stale`, or `failing`). Verify **now, before clearing**, using
120
+ `AskUserQuestion` with exactly these three options — but only when the host has a
121
+ question mechanism **and** the clean-room path is available (the `Agent` tool plus a
122
+ dispatchable `forge-verifier` subagent); otherwise degrade exactly as `manual-print`
123
+ below:
124
+
125
+ - **Verify {stageNoun} now** *(recommended)* — dispatch the clean-room `forge-verifier`
126
+ subagent from this session in require-clean mode; the digest returns here so any fix
127
+ decision keeps its context. One-time — it does **not** change config.
128
+ - **Verify now + enable auto-verify going forward** — verify now **and** patch
129
+ `"autoVerify": true` into `forge.config.json` in place (preserve formatting and every
130
+ other key) so future stages verify automatically, no prompt. This complements the
131
+ `forge-init` opt-in. **Do not auto-commit this config change** — treat it like
132
+ `notes`: a user-facing edit the user commits on their own cadence, never folded into
133
+ a stage's artifact commit.
134
+ - **Skip for now** — go straight to the NEXT-STEPS block without verifying. Record this
135
+ stage's verify status as `"skipped"` in pipeline state (mirroring the existing skip
136
+ handling) **only** on an explicit skip — a skip does not go stale.
137
+
138
+ If verify runs and finds findings, handle them exactly as in the in-stage flow above
139
+ (digest + `AskUserQuestion` gate; `autoFixEligible` applies unchanged).
140
+
141
+ ### `verifyGate: "manual-print"`
142
+
143
+ Verification is outstanding but the host cannot present the gate or dispatch
144
+ clean-room. Do **not** run verify inline — print the `verifyCommand` for the user to
145
+ run (mirroring `autoInvokeNextStage`), offer the auto-verify enable as plain text only
146
+ if a config write is possible, and continue to the NEXT-STEPS block. Verify state stays
147
+ outstanding, so the navigator catch-up can fire later.
148
+
149
+ ### `verifyGate: "none"`
150
+
151
+ Verification is already resolved (fresh or explicitly skipped) or the in-stage run
152
+ above covers it. Say so in one line and continue to the NEXT-STEPS block.
153
+
154
+ ### `epicReconcile` (epic backflow — present only when there are open requests)
155
+
156
+ Emitted only when the exiting member carries `open` `epicChangeRequests` (recorded by
157
+ `forge-1-prd`/`forge-2-tech` when the epic *decomposition* itself must change — see
158
+ `references/pipeline-state-schema.json`). Absent on the common path and for standalone
159
+ features. The script has already folded the routing into the NEXT-STEPS block, so this
160
+ directive is informational — you do **not** re-derive the wording:
161
+
162
+ - `required: true` (at least one `blocksCurrent: true` request) — the NEXT-STEPS block's
163
+ fenced **primary** command is the epic reconcile command
164
+ (`/skill:forge-0-epic {epic}`), and the normal next stage is demoted to a
165
+ follow-up line ("After reconciling, continue with …"). This is *reconcile-before-specs*:
166
+ proceeding would author artifacts against a decomposition that is about to change. It is
167
+ strongest when exiting `forge-2-tech` (next is `forge-3-specs`, the point of no cheap
168
+ return).
169
+ - `reminder: true` (only `blocksCurrent: false` requests) — normal next-stage routing is
170
+ unchanged; the block appends a non-blocking reminder line ("You also flagged N epic
171
+ change(s) to reconcile when convenient …"). This is *finish-then-edit*.
172
+
173
+ Either way the added lines are host-neutral (no literal `/clear`) and sit **above** the
174
+ sentinel; just print the NEXT-STEPS block verbatim as always.
175
+
176
+ ### Deferred decisions — do not solicit next-stage decisions at this exit
177
+
178
+ Each stage owns its own decisions. At a stage exit, do **not** pull a *later* stage's
179
+ decision forward — do not ask the user (or decide unilaterally) something that properly
180
+ belongs to the next stage's interview (e.g. at `forge-1-prd` exit, don't settle the
181
+ concrete cache backend that `forge-2-tech` will design). Soliciting it here guesses ahead
182
+ of the stage that owns the context, and the answer has nowhere durable to live.
183
+
184
+ Instead, when you notice a decision that belongs downstream, **record it structurally** as
185
+ a `deferredDecisions[]` entry on this feature's `.pipeline-state.json` (schema in
186
+ `references/pipeline-state-schema.json`; same direct-edit path as `notes` /
187
+ `epicChangeRequests[]`): `question` (phrased for the target stage), optional `rationale`
188
+ and `targetStage`, `raisedBy` (this stage), `raisedAt` (ISO-8601 UTC), `status: "open"`.
189
+ This keeps the exit focused on *this* stage's next-step routing while carrying the open
190
+ question forward for the owning stage to resolve (it flips `status` to `addressed` when it
191
+ does). Prefer a `deferredDecisions[]` entry over stuffing the same thing into the free-text
192
+ `notes` string. This is a recording affordance, not a gate: never block the exit on it.
193
+
194
+ ### The NEXT-STEPS block (always last)
195
+
196
+ Print the script's NEXT-STEPS block **verbatim as your absolute last output**. Nothing
197
+ follows its final sentinel line (`─ forge: end of stage ─`) — no caveats, no summary,
198
+ no sign-off. The block already carries the `/clear` recommendation (host-aware wording
199
+ via `--host`) and the exact next command, so trailing prose can only push the user's
200
+ next action out of view.
201
+
202
+ ---
203
+
204
+ ## Standard block
205
+
206
+ Stamped at the loop's step-6 epic-member handoff (finishing feature A → starting
207
+ feature B's PRD). It self-adapts: step 1's verify gate only fires when verification is
208
+ actually outstanding, so at a boundary where verify already ran (or was explicitly
209
+ skipped, or auto-verify is on) it silently collapses to just the `/clear` →
210
+ next-command steps.
211
+
212
+ Slots: `{stage}` (a lowercase noun phrase), `{verify-command}`, `{next-command}`.
213
+
214
+ <!-- BEGIN: standard-exit-block -->
215
+ **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:
216
+
217
+ 1. **Verify {stage} 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 `AskUserQuestion` with exactly these three options — but only when the host has a question mechanism **and** the clean-room path is available (the `Agent` tool plus a dispatchable `forge-verifier` subagent):
218
+ - **Verify {stage} 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.
219
+ - **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.
220
+ - **Skip for now** — go straight to `/clear` 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.
221
+
222
+ **Host / clean-room fallback (not a user-selectable option):** if the question mechanism, the `Agent` tool, or the `forge-verifier` subagent is unavailable, do **not** run clean-room — degrade to printing `{verify-command}` 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.
223
+ 2. **Then `/clear`.** 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` for you — you have to run it yourself.**
224
+ 3. **Then run the next command** in the fresh session — or re-run `/skill:forge` to let the navigator resume from disk:
225
+
226
+ ```
227
+ {next-command}
228
+ ```
229
+ <!-- END: standard-exit-block -->
230
+
231
+ ---
232
+
233
+ ## Warm-acceptable variant
234
+
235
+ Stamp this only at the `forge-5-loop → forge-6-docs` boundary (the all-done result
236
+ report). Here clearing is **optional**: the docs stage benefits from the still-warm
237
+ context of what the loop actually did, and impl-verify is already offered interactively
238
+ by the loop itself, so this block defers rather than re-presenting a gate.
239
+
240
+ > **Note — no literal `/clear` here.** The warm block lives in `result-reporting.md`, a
241
+ > skill-*own* reference that the adapter build copies **verbatim** (unlike skill bodies,
242
+ > it is not host-term translated), so a literal `/clear` would reach non-Claude adapters
243
+ > undegraded. The warm variant says "clearing is optional" anyway, so it is phrased
244
+ > host-neutrally without the token on purpose — do not reintroduce `/clear` here. (The
245
+ > standard block *does* use `/clear`; that is fine because every standard stamp site is a
246
+ > skill **body**, where `scripts/build-adapters.py` degrades it.)
247
+
248
+ <!-- BEGIN: warm-exit-block -->
249
+ **The loop is complete — this is the one boundary where clearing before the next stage is optional.**
250
+
251
+ 1. **Verify is already offered above.** Impl-verify is offered interactively right after this report (Step 5b for a standalone feature, Step 6.1 for an epic member) — run it there rather than as a second gate. It runs clean-room, so it needs no fresh session.
252
+ 2. **Clearing is optional here — warm is fine.** `forge-6-docs` benefits from the still-warm context of what the loop actually did, so continuing in this same session is the easy default. A cold start also works — every artifact is on disk — but there is no need to force it.
253
+ 3. **Then run the next command** — in this warm session, or a fresh one if you prefer:
254
+
255
+ ```
256
+ {next-command}
257
+ ```
258
+ <!-- END: warm-exit-block -->
@@ -0,0 +1,32 @@
1
+ # Agent Instructions — `specs/` (feature-forge)
2
+
3
+ This directory holds **pre-implementation design artifacts** produced by the
4
+ feature-forge pipeline (PRDs, technical specs, numbered implementation specs,
5
+ traceability matrices, and per-feature `backlog.json` files).
6
+
7
+ ## How to treat these specs
8
+
9
+ - **Specs are not live contracts.** They exist to plan the work and establish the
10
+ backlog. They are intentionally **not kept in sync** with the implementation as
11
+ the code evolves.
12
+ - **Do not flag spec↔code divergence.** Once a spec is finalized and its backlog has
13
+ been implemented, the code is the source of truth for behavior. Do not "fix" the
14
+ implementation to match a spec, or the spec to match the code, unless a human
15
+ explicitly asks for it.
16
+ - **Read freely; reference deliberately.** It is fine — encouraged, even — for
17
+ pipeline artifacts here (specs, `backlog.json`) to cite each other for provenance
18
+ and context. But implementation artifacts shipped into the project (source code,
19
+ generated skills/agents, configs, docs) should be self-contained and should **not**
20
+ reference files under `specs/`, which may be archived or deleted after a feature
21
+ ships.
22
+
23
+ ## Tooling feedback
24
+
25
+ Friction with the feature-forge pipeline or the rauf loop — anything confusing, buggy, or
26
+ missing? Capture it while fresh and file it (feature-forge →
27
+ https://github.com/garygentry/feature-forge/issues, rauf →
28
+ https://github.com/garygentry/rauf/issues). See the project-root `AGENTS.md` "Tooling
29
+ feedback" section for the full flow. In an autonomous rauf iteration, note it in
30
+ `progress.md` instead of opening an issue mid-loop.
31
+
32
+ This file was generated by feature-forge. Edit or remove it to suit your project.
@@ -0,0 +1,31 @@
1
+ # Claude Instructions — `specs/` (feature-forge)
2
+
3
+ This directory holds **pre-implementation design artifacts** produced by the
4
+ feature-forge pipeline (PRDs, technical specs, numbered implementation specs,
5
+ traceability matrices, and per-feature `backlog.json` files).
6
+
7
+ ## How to treat these specs
8
+
9
+ - **Specs are not live contracts.** They exist to plan the work and establish the
10
+ backlog. They are intentionally **not kept in sync** with the implementation as
11
+ the code evolves.
12
+ - **Do not flag spec↔code divergence.** Once a spec is finalized and its backlog has
13
+ been implemented, the code is the source of truth for behavior. Don't "fix" the
14
+ implementation to match a spec, or the spec to match the code, unless I explicitly
15
+ ask you to.
16
+ - **Read freely; reference deliberately.** It's fine — encouraged, even — for pipeline
17
+ artifacts here (specs, `backlog.json`) to cite each other for provenance and context.
18
+ But implementation artifacts shipped into the project (source code, generated
19
+ skills/agents, configs, docs) should be self-contained and should **not** reference
20
+ files under `specs/`, which may be archived or deleted after a feature ships.
21
+
22
+ ## Tooling feedback
23
+
24
+ Friction with the feature-forge pipeline or the rauf loop — anything confusing, buggy, or
25
+ missing? Help me capture it while fresh and file it (feature-forge →
26
+ https://github.com/garygentry/feature-forge/issues, rauf →
27
+ https://github.com/garygentry/rauf/issues). See the project-root `CLAUDE.md` "Tooling
28
+ feedback" section for the full flow. In an autonomous rauf iteration, note it in
29
+ `progress.md` instead of opening an issue mid-loop.
30
+
31
+ This file was generated by feature-forge. Edit or remove it to suit your project.
@@ -0,0 +1,50 @@
1
+ # Vendor-Construct Inventory
2
+
3
+ > Feature: `forge-skill-spec-purity` (epic `agent-agnostic`, target repo **feature-forge**).
4
+ > Source of truth: `PRD.md` (v1) + `tech-spec.md` (v1).
5
+ > This file is the REQ-VND-03 audit output — the single, exhaustive record of every vendor-specific
6
+ > construct found across all 11 skills and their `references/`, each with exactly one disposition.
7
+
8
+ ## Disposition Legend
9
+
10
+ Every disposition cell in the inventory below is exactly one member of the closed `Disposition`
11
+ vocabulary defined in `00-core-definitions.md` §8. No free-form values are permitted.
12
+
13
+ | Disposition | Meaning |
14
+ |---|---|
15
+ | `relocated` | Moved to a spec-allowed location (e.g. `metadata`). |
16
+ | `removed` | Deleted from canon (none expected in this tree). |
17
+ | `preserved-as-spec-allowed` | Kept as-is; already spec-legal. |
18
+ | `out-of-canon` | Kept but documented as non-canonical (e.g. `hooks/hooks.json`). |
19
+ | `routed-through-resolver` | `${CLAUDE_PLUGIN_ROOT}` replaced by the bootstrap prelude + `scripts/forge-root.sh`. |
20
+
21
+ ## Inventory
22
+
23
+ | Construct | Locations / count | Disposition | Rationale / notes |
24
+ |---|---|---|---|
25
+ | `argument-hint` (top-level frontmatter key) | 10 `skills/*/SKILL.md` (all skills **except** `forge-init`) | `relocated` | Claude-specific vendor key (constraint C-2). Moved verbatim to `metadata.argument-hint` per REQ-VND-01 (see `02-frontmatter-purity-and-inventory.md` §2). Value byte-identical; `description` untouched. |
26
+ | `${CLAUDE_PLUGIN_ROOT}` — canonical invocations + prose | 23 occurrences across 9 canonical surfaces: `skills/forge-0-epic/SKILL.md` (12), `skills/forge/SKILL.md` (3), `skills/forge-5-loop/SKILL.md` (1), `skills/forge-6-docs/SKILL.md` (1), `skills/forge-init/SKILL.md` (1), `skills/forge-verify/SKILL.md` (1), `skills/forge-verify/references/verification-checklists.md` (1), `references/shared-conventions.md` (2), `agents/forge-verifier.md` (1) | `routed-through-resolver` | Claude-only env var. Routed through the byte-identical bootstrap prelude + `scripts/forge-root.sh` per REQ-RES-03. Mechanics owned by `03-portable-root-resolver.md`; recorded here for audit completeness. |
27
+ | `${CLAUDE_PLUGIN_ROOT}` — sanctioned residual | 1 occurrence in `scripts/forge-root.sh` (env-fallback, REQ-RES-02 step 3) | `preserved-as-spec-allowed` | The single sanctioned residual: the resolver's documented Claude-compat fallback (REQ-RES-03 / REQ-RES-05). Exempt from the residual-var scan (`00-core-definitions.md` §6 `RESIDUAL_VAR_EXEMPT`). |
28
+ | `${CLAUDE_PLUGIN_ROOT:-}` — bootstrap-prelude first-hint (Chunk 2b) | 1 occurrence per prelude across every canonical stamp site (the byte-pinned `BOOTSTRAP_PRELUDE`) | `preserved-as-spec-allowed` | The prelude's first resolver candidate — exact, glob-free root resolution on any Claude layout; expands to empty and is skipped when unset. Rule 3 allows it by stripping the byte-pinned prelude before its scan (detection is by `${CLAUDE_PLUGIN_ROOT` prefix, so the `:-}` default form is not an escape hatch elsewhere). `forge-agent-adapters-build` translates it to `${FEATURE_FORGE_ROOT:-}` in non-Claude bundles. |
29
+ | `${CLAUDE_PLUGIN_ROOT}` — in `hooks/hooks.json` | 1 occurrence in `hooks/hooks.json` | `out-of-canon` | Non-canonical Claude artifact (REQ-VND-04). Not a canonical surface; exempt from the REQ-RES-03 scan. Left in place. |
30
+ | `hooks/hooks.json` SessionStart wiring | 1 file (`hooks/hooks.json`) — Claude `SessionStart` → `bash ${CLAUDE_PLUGIN_ROOT}/scripts/session-check.sh` | `out-of-canon` | Claude-specific plugin hook wiring (REQ-VND-04, decision D3). Preserved + documented so `forge-agent-adapters-build` treats it as a Claude artifact, not portable canon. |
31
+ | (contingency) any other vendor invocation directive | none found in the audit | — | REQ-VND-02 contingency did not fire (see Notes). If one is later surfaced, add a row with `removed` or `out-of-canon` per `02-frontmatter-purity-and-inventory.md` §3. |
32
+
33
+ ## Notes
34
+
35
+ - **REQ-VND-02 contingency did not fire.** The exhaustive audit found **no** Codex / Copilot /
36
+ Cursor / Gemini invocation directive — and no other agent-specific run-this command block — in any
37
+ skill body or frontmatter. The only vendor constructs in scope across the suite are the three
38
+ recorded above: `argument-hint`, `${CLAUDE_PLUGIN_ROOT}`, and the `hooks/hooks.json` SessionStart
39
+ wiring. Treating REQ-VND-02 as a contingency rather than an action item is therefore correct.
40
+ - **`${CLAUDE_PLUGIN_ROOT}` relocation mechanics** — the prelude replacement, the resolver, and the
41
+ canonical-surface routing — are owned by `03-portable-root-resolver.md`; this file only records the
42
+ inventory dispositions.
43
+ - **The closed `Disposition` vocabulary** is defined in `00-core-definitions.md` §8; the legend above
44
+ reproduces it so this file is self-contained for a downstream reader.
45
+ - The two surviving `${CLAUDE_PLUGIN_ROOT}` instances (the `forge-root.sh` env fallback and the
46
+ `hooks/hooks.json` literal) are written here as descriptive text in code spans so they are not
47
+ routable invocations and do not trip the spec-purity checker's residual-var rule, consistent with
48
+ how `02-frontmatter-purity-and-inventory.md` §5 records them.
49
+ </content>
50
+ </invoke>