@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,379 @@
1
+ # Verification Checklists
2
+
3
+ Detailed checklists for each verification mode. Execute EVERY check — do not skip.
4
+
5
+ > **Stack-specific details:** When a stack profile exists at `references/stacks/{stack}.md`, load it alongside this checklist for language-specific check criteria (e.g., what "valid syntax" means, what the type check command is, how module exports work).
6
+
7
+ ## PRD Mode Checklist
8
+
9
+ ### Completeness
10
+ - [ ] **CHECK-P01**: All template sections from `references/prd-template.md` are populated
11
+ - [ ] **CHECK-P02**: No TBD or TODO placeholders remain in the document
12
+ - [ ] **CHECK-P03**: Out-of-scope section exists and is specific (not just "everything else")
13
+ - [ ] **CHECK-P04**: Open questions section contains only actionable items (not vague concerns)
14
+ - [ ] **CHECK-P05**: Success criteria are measurable and verifiable
15
+
16
+ ### Requirement Quality
17
+ - [ ] **CHECK-P06**: Every requirement has a unique ID (REQ-XXX-NN format)
18
+ - [ ] **CHECK-P07**: Every requirement has a priority assigned (P0/P1/P2)
19
+ - [ ] **CHECK-P08**: Every requirement is testable/verifiable — could you write an acceptance test for it?
20
+ - [ ] **CHECK-P09**: No requirements contain technology decisions (specific libraries, frameworks, or implementation choices) unless clearly labeled as constraints with justification
21
+ - [ ] **CHECK-P10**: User stories cover all identified actors/personas
22
+
23
+ ### Non-Functional Requirements
24
+ - [ ] **CHECK-P11**: Non-functional requirements are quantified where applicable (latency targets, uptime SLAs, throughput minimums)
25
+ - [ ] **CHECK-P12**: Security requirements are explicit, not assumed
26
+ - [ ] **CHECK-P13**: Constraints section distinguishes mandates (must) from preferences (should/nice-to-have)
27
+
28
+ ### Open-Ended Analysis
29
+ - [ ] **CHECK-P14**: Are there implicit requirements that should be made explicit? (e.g., assumptions about authentication, authorization, data retention)
30
+ - [ ] **CHECK-P15**: Are there requirement conflicts or tensions? (e.g., performance vs. completeness, simplicity vs. flexibility)
31
+
32
+ ## Tech-Spec Mode Checklist
33
+
34
+ ### Requirement Traceability
35
+ - [ ] **CHECK-T01**: Every tech decision traces to at least one PRD requirement (REQ-XXX-NN)
36
+ - [ ] **CHECK-T02**: No tech decisions contradict PRD constraints
37
+ - [ ] **CHECK-T03**: Every P0 PRD requirement has a corresponding tech decision or is explicitly deferred with rationale
38
+
39
+ ### Integration Analysis
40
+ - [ ] **CHECK-T04**: Integration analysis section is complete — all packages identified
41
+ - [ ] **CHECK-T05**: Import paths and function signatures are verified against actual source code
42
+ - [ ] **CHECK-T06**: For each integration point: shared types/contracts are explicitly named
43
+ - [ ] **CHECK-T07**: For each integration point: data flow direction is clear
44
+ - [ ] **CHECK-T08**: Changes required to existing packages are specified
45
+
46
+ ### Design Quality
47
+ - [ ] **CHECK-T09**: Alternatives considered for major decisions (not just "we chose X")
48
+ - [ ] **CHECK-T10**: Error handling strategy is defined (error types, propagation, recovery)
49
+ - [ ] **CHECK-T11**: Testing approach is specified (unit, integration, e2e strategy)
50
+ - [ ] **CHECK-T12**: Data model aligns with PRD data requirements
51
+
52
+ ### Completeness
53
+ - [ ] **CHECK-T13**: Package/module structure is defined with exports map
54
+ - [ ] **CHECK-T14**: Configuration approach is specified
55
+ - [ ] **CHECK-T15**: Migration/deployment considerations are addressed if applicable
56
+
57
+ ### Open-Ended Analysis
58
+ - [ ] **CHECK-T16**: Are there integration points that could cause implementation surprises? (e.g., undocumented behavior, version incompatibilities, missing APIs)
59
+ - [ ] **CHECK-T17**: Are there scalability concerns unaddressed by the current design? (e.g., data growth, concurrent users, resource limits)
60
+
61
+ ## Specs Mode Checklist
62
+
63
+ ### Requirement Coverage
64
+ - [ ] **CHECK-S01**: Every PRD requirement (REQ-XXX-NN) is referenced by at least one implementation spec
65
+ - [ ] **CHECK-S02**: Every P0 (must-have) requirement has detailed implementation guidance, not just a mention
66
+ - [ ] **CHECK-S03**: Every P1 requirement is at least acknowledged with an implementation approach
67
+ - [ ] **CHECK-S04**: No implementation spec sections exist that don't trace to a PRD requirement or tech-spec decision (orphaned specs indicate scope creep)
68
+
69
+ ### Tech Spec ↔ Implementation Spec Consistency
70
+ - [ ] **CHECK-S05**: Every technology decision in the tech spec is reflected in the implementation specs
71
+ - [ ] **CHECK-S06**: Package structure in 01-architecture-layout.md matches what the tech spec describes
72
+ - [ ] **CHECK-S07**: Dependencies listed in the tech spec match those in the architecture spec
73
+ - [ ] **CHECK-S08**: No implementation spec contradicts a tech-spec decision
74
+
75
+ ### Type System Integrity
76
+ - [ ] **CHECK-S09**: All type definitions in 00-core-definitions.md are valid syntax in the project's language (not pseudocode)
77
+ - [ ] **CHECK-S10**: All types referenced in other spec docs are defined in 00-core-definitions.md or an explicit external package
78
+ - [ ] **CHECK-S11**: Error classes form a consistent hierarchy with no gaps
79
+ - [ ] **CHECK-S12**: No duplicate or conflicting type definitions across documents
80
+ - [ ] **CHECK-S13**: Every type/interface/struct has documentation comments on every field (JSDoc, docstrings, godoc, etc.)
81
+
82
+ ### Cross-Reference Consistency
83
+ - [ ] **CHECK-S14**: All file references between spec documents point to actual files
84
+ - [ ] **CHECK-S15**: Section references (e.g., "see section 3.2 of 02-provider-registry.md") point to actual sections
85
+ - [ ] **CHECK-S16**: Dependency ordering between spec docs is consistent (no circular dependencies)
86
+ - [ ] **CHECK-S17**: Import paths referenced in specs are consistent with the exports map in 01-architecture-layout.md
87
+
88
+ ### Error Handling Coverage
89
+ - [ ] **CHECK-S18**: Every operation that can fail has an error type defined
90
+ - [ ] **CHECK-S19**: Error propagation is described: where errors are thrown, caught, transformed, and surfaced
91
+ - [ ] **CHECK-S20**: User-facing error messages are specified (not just error codes)
92
+ - [ ] **CHECK-S21**: Recovery behavior is described for recoverable errors
93
+
94
+ ### Integration Point Completeness
95
+ - [ ] **CHECK-S22**: Every package listed in the tech spec's integration section has corresponding detail in the implementation specs
96
+ - [ ] **CHECK-S23**: For each integration: the shared types/contracts are explicitly named
97
+ - [ ] **CHECK-S24**: For each integration: data flow direction is clear
98
+ - [ ] **CHECK-S25**: If integration requires changes to existing packages, those changes are specified
99
+ - [ ] **CHECK-S26**: Import paths match actual package export maps
100
+
101
+ ### Edge Cases and Non-Functional
102
+ - [ ] **CHECK-S27**: Concurrent access scenarios are addressed if relevant
103
+ - [ ] **CHECK-S28**: Empty/null/undefined inputs are handled
104
+ - [ ] **CHECK-S29**: Performance-sensitive paths are identified
105
+ - [ ] **CHECK-S30**: Security considerations from PRD are reflected in implementation
106
+ - [ ] **CHECK-S31**: Observability (logging, metrics, tracing) approach is specified if PRD requires it
107
+ - [ ] **CHECK-S32**: Each implementation spec has a clear "public API" section that defines what is exported vs internal
108
+
109
+ ### Testing Strategy
110
+ - [ ] **CHECK-S33**: Testing strategy document exists
111
+ - [ ] **CHECK-S34**: Test approach covers unit, integration, and e2e as appropriate
112
+ - [ ] **CHECK-S35**: Mock/fixture strategy is defined for external dependencies
113
+ - [ ] **CHECK-S36**: Coverage targets are stated
114
+ - [ ] **CHECK-S37**: Test fixtures and mocks defined in specs align with real interface shapes from 00-core-definitions.md
115
+
116
+ ### Traceability
117
+ - [ ] **CHECK-S38**: Build a complete traceability matrix from every REQ-XXX-NN to the spec document and section that implements it. Any REQ ID not found in at least one spec is a gap finding.
118
+
119
+ ## Backlog Mode Checklist
120
+
121
+ ### Schema Compliance
122
+ - [ ] **CHECK-B01**: backlog.json is valid JSON
123
+ - [ ] **CHECK-B02**: Every item has all required fields: id, type, priority, title, description, acceptanceCriteria, status, dependsOn, specReferences
124
+ - [ ] **CHECK-B03**: All `id` values are unique
125
+ - [ ] **CHECK-B04**: All `type` values are valid (feature, bugfix, chore, etc.)
126
+ - [ ] **CHECK-B05**: All `priority` values are valid numbers
127
+ - [ ] **CHECK-B06**: All `status` values are valid (pending, in-progress, complete, etc.)
128
+
129
+ ### Spec Coverage
130
+ - [ ] **CHECK-B07**: Every implementation spec document is referenced by at least one backlog item
131
+ - [ ] **CHECK-B08**: Every P0 PRD requirement is covered by at least one backlog item's acceptance criteria
132
+ - [ ] **CHECK-B09**: No backlog item references a spec file that doesn't exist
133
+ - [ ] **CHECK-B10**: specReferences paths are valid relative paths to actual files
134
+
135
+ ### Task Quality
136
+ - [ ] **CHECK-B11**: Each item is scoped to be completable in a single rauf loop iteration
137
+ - [ ] **CHECK-B12**: Descriptions are detailed enough for a fresh agent with no prior context
138
+ - [ ] **CHECK-B13**: Acceptance criteria are objectively verifiable (not subjective like "works well")
139
+ - [ ] **CHECK-B14**: Each item specifies what files to create or modify
140
+
141
+ ### Dependency Ordering
142
+ - [ ] **CHECK-B15**: `dependsOn` references are valid item IDs
143
+ - [ ] **CHECK-B16**: No circular dependencies exist
144
+ - [ ] **CHECK-B17**: Foundation items (types, scaffold) have no dependencies
145
+ - [ ] **CHECK-B18**: Items that depend on types/interfaces reference the item that creates them
146
+ - [ ] **CHECK-B19**: Priority ordering is consistent with dependency ordering (dependencies should have equal or higher priority)
147
+
148
+ ### Completeness
149
+ - [ ] **CHECK-B20**: There is an item for the initial package scaffold
150
+ - [ ] **CHECK-B21**: There is an item for shared types and error hierarchy
151
+ - [ ] **CHECK-B22**: There are items for each major subsystem
152
+ - [ ] **CHECK-B23**: There are items for integration wiring (not just isolated subsystems)
153
+ - [ ] **CHECK-B24**: There are items for tests (or testing is included in each feature item's acceptance criteria)
154
+ - [ ] **CHECK-B25**: No large items that try to do too many things (should be broken down)
155
+
156
+ ## Implementation Mode Checklist
157
+
158
+ ### Spec Compliance
159
+ - [ ] **CHECK-I01**: Every file listed in 01-architecture-layout.md exists
160
+ - [ ] **CHECK-I02**: Package.json exports map matches what the spec describes
161
+ - [ ] **CHECK-I03**: Every type in 00-core-definitions.md is implemented
162
+ - [ ] **CHECK-I04**: Every error class is implemented with correct properties
163
+
164
+ ### Backlog Completion
165
+ - [ ] **CHECK-I05**: Every backlog item marked "complete" has its acceptance criteria met
166
+ - [ ] **CHECK-I06**: No backlog items are still "pending" or "in-progress"
167
+ - [ ] **CHECK-I07**: Acceptance criteria can be verified by reading the code
168
+
169
+ ### Integration
170
+ - [ ] **CHECK-I08**: Import paths work (no broken imports)
171
+ - [ ] **CHECK-I09**: Module exports/entry points re-export everything the spec says they should
172
+ - [ ] **CHECK-I10**: Types shared with other packages are compatible
173
+ - [ ] **CHECK-I11**: Type checking / linting passes for the module (`{typeCheckCommand}` from forge.config.json succeeds)
174
+ - [ ] **CHECK-I12**: Type checking / linting passes for modules that depend on this one
175
+
176
+ ### Code Quality
177
+ - [ ] **CHECK-I13**: No placeholder or TODO comments that should have been resolved
178
+ - [ ] **CHECK-I14**: Error handling matches what the specs describe
179
+ - [ ] **CHECK-I15**: No hardcoded values that should be configurable
180
+ - [ ] **CHECK-I16**: Tests exist and pass
181
+ - [ ] **CHECK-I17**: No obvious missing test cases for documented edge cases
182
+
183
+ ### Documentation
184
+ - [ ] **CHECK-I18**: Package has a README or the docs directory has been populated
185
+ - [ ] **CHECK-I19**: Exported functions/classes have documentation comments (JSDoc, docstrings, godoc, etc.)
186
+ - [ ] **CHECK-I20**: Configuration options are documented
187
+
188
+ ## Epic Mode Checklist
189
+
190
+ Run `epic-manifest.py validate "{epic}" --specs-dir "{specsDir}" --json` once; map its
191
+ findings to E01/E02/E03/E08. Then perform the judgment checks E04–E07 by reading the
192
+ manifest, EPIC.md, and completed members' specs.
193
+
194
+ ```bash
195
+ 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)"
196
+ [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
197
+ python3 "$R/scripts/epic-manifest.py" validate "{epic}" --specs-dir "{specsDir}" --json
198
+ ```
199
+
200
+ ### Manifest Integrity (helper-delegated)
201
+ - [ ] **CHECK-E01**: `epic-manifest.json` conforms to `epic-manifest-schema.json`
202
+ (delegated: `validate` reports `schema` / `corrupt-json` findings).
203
+ - [ ] **CHECK-E02**: the `dependsOn` graph is **acyclic** (delegated: `validate` reports
204
+ `cycle`).
205
+ - [ ] **CHECK-E03**: no dangling `dependsOn` / `consumes.from` — every reference names a
206
+ feature in `features[]` (delegated: `validate` reports `dangling-ref`).
207
+ - [ ] **CHECK-E08**: **global name uniqueness** across the specs tree — no feature name
208
+ resolves to more than one feature-shaped dir (delegated: `validate` / `check-name`
209
+ report `duplicate-name` / `ambiguous`). Surfaced non-fatally for manual cleanup.
210
+
211
+ ### Charter & Contract Coverage (verifier judgment)
212
+ - [ ] **CHECK-E04**: **charter coverage** — every feature has a non-empty `charter`
213
+ stating scope **and** contract obligations (REQ-EPIC-04).
214
+ - [ ] **CHECK-E05**: each feature has a meaningful `exposes`/`consumes` declaration — flag
215
+ a feature with empty contracts that the narrative implies should have them
216
+ (REQ-EPIC-03). (Empty is *schema-legal* but suspicious for a feature other features
217
+ depend on.)
218
+ - [ ] **CHECK-E06**: **EPIC.md ⇆ manifest contract drift, for completed features only** —
219
+ the contracts in `EPIC.md` match the manifest `exposes`/`consumes`, and a completed
220
+ feature's specs actually deliver what it `exposes`. Drift between EPIC.md prose and the
221
+ manifest, or between the manifest and the built spec, is a finding (REQ-VERIFY-01).
222
+ - [ ] **CHECK-E07**: **back-pointer ⇆ manifest consistency** — every member's
223
+ `.pipeline-state.json` `epic` value names this epic, and every `features[]` entry has a
224
+ matching member directory. On conflict the **manifest wins** (REQ-STATE-01); report, do
225
+ not auto-repair.
226
+
227
+ ## Findings Document Template (Step 4)
228
+
229
+ Write findings to `{specsDir}/{feature}/.verification/VERIFY-{mode}-{YYYY-MM-DD}.md`
230
+ (for epic mode, `{specsDir}/{epic}/.verification/VERIFY-epic-{YYYY-MM-DD}.md` — same
231
+ format, with `{mode}=epic`). Ensure the `.verification/` subdirectory exists first.
232
+
233
+ ```markdown
234
+ # Verification Report: {feature} ({mode})
235
+ Date: {YYYY-MM-DD}
236
+ Pipeline Stage: {currentStage}
237
+ Artifacts Reviewed: {list of files}
238
+
239
+ ## Summary
240
+ - Total findings: {N}
241
+ - Gaps: {N}
242
+ - Inconsistencies: {N}
243
+ - Improvements: {N}
244
+ - Errors: {N}
245
+
246
+ ## Findings
247
+
248
+ ### V-001: {Short title}
249
+ - **Severity:** gap | inconsistency | improvement | error
250
+ - **Location:** {filename}, section {N.N}
251
+ - **Issue:** {Detailed description of what's wrong}
252
+ - **Suggested fix:** {Specific, actionable fix a fresh agent can apply}
253
+ - **References:** {Other files/sections involved}
254
+ - **Checklist:** {CHECK-XXX IDs that this finding relates to}
255
+
256
+ ### V-002: ...
257
+
258
+ ## Fix Execution Plan
259
+
260
+ ### User Decisions Required
261
+ {List any findings that need user input before fixes can be applied. If none, write "None — all fixes can be applied directly."}
262
+
263
+ ### Execution Steps
264
+
265
+ Apply these steps in order. Each step is self-contained — a fresh agent can
266
+ execute it without prior context beyond this document.
267
+
268
+ #### Step {N}: {Short title}
269
+ - **Files:** {exact file paths to edit}
270
+ - **Addresses:** {V-NNN finding IDs}
271
+ - **Checklist:** {CHECK-XXX IDs}
272
+ - **Action:** {Exact description of what to change — specific enough for a fresh agent}
273
+ - **Depends on:** {Step N or "none"}
274
+ - **Rationale:** {Why this order, why grouped this way}
275
+ ```
276
+
277
+ ## Example Findings (Step 4)
278
+
279
+ Here are complete example findings showing the expected quality:
280
+
281
+ **Gap example:**
282
+ ```
283
+ ### V-003: Missing retry logic for rate-limited API calls
284
+ - **Severity:** gap
285
+ - **Location:** specs/auth/03-session-management.md, section 3.2 "Token Refresh"
286
+ - **Issue:** PRD.md REQ-ERR-04 requires retry behavior when external auth providers rate-limit requests. The spec only handles rate limits by throwing `ProviderRateLimitError` — no retry logic, backoff strategy, or max-retry count is specified.
287
+ - **Suggested fix:** Add a "Retry Strategy" subsection to section 3.2 specifying: exponential backoff starting at 500ms, max 3 retries, circuit breaker after 5 consecutive failures. Reference the error type from 00-core-definitions.md.
288
+ - **References:** PRD.md REQ-ERR-04, 00-core-definitions.md (ProviderRateLimitError)
289
+ ```
290
+
291
+ **Inconsistency example:**
292
+ ```
293
+ ### V-007: Conflicting session duration constants
294
+ - **Severity:** inconsistency
295
+ - **Location:** 00-core-definitions.md section 2.3 vs 03-session-management.md section 1.1
296
+ - **Issue:** 00-core-definitions.md defines `SESSION_DURATION_MS = 7 * 24 * 60 * 60 * 1000` (7 days), but 03-session-management.md section 1.1 states "sessions expire after 30 days." These contradict each other.
297
+ - **Suggested fix:** Align both documents to the PRD requirement. PRD.md REQ-SEC-03 says "sessions should have a reasonable expiry" without specifying a duration — use `AskUserQuestion` to ask the user which value is intended, then update both documents.
298
+ - **References:** PRD.md REQ-SEC-03, 00-core-definitions.md section 2.3, 03-session-management.md section 1.1
299
+ ```
300
+
301
+ **Improvement example:**
302
+ ```
303
+ ### V-012: Testing strategy lacks fixture factory pattern
304
+ - **Severity:** improvement
305
+ - **Location:** specs/auth/08-testing-strategy.md, section 3 "Test Fixtures"
306
+ - **Issue:** The testing strategy describes test data inline in each test file. For a feature with 15+ test files, this leads to duplicated fixture data. A factory pattern would reduce duplication and make tests more maintainable.
307
+ - **Suggested fix:** Add a "Fixture Factories" subsection describing a `createTestSession()`, `createTestUser()` factory pattern in a shared `__fixtures__/` directory, consistent with how @repo/db handles test fixtures.
308
+ - **References:** 01-architecture-layout.md (directory structure), packages/db/src/__fixtures__/ (existing pattern)
309
+ ```
310
+
311
+ ## Epic Mode State Write Detail (Step 6)
312
+
313
+ Epic mode is **epic-scoped**, not per-feature: record its result into the epic-level
314
+ state file `{specsDir}/{epic}/.epic-state.json` — **never** into any member's
315
+ `.pipeline-state.json`. This file holds only epic-scoped stage entries (currently just
316
+ `forge-verify-epic`) and carries **no cached per-feature member status** (so it does not
317
+ violate REQ-STATE-02; per-feature status is always derived live from each member's
318
+ `.pipeline-state.json`).
319
+
320
+ Set `stages.forge-verify-epic.status` to `findings-reported` (or `passed` if zero
321
+ findings), recording `findingsFile`, `findingsCount`, and `verifiedAt`. The minimal
322
+ shape:
323
+
324
+ ```jsonc
325
+ {
326
+ "epic": "auth-overhaul", // matches the manifest `epic`
327
+ "stages": {
328
+ "forge-verify-epic": {
329
+ "status": "findings-reported", // "findings-reported" | "passed" | "findings-applied"
330
+ "findingsFile": ".verification/VERIFY-epic-2026-06-12.md",
331
+ "findingsCount": 3,
332
+ "verifiedAt": "2026-06-12T00:00:00Z"
333
+ }
334
+ }
335
+ }
336
+ ```
337
+
338
+ **Write mechanism.** `epic-manifest.py` exposes no subcommand that writes this file, so
339
+ the skill writes it **directly**, using an atomic temp-file + `os.replace()` pattern
340
+ (mirroring `02-manifest-helper-cli.md §3.3`): serialize the merged state to a sibling
341
+ temp file in `{specsDir}/{epic}/`, flush, then `os.replace()` it into place. Create the
342
+ file **lazily on first write** (a missing file is simply created; an existing file is
343
+ read, its `stages.forge-verify-epic` entry merged/replaced, and rewritten). On any I/O
344
+ failure, **report the error and leave any prior `.epic-state.json` intact** (never a
345
+ partial write). For example:
346
+
347
+ ```bash
348
+ python3 - "$SPECS_DIR/$EPIC" <<'PY'
349
+ import json, os, sys, tempfile
350
+ from pathlib import Path
351
+ epic_dir = Path(sys.argv[1])
352
+ path = epic_dir / ".epic-state.json"
353
+ state = {}
354
+ if path.exists():
355
+ state = json.loads(path.read_text())
356
+ state.setdefault("epic", epic_dir.name)
357
+ state.setdefault("stages", {})
358
+ state["stages"]["forge-verify-epic"] = {
359
+ "status": "findings-reported", # or "passed" when findingsCount == 0
360
+ "findingsFile": ".verification/VERIFY-epic-2026-06-12.md",
361
+ "findingsCount": 3,
362
+ "verifiedAt": "2026-06-12T00:00:00Z",
363
+ }
364
+ fd, tmp = tempfile.mkstemp(dir=str(epic_dir), prefix=".epic-state.", suffix=".tmp")
365
+ try:
366
+ with os.fdopen(fd, "w") as f:
367
+ json.dump(state, f, indent=2)
368
+ f.flush()
369
+ os.fsync(f.fileno())
370
+ os.replace(tmp, path)
371
+ except OSError as e:
372
+ try:
373
+ os.unlink(tmp)
374
+ except OSError:
375
+ pass
376
+ print(f"failed to write .epic-state.json: {e}", file=sys.stderr)
377
+ raise
378
+ PY
379
+ ```
@@ -0,0 +1,133 @@
1
+ ---
2
+ # GENERATED — DO NOT EDIT. Source: agents/forge-researcher.md. Regenerate: python3 scripts/build-adapters.py
3
+ name: forge-researcher
4
+ description: Explores the codebase to understand package structure, integration points, existing patterns, and conventions. Use during feature planning, especially when running /feature-forge:forge-2-tech. Returns a distilled integration report without polluting the main conversation's context window.
5
+ ---
6
+
7
+ You are a codebase research agent for the feature-forge pipeline. Your job is to explore a codebase, understand its structure, and produce a concise integration report that informs feature planning.
8
+
9
+ ## Your Role
10
+
11
+ When a new feature is being planned, the main agent needs to understand:
12
+ - What packages exist and what they do
13
+ - How packages connect to each other
14
+ - What patterns and conventions are established
15
+ - Where the new feature will need to integrate
16
+
17
+ You do the deep reading so the main conversation stays focused on the interview with the user.
18
+
19
+ ## How You Work
20
+
21
+ You will receive a research prompt specifying:
22
+ - The feature being planned
23
+ - Specific questions to answer (e.g., "How does @repo/config export its types?")
24
+ - Or a general request to map the codebase
25
+
26
+ ## Standard Research Protocol
27
+
28
+ When asked to explore for a new feature, follow this protocol:
29
+
30
+ ### 1. Map the Project Structure
31
+ - Read the project's root manifest and build configuration (`package.json`, `pyproject.toml`, `go.mod`, `Cargo.toml`, etc.)
32
+ - Determine if this is a monorepo or single project. If monorepo, identify the workspace tool.
33
+ - List all modules/packages with their names and one-line purposes
34
+ - Identify the module/package naming convention
35
+
36
+ ### 2. Identify Integration Surfaces
37
+ - For each module/package that might be relevant to the new feature:
38
+ - Read its manifest for exports and dependencies
39
+ - Read its main entry point to understand the public API
40
+ - Note key types, interfaces/protocols, and functions it exports
41
+ - Note its internal dependencies on other modules/packages
42
+
43
+ ### 3. Catalog Established Patterns
44
+ - How are packages structured internally? (directory conventions, barrel exports)
45
+ - How is configuration handled? (env vars, config packages, etc.)
46
+ - How is error handling done? (error class hierarchies, patterns)
47
+ - How are tests structured? (test file locations, frameworks, fixtures)
48
+ - What styling/theming approach is used?
49
+
50
+ ### 4. Check Existing Specs and Docs
51
+ - Read `specs/*/PRD.md` and `specs/*/tech-spec.md`, and also depth-2 `specs/*/*/PRD.md` and `specs/*/*/tech-spec.md`, for other features. The depth-2 paths surface nested epic members, subject to the **feature-shaped-dir bound**: only treat a directory as a feature if it directly contains a `.pipeline-state.json`. An epic root (`epic-manifest.json`, no `.pipeline-state.json`) is a grouping, not a feature; its member subdirectories are the features. Flat-only projects gain no new matches from the depth-2 paths.
52
+ - Read `docs/architecture/` for existing documentation
53
+ - Note any in-progress features that might conflict or share concerns
54
+
55
+ ### 5. Check for Stack Configuration
56
+ - Look for `.claude/references/stack-decisions.md`
57
+ - Look for `forge.config.json`
58
+ - Look for `CLAUDE.md` for project conventions
59
+
60
+ ## Output Format
61
+
62
+ Return a structured report:
63
+
64
+ ```markdown
65
+ # Codebase Research: {feature}
66
+
67
+ ## Project Overview
68
+ - Language/Runtime: {detected}
69
+ - Package manager / Build tool: {detected}
70
+ - Project structure: {monorepo with X / single project}
71
+ - Total modules/packages: {N}
72
+
73
+ ## Module Map
74
+ | Module | Purpose | Key Exports |
75
+ |--------|---------|-------------|
76
+ | {module-a} | Configuration management | ConfigStore, createConfig |
77
+ | ... | ... | ... |
78
+
79
+ ## Relevant Integration Points for {feature}
80
+ ### {module-a}
81
+ - Exports used: {list}
82
+ - Import path: {path}
83
+ - Notes: {any patterns to follow}
84
+
85
+ ### {module-b}
86
+ ...
87
+
88
+ ## Established Patterns
89
+ - Directory structure: {pattern}
90
+ - Barrel exports: {pattern}
91
+ - Error handling: {pattern}
92
+ - Testing: {pattern}
93
+ - Configuration: {pattern}
94
+
95
+ ## Existing Feature Specs
96
+ - {feature-a}: {status, brief summary}
97
+ - {feature-b}: {status, brief summary}
98
+
99
+ ## Potential Conflicts or Shared Concerns
100
+ - {any in-progress features that touch similar areas}
101
+
102
+ ## Stack Configuration
103
+ - {summary of stack-decisions.md if found}
104
+ - {summary of forge.config.json if found}
105
+ ```
106
+
107
+ ## Important Constraints
108
+
109
+ - Keep the report CONCISE. Distill, don't dump. The main agent needs a summary, not raw code.
110
+ - Focus on PUBLIC APIs and exports. Internal implementation details are only relevant if they establish a pattern the new feature should follow.
111
+ - If you can't determine something from the code, say so explicitly rather than guessing.
112
+ - Do NOT modify any files. You are read-only.
113
+
114
+ ## Bash Tool Usage
115
+
116
+ You have Bash access for read-only exploration ONLY. The following is an exhaustive allowlist.
117
+
118
+ ### Allowed Commands
119
+ - `find` — locating files
120
+ - `ls`, `tree` — listing directory contents
121
+ - `wc` — counting lines, words, characters
122
+ - `head`, `tail` — viewing file excerpts
123
+ - `cat` — reading file contents
124
+ - Build/package manager info commands (e.g., `npm ls`, `pip list`, `cargo tree`) — read-only queries only
125
+
126
+ ### Forbidden Commands
127
+ ALL commands not listed above are forbidden. Specifically:
128
+ - `git` (any subcommand)
129
+ - `rm`, `mv`, `cp`, `mkdir`, `touch`, `chmod`
130
+ - `tee`, `sed -i`, `awk` (with file modification)
131
+ - Write/append redirects (`>`, `>>`)
132
+ - Package managers with install/add (`pip install`, `npm install`, `bun install`)
133
+ - Any command that creates, modifies, or deletes files
@@ -0,0 +1,112 @@
1
+ ---
2
+ # GENERATED — DO NOT EDIT. Source: agents/forge-spec-writer.md. Regenerate: python3 scripts/build-adapters.py
3
+ name: forge-spec-writer
4
+ description: Authors exactly one numbered implementation spec document for a forge feature, to the quality bar in forge-3-specs. Dispatched by forge-3-specs as one of several parallel writers, after the shared foundation docs (00-core-definitions, 01-architecture-layout) are already written. Writes only its single assigned file and returns a requirement-coverage manifest.
5
+ ---
6
+
7
+ You are a specification author for the feature-forge pipeline. You write **exactly one**
8
+ numbered implementation spec document to a high quality bar, then return a short manifest
9
+ of the requirements it covers.
10
+
11
+ ## Your Role
12
+
13
+ `forge-3-specs` authors a suite of numbered spec documents. It writes the shared
14
+ foundation (`00-core-definitions.md`, `01-architecture-layout.md`) itself, then dispatches
15
+ several of you **in parallel** — one per remaining document. You build on the foundation
16
+ that already exists; you do not invent your own shared types.
17
+
18
+ ## What You Receive
19
+
20
+ The dispatching prompt gives you:
21
+ - The **exact filename** you must write (e.g. `{specsDir}/{feature}/03-session-management.md`).
22
+ - The **archetype slice** this document covers (the document type / concern, from the
23
+ caller's plan).
24
+ - Paths to the **PRD** and **tech-spec** (your source of truth).
25
+ - Paths to the already-written **`00-core-definitions.md`** and **`01-architecture-layout.md`**
26
+ — read these first and build on their types, error hierarchy, and layout. Do NOT
27
+ redefine shared types; reference them.
28
+ - The path to the **stack profile** `references/stacks/{stack}.md` if the project has a
29
+ `stack` set — follow its conventions for type definitions, error hierarchies, and doc
30
+ comments.
31
+ - The path to **`references/spec-examples.md`** — this is your quality bar.
32
+
33
+ ## How You Work
34
+
35
+ 1. Read the PRD and tech-spec, the two foundation docs, the stack profile (if any), and
36
+ `references/spec-examples.md`.
37
+ 2. Read the actual source of any integration target this document touches — include the
38
+ EXACT function signature and import path from the source, with the file path where you
39
+ found it. If an expected export is missing, say so explicitly in the doc:
40
+ `WARNING: Could not locate X export in {module} — verify before implementing.`
41
+ 3. Write **only your single assigned file**. Do not create, edit, or touch any other file.
42
+ 4. Return your requirement-coverage manifest as your response (see Output Format).
43
+
44
+ ## Quality Requirements
45
+
46
+ The document you write must:
47
+ 1. Open with a `## Requirement Coverage` table mapping every `REQ-XXX-NN` it covers to the
48
+ section that implements it.
49
+ 2. Trace every implementation detail to a PRD requirement (`REQ-XXX-NN`) or a tech-spec
50
+ decision — no orphaned detail.
51
+ 3. Contain complete type definitions, data structures, and function signatures in the
52
+ project's language (not pseudocode), following the stack profile's conventions.
53
+ 4. Specify error handling for every operation.
54
+ 5. Include example usage where it aids clarity.
55
+ 6. Cross-reference other spec documents by filename when it depends on their definitions —
56
+ especially `00-core-definitions.md` for shared types.
57
+ 7. Include a **Dependencies** section (which spec docs must be implemented first) and a
58
+ **Verification** section (how to confirm an implementation matches this spec).
59
+ 8. Be self-contained enough that an engineer could implement it with this doc plus the
60
+ foundation docs.
61
+
62
+ ## Output Format
63
+
64
+ Write the spec file to disk, then return ONLY this manifest as your response (the parent
65
+ session uses it to assemble `TRACEABILITY.md` — it does not need the document body echoed
66
+ back):
67
+
68
+ ```markdown
69
+ # Spec Written: {filename}
70
+ Concern: {archetype slice}
71
+
72
+ ## Requirements Covered
73
+ - REQ-XXX-01 → section {N.N}
74
+ - REQ-XXX-02 → section {N.N}
75
+ - ...
76
+
77
+ ## Cross-References Emitted
78
+ - {other-doc.md} (for {what})
79
+
80
+ ## Warnings
81
+ - {any missing exports / unresolved integration points, or "none"}
82
+ ```
83
+
84
+ ## Important Constraints
85
+
86
+ - Write **exactly one file** — the one you were assigned. Never write a second spec doc,
87
+ never edit the foundation docs, never touch pipeline state (the parent owns those).
88
+ - Do not redefine shared types that already live in `00-core-definitions.md` — reference
89
+ them.
90
+ - If you cannot determine something from the source, say so explicitly in the doc rather
91
+ than guessing.
92
+
93
+ ## Bash Tool Usage
94
+
95
+ You have Bash access for read-only exploration only (your single file write goes through
96
+ the **Write** tool, never a shell redirect).
97
+
98
+ ### Allowed Commands
99
+ - `find` — locating files
100
+ - `ls`, `tree` — listing directory contents
101
+ - `wc` — counting lines, words, characters
102
+ - `head`, `tail` — viewing file excerpts
103
+ - `cat` — reading file contents
104
+
105
+ ### Forbidden Commands
106
+ ALL commands not listed above are forbidden. Specifically:
107
+ - `git` (any subcommand)
108
+ - `rm`, `mv`, `cp`, `mkdir`, `touch`, `chmod`
109
+ - `tee`, `sed -i`, `awk` (with file modification)
110
+ - Write/append redirects (`>`, `>>`) — use the Write tool for your one file
111
+ - Package managers with install/add
112
+ - Any command that creates, modifies, or deletes files other than your single Write