@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,164 @@
1
+ ---
2
+ # GENERATED — DO NOT EDIT. Source: skills/forge/SKILL.md. Regenerate: python3 scripts/build-adapters.py
3
+ name: forge
4
+ description: Feature-forge pipeline navigator and status dashboard. Use when the user references the forge pipeline, asks about forge status or progress, types /feature-forge:forge, or wants to check what stage a feature is at in the forge pipeline. Do NOT use for general feature requests, project status, or tasks unrelated to the forge development pipeline.
5
+ ---
6
+
7
+ # Feature Forge — Pipeline Navigator
8
+
9
+ You are the navigator for the feature-forge development pipeline. Your job is to orient the user: show where they are, what's been done, and what's next.
10
+
11
+ ## Behavior
12
+
13
+ ### 1. Read Configuration
14
+
15
+ Read and follow `references/shared-conventions.md` for configuration reading (feature name validation, config defaults, force mode).
16
+
17
+ For pipeline architecture details, read `references/process-overview.md`.
18
+
19
+ ### 2. Determine Context
20
+
21
+ **If a feature name is provided** (e.g., `/feature-forge:forge auth`):
22
+ - **First test whether the name is an epic:** if `{specsDir}/{name}/epic-manifest.json` exists, render the **Epic Dashboard** (see format below) and stop — do not treat it as a feature.
23
+ - Otherwise, resolve the name via the **Feature Directory Resolution** block in `references/shared-conventions.md` (so a nested epic-member name finds its dashboard too). On a resolution failure (`not-found` / `ambiguous` at exit 1; `unsafe-name` or a path-containment escape at exit 2), surface it verbatim.
24
+ - On `not-found` for a never-started feature, ask: "No pipeline exists for '{feature}'. Want to start one? Run `/feature-forge:forge-1-prd {feature}` to begin."
25
+ - If resolution succeeds, display the per-feature pipeline status dashboard (see format below) from `{resolvedFeatureDir}/`.
26
+
27
+ **If no feature name is provided:** list in two tiers.
28
+
29
+ 1. **Epics first.** Identify epic directories as any `{specsDir}/*/` that directly contains an `epic-manifest.json` **and no `.pipeline-state.json` of its own** (an epic root is never itself a feature). For each epic, run:
30
+ ```bash
31
+ 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)"
32
+ [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
33
+ python3 "$R/scripts/epic-manifest.py" render-status "{epic}" --specs-dir "{specsDir}" --json
34
+ ```
35
+ and show one rollup line: `{epic} — {complete}/{total} complete, next: {nextCommand}`.
36
+ 2. **Standalone features below.** Scan the remaining `{specsDir}/*/` that directly contain a `.pipeline-state.json` **without** an `epic` back-pointer. A nested member's `.pipeline-state.json` is **attributed to its epic (Tier 1), never listed as a standalone feature**.
37
+ - Within this standalone tier the existing logic still applies: if exactly one active (non-complete) standalone pipeline exists, show its dashboard; if multiple exist, list them with a one-line summary each and use `AskUserQuestion` to ask which to focus on.
38
+
39
+ If no epics and no standalone features exist, say: "No active feature pipelines found. Start one with `/feature-forge:forge-1-prd <feature-name>` or group several with `/feature-forge:forge-0-epic <epic-name>`."
40
+
41
+ The feature name must be a single kebab-case token. If the user provides multiple words (e.g., "user auth flow"), convert to kebab-case: `user-auth-flow`.
42
+
43
+ ### 3. Pipeline Status Dashboard
44
+
45
+ Write pipeline state conforming to `references/pipeline-state-schema.json`.
46
+
47
+ Display a clear, scannable status for the feature:
48
+
49
+ ```
50
+ Feature: {feature} [active]
51
+ Stage: {currentStage} ({status}, started {relative time})
52
+
53
+ ✅ forge-1-prd → PRD.md (v{n})
54
+ ⬜ forge-verify (prd) ← show only if forge-1-prd is complete
55
+ ✅ forge-2-tech → tech-spec.md (v{n}, ⚠️ not yet verified)
56
+ ⬜ forge-verify (tech) ← show only if forge-2-tech is complete
57
+ 🔄 forge-3-specs → in progress
58
+ ⬜ forge-verify (specs) ← show only if forge-3-specs is complete
59
+ ⬜ forge-4-backlog
60
+ ⬜ forge-verify (backlog) ← show only if forge-4-backlog is complete
61
+ ⬜ forge-5-loop
62
+ ⬜ forge-6-docs
63
+
64
+ Next: Continue with /feature-forge:forge-3-specs {feature}
65
+ Or verify tech-spec with /feature-forge:forge-verify {feature}
66
+
67
+ Notes: "{any persisted notes}"
68
+ ```
69
+
70
+ Use these status indicators:
71
+ - ✅ = complete
72
+ - ✅⚠️ = complete but not yet verified
73
+ - 🔄 = in progress
74
+ - ⬜ = pending
75
+ - ❌ = verification found issues (not yet fixed)
76
+ - ✅🔍 = verified and fixes applied
77
+ - ⏭️ = verification skipped (user chose to proceed without verifying)
78
+ - ⚠️ = stale (built against an older version of an upstream artifact)
79
+
80
+ ### Epic Dashboard
81
+
82
+ When the named argument is an epic (`{specsDir}/{name}/epic-manifest.json` exists), render the epic dashboard instead of a per-feature one. Run:
83
+
84
+ ```bash
85
+ 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)"
86
+ [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
87
+ python3 "$R/scripts/epic-manifest.py" render-status "{epic}" --specs-dir "{specsDir}" --json
88
+ ```
89
+
90
+ and render from its output:
91
+
92
+ - **Epic header:** name + `status` (active | paused | abandoned | complete).
93
+ - **Dependency graph:** each feature with its `dependsOn`, as an arrow list or indented tree (the helper guarantees the graph is acyclic).
94
+ - **Per-feature rows:** reuse the **existing status indicators** below (✅/✅⚠️/🔄/⬜/❌/✅🔍/⏭️/⚠️), driven by each feature's derived `stage`/`status`. Mark `blocked` features and list their `unmetDeps`.
95
+ - **Actionable vs blocked:** list the `actionable` set and the recommended `nextCommand`.
96
+ - **Rollup:** `{complete}/{total} features complete`.
97
+
98
+ Example:
99
+
100
+ ```
101
+ Epic: auth-overhaul [active] — 2/4 features complete
102
+
103
+ Dependency graph:
104
+ config-store (no deps)
105
+ token-service → config-store
106
+ api-gateway → token-service
107
+ audit-log (no deps)
108
+
109
+ ✅ config-store complete
110
+ 🔄 token-service forge-3-specs (in progress)
111
+ ⬜ api-gateway blocked — waiting on token-service
112
+ ✅ audit-log complete
113
+
114
+ Actionable now: token-service
115
+ Next: /feature-forge:forge-3-specs token-service
116
+ ```
117
+
118
+ All of this is reconstructed **purely from disk** — the manifest plus each member's `.pipeline-state.json`, with no in-memory state — so a fresh session renders the same dashboard. If `render-status` fails, do not render a partial dashboard; surface 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).
119
+
120
+ ### 4. Notes Management
121
+
122
+ If the user says something like "note: switching to jose for JWT" or "remember: we decided X", update the `notes` field in `.pipeline-state.json`. This helps preserve context across session clears.
123
+
124
+ ### 5. Available Commands Reference
125
+
126
+ When showing the dashboard, include a compact reference:
127
+
128
+ ```
129
+ Commands:
130
+ /feature-forge:forge-1-prd <feature> Create requirements document
131
+ /feature-forge:forge-2-tech <feature> Create technical spec
132
+ /feature-forge:forge-3-specs <feature> Create implementation specs
133
+ /feature-forge:forge-4-backlog <feature> Generate rauf backlog
134
+ /feature-forge:forge-5-loop <feature> Run rauf autonomous loop
135
+ /feature-forge:forge-6-docs <feature> Generate architecture docs
136
+ /feature-forge:forge-verify <feature> Run verification on current stage
137
+ ```
138
+
139
+ ### 6. Pipeline Lifecycle Commands
140
+
141
+ Support these sub-commands for pipeline lifecycle management:
142
+ - `/feature-forge:forge pause {feature}` — Set `pipelineStatus` to `"paused"`. Do NOT modify `currentStage` or any stage statuses. The pipeline freezes exactly as-is. Show a confirmation.
143
+ - `/feature-forge:forge resume {feature}` — Set `pipelineStatus` back to `"active"`. Calculate how long the feature was paused (from `updatedAt` to now). If paused for more than 24 hours, show a hint: "This feature was paused for {duration}. Session context may have been lost — consider re-running `/feature-forge:forge-{currentStage} {feature}` to rebuild context."
144
+ - `/feature-forge:forge abandon {feature}` — Set `pipelineStatus` to `"abandoned"`. Use `AskUserQuestion` to confirm with user first. Note: abandoned pipelines can be resumed with `/feature-forge:forge resume {feature}` if the user changes their mind.
145
+
146
+ **Epic lifecycle.** When the argument names an **epic** (`{specsDir}/{name}/epic-manifest.json` exists), `pause` / `resume` / `abandon` operate on the epic manifest, not a `.pipeline-state.json`:
147
+
148
+ - Set the manifest's top-level `status` (`paused` / `active` / `abandoned`) via the helper's `set-status` mutator — an atomic write that also bumps `updatedAt`:
149
+ ```bash
150
+ 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)"
151
+ [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
152
+ python3 "$R/scripts/epic-manifest.py" set-status "{epic}" --status paused --specs-dir "{specsDir}"
153
+ ```
154
+ For `complete`, do **not** set the status directly — completion is *derived* from member states (the rollup), so the manifest `status` is a lifecycle flag, never a completion signal.
155
+ - **Member feature states are NOT silently mutated.** Pausing/abandoning the epic changes only the manifest `status`. Before doing so, use `AskUserQuestion` to make the relationship explicit: "Pausing the epic does not pause its in-flight member features. {N} members are active. Pause the epic only, or also pause each member?" If the user opts to pause members too, update each member's own `pipelineStatus` **individually and visibly** (one explicit action per member), never as a hidden side-effect.
156
+ - Commit the change via the Git Commit Protocol, staging `{specsDir}/{epic}/`.
157
+
158
+ When listing features, show active pipelines by default. Include a count of paused/abandoned: "3 active pipelines (1 paused, 1 abandoned — use `/feature-forge:forge list all` to see them)."
159
+
160
+ ## Gotchas
161
+
162
+ - Never modify any spec files, backlog files, or pipeline state beyond the `notes`, `updatedAt`, and `pipelineStatus` fields. The navigator is read-only except for notes and lifecycle commands.
163
+ - If a user asks to "continue" or "pick up where I left off" without naming a feature, check for active pipelines before asking. Only ask if ambiguous.
164
+ - The pipeline state file is the source of truth. Don't infer stage from the existence of files alone — a file might exist from a previous incomplete run.
@@ -0,0 +1,302 @@
1
+ ---
2
+ # GENERATED — DO NOT EDIT. Source: skills/forge-0-epic/SKILL.md. Regenerate: python3 scripts/build-adapters.py
3
+ name: forge-0-epic
4
+ description: 'Create or edit a forge epic: decompose a large change into discrete member features with dependencies, charters, and structured contracts, producing epic-manifest.json + EPIC.md. Re-run on an existing epic to enter edit mode (add/remove/reorder features, change dependencies). Use when the user runs /feature-forge:forge-0-epic or explicitly asks to start/modify an epic. Do NOT trigger for single-feature PRD work (that is forge-1-prd) or for general project planning outside forge.'
5
+ ---
6
+
7
+ # forge-0-epic — Epic Decomposition & Orchestration
8
+
9
+ Create an epic — a named grouping of related forge features with declared dependencies
10
+ and shared contracts — through a structured decomposition interview, OR edit an existing
11
+ epic. The manifest is the source of truth; EPIC.md mirrors it. All graph/validation work
12
+ is delegated to `scripts/epic-manifest.py`.
13
+
14
+ This skill **composes** JSON and **issues** helper commands. It NEVER eyeballs a dependency
15
+ graph for cycles, NEVER hand-rolls a manifest write where a mutator exists, and NEVER asks a
16
+ question in inline prose — every question goes through `AskUserQuestion`.
17
+
18
+ ## Prerequisites
19
+
20
+ Read and follow `references/shared-conventions.md` for:
21
+ - the **Feature Name Requirement** (applied here to the *epic* name — see below),
22
+ - the **User Input Protocol** (the AskUserQuestion guardrail — all questions go through the tool),
23
+ - **Configuration Reading**, and
24
+ - the **Git Commit Protocol**.
25
+
26
+ **Epic name handling.** The single positional argument is the **epic** name (not a feature).
27
+ If no name is given, STOP and ask for one — do not guess. Convert multi-word input to a single
28
+ kebab-case token. The name must satisfy `SAFE_NAME_RE` (`^[a-z0-9]+(?:-[a-z0-9]+)*$`); the
29
+ helper rejects unsafe names. Member feature names are elicited later, in the interview.
30
+
31
+ **Force mode.** `--force` is honored as in shared-conventions: skip pipeline-state prerequisite
32
+ checks but still load any on-disk artifacts.
33
+
34
+ **Config values read** (defaults from shared-conventions): `specsDir` (default `./specs`),
35
+ `gitCommitAfterStage` (default true), `commitPrefix` (default `forge`).
36
+
37
+ **Helper invocation.** Every helper call uses the convention from 01 §2.2 — the absolute
38
+ plugin path and the configured specs dir:
39
+
40
+ ```bash
41
+ 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)"
42
+ [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
43
+ python3 "$R/scripts/epic-manifest.py" <subcommand> ... --specs-dir "{specsDir}"
44
+ ```
45
+
46
+ `$R` resolves to the installed plugin root via the portable resolver (`scripts/forge-root.sh`,
47
+ bootstrapped by the prelude above; see `references/portable-root.md`). Pass `--specs-dir "{specsDir}"`
48
+ on every invocation.
49
+
50
+ ---
51
+
52
+ ## Step 0 — Dispatch Detection
53
+
54
+ Resolve the epic subtree path `{specsDir}/{epic}/` and decide which branch to run.
55
+
56
+ 1. **Collision check — is this name already a standalone feature?** If `{specsDir}/{epic}/`
57
+ exists and directly contains a `.pipeline-state.json` of its own (i.e. it is itself a
58
+ *feature* directory, not an epic root), STOP. Surface verbatim:
59
+ > `{epic}` is already a standalone feature, not an epic. Choose a different epic name or
60
+ > relocate the feature.
61
+
62
+ 2. **Manifest existence probe** — does this epic already have a manifest?
63
+
64
+ ```bash
65
+ test -f "{specsDir}/{epic}/epic-manifest.json" && echo EXISTS || echo NEW
66
+ ```
67
+
68
+ - **NEW** (no `epic-manifest.json`) → **Creation branch** (Step C1 onward).
69
+ - **EXISTS** → **Edit branch** (§ Edit Mode below).
70
+
71
+ 3. **Pre-flight epic-name uniqueness (creation only).** Before composing anything for a NEW
72
+ epic, confirm the epic name itself does not collide with any existing feature or epic:
73
+
74
+ ```bash
75
+ 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)"
76
+ [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
77
+ python3 "$R/scripts/epic-manifest.py" check-name "{epic}" --specs-dir "{specsDir}"
78
+ ```
79
+
80
+ - Exit `0` → the name is free; proceed to C1.
81
+ - Exit `1` (`duplicate-name`) → STOP and surface the helper's finding **verbatim**; ask
82
+ (via `AskUserQuestion`) for a different epic name, then re-run check-name.
83
+ - Exit `2` (unsafe name) → STOP and surface the finding; ask for a corrected name.
84
+
85
+ ---
86
+
87
+ ## Creation Branch
88
+
89
+ ### Step 1 — Branch Setup (optional)
90
+
91
+ If `gitCommitAfterStage` is true and the project uses git, use `AskUserQuestion`:
92
+ "Create a `forge/{epic}` branch for this epic? (Recommended — keeps epic work isolated.)"
93
+ If yes, create and checkout the branch before proceeding.
94
+
95
+ ### Step C1 — Epic Framing Interview
96
+
97
+ Output context as text (what an epic is, that a decomposition interview will follow). Then
98
+ call `AskUserQuestion` to elicit:
99
+
100
+ 1. **Epic goal / problem** — the overarching change being decomposed. Becomes the EPIC.md
101
+ "Overall Goal" narrative and seeds the manifest `description`.
102
+ 2. **One-paragraph description** — a confirmed/edited summary. Becomes the manifest `description`.
103
+
104
+ The epic `name` is the validated CLI argument from Step 0 — do NOT prompt for it again.
105
+
106
+ ### Step C2 — Feature-List Interview
107
+
108
+ Drive a decomposition dialogue. Output your analysis as text first (how the goal might split,
109
+ right-sizing guidance: each feature should be a single pipeline-sized unit — a unit forge-1-prd
110
+ through forge-5-loop would carry end-to-end — not item-level interleaving). Then use
111
+ `AskUserQuestion` to elicit the candidate feature list. Probe with questions like "Is any of
112
+ these two features really one?" and "Is any one of these really two?" Iterate until the user
113
+ confirms the set.
114
+
115
+ For **each** proposed feature name, before accepting it into the set, enforce global uniqueness
116
+ and name safety via the helper:
117
+
118
+ ```bash
119
+ 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)"
120
+ [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
121
+ python3 "$R/scripts/epic-manifest.py" check-name "{feature}" --specs-dir "{specsDir}"
122
+ ```
123
+
124
+ - Exit `0` → accept the name.
125
+ - Exit `1` (`duplicate-name`) → reject that name; surface the finding verbatim and re-prompt
126
+ (via `AskUserQuestion`) for a different name.
127
+ - Exit `2` (`unsafe-name`) → reject; surface the finding and re-prompt.
128
+
129
+ Never accept a feature name that has not passed `check-name` exit 0.
130
+
131
+ ### Step C3 — Per-Feature Charter + Structured Contracts
132
+
133
+ For each confirmed feature, run a focused `AskUserQuestion` batch (one feature at a time,
134
+ 2–3 questions per call) eliciting:
135
+
136
+ - **Charter** — a single paragraph: scope statement + contract obligations. This is a
137
+ **charter only, NOT a PRD**. Do NOT conduct a full requirements interview here. If the user
138
+ starts dictating detailed requirements, redirect (as context text, then continue the batch):
139
+ > "That's PRD-level detail — `forge-1-prd` will capture it when this feature is ready. For
140
+ > the charter I just need the one-paragraph scope and what it must expose/consume."
141
+ - **`exposes`** — zero or more structured `Contract` objects this feature provides to
142
+ dependents. Each is `{ "name", "kind", "summary" }` where `kind` ∈
143
+ `function | type | endpoint | module | event`.
144
+ - **`consumes`** — zero or more structured `ConsumedContract` objects this feature relies on.
145
+ Each is `{ "from", "name", "summary" }`, where `from` is a sibling feature name in this epic.
146
+
147
+ Collect these into plain JSON objects per feature. Do NOT free-form the contracts in prose —
148
+ the structured arrays are the source of truth; EPIC.md renders them as prose later (Step C6).
149
+
150
+ ### Step C4 — Dependency-Edge Interview
151
+
152
+ For each feature, use `AskUserQuestion`: "Which sibling features must be complete before this
153
+ one can build?" → populates `dependsOn: [names]`.
154
+
155
+ **Seed the suggestion from `consumes`:** a `consumes.from` X strongly implies `dependsOn` X.
156
+ Offer the union of each feature's `consumes.from` set as the default, but let the user confirm —
157
+ `dependsOn` is the authoritative edge set.
158
+
159
+ The `features[]` array order is the user-declared sequence from C2 (order is a presentation
160
+ sequence, **not** a dependency ordering). Preserve the C2 order unless the user asks to reorder.
161
+
162
+ ### Step C5 — Compose & Validate the Manifest
163
+
164
+ Compose the full `epic-manifest.json` per the 00 §2 schema, setting:
165
+
166
+ - `schemaVersion`: `1`
167
+ - `epic`: `"{epic}"`
168
+ - `description`: from C1
169
+ - `status`: `"active"`
170
+ - `narrativeDoc`: `"EPIC.md"`
171
+ - `createdAt` and `updatedAt`: the **same** current ISO-8601 UTC timestamp (`createdAt == updatedAt`)
172
+ - `features[]`: in declared order, each with `name`, `charter`, `dependsOn`, `exposes`,
173
+ `consumes`. **No per-feature `status` field** — including one makes the manifest fail
174
+ validation (the `cached-status` finding).
175
+
176
+ Write the composed JSON to `{specsDir}/{epic}/epic-manifest.json` (creating the epic dir first).
177
+ For the *initial* creation write the skill writes the file directly — atomic guarantees are only
178
+ required for in-place mutation, which is the helper mutators' job. Then validate:
179
+
180
+ ```bash
181
+ 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)"
182
+ [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
183
+ python3 "$R/scripts/epic-manifest.py" validate "{epic}" --specs-dir "{specsDir}" --json
184
+ ```
185
+
186
+ - Exit `0` → proceed to C6.
187
+ - Exit `1` → the manifest is malformed. Surface **every** `findings[]` entry **verbatim**, do
188
+ NOT proceed, and loop back into the relevant interview step to correct, then re-compose and
189
+ re-validate:
190
+ - `cycle` → re-open the dependency interview (C4).
191
+ - `dangling-ref` → re-open C4 (bad `dependsOn`) or C3 (bad `consumes.from`).
192
+ - `duplicate-name` / `unsafe-name` → re-open the feature-list interview (C2).
193
+ - `cached-status` / schema violation → fix the composed JSON and re-validate.
194
+ - Exit `2` → IO/usage error (missing manifest or unreadable). Surface and STOP.
195
+
196
+ Acyclicity, uniqueness, and dangling-ref checks are thus ALWAYS performed by the helper, never
197
+ by the LLM eyeballing the graph.
198
+
199
+ > **Contracts have no mutator.** There is intentionally no `--exposes-json`/`--consumes-json`
200
+ > flag. At creation, the skill populates each feature's `exposes`/`consumes` directly in the
201
+ > composed manifest entry (above), then re-runs `validate` — exactly as described here. The
202
+ > same pattern applies after an edit-mode `add-feature` (see Edit Mode).
203
+
204
+ ### Step C6 — Generate EPIC.md
205
+
206
+ Generate `{specsDir}/{epic}/EPIC.md` from the **validated** manifest. It is the human-readable
207
+ **mirror** of the manifest (the manifest is the source of truth). For the full EPIC.md structure
208
+ skeleton, read `references/edit-mode.md` (EPIC.md Mirror Template section) — the same template the
209
+ edit-mode E5 patch applies.
210
+
211
+ **The mirror rule.** Render each feature's `exposes`/`consumes` arrays as prose, one bullet per
212
+ contract entry, preserving `name`, `kind`/`from`, and `summary`. Do not invent a contract that
213
+ is not in the manifest, and do not omit one that is. The Overall Goal and Decomposition
214
+ Rationale are the only prose without a 1:1 manifest counterpart. The skill does NOT itself diff
215
+ EPIC.md against the manifest — drift detection is `forge-verify` epic mode CHECK-E06.
216
+
217
+ ### Step C7 — Create Member Subdirectories + Back-Pointer States
218
+
219
+ After the manifest validates and EPIC.md is written, create one subdirectory per member feature
220
+ so the navigator and resolver can see them before any stage runs. For each `features[].name`:
221
+
222
+ 1. Create `{specsDir}/{epic}/{feature}/`.
223
+ 2. Write `{specsDir}/{epic}/{feature}/.pipeline-state.json` conforming to
224
+ `references/pipeline-state-schema.json`, carrying:
225
+ - `epic`: `"{epic}"` — the back-pointer.
226
+ - `currentStage`: `"forge-1-prd"` — the next actionable stage for the member.
227
+ - `stages["forge-0-epic"]`: `{ "status": "complete", "version": 1, "completedAt": "<ts>" }`
228
+ — recording that the epic stage seeded this member.
229
+ - No other stages (all other stages absent/pending), exactly as a freshly-initialized
230
+ standalone feature. **No per-feature `status` beyond the stage entry** — the member state
231
+ holds derived stage progress only.
232
+
233
+ For an example member state, read `references/edit-mode.md` (Member State Example section).
234
+
235
+ The member subtree holds the **same** artifact set a standalone feature holds; only
236
+ `.pipeline-state.json` exists at creation. No PRD/specs are authored here. The epic subtree is
237
+ now self-contained: manifest + EPIC.md + one subdirectory per member.
238
+
239
+ ### Step C8 — Review, Pipeline State & Commit
240
+
241
+ 1. **Review.** Present a summary (epic name, N features, dependency edges, contracts) as text,
242
+ then use `AskUserQuestion`: "Does this epic decomposition look right? Any feature, dependency,
243
+ or contract to change before I commit?" If the user wants changes, loop back to the relevant
244
+ creation step, re-compose, and re-validate.
245
+
246
+ 2. **Commit (Git Commit Protocol).** If `gitCommitAfterStage` is true, follow the Git Commit
247
+ Protocol in shared-conventions:
248
+ - Stage the whole epic subtree only: `git add {specsDir}/{epic}/` — never `git add -A`. This
249
+ captures `epic-manifest.json`, `EPIC.md`, and all member `.pipeline-state.json` files
250
+ atomically.
251
+ - Commit with message `"{commitPrefix}({epic}): create epic with {N} features"`.
252
+ - On success, capture the commit hash. On failure (pre-commit hook, conflict), report and do
253
+ not mark complete; never use `--no-verify`/`--force`.
254
+
255
+ 3. **Closing message.** After a successful creation, tell the user the next steps:
256
+
257
+ > Epic `{epic}` created with {N} features. Next steps:
258
+ > - `/feature-forge:forge {epic}` to see the epic dashboard
259
+ > - `/feature-forge:forge-verify {epic}` to verify the epic
260
+ > - `/feature-forge:forge-1-prd {first-actionable-feature}` to start the first feature
261
+
262
+ The first-actionable feature is any feature with empty `dependsOn` (or the first entry of
263
+ `render-status`'s `actionable` set).
264
+
265
+ ---
266
+
267
+ ## Edit Mode
268
+
269
+ Entered from Step 0 when `{specsDir}/{epic}/epic-manifest.json` already exists (the **EXISTS**
270
+ branch). The edit branch mutates the manifest **only** through helper mutators — atomic
271
+ (temp file + `os.replace`) and internally re-validated, so a refused write leaves the manifest
272
+ **byte-identical**; the skill never hand-rolls an in-place write. Every question goes through
273
+ `AskUserQuestion`, and **every mutation is committed individually** so git history is the audit trail.
274
+
275
+ For the full E1–E6 mechanics — the E1 refuse-if-invalid protocol, E2 operation→mutator table, E3
276
+ contracts/remove-feature caveats (incl. the verbatim WARN block), E4 impact-warning rules, E5
277
+ EPIC.md patch rule, and the E6 Observability / Pipeline State & Commit machinery
278
+ (`.epic-state.json` schema, `updatedAt` rules, Git Commit Protocol shared with C8) — read
279
+ `references/edit-mode.md`. For the exact `epic-manifest.py` mutator flag surface and
280
+ per-subcommand exit-code (`0`/`1`/`2`) handling, read `references/epic-manifest-subcommands.md`.
281
+
282
+ ---
283
+
284
+ ## Error Handling
285
+
286
+ The skill **never** repairs a corrupt manifest automatically and **never** proceeds past a gating
287
+ helper exit `≥ 1`. All findings are surfaced **verbatim**. For the full condition → helper-signal →
288
+ skill-behavior disposition table, read `references/epic-manifest-subcommands.md` (Error Handling
289
+ section).
290
+
291
+ ---
292
+
293
+ ## Gotchas
294
+
295
+ - The argument names an **epic**, not a feature — this is the only stage where that is true.
296
+ Member feature names come from the C2 interview, each gated through `check-name`.
297
+ - Never eyeball the dependency graph for cycles. Compose the manifest, run `validate`, and
298
+ surface findings. The helper owns acyclicity, uniqueness, dangling-ref, and schema checks.
299
+ - A charter is one paragraph, not a PRD. Redirect requirement-level detail to `forge-1-prd`.
300
+ - Contracts have no mutator: edit `exposes`/`consumes` in the composed manifest entry, then
301
+ re-run `validate`.
302
+ - All questions go through `AskUserQuestion`. Never put a question in your text output.