@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,219 @@
1
+ ---
2
+ # GENERATED — DO NOT EDIT. Source: skills/forge-verify/SKILL.md. Regenerate: python3 scripts/build-adapters.py
3
+ name: forge-verify
4
+ description: Verify forge pipeline artifacts for completeness, consistency, and quality. Use when user runs /feature-forge:forge-verify or asks to check forge specs, backlog, or implementation for gaps. Do NOT trigger for general code review, quality checks, or verification tasks outside the forge pipeline.
5
+ argument-hint: '<feature-name> [stage: prd|tech|specs|backlog|impl]'
6
+ ---
7
+
8
+ # forge-verify — Verification Gate
9
+
10
+ Analyze feature artifacts for completeness, consistency, and quality. Produce structured, actionable findings designed for a fresh-context agent to apply.
11
+
12
+ ## Subagent Delegation
13
+
14
+ This skill is delegated to the `forge-verifier` subagent via the Agent tool. The verifier subagent has:
15
+ - **Read-only tools** (Read, Glob, Grep, Bash) — it cannot accidentally modify specs
16
+ - **Persistent memory** — it accumulates knowledge about this project's recurring issues and patterns across sessions
17
+ - **The forge-verify skill pre-loaded** — so it has all verification checklists and guidance at startup
18
+
19
+ ### Choose single vs. parallel dispatch
20
+
21
+ Pick based on how many checks the mode carries (see the per-mode totals in Step 3):
22
+
23
+ - **Small modes (prd ~15, tech ~15): single verifier.** Use the Agent tool once with
24
+ `subagent_type="forge-verifier"`, passing the feature name and mode. It runs all
25
+ checks and returns findings.
26
+ - **Large modes (specs ~38, backlog ~25, impl ~20): parallel dimensioned fan-out.**
27
+ Split the mode's checklist into **dimension groups** and dispatch **one
28
+ `forge-verifier` per group, in parallel — a single message with multiple Agent
29
+ calls** (the `superpowers:dispatching-parallel-agents` pattern). Each instance owns a
30
+ disjoint slice of CHECK-IDs, so it verifies deeper over a narrower scope and they all
31
+ run concurrently. Suggested groups (map to the category clusters in
32
+ `references/verification-checklists.md`):
33
+ - **specs:** (1) types/contracts, (2) architecture/layout, (3) cross-reference &
34
+ traceability, (4) testing strategy, (5) integration.
35
+ - **backlog:** (1) item scoping & acceptance criteria, (2) dependency/ordering sanity,
36
+ (3) spec coverage & traceability, (4) schema/enum correctness.
37
+ - **impl:** (1) requirement coverage vs specs, (2) integration correctness,
38
+ (3) testing, (4) code-quality/conventions.
39
+
40
+ In each parallel instance's prompt, pass: the feature, the mode, the **dimension
41
+ label**, the **exact CHECK-IDs it owns**, and a note that **it is one of several
42
+ parallel instances** — it must verify ONLY its assigned checks and return findings
43
+ for that slice. Tell parallel instances to treat their `MEMORY.md` as **read-only**
44
+ (apply learned patterns, but do NOT write it — concurrent writers would race);
45
+ memory consolidation is left to single-verifier runs.
46
+
47
+ ### Synthesize (parent session)
48
+
49
+ The verifier(s) are read-only — they return findings as their response; **you** (the
50
+ parent) assemble and write the single document to
51
+ `{specsDir}/{feature}/.verification/VERIFY-{mode}-{YYYY-MM-DD}.md`. When you fanned out:
52
+ 1. Concatenate all instances' findings and **renumber `V-NNN` IDs uniquely** across the
53
+ merged set.
54
+ 2. **Dedup** overlaps — when two instances flag the same file+location+issue (e.g. a
55
+ cross-reference and a type-contract verifier both catch one mismatch), keep one,
56
+ union their `Checklist:` IDs.
57
+ 3. Build the **single Fix Execution Plan** over the merged findings (Step 5). The output
58
+ document format is unchanged, so `forge-fix` consumes it identically.
59
+
60
+ ### Adversarial confirmation (opt-in "deep verify")
61
+
62
+ When the user asks for a deep/thorough verify, add a confirmation pass before writing:
63
+ for each `error`- and `gap`-severity finding, dispatch a short skeptic `forge-verifier`
64
+ prompted to **refute** it ("here is a claimed finding; prove it wrong; default to
65
+ REFUTED if you cannot confirm it from the artifacts"). Drop findings the skeptic refutes
66
+ with confidence — this cuts false positives before they reach the user. Lower-severity
67
+ findings (`improvement`, `inconsistency`) skip this pass.
68
+
69
+ ### Fallback
70
+
71
+ If the `forge-verifier` subagent is not available (not installed, or an environment
72
+ without subagents), fall back to running verification inline in the current session.
73
+
74
+ **Inline execution guidance:** If running inline (not as subagent), process verification checklists one category at a time to manage context pressure. Load only the artifacts needed for each category, verify, summarize findings, then move to the next category.
75
+
76
+ ## Prerequisites
77
+
78
+ Read and follow `references/shared-conventions.md` for feature name validation, configuration reading, and force mode handling before proceeding.
79
+
80
+ **Turn structure reminder:** Output analysis/context as text, then route ALL questions through `AskUserQuestion`. Never embed questions in text output — the user will not be prompted and the session will stall.
81
+
82
+ ## Step 1: Read Configuration and Determine Mode
83
+
84
+ Read `{specsDir}/{feature}/.pipeline-state.json` to understand current pipeline state.
85
+
86
+ ### Mode Selection
87
+
88
+ If a stage is specified as a second argument (e.g., `/feature-forge:forge-verify auth specs`), use that mode. Otherwise, auto-detect based on pipeline state:
89
+
90
+ - **epic mode**: Explicit via `/feature-forge:forge-verify {epic} epic`, or auto-detected when the named argument resolves to an **epic directory** — i.e. `{specsDir}/{name}/epic-manifest.json` exists (an epic root holds `epic-manifest.json` but no `.pipeline-state.json` of its own). When the argument is an epic, prefer epic mode over feature-mode resolution.
91
+ - **prd mode**: If `forge-1-prd` is complete but `forge-verify-prd` is not `passed` or `findings-applied`
92
+ - **tech mode**: If `forge-2-tech` is complete but `forge-verify-tech` is not `passed` or `findings-applied`
93
+ - **specs mode**: If `forge-3-specs` is complete but `forge-verify-specs` is not `passed` or `findings-applied`
94
+ - **backlog mode**: If `forge-4-backlog` is complete but `forge-verify-backlog` is not `passed` or `findings-applied`
95
+ - **impl mode**: If user explicitly requests or if implementation code exists for this feature
96
+
97
+ If ambiguous, use `AskUserQuestion` to ask which stage to verify.
98
+
99
+ ## Step 2: Load All Relevant Artifacts
100
+
101
+ Load into context ALL artifacts for this feature based on mode:
102
+
103
+ **For prd mode:**
104
+ - `{specsDir}/{feature}/PRD.md`
105
+
106
+ **For tech mode:**
107
+ - `{specsDir}/{feature}/PRD.md`
108
+ - `{specsDir}/{feature}/tech-spec.md`
109
+
110
+ **For specs mode:**
111
+ - `{specsDir}/{feature}/PRD.md`
112
+ - `{specsDir}/{feature}/tech-spec.md`
113
+ - `{specsDir}/{feature}/##-*.md` (all implementation specs)
114
+
115
+ **For backlog mode:**
116
+ - All of the above, PLUS
117
+ - `{resolvedFeatureDir}/backlog.json` (or `{backlogDir}/{feature}/backlog.json` if `backlogDir` is configured) — resolve `{resolvedFeatureDir}` via the **Feature Directory Resolution** block in `references/shared-conventions.md`, using the same composed path as forge-4-backlog and forge-5-loop (04 §6.2)
118
+
119
+ **For impl mode:**
120
+ - All of the above, PLUS
121
+ - The actual source code for this feature (read package directory)
122
+ - Source code of packages this feature integrates with
123
+
124
+ **For epic mode:**
125
+ - `{specsDir}/{epic}/epic-manifest.json`
126
+ - `{specsDir}/{epic}/EPIC.md`
127
+ - each member feature's `.pipeline-state.json` (for the `epic` back-pointer + derived status)
128
+ - each **completed** member's `PRD.md` + `tech-spec.md` (for contract-drift checking, CHECK-E06)
129
+
130
+ ## Step 3: Run Verification Checklists
131
+
132
+ Read `references/verification-checklists.md` for the detailed checklists per mode. Execute every check. Do not skip checks because things "look fine." That same reference also holds the relocated **Findings Document Template (Step 4)**, the worked **Example Findings (Step 4)**, and the **Epic Mode State Write Detail (Step 6)** sections used later in this skill.
133
+
134
+ Each check in `verification-checklists.md` has a unique ID (CHECK-P01, CHECK-T01, CHECK-S01, CHECK-B01, etc.). As you execute each check, record its ID and result (pass/fail/not-applicable). After completing all checks, report the total: "Executed N of M checks. Results: X pass, Y fail, Z not-applicable." If your count is significantly below the expected total for the mode (prd: ~15 checks, tech: ~15 checks, specs: ~38 checks, backlog: ~25 checks, impl: ~20 checks, epic: ~8 checks), you likely skipped checks — go back and complete them.
135
+
136
+ **Epic mode dispatch.** Epic mode is a small (~8-check) checklist, so per the single-vs-parallel rule above, dispatch a **single `forge-verifier`** via the Agent tool, passing the epic name and `mode=epic`. The verifier runs CHECK-E01..E08 from the `## Epic Mode Checklist` in `references/verification-checklists.md` (E01/E02/E03/E08 are delegated to `epic-manifest.py validate`/`check-name`; E04–E07 are verifier judgment) and returns its findings.
137
+
138
+ ### Important: Be Specific, Not General
139
+
140
+ BAD finding: "The error handling could be more thorough."
141
+ GOOD finding: "PRD.md REQ-ERR-04 requires rate limit retry behavior, but spec 03-provider-registry.md only handles rate limits by throwing — no retry logic is specified."
142
+
143
+ Every finding must include:
144
+ 1. A unique ID (V-001, V-002, etc.)
145
+ 2. Severity: `gap` (missing requirement coverage), `inconsistency` (contradictory specs), `improvement` (not wrong but could be better), `error` (factually incorrect)
146
+ 3. Exact location (file + section)
147
+ 4. What's wrong
148
+ 5. Suggested fix (specific enough that a fresh agent can apply it)
149
+ 6. References (which other files/sections are involved)
150
+ 7. Related checklist item(s) (e.g., CHECK-P01, CHECK-S12)
151
+
152
+ ## Step 4: Write Findings Document
153
+
154
+ Ensure the `.verification/` subdirectory exists, then write findings to `{specsDir}/{feature}/.verification/VERIFY-{mode}-{YYYY-MM-DD}.md`.
155
+
156
+ **For epic mode**, the target is `{specsDir}/{epic}/.verification/VERIFY-epic-{YYYY-MM-DD}.md` (the same format, with `{mode}=epic`).
157
+
158
+ The full findings-document template (report header, `V-NNN` finding shape, and the
159
+ Fix Execution Plan layout) and the worked **Example Findings** (gap / inconsistency /
160
+ improvement) live in `references/verification-checklists.md` under the **Findings
161
+ Document Template (Step 4)** and **Example Findings (Step 4)** sections — follow that
162
+ template verbatim when writing the document.
163
+
164
+ ## Step 5: Fix Plan and Next Steps
165
+
166
+ The Fix Execution Plan (written as part of the findings document in Step 4) is ALWAYS generated regardless of mode. This ensures the findings document is self-contained: diagnosis + action plan in one artifact.
167
+
168
+ When building the Fix Execution Plan:
169
+ 1. Group related findings into logical steps (e.g., all type-system fixes together)
170
+ 2. Order steps to avoid conflicts (fix shared types before documents that reference them)
171
+ 3. Each step must be specific enough for a fresh agent with zero prior context to execute
172
+ 4. Flag any findings that require user decisions before fixes can be applied
173
+
174
+ **If in plan mode:** Also write the Fix Execution Plan to the active plan file so the plan mode workflow is preserved. The user reviews the plan, exits plan mode, and a fresh agent executes the fixes.
175
+
176
+ **If not in plan mode:** Output the following as text:
177
+ "Findings and fix plan written to `{findings-file}`."
178
+
179
+ Then use `AskUserQuestion` to ask: "Would you like to: (a) Review the findings first, (b) Run `/feature-forge:forge-fix {feature}` to apply fixes now, or (c) Enter plan mode and re-run `/feature-forge:forge-verify {feature}` for plan-mode workflow?" Do NOT embed this question in your text output.
180
+
181
+ ## Step 6: Update Pipeline State
182
+
183
+ Write pipeline state conforming to `references/pipeline-state-schema.json`.
184
+
185
+ Update `{specsDir}/{feature}/.pipeline-state.json`:
186
+ - Set the relevant verify entry status to `findings-reported`
187
+ - Record `findingsFile`, `findingsCount`, `verifiedAt`
188
+
189
+ Do NOT mark as `findings-applied` — that happens after the fix pass.
190
+
191
+ ### Epic mode state (`.epic-state.json`)
192
+
193
+ Epic mode is **epic-scoped**, not per-feature: record its result into the epic-level
194
+ state file `{specsDir}/{epic}/.epic-state.json` — **never** into any member's
195
+ `.pipeline-state.json`. Set `stages.forge-verify-epic.status` to `findings-reported`
196
+ (or `passed` if zero findings), recording `findingsFile`, `findingsCount`, and
197
+ `verifiedAt`. The full `.epic-state.json` schema (minimal shape) and the atomic
198
+ temp-file + `os.replace()` **write-mechanism** detail (lazy-create, merge/replace,
199
+ fail-intact) — including the worked Python snippet — live in
200
+ `references/verification-checklists.md` under the **Epic Mode State Write Detail
201
+ (Step 6)** section. Follow it verbatim.
202
+
203
+ Do NOT mark as `findings-applied` — that happens after the fix pass.
204
+
205
+ ## Gotchas
206
+
207
+ - This skill should be run in plan mode for best results. The plan gives the user a chance to review before committing to changes.
208
+ - Verification is most valuable when it finds things that are MISSING, not just things that are present but imperfect. Prioritize gap detection over style preferences.
209
+ - Don't verify things that are intentionally left open (check the PRD's "Open Questions" section).
210
+ - If you find zero issues, say so honestly. Don't manufacture findings to seem thorough. But zero findings on a complex feature is suspicious — double-check.
211
+ - The findings document must be self-contained. A fresh agent reading it should be able to apply every fix without needing conversational context from this session.
212
+ - For backlog verification, also run the loop runner's validate command (resolve `loopRunner` from `forge.config.json`, default rauf: `rauf backlog validate . --backlog {backlogDir} --specs-dir {specsDir}/{feature} --json`). Include any findings it reports (exit 1) as verification findings; if the runner isn't installed yet (command missing), note that backlog validation was skipped rather than failing.
213
+ - For specs verification, also run the deterministic traceability validator to supplement agent-driven traceability checks. Include any uncovered requirements or orphaned references as findings:
214
+
215
+ ```bash
216
+ 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)"
217
+ [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
218
+ python3 "$R/scripts/validate-traceability.py" {specsDir}/{feature}/PRD.md {specsDir}/{feature}/ --json
219
+ ```
@@ -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
+ ```