@garygentry/feature-forge 0.1.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 (231) hide show
  1. package/LICENSE +21 -0
  2. package/adapters/GENERATION-REPORT.md +128 -0
  3. package/adapters/claude/agents/forge-researcher.md +137 -0
  4. package/adapters/claude/agents/forge-spec-writer.md +115 -0
  5. package/adapters/claude/agents/forge-verifier.md +121 -0
  6. package/adapters/claude/references/epic-manifest-schema.json +120 -0
  7. package/adapters/claude/references/forge-config-schema.json +166 -0
  8. package/adapters/claude/references/pipeline-state-schema.json +110 -0
  9. package/adapters/claude/references/portable-root.md +56 -0
  10. package/adapters/claude/references/process-overview.md +123 -0
  11. package/adapters/claude/references/ralph-loop-contract.md +221 -0
  12. package/adapters/claude/references/shared-conventions.md +144 -0
  13. package/adapters/claude/references/skill-frontmatter.schema.json +17 -0
  14. package/adapters/claude/references/stack-resolution.md +51 -0
  15. package/adapters/claude/references/stacks/_generic.md +90 -0
  16. package/adapters/claude/references/stacks/go.md +138 -0
  17. package/adapters/claude/references/stacks/python.md +163 -0
  18. package/adapters/claude/references/stacks/rust.md +151 -0
  19. package/adapters/claude/references/stacks/typescript.md +111 -0
  20. package/adapters/claude/references/vendor-construct-inventory.md +49 -0
  21. package/adapters/claude/scripts/forge-root.sh +50 -0
  22. package/adapters/claude/skills/forge/SKILL.md +165 -0
  23. package/adapters/claude/skills/forge-0-epic/SKILL.md +303 -0
  24. package/adapters/claude/skills/forge-0-epic/references/edit-mode.md +222 -0
  25. package/adapters/claude/skills/forge-0-epic/references/epic-manifest-subcommands.md +64 -0
  26. package/adapters/claude/skills/forge-1-prd/SKILL.md +121 -0
  27. package/adapters/claude/skills/forge-1-prd/references/prd-template.md +106 -0
  28. package/adapters/claude/skills/forge-2-tech/SKILL.md +198 -0
  29. package/adapters/claude/skills/forge-2-tech/references/stack-discovery-checklist.md +95 -0
  30. package/adapters/claude/skills/forge-3-specs/SKILL.md +154 -0
  31. package/adapters/claude/skills/forge-3-specs/references/spec-archetypes.md +106 -0
  32. package/adapters/claude/skills/forge-3-specs/references/spec-examples.md +71 -0
  33. package/adapters/claude/skills/forge-4-backlog/SKILL.md +146 -0
  34. package/adapters/claude/skills/forge-5-loop/SKILL.md +303 -0
  35. package/adapters/claude/skills/forge-5-loop/references/result-reporting.md +63 -0
  36. package/adapters/claude/skills/forge-5-loop/references/runner-contract.md +214 -0
  37. package/adapters/claude/skills/forge-6-docs/SKILL.md +179 -0
  38. package/adapters/claude/skills/forge-6-docs/references/doc-conventions.md +126 -0
  39. package/adapters/claude/skills/forge-fix/SKILL.md +65 -0
  40. package/adapters/claude/skills/forge-init/SKILL.md +29 -0
  41. package/adapters/claude/skills/forge-verify/SKILL.md +219 -0
  42. package/adapters/claude/skills/forge-verify/references/verification-checklists.md +379 -0
  43. package/adapters/codex/agents/forge-researcher.md +133 -0
  44. package/adapters/codex/agents/forge-spec-writer.md +112 -0
  45. package/adapters/codex/agents/forge-verifier.md +115 -0
  46. package/adapters/codex/agents/openai.yaml +10 -0
  47. package/adapters/codex/references/epic-manifest-schema.json +120 -0
  48. package/adapters/codex/references/forge-config-schema.json +166 -0
  49. package/adapters/codex/references/pipeline-state-schema.json +110 -0
  50. package/adapters/codex/references/portable-root.md +56 -0
  51. package/adapters/codex/references/process-overview.md +123 -0
  52. package/adapters/codex/references/ralph-loop-contract.md +221 -0
  53. package/adapters/codex/references/shared-conventions.md +144 -0
  54. package/adapters/codex/references/skill-frontmatter.schema.json +17 -0
  55. package/adapters/codex/references/stack-resolution.md +51 -0
  56. package/adapters/codex/references/stacks/_generic.md +90 -0
  57. package/adapters/codex/references/stacks/go.md +138 -0
  58. package/adapters/codex/references/stacks/python.md +163 -0
  59. package/adapters/codex/references/stacks/rust.md +151 -0
  60. package/adapters/codex/references/stacks/typescript.md +111 -0
  61. package/adapters/codex/references/vendor-construct-inventory.md +49 -0
  62. package/adapters/codex/scripts/forge-root.sh +50 -0
  63. package/adapters/codex/skills/forge/forge.md +164 -0
  64. package/adapters/codex/skills/forge-0-epic/forge-0-epic.md +302 -0
  65. package/adapters/codex/skills/forge-0-epic/references/edit-mode.md +222 -0
  66. package/adapters/codex/skills/forge-0-epic/references/epic-manifest-subcommands.md +64 -0
  67. package/adapters/codex/skills/forge-1-prd/forge-1-prd.md +120 -0
  68. package/adapters/codex/skills/forge-1-prd/references/prd-template.md +106 -0
  69. package/adapters/codex/skills/forge-2-tech/forge-2-tech.md +197 -0
  70. package/adapters/codex/skills/forge-2-tech/references/stack-discovery-checklist.md +95 -0
  71. package/adapters/codex/skills/forge-3-specs/forge-3-specs.md +153 -0
  72. package/adapters/codex/skills/forge-3-specs/references/spec-archetypes.md +106 -0
  73. package/adapters/codex/skills/forge-3-specs/references/spec-examples.md +71 -0
  74. package/adapters/codex/skills/forge-4-backlog/forge-4-backlog.md +145 -0
  75. package/adapters/codex/skills/forge-5-loop/forge-5-loop.md +302 -0
  76. package/adapters/codex/skills/forge-5-loop/references/result-reporting.md +63 -0
  77. package/adapters/codex/skills/forge-5-loop/references/runner-contract.md +214 -0
  78. package/adapters/codex/skills/forge-6-docs/forge-6-docs.md +178 -0
  79. package/adapters/codex/skills/forge-6-docs/references/doc-conventions.md +126 -0
  80. package/adapters/codex/skills/forge-fix/forge-fix.md +64 -0
  81. package/adapters/codex/skills/forge-init/forge-init.md +29 -0
  82. package/adapters/codex/skills/forge-verify/forge-verify.md +218 -0
  83. package/adapters/codex/skills/forge-verify/references/verification-checklists.md +379 -0
  84. package/adapters/copilot/agents/forge-researcher.md +133 -0
  85. package/adapters/copilot/agents/forge-spec-writer.md +112 -0
  86. package/adapters/copilot/agents/forge-verifier.md +115 -0
  87. package/adapters/copilot/references/epic-manifest-schema.json +120 -0
  88. package/adapters/copilot/references/forge-config-schema.json +166 -0
  89. package/adapters/copilot/references/pipeline-state-schema.json +110 -0
  90. package/adapters/copilot/references/portable-root.md +56 -0
  91. package/adapters/copilot/references/process-overview.md +123 -0
  92. package/adapters/copilot/references/ralph-loop-contract.md +221 -0
  93. package/adapters/copilot/references/shared-conventions.md +144 -0
  94. package/adapters/copilot/references/skill-frontmatter.schema.json +17 -0
  95. package/adapters/copilot/references/stack-resolution.md +51 -0
  96. package/adapters/copilot/references/stacks/_generic.md +90 -0
  97. package/adapters/copilot/references/stacks/go.md +138 -0
  98. package/adapters/copilot/references/stacks/python.md +163 -0
  99. package/adapters/copilot/references/stacks/rust.md +151 -0
  100. package/adapters/copilot/references/stacks/typescript.md +111 -0
  101. package/adapters/copilot/references/vendor-construct-inventory.md +49 -0
  102. package/adapters/copilot/scripts/forge-root.sh +50 -0
  103. package/adapters/copilot/skills/forge/forge.md +164 -0
  104. package/adapters/copilot/skills/forge-0-epic/forge-0-epic.md +302 -0
  105. package/adapters/copilot/skills/forge-0-epic/references/edit-mode.md +222 -0
  106. package/adapters/copilot/skills/forge-0-epic/references/epic-manifest-subcommands.md +64 -0
  107. package/adapters/copilot/skills/forge-1-prd/forge-1-prd.md +120 -0
  108. package/adapters/copilot/skills/forge-1-prd/references/prd-template.md +106 -0
  109. package/adapters/copilot/skills/forge-2-tech/forge-2-tech.md +197 -0
  110. package/adapters/copilot/skills/forge-2-tech/references/stack-discovery-checklist.md +95 -0
  111. package/adapters/copilot/skills/forge-3-specs/forge-3-specs.md +153 -0
  112. package/adapters/copilot/skills/forge-3-specs/references/spec-archetypes.md +106 -0
  113. package/adapters/copilot/skills/forge-3-specs/references/spec-examples.md +71 -0
  114. package/adapters/copilot/skills/forge-4-backlog/forge-4-backlog.md +145 -0
  115. package/adapters/copilot/skills/forge-5-loop/forge-5-loop.md +302 -0
  116. package/adapters/copilot/skills/forge-5-loop/references/result-reporting.md +63 -0
  117. package/adapters/copilot/skills/forge-5-loop/references/runner-contract.md +214 -0
  118. package/adapters/copilot/skills/forge-6-docs/forge-6-docs.md +178 -0
  119. package/adapters/copilot/skills/forge-6-docs/references/doc-conventions.md +126 -0
  120. package/adapters/copilot/skills/forge-fix/forge-fix.md +64 -0
  121. package/adapters/copilot/skills/forge-init/forge-init.md +29 -0
  122. package/adapters/copilot/skills/forge-verify/forge-verify.md +218 -0
  123. package/adapters/copilot/skills/forge-verify/references/verification-checklists.md +379 -0
  124. package/adapters/cursor/agents/forge-researcher.mdc +134 -0
  125. package/adapters/cursor/agents/forge-spec-writer.mdc +113 -0
  126. package/adapters/cursor/agents/forge-verifier.mdc +116 -0
  127. package/adapters/cursor/references/epic-manifest-schema.json +120 -0
  128. package/adapters/cursor/references/forge-config-schema.json +166 -0
  129. package/adapters/cursor/references/pipeline-state-schema.json +110 -0
  130. package/adapters/cursor/references/portable-root.md +56 -0
  131. package/adapters/cursor/references/process-overview.md +123 -0
  132. package/adapters/cursor/references/ralph-loop-contract.md +221 -0
  133. package/adapters/cursor/references/shared-conventions.md +144 -0
  134. package/adapters/cursor/references/skill-frontmatter.schema.json +17 -0
  135. package/adapters/cursor/references/stack-resolution.md +51 -0
  136. package/adapters/cursor/references/stacks/_generic.md +90 -0
  137. package/adapters/cursor/references/stacks/go.md +138 -0
  138. package/adapters/cursor/references/stacks/python.md +163 -0
  139. package/adapters/cursor/references/stacks/rust.md +151 -0
  140. package/adapters/cursor/references/stacks/typescript.md +111 -0
  141. package/adapters/cursor/references/vendor-construct-inventory.md +49 -0
  142. package/adapters/cursor/scripts/forge-root.sh +50 -0
  143. package/adapters/cursor/skills/forge/forge.mdc +165 -0
  144. package/adapters/cursor/skills/forge-0-epic/forge-0-epic.mdc +303 -0
  145. package/adapters/cursor/skills/forge-0-epic/references/edit-mode.md +222 -0
  146. package/adapters/cursor/skills/forge-0-epic/references/epic-manifest-subcommands.md +64 -0
  147. package/adapters/cursor/skills/forge-1-prd/forge-1-prd.mdc +121 -0
  148. package/adapters/cursor/skills/forge-1-prd/references/prd-template.md +106 -0
  149. package/adapters/cursor/skills/forge-2-tech/forge-2-tech.mdc +198 -0
  150. package/adapters/cursor/skills/forge-2-tech/references/stack-discovery-checklist.md +95 -0
  151. package/adapters/cursor/skills/forge-3-specs/forge-3-specs.mdc +154 -0
  152. package/adapters/cursor/skills/forge-3-specs/references/spec-archetypes.md +106 -0
  153. package/adapters/cursor/skills/forge-3-specs/references/spec-examples.md +71 -0
  154. package/adapters/cursor/skills/forge-4-backlog/forge-4-backlog.mdc +146 -0
  155. package/adapters/cursor/skills/forge-5-loop/forge-5-loop.mdc +303 -0
  156. package/adapters/cursor/skills/forge-5-loop/references/result-reporting.md +63 -0
  157. package/adapters/cursor/skills/forge-5-loop/references/runner-contract.md +214 -0
  158. package/adapters/cursor/skills/forge-6-docs/forge-6-docs.mdc +179 -0
  159. package/adapters/cursor/skills/forge-6-docs/references/doc-conventions.md +126 -0
  160. package/adapters/cursor/skills/forge-fix/forge-fix.mdc +65 -0
  161. package/adapters/cursor/skills/forge-init/forge-init.mdc +30 -0
  162. package/adapters/cursor/skills/forge-verify/forge-verify.mdc +219 -0
  163. package/adapters/cursor/skills/forge-verify/references/verification-checklists.md +379 -0
  164. package/adapters/gemini/agents/forge-researcher.md +133 -0
  165. package/adapters/gemini/agents/forge-spec-writer.md +112 -0
  166. package/adapters/gemini/agents/forge-verifier.md +115 -0
  167. package/adapters/gemini/gemini-extension.json +54 -0
  168. package/adapters/gemini/references/epic-manifest-schema.json +120 -0
  169. package/adapters/gemini/references/forge-config-schema.json +166 -0
  170. package/adapters/gemini/references/pipeline-state-schema.json +110 -0
  171. package/adapters/gemini/references/portable-root.md +56 -0
  172. package/adapters/gemini/references/process-overview.md +123 -0
  173. package/adapters/gemini/references/ralph-loop-contract.md +221 -0
  174. package/adapters/gemini/references/shared-conventions.md +144 -0
  175. package/adapters/gemini/references/skill-frontmatter.schema.json +17 -0
  176. package/adapters/gemini/references/stack-resolution.md +51 -0
  177. package/adapters/gemini/references/stacks/_generic.md +90 -0
  178. package/adapters/gemini/references/stacks/go.md +138 -0
  179. package/adapters/gemini/references/stacks/python.md +163 -0
  180. package/adapters/gemini/references/stacks/rust.md +151 -0
  181. package/adapters/gemini/references/stacks/typescript.md +111 -0
  182. package/adapters/gemini/references/vendor-construct-inventory.md +49 -0
  183. package/adapters/gemini/scripts/forge-root.sh +50 -0
  184. package/adapters/gemini/skills/forge/forge.md +164 -0
  185. package/adapters/gemini/skills/forge-0-epic/forge-0-epic.md +302 -0
  186. package/adapters/gemini/skills/forge-0-epic/references/edit-mode.md +222 -0
  187. package/adapters/gemini/skills/forge-0-epic/references/epic-manifest-subcommands.md +64 -0
  188. package/adapters/gemini/skills/forge-1-prd/forge-1-prd.md +120 -0
  189. package/adapters/gemini/skills/forge-1-prd/references/prd-template.md +106 -0
  190. package/adapters/gemini/skills/forge-2-tech/forge-2-tech.md +197 -0
  191. package/adapters/gemini/skills/forge-2-tech/references/stack-discovery-checklist.md +95 -0
  192. package/adapters/gemini/skills/forge-3-specs/forge-3-specs.md +153 -0
  193. package/adapters/gemini/skills/forge-3-specs/references/spec-archetypes.md +106 -0
  194. package/adapters/gemini/skills/forge-3-specs/references/spec-examples.md +71 -0
  195. package/adapters/gemini/skills/forge-4-backlog/forge-4-backlog.md +145 -0
  196. package/adapters/gemini/skills/forge-5-loop/forge-5-loop.md +302 -0
  197. package/adapters/gemini/skills/forge-5-loop/references/result-reporting.md +63 -0
  198. package/adapters/gemini/skills/forge-5-loop/references/runner-contract.md +214 -0
  199. package/adapters/gemini/skills/forge-6-docs/forge-6-docs.md +178 -0
  200. package/adapters/gemini/skills/forge-6-docs/references/doc-conventions.md +126 -0
  201. package/adapters/gemini/skills/forge-fix/forge-fix.md +64 -0
  202. package/adapters/gemini/skills/forge-init/forge-init.md +29 -0
  203. package/adapters/gemini/skills/forge-verify/forge-verify.md +218 -0
  204. package/adapters/gemini/skills/forge-verify/references/verification-checklists.md +379 -0
  205. package/dist/agent-targets.d.ts +70 -0
  206. package/dist/agent-targets.js +111 -0
  207. package/dist/apply.d.ts +49 -0
  208. package/dist/apply.js +246 -0
  209. package/dist/cli.d.ts +94 -0
  210. package/dist/cli.js +508 -0
  211. package/dist/detect.d.ts +45 -0
  212. package/dist/detect.js +72 -0
  213. package/dist/fsutil.d.ts +56 -0
  214. package/dist/fsutil.js +175 -0
  215. package/dist/hash.d.ts +50 -0
  216. package/dist/hash.js +107 -0
  217. package/dist/index.d.ts +8 -0
  218. package/dist/index.js +9 -0
  219. package/dist/manifest.d.ts +72 -0
  220. package/dist/manifest.js +222 -0
  221. package/dist/plan.d.ts +66 -0
  222. package/dist/plan.js +166 -0
  223. package/dist/rauf.d.ts +83 -0
  224. package/dist/rauf.js +118 -0
  225. package/dist/report.d.ts +35 -0
  226. package/dist/report.js +110 -0
  227. package/dist/source.d.ts +69 -0
  228. package/dist/source.js +164 -0
  229. package/dist/types.d.ts +264 -0
  230. package/dist/types.js +57 -0
  231. package/package.json +42 -0
@@ -0,0 +1,214 @@
1
+ # forge-5-loop — Loop-Runner Contract (launch, supervision, model precedence)
2
+
3
+ This file holds the detailed loop-runner contract relocated out of
4
+ `forge-5-loop/SKILL.md`: the event-stream vs. log-fallback **launch** detail
5
+ (Steps 3b/3d/3e), the structured-surface **monitoring** caveats, the **model
6
+ precedence** rule, and the **optional-flags catalog** referenced from Step 2d.
7
+ Every command below is rendered from `loopRunner` with token substitution, as in
8
+ the skill body.
9
+
10
+ ## Model selection precedence (Step 2d)
11
+
12
+ The runner picks the per-iteration model by precedence (highest wins):
13
+
14
+ ```
15
+ item.model > --model / options > project default > provider default
16
+ ```
17
+
18
+ So a backlog item's own `model` field overrides a `--model` flag passed to the
19
+ run, which overrides the project's configured default, which overrides the
20
+ runner/provider default. Pass `--model <model>` (optional flag below) to override
21
+ the project default for the whole run.
22
+
23
+ ## Agent selection (Step 2d)
24
+
25
+ This section is **parallel** to `## Model selection precedence` above: it governs
26
+ which **coding agent** rauf drives for the run. The entire surface is
27
+ **presence-gated** on `loopRunner.agentArgument` — when that field is absent or
28
+ empty, there is no selector, no probe, and no `{agent}` substitution, and Step 2d /
29
+ Step 3c are byte-identical to today (capability gate;
30
+ `02-config-schema-and-gating.md`, REQ-PLUG-02). The rest assumes the gate is on.
31
+
32
+ **Precedence (highest wins):**
33
+
34
+ ```
35
+ item.provider > --agent (run selection) > loopRunner.defaultAgent (project) > runner default (claude-cli)
36
+ ```
37
+
38
+ **Run-layer mapping — why forge never re-implements rauf's resolver.** forge owns
39
+ **only** its run and project layers and collapses them into **one** value
40
+ (`resolve()`: `run_selection or defaultAgent or none`), which it emits as a single
41
+ `--agent {agent}` occupying rauf's **run layer only**. rauf alone resolves
42
+ item-vs-run via its own 5-layer resolver, sitting the per-item `BacklogItem.provider`
43
+ **above** forge's run layer — so a run selection can never clobber a deliberate
44
+ per-item agent. forge **never reads, writes, or overrides** `BacklogItem.provider`
45
+ (REQ-AGENT-05). When forge sends nothing (the default path), rauf applies its own
46
+ default `claude-cli`, byte-identical to today. Empty/whitespace selections are
47
+ treated as unset, and an explicit pick of the runner default id collapses to the
48
+ default path (append nothing, run no probe). See
49
+ `03-selection-resolution-observability.md §3–§4`.
50
+
51
+ **Availability pre-check + disambiguation.** For a **non-default** resolved id only,
52
+ forge runs `loopRunner.agentsProbeCommand` **once** (no retries) and classifies the
53
+ id by **membership** in the advertised set (`{ row.id for row in agents }`), then the
54
+ matching row's `available` flag — **never** by exit code, because `rauf agents
55
+ --json` always exits 0 (an unknown id is simply absent; a known-unavailable one is
56
+ present with `available: false`):
57
+
58
+ - **UNKNOWN** (`∉` advertised set): hard-reject **before any loop side-effect**,
59
+ listing the sorted valid ids; **no proceed-anyway**; the value never interpolates
60
+ into `{agent}` (the advertised set IS the allow-list — REQ-SEC-01).
61
+ - **UNAVAILABLE** (member, `available == False`): warn with the row's `detail`, then
62
+ offer **proceed-anyway OR choose-another** — never silent.
63
+ - **AVAILABLE** (member, `available == True`): proceed; the validated id fills
64
+ `{agent}`.
65
+ - **Probe failure** (non-zero exit / unparseable / wrong shape / empty `agents[]` /
66
+ row missing `id`): surface it and offer **choose-another OR abort**; never launch
67
+ the non-default agent unvalidated, never silently fall back to the default.
68
+
69
+ The default / `claude-cli` path runs **no** probe (zero extra cost). See
70
+ `04-availability-precheck.md` for the full pre-check, classification, and allow-list,
71
+ and `02-config-schema-and-gating.md` for the capability gate.
72
+
73
+ ## Optional flags catalog (Step 2d, rauf)
74
+
75
+ These are the optional flags the user may add to the rendered run command. If the
76
+ user requests additional flags, append them to the rendered run command.
77
+
78
+ ```
79
+ --agent <id> Coding agent rauf drives this run (see Agent selection below).
80
+ Only the runner's advertised ids are valid; an unknown id is
81
+ rejected before launch. Shown only when the runner advertises
82
+ an agent surface (loopRunner.agentArgument present).
83
+ --review Run a review pass after all iterations (extra agent session)
84
+ --model <model> Override the model (see precedence above)
85
+ --timeout <min> Per-session timeout in minutes (default: 60)
86
+ --retry-blocked Unblock and retry previously blocked items
87
+ ```
88
+
89
+ ## Launch detail (Step 3b — background process)
90
+
91
+ Launch the loop **backgrounded** so it survives session end and does not block the
92
+ session, and prefer the machine-readable event stream so the session can supervise
93
+ it live.
94
+
95
+ - **If `loopRunner.eventStreamCommand` is configured (default for rauf):** render it
96
+ (it appends `--ndjson` to the run) and launch via the Bash tool with
97
+ `run_in_background: true`, redirecting stdout to a stable events file:
98
+
99
+ ```
100
+ mkdir -p {backlogDir}/{loopRunner.stateDir} && {rendered eventStreamCommand} > {backlogDir}/{loopRunner.stateDir}/events.ndjson 2>&1
101
+ ```
102
+
103
+ (The `mkdir -p` guards the very first run, before the runner has created its
104
+ state dir.) This emits one JSON event per line **and** keeps the loop detached. The background
105
+ task's exit notification remains the single authoritative terminal signal (Step 4).
106
+ - **Fallback (runner has no `eventStreamCommand`):** launch the plain `runCommand`
107
+ with `run_in_background: true`. The session will then supervise by tailing the
108
+ human log (3d fallback) instead of the NDJSON file.
109
+
110
+ Loop runs can take significant time (minutes to hours depending on backlog size).
111
+
112
+ ## Arm a Monitor on the event stream (Step 3d)
113
+
114
+ Arm the **`Monitor` tool** on the structured event stream so events flow back into
115
+ this session as they happen. Use **`persistent: true`** — runs can exceed `Monitor`'s
116
+ maximum `timeout_ms` (1 hour), and a bounded timeout would silently stop watching a
117
+ still-running loop.
118
+
119
+ **Coverage-complete filter (silence is not success).** The filter MUST match every
120
+ terminal and exception state, not just the happy path — otherwise a crash or hang
121
+ looks identical to "still running." Monitor command (NDJSON path):
122
+
123
+ ```
124
+ tail -n +1 -f {backlogDir}/{loopRunner.stateDir}/events.ndjson 2>&1 \
125
+ | jq -rc --unbuffered 'select(.type | test("item_completed|item_blocked|needs_human|signal_parsed|loop_completed|loop_error|loop_cancelled|llm_stuck_warning"))'
126
+ ```
127
+
128
+ - **Fallback (log tail, no NDJSON):** match the runner's **structured prose
129
+ prefixes**, never the `RAUF_*` tokens (those leak inside agent output and
130
+ false-match). For rauf:
131
+
132
+ ```
133
+ tail -n +1 -f {backlogDir}/{loopRunner.stateDir}/{loopRunner.logFile} \
134
+ | grep -E --line-buffered 'Item [^ ]+ (completed|blocked):|Item [^ ]+ needs human input|Loop completed|Loop error:|Circuit breaker:'
135
+ ```
136
+
137
+ (Match `needs human input` **without** a trailing colon — the runner writes
138
+ `needs human input (set aside):`.)
139
+
140
+ If the Monitor is ever auto-stopped for event volume, re-arm with a tighter filter
141
+ (drop `item_completed`, keep the exception/terminal events).
142
+
143
+ ## React to events as they land (Step 3e)
144
+
145
+ Each Monitor event arrives as a message. React per type — but keep the user signal
146
+ high and the noise low:
147
+
148
+ - **`item_completed`** → increment a running tally. These land minutes apart, so they
149
+ won't trip the volume auto-stop; still, surface a coalesced milestone ("12/30 done")
150
+ rather than echoing every line. For an exact breakdown, run the one-shot
151
+ `{rendered statusJsonCommand}` and report `done/total` from `backlogSummary`.
152
+ - **`needs_human`** (or `signal_parsed` with `signal: "needs_human"`) → **surface
153
+ immediately** and send a **`PushNotification`** (an hours-long run means the user has
154
+ likely stepped away). **Important — the loop is NOT paused:** the runner has set that
155
+ item aside and kept working other items. So report *what* needs a human and *which*
156
+ item, then either (a) collect the user's answer via `AskUserQuestion` to **stage a
157
+ post-run retry**, or (b) offer to **cancel the run early** if the answer changes the
158
+ whole plan. Do not tell the user the loop is waiting on their reply — it isn't.
159
+ - **`item_blocked`** → surface the blocked item + reason now (visibility) and
160
+ accumulate for the final summary. Use `{rendered statusJsonCommand}` to distinguish a
161
+ genuine `blocked` from a runner-`deferred` "false block" (`backlogSummary.deferred`).
162
+ - **`loop_error`** → a real failure (this is also what a circuit-breaker halt — too many
163
+ consecutive infra failures — emits). Surface now and `PushNotification`. Offer
164
+ inspection / `--force` / re-run as appropriate.
165
+ - **Stall detection** → rauf emits an **`llm_stuck_warning`** event when an iteration
166
+ stops making progress; the filter above includes it, so surface it live (a hang
167
+ warning, not yet a failure) and offer `--force` if it persists. If you instead want to
168
+ probe on quiet, run `{rendered watchCommand}` (or read
169
+ `{backlogDir}/{loopRunner.stateDir}/iteration-status.json`) and key off its
170
+ `stuckWarning` flag. Do **not** infer a stall from `state.json.updatedAt` alone — it is
171
+ not a liveness proof.
172
+
173
+ ## Inform-user output template (Step 3c)
174
+
175
+ This is the verbatim "Loop started…" output the session shows the user after
176
+ launch. Commands are the rendered `loopRunner` monitoring commands.
177
+
178
+ When the agent surface is gated on (`loopRunner.agentArgument` present), add the
179
+ `Coding agent:` line shown below immediately after the opening `Loop started …`
180
+ line, using the same `sourceLabel` mapping as the Step 2d confirmation
181
+ (`RUN` → `"per-run selection"`, `PROJECT` →
182
+ `"project default (loopRunner.defaultAgent)"`, `DEFAULT` →
183
+ `"runner default — claude-cli"`). When the gate is off, the line is **absent** and
184
+ the template is byte-identical to today (REQ-PLUG-02). When the launch proceeded via
185
+ the UNAVAILABLE *proceed-anyway* path, use the audit variant instead:
186
+
187
+ ```
188
+ Coding agent: {resolved.agent or claude-cli} (source: {sourceLabel}).
189
+ Coding agent: {resolved.agent} (source: {sourceLabel}; proceeded despite unavailability warning).
190
+ ```
191
+
192
+ (The two lines above are alternatives — the first is the normal line; the second
193
+ replaces it only on the proceed-anyway path. This is session-side prose only; it
194
+ introduces no new event type, so the Step 3d Monitor filter is unchanged.)
195
+
196
+ ```
197
+ Loop started for {feature} ({N} items to process).
198
+ Coding agent: {resolved.agent or claude-cli} (source: {sourceLabel}). # only when the agent surface is gated on
199
+ This session is now monitoring it live — I'll report milestones and stop you in if
200
+ the loop needs a human. The loop also runs detached and survives this session ending.
201
+ Each item gets a fresh agent session with full context from the backlog and specs.
202
+
203
+ Watch directly if you like (another terminal or `!` prefix):
204
+ {rendered statusCommand} # one-shot status
205
+ {rendered followCommand} # stream live events (human)
206
+ {rendered logCommand} # tail log file
207
+ {rendered listCommand} # check item statuses
208
+
209
+ State files are at: {backlogDir}/{loopRunner.stateDir}/
210
+ - state.json (loop state)
211
+ - events.ndjson (structured event stream this session is watching)
212
+ - {loopRunner.logFile} (human event log)
213
+ - iteration-status.json (live activity, incl. stuckWarning)
214
+ ```
@@ -0,0 +1,178 @@
1
+ ---
2
+ # GENERATED — DO NOT EDIT. Source: skills/forge-6-docs/SKILL.md. Regenerate: python3 scripts/build-adapters.py
3
+ name: forge-6-docs
4
+ description: Generate developer-focused architecture documentation for a forge pipeline feature. Use when user runs /feature-forge:forge-6-docs or asks to generate docs after implementation is complete. Do NOT trigger for general documentation writing, README creation, or doc generation outside the forge pipeline.
5
+ ---
6
+
7
+ # forge-6-docs — Architecture Documentation Generator
8
+
9
+ Generate developer-focused architecture documentation for a feature, suitable for onboarding, reference, and maintenance.
10
+
11
+ ## Prerequisites
12
+
13
+ Read and follow `references/shared-conventions.md` for feature name validation, configuration reading, and force mode handling before proceeding.
14
+
15
+ **Turn structure reminder:** Output analysis/context as text, then route ALL questions through `AskUserQuestion`. Never embed questions in text output — the user will not be prompted and the session will stall.
16
+
17
+ ## Step 1: Read Context
18
+
19
+ Resolve the feature directory via the **Feature Directory Resolution** block in `references/shared-conventions.md` (so a standalone feature resolves to its flat `{specsDir}/{feature}/` path exactly as today, and an epic member resolves to its nested path). Use the resulting `{resolvedFeatureDir}` everywhere this skill previously wrote `{specsDir}/{feature}/`.
20
+
21
+ Read `{resolvedFeatureDir}/.pipeline-state.json` to understand what exists.
22
+
23
+ ### Gather Sources
24
+
25
+ Load into context:
26
+ 1. **Specs**: PRD.md, tech-spec.md, all implementation specs
27
+ 2. **Implementation**: Read the actual source code for this feature's package
28
+ 3. **Existing docs**: Check `{docsDir}/` for other features' docs to match conventions
29
+ 4. **README**: Check if the feature package has its own README.md
30
+
31
+ ### Implementation Completeness Check
32
+
33
+ Check `{resolvedFeatureDir}/backlog.json` (or `{backlogDir}/{feature}/backlog.json` if configured). Count items with status `complete` vs total. If implementation is less than 80% complete, use `AskUserQuestion` to warn: "Implementation is only N% complete. Documentation will be based primarily on specs and may need updates after implementation. Proceed?" If user proceeds, add a `PRE-IMPLEMENTATION` notice at the top of each generated doc.
34
+
35
+ Also check `.pipeline-state.json` for `stages.forge-5-loop`. If it exists and has status `in-progress` (some items incomplete), include this in the warning: "The rauf loop has not fully completed — {done}/{total} items done. Documentation may need updates after remaining items are implemented."
36
+
37
+ ### Epic-Level Documentation (epic members only)
38
+
39
+ If the resolved feature has an `epic` back-pointer in its `.pipeline-state.json`, run:
40
+
41
+ ```bash
42
+ R="$(for d in "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/*/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done)"
43
+ [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
44
+ python3 "$R/scripts/epic-manifest.py" render-status "{epic}" --specs-dir "{specsDir}" --json
45
+ ```
46
+
47
+ If `render-status` fails, skip the epic-level offer and proceed with the per-feature docs only; surface the error per the exit-1/exit-2 split in the **Feature Directory Resolution** block of `references/shared-conventions.md` (exit 1 → parse `{findings[]}` from stdout; exit 2 → surface the plain `Error:` stderr line verbatim).
48
+
49
+ **Only if `rollup.total > 0 AND rollup.complete == rollup.total`** (every member is complete-for-orchestration; the `total > 0` guard excludes an empty epic), use `AskUserQuestion` to offer:
50
+
51
+ "All {total} features in the '{epic}' epic are complete. Generate an **epic-level architecture document** spanning the features, in addition to {feature}'s per-feature docs?"
52
+
53
+ On yes, synthesize a doc at **`{docsDir}/{epic}/`** sourced from: the `EPIC.md` narrative, each member's per-feature docs, and the manifest contracts (each feature's `exposes`/`consumes`). When the epic-level doc is written, the Step 5 commit also stages `{docsDir}/{epic}/`.
54
+
55
+ If not all members are complete (or the feature has no `epic` back-pointer), **do not offer** — the per-feature doc flow proceeds unchanged.
56
+
57
+ Read `references/doc-conventions.md` for documentation standards.
58
+
59
+ ## Step 2: Plan Documentation Structure
60
+
61
+ Based on feature complexity and existing doc conventions, propose a doc plan:
62
+
63
+ **Minimum (simple feature):**
64
+ ```
65
+ {docsDir}/{feature}/
66
+ ├── README.md — Overview, quick start, key concepts
67
+ └── api-reference.md — Exported APIs, types, configuration
68
+ ```
69
+
70
+ **Standard (typical feature):**
71
+ ```
72
+ {docsDir}/{feature}/
73
+ ├── README.md — Overview, quick start, key concepts
74
+ ├── architecture.md — Design decisions, data flow, component relationships
75
+ ├── api-reference.md — Exported APIs, types, configuration
76
+ └── guides/
77
+ └── integration.md — How to integrate this feature into an app
78
+ ```
79
+
80
+ **Comprehensive (complex feature):**
81
+ ```
82
+ {docsDir}/{feature}/
83
+ ├── README.md — Overview, quick start, key concepts
84
+ ├── architecture.md — Design decisions, data flow, component relationships
85
+ ├── api-reference.md — Exported APIs, types, configuration
86
+ ├── configuration.md — All configuration options with examples
87
+ ├── guides/
88
+ │ ├── getting-started.md — Step-by-step setup
89
+ │ ├── integration.md — How to integrate with other packages
90
+ │ └── troubleshooting.md — Common issues and solutions
91
+ └── decisions/
92
+ └── adr-001-*.md — Architecture decision records (if significant decisions were made)
93
+ ```
94
+
95
+ Present the plan and use `AskUserQuestion` to get the user's confirmation.
96
+
97
+ ## Step 3: Write Documentation
98
+
99
+ ### Key Principles
100
+
101
+ **Write for the reader, not the writer.**
102
+ - A developer encountering this feature for the first time should be able to understand it from the docs alone
103
+ - Lead with the "what" and "why" before the "how"
104
+ - Include code examples for every exported API
105
+ - Don't assume familiarity with the spec documents
106
+
107
+ **Be accurate to the implementation, not the spec.**
108
+ - If the implementation diverged from the spec, document the implementation
109
+ - Specs are the source of truth for design intent; code is the source of truth for behavior
110
+ - Read the actual source code to verify your documentation is correct
111
+
112
+ **Match existing conventions.**
113
+ - If other features' docs use a specific heading structure, follow it
114
+ - If they include diagrams, include diagrams
115
+ - If they use a specific tone (formal, casual, tutorial-style), match it
116
+
117
+ ### README.md Structure
118
+
119
+ ```markdown
120
+ # {Feature Name}
121
+
122
+ {One-paragraph description of what this feature does and why it exists.}
123
+
124
+ ## Quick Start
125
+
126
+ {Minimal code to get started — import, configure, use.}
127
+
128
+ ## Key Concepts
129
+
130
+ {Explain the domain model and core abstractions in plain language.}
131
+
132
+ ## Package Exports
133
+
134
+ {Table of subpath exports and what each contains.}
135
+
136
+ | Export / Entry Point | Description |
137
+ |---------------------|-------------|
138
+ | `{module}` | Shared types and utilities |
139
+ | `{module}/server` | Server-side functionality |
140
+ | ... | ... |
141
+
142
+ Adapt export paths to match the project's module/package conventions.
143
+
144
+ ## Configuration
145
+
146
+ {Key configuration options with defaults.}
147
+
148
+ ## Further Reading
149
+
150
+ - [Architecture](./architecture.md) — Design decisions and data flow
151
+ - [API Reference](./api-reference.md) — Complete API documentation
152
+ - [Integration Guide](./guides/integration.md) — How to use with other packages
153
+ ```
154
+
155
+ ## Step 4: Review with User
156
+
157
+ Present the docs as text. Then use `AskUserQuestion` to collect feedback — do NOT include these questions in your text output:
158
+
159
+ "1. Does this accurately reflect the implementation? 2. Is the level of detail appropriate for your team? 3. Any areas that need more explanation?"
160
+
161
+ ## Step 5: Update Pipeline State and Commit
162
+
163
+ Write pipeline state conforming to `references/pipeline-state-schema.json`.
164
+
165
+ 1. Update `{resolvedFeatureDir}/.pipeline-state.json`:
166
+ - Set `currentStage` to `complete`
167
+ - Record `artifacts`
168
+ - Set `stages.forge-6-docs.basedOnVersions` to include versions for all completed upstream stages. Always include forge-1-prd, forge-2-tech, forge-3-specs. Include forge-4-backlog and forge-5-loop ONLY if they have status `complete`.
169
+ 2. If `gitCommitAfterStage` is true, follow the Git Commit Protocol in `references/shared-conventions.md`: stage files (`git add {docsDir}/{feature}/ {resolvedFeatureDir}/` — and **also** `{docsDir}/{epic}/` when an epic-level doc was written in Step 1), attempt commit with message `"{commitPrefix}({feature}): complete architecture docs"`, then set `stages.forge-6-docs.status` to `complete` with commit hash only on success. If commit fails, leave status as `in-progress`.
170
+ 4. Tell user: "Documentation complete. Feature pipeline for '{feature}' is finished!\n `/feature-forge:forge {feature}` to see the final pipeline status."
171
+
172
+ ## Gotchas
173
+
174
+ - Don't just rephrase the specs. Documentation should explain the implemented system, not the planned system. Read the actual code.
175
+ - If the implementation doesn't exist yet (backlog hasn't been run), document based on specs but note prominently that docs are pre-implementation and may need updating.
176
+ - API reference should include actual function signatures from the code, not from the spec (they may differ).
177
+ - Don't generate docs that will immediately be stale. Focus on concepts, architecture, and patterns rather than line-by-line code walkthroughs.
178
+ - Include "When to use" and "When NOT to use" sections — they save developers more time than any other documentation pattern.
@@ -0,0 +1,126 @@
1
+ # Documentation Conventions
2
+
3
+ Standards and patterns for feature architecture documentation.
4
+
5
+ ## General Rules
6
+
7
+ - Write in present tense ("The auth module validates..." not "The auth module will validate...")
8
+ - Use second person for guides ("You can configure..." not "One can configure...")
9
+ - Include code examples for every exported function, class, or component
10
+ - Code examples must be runnable — no pseudocode, no incomplete snippets
11
+ - Use the project's primary language for all code examples
12
+
13
+ ## Heading Structure
14
+
15
+ - H1: Feature name (only in README.md)
16
+ - H2: Major sections
17
+ - H3: Subsections
18
+ - Don't go deeper than H4
19
+
20
+ ## Code Examples
21
+
22
+ The following examples use TypeScript. Adapt language and import syntax to your project's stack. The principle — always include imports, show complete runnable examples — applies to all languages.
23
+
24
+ Always include import statements:
25
+ ```typescript
26
+ // Good
27
+ import { createAuthMiddleware } from '@repo/auth/server';
28
+
29
+ const middleware = createAuthMiddleware({ secret: process.env.JWT_SECRET });
30
+
31
+ // Bad — missing import, unclear where this comes from
32
+ const middleware = createAuthMiddleware({ secret: process.env.JWT_SECRET });
33
+ ```
34
+
35
+ ### Complete Quick Start Example
36
+
37
+ Here's a complete "Quick Start" section showing the expected quality:
38
+
39
+ ```markdown
40
+ ## Quick Start
41
+
42
+ Install the auth package:
43
+
44
+ ```bash
45
+ bun add @repo/auth
46
+ ```
47
+
48
+ Add the auth middleware to your Hono server:
49
+
50
+ ```typescript
51
+ import { createAuthMiddleware } from '@repo/auth/server';
52
+ import { getConfig } from '@repo/config';
53
+
54
+ const config = getConfig();
55
+
56
+ app.use('*', createAuthMiddleware({
57
+ secret: config.auth.jwtSecret,
58
+ cookieName: 'session',
59
+ }));
60
+ ```
61
+
62
+ Access the session in any route handler:
63
+
64
+ ```typescript
65
+ app.get('/api/me', (c) => {
66
+ const session = c.get('session');
67
+ if (!session) return c.json({ error: 'Not authenticated' }, 401);
68
+ return c.json({ userId: session.userId, roles: session.roles });
69
+ });
70
+ ```
71
+
72
+ For full configuration options, see [API Reference](./api-reference.md).
73
+ For setting up OAuth providers, see [Integration Guide](./guides/integration.md).
74
+ ```
75
+
76
+ ## API Reference Format
77
+
78
+ For each exported item:
79
+
80
+ ```markdown
81
+ ### `functionName(params): ReturnType`
82
+
83
+ Brief description of what this does.
84
+
85
+ **Parameters:**
86
+ - `param1` (`Type`) — Description
87
+ - `param2` (`Type`, optional) — Description. Defaults to `defaultValue`.
88
+
89
+ **Returns:** `ReturnType` — Description
90
+
91
+ **Throws:** `ErrorType` — When condition
92
+
93
+ **Example:**
94
+ \`\`\`typescript
95
+ import { functionName } from '@repo/feature';
96
+
97
+ const result = functionName({ param1: 'value' });
98
+ \`\`\`
99
+ ```
100
+
101
+ ## Diagrams
102
+
103
+ If the feature has complex data flow or component relationships, include a Mermaid diagram:
104
+
105
+ ```markdown
106
+ \`\`\`mermaid
107
+ graph LR
108
+ A[Request] --> B[Auth Middleware]
109
+ B --> C{Valid Session?}
110
+ C -->|Yes| D[Route Handler]
111
+ C -->|No| E[401 Response]
112
+ \`\`\`
113
+ ```
114
+
115
+ ## Cross-References
116
+
117
+ When referencing other packages or features:
118
+ - Link to their docs if they exist: `[Configuration package](../config/README.md)`
119
+ - Use the package name in backticks: `@repo/config`
120
+ - Don't duplicate their documentation — link to it
121
+
122
+ ## File Naming
123
+
124
+ - All lowercase with hyphens: `api-reference.md`, `getting-started.md`
125
+ - Guides go in a `guides/` subdirectory
126
+ - ADRs go in a `decisions/` subdirectory with format `adr-NNN-short-title.md`
@@ -0,0 +1,64 @@
1
+ ---
2
+ # GENERATED — DO NOT EDIT. Source: skills/forge-fix/SKILL.md. Regenerate: python3 scripts/build-adapters.py
3
+ name: forge-fix
4
+ description: Apply fixes from the most recent forge-verify findings document. Use when user runs /feature-forge:forge-fix or asks to apply verification fixes for a forge feature. Do NOT trigger for general code fixes, bug fixes, or repairs outside the forge verification workflow.
5
+ ---
6
+
7
+ # forge-fix — Apply Verification Fixes
8
+
9
+ Apply fixes from the most recent forge-verify findings document, with step-level tracking for crash recovery.
10
+
11
+ ## Prerequisites
12
+
13
+ Read and follow `references/shared-conventions.md` for feature name validation, configuration reading, and force mode handling before proceeding.
14
+
15
+ **Turn structure reminder:** Output analysis/context as text, then route ALL questions through `AskUserQuestion`. Never embed questions in text output — the user will not be prompted and the session will stall.
16
+
17
+ ## Step 1: Locate Findings Document
18
+
19
+ 1. Read `forge.config.json` for `specsDir` (default: `./specs`)
20
+ 2. Resolve the feature directory via the **Feature Directory Resolution** block in `references/shared-conventions.md` (a standalone feature resolves to its flat `{specsDir}/{feature}/` path exactly as today; an epic member resolves to its nested path). Then find the most recent `VERIFY-*-*.md` file in `{resolvedFeatureDir}/.verification/`.
21
+ 3. If no findings document exists, tell the user: "No verification findings found. Run `/feature-forge:forge-verify {feature}` first."
22
+
23
+ ## Step 2: Parse Fix Execution Plan
24
+
25
+ 1. Read the "Fix Execution Plan" section of the findings document
26
+ 2. Identify all execution steps and their dependencies
27
+ 3. Check for a `## Fix Progress` section at the bottom of the findings document — if present, some steps were already applied in a previous interrupted run
28
+
29
+ ## Step 3: Handle User Decisions
30
+
31
+ If the "User Decisions Required" section has unresolved items:
32
+ 1. Present each decision to the user with the context from the findings, using `AskUserQuestion` for each decision point. Only recommend a specific option if the findings provide clear evidence for it; otherwise present options neutrally.
33
+ 2. Wait for answers before proceeding
34
+ 3. Record decisions in the findings document under the "User Decisions Required" section (mark each as resolved)
35
+
36
+ ## Step 4: Execute Fix Steps
37
+
38
+ For each step in the "Execution Steps" section, in order:
39
+
40
+ 1. **Check if already applied:** If the step appears in the "Fix Progress" section as `[APPLIED]`, skip it
41
+ 2. **Check dependencies:** If the step depends on another step, verify that step is marked as applied
42
+ 3. **Apply the fix:** Execute the change described in the step's "Action" field
43
+ 4. **Verify the change:** Re-read the modified file and check that the change is correct and consistent with the step's rationale
44
+ 5. **Record progress:** Append to the `## Fix Progress` section at the bottom of the findings document:
45
+ ```
46
+ - Step {N}: [APPLIED] {date} — {short summary of what was done}
47
+ ```
48
+ 6. If a step fails or produces unexpected results, STOP. Report the issue to the user. Do not continue to dependent steps.
49
+
50
+ ## Step 5: Update Pipeline State and Commit
51
+
52
+ Follow the Git Commit Protocol in `references/shared-conventions.md`.
53
+
54
+ 1. Update `{resolvedFeatureDir}/.pipeline-state.json`:
55
+ - Set the relevant `forge-verify-*` entry status to `findings-applied`
56
+ - Record `fixedAt` timestamp
57
+ 2. If `gitCommitAfterStage` is true, follow the Git Commit Protocol: stage files (`git add {resolvedFeatureDir}/` — or `{specsDir}/{epic}/` for an epic member so the member-state change commits atomically with the epic subtree), attempt commit with message `"{commitPrefix}({feature}): apply {mode} verification fixes"`, then record commit hash only on success.
58
+
59
+ ## Step 6: Next Steps
60
+
61
+ Tell the user:
62
+ "Fixes applied. Next steps:
63
+ - Run `/feature-forge:forge-verify {feature}` again to confirm all issues are resolved
64
+ - Or `/feature-forge:forge {feature}` to see pipeline status"
@@ -0,0 +1,29 @@
1
+ ---
2
+ # GENERATED — DO NOT EDIT. Source: skills/forge-init/SKILL.md. Regenerate: python3 scripts/build-adapters.py
3
+ name: forge-init
4
+ description: Initialize feature-forge configuration in the current project. Use when user runs /feature-forge:forge-init or asks to set up forge for the first time. Creates forge.config.json with defaults. Do NOT trigger for general project initialization or setup tasks outside the forge pipeline.
5
+ ---
6
+
7
+ # Initialize Feature Forge
8
+
9
+ Run the initialization script to create `forge.config.json` with default settings:
10
+
11
+ ```bash
12
+ R="$(for d in "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/*/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done)"
13
+ [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
14
+ bash "$R/scripts/forge-init.sh"
15
+ ```
16
+
17
+ After initialization, the config file will contain defaults for:
18
+ - `specsDir`: `./specs`
19
+ - `docsDir`: `./docs/architecture`
20
+ - `backlogDir`: `null` (backlog lives alongside specs)
21
+ - `gitCommitAfterStage`: `true`
22
+ - `commitPrefix`: `forge`
23
+ - `stack`: `null` (detected during `/feature-forge:forge-2-tech`)
24
+ - `typeCheckCommand`: `null` (set during `/feature-forge:forge-2-tech`)
25
+ - `testCommand`: `null` (set during `/feature-forge:forge-2-tech`)
26
+
27
+ If `forge.config.json` already exists, the script will not overwrite it.
28
+
29
+ After initialization, start the pipeline with `/feature-forge:forge-1-prd <feature-name>`.