@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.
- package/LICENSE +21 -0
- package/adapters/GENERATION-REPORT.md +128 -0
- package/adapters/claude/agents/forge-researcher.md +137 -0
- package/adapters/claude/agents/forge-spec-writer.md +115 -0
- package/adapters/claude/agents/forge-verifier.md +121 -0
- package/adapters/claude/references/epic-manifest-schema.json +120 -0
- package/adapters/claude/references/forge-config-schema.json +166 -0
- package/adapters/claude/references/pipeline-state-schema.json +110 -0
- package/adapters/claude/references/portable-root.md +56 -0
- package/adapters/claude/references/process-overview.md +123 -0
- package/adapters/claude/references/ralph-loop-contract.md +221 -0
- package/adapters/claude/references/shared-conventions.md +144 -0
- package/adapters/claude/references/skill-frontmatter.schema.json +17 -0
- package/adapters/claude/references/stack-resolution.md +51 -0
- package/adapters/claude/references/stacks/_generic.md +90 -0
- package/adapters/claude/references/stacks/go.md +138 -0
- package/adapters/claude/references/stacks/python.md +163 -0
- package/adapters/claude/references/stacks/rust.md +151 -0
- package/adapters/claude/references/stacks/typescript.md +111 -0
- package/adapters/claude/references/vendor-construct-inventory.md +49 -0
- package/adapters/claude/scripts/forge-root.sh +50 -0
- package/adapters/claude/skills/forge/SKILL.md +165 -0
- package/adapters/claude/skills/forge-0-epic/SKILL.md +303 -0
- package/adapters/claude/skills/forge-0-epic/references/edit-mode.md +222 -0
- package/adapters/claude/skills/forge-0-epic/references/epic-manifest-subcommands.md +64 -0
- package/adapters/claude/skills/forge-1-prd/SKILL.md +121 -0
- package/adapters/claude/skills/forge-1-prd/references/prd-template.md +106 -0
- package/adapters/claude/skills/forge-2-tech/SKILL.md +198 -0
- package/adapters/claude/skills/forge-2-tech/references/stack-discovery-checklist.md +95 -0
- package/adapters/claude/skills/forge-3-specs/SKILL.md +154 -0
- package/adapters/claude/skills/forge-3-specs/references/spec-archetypes.md +106 -0
- package/adapters/claude/skills/forge-3-specs/references/spec-examples.md +71 -0
- package/adapters/claude/skills/forge-4-backlog/SKILL.md +146 -0
- package/adapters/claude/skills/forge-5-loop/SKILL.md +303 -0
- package/adapters/claude/skills/forge-5-loop/references/result-reporting.md +63 -0
- package/adapters/claude/skills/forge-5-loop/references/runner-contract.md +214 -0
- package/adapters/claude/skills/forge-6-docs/SKILL.md +179 -0
- package/adapters/claude/skills/forge-6-docs/references/doc-conventions.md +126 -0
- package/adapters/claude/skills/forge-fix/SKILL.md +65 -0
- package/adapters/claude/skills/forge-init/SKILL.md +29 -0
- package/adapters/claude/skills/forge-verify/SKILL.md +219 -0
- package/adapters/claude/skills/forge-verify/references/verification-checklists.md +379 -0
- package/adapters/codex/agents/forge-researcher.md +133 -0
- package/adapters/codex/agents/forge-spec-writer.md +112 -0
- package/adapters/codex/agents/forge-verifier.md +115 -0
- package/adapters/codex/agents/openai.yaml +10 -0
- package/adapters/codex/references/epic-manifest-schema.json +120 -0
- package/adapters/codex/references/forge-config-schema.json +166 -0
- package/adapters/codex/references/pipeline-state-schema.json +110 -0
- package/adapters/codex/references/portable-root.md +56 -0
- package/adapters/codex/references/process-overview.md +123 -0
- package/adapters/codex/references/ralph-loop-contract.md +221 -0
- package/adapters/codex/references/shared-conventions.md +144 -0
- package/adapters/codex/references/skill-frontmatter.schema.json +17 -0
- package/adapters/codex/references/stack-resolution.md +51 -0
- package/adapters/codex/references/stacks/_generic.md +90 -0
- package/adapters/codex/references/stacks/go.md +138 -0
- package/adapters/codex/references/stacks/python.md +163 -0
- package/adapters/codex/references/stacks/rust.md +151 -0
- package/adapters/codex/references/stacks/typescript.md +111 -0
- package/adapters/codex/references/vendor-construct-inventory.md +49 -0
- package/adapters/codex/scripts/forge-root.sh +50 -0
- package/adapters/codex/skills/forge/forge.md +164 -0
- package/adapters/codex/skills/forge-0-epic/forge-0-epic.md +302 -0
- package/adapters/codex/skills/forge-0-epic/references/edit-mode.md +222 -0
- package/adapters/codex/skills/forge-0-epic/references/epic-manifest-subcommands.md +64 -0
- package/adapters/codex/skills/forge-1-prd/forge-1-prd.md +120 -0
- package/adapters/codex/skills/forge-1-prd/references/prd-template.md +106 -0
- package/adapters/codex/skills/forge-2-tech/forge-2-tech.md +197 -0
- package/adapters/codex/skills/forge-2-tech/references/stack-discovery-checklist.md +95 -0
- package/adapters/codex/skills/forge-3-specs/forge-3-specs.md +153 -0
- package/adapters/codex/skills/forge-3-specs/references/spec-archetypes.md +106 -0
- package/adapters/codex/skills/forge-3-specs/references/spec-examples.md +71 -0
- package/adapters/codex/skills/forge-4-backlog/forge-4-backlog.md +145 -0
- package/adapters/codex/skills/forge-5-loop/forge-5-loop.md +302 -0
- package/adapters/codex/skills/forge-5-loop/references/result-reporting.md +63 -0
- package/adapters/codex/skills/forge-5-loop/references/runner-contract.md +214 -0
- package/adapters/codex/skills/forge-6-docs/forge-6-docs.md +178 -0
- package/adapters/codex/skills/forge-6-docs/references/doc-conventions.md +126 -0
- package/adapters/codex/skills/forge-fix/forge-fix.md +64 -0
- package/adapters/codex/skills/forge-init/forge-init.md +29 -0
- package/adapters/codex/skills/forge-verify/forge-verify.md +218 -0
- package/adapters/codex/skills/forge-verify/references/verification-checklists.md +379 -0
- package/adapters/copilot/agents/forge-researcher.md +133 -0
- package/adapters/copilot/agents/forge-spec-writer.md +112 -0
- package/adapters/copilot/agents/forge-verifier.md +115 -0
- package/adapters/copilot/references/epic-manifest-schema.json +120 -0
- package/adapters/copilot/references/forge-config-schema.json +166 -0
- package/adapters/copilot/references/pipeline-state-schema.json +110 -0
- package/adapters/copilot/references/portable-root.md +56 -0
- package/adapters/copilot/references/process-overview.md +123 -0
- package/adapters/copilot/references/ralph-loop-contract.md +221 -0
- package/adapters/copilot/references/shared-conventions.md +144 -0
- package/adapters/copilot/references/skill-frontmatter.schema.json +17 -0
- package/adapters/copilot/references/stack-resolution.md +51 -0
- package/adapters/copilot/references/stacks/_generic.md +90 -0
- package/adapters/copilot/references/stacks/go.md +138 -0
- package/adapters/copilot/references/stacks/python.md +163 -0
- package/adapters/copilot/references/stacks/rust.md +151 -0
- package/adapters/copilot/references/stacks/typescript.md +111 -0
- package/adapters/copilot/references/vendor-construct-inventory.md +49 -0
- package/adapters/copilot/scripts/forge-root.sh +50 -0
- package/adapters/copilot/skills/forge/forge.md +164 -0
- package/adapters/copilot/skills/forge-0-epic/forge-0-epic.md +302 -0
- package/adapters/copilot/skills/forge-0-epic/references/edit-mode.md +222 -0
- package/adapters/copilot/skills/forge-0-epic/references/epic-manifest-subcommands.md +64 -0
- package/adapters/copilot/skills/forge-1-prd/forge-1-prd.md +120 -0
- package/adapters/copilot/skills/forge-1-prd/references/prd-template.md +106 -0
- package/adapters/copilot/skills/forge-2-tech/forge-2-tech.md +197 -0
- package/adapters/copilot/skills/forge-2-tech/references/stack-discovery-checklist.md +95 -0
- package/adapters/copilot/skills/forge-3-specs/forge-3-specs.md +153 -0
- package/adapters/copilot/skills/forge-3-specs/references/spec-archetypes.md +106 -0
- package/adapters/copilot/skills/forge-3-specs/references/spec-examples.md +71 -0
- package/adapters/copilot/skills/forge-4-backlog/forge-4-backlog.md +145 -0
- package/adapters/copilot/skills/forge-5-loop/forge-5-loop.md +302 -0
- package/adapters/copilot/skills/forge-5-loop/references/result-reporting.md +63 -0
- package/adapters/copilot/skills/forge-5-loop/references/runner-contract.md +214 -0
- package/adapters/copilot/skills/forge-6-docs/forge-6-docs.md +178 -0
- package/adapters/copilot/skills/forge-6-docs/references/doc-conventions.md +126 -0
- package/adapters/copilot/skills/forge-fix/forge-fix.md +64 -0
- package/adapters/copilot/skills/forge-init/forge-init.md +29 -0
- package/adapters/copilot/skills/forge-verify/forge-verify.md +218 -0
- package/adapters/copilot/skills/forge-verify/references/verification-checklists.md +379 -0
- package/adapters/cursor/agents/forge-researcher.mdc +134 -0
- package/adapters/cursor/agents/forge-spec-writer.mdc +113 -0
- package/adapters/cursor/agents/forge-verifier.mdc +116 -0
- package/adapters/cursor/references/epic-manifest-schema.json +120 -0
- package/adapters/cursor/references/forge-config-schema.json +166 -0
- package/adapters/cursor/references/pipeline-state-schema.json +110 -0
- package/adapters/cursor/references/portable-root.md +56 -0
- package/adapters/cursor/references/process-overview.md +123 -0
- package/adapters/cursor/references/ralph-loop-contract.md +221 -0
- package/adapters/cursor/references/shared-conventions.md +144 -0
- package/adapters/cursor/references/skill-frontmatter.schema.json +17 -0
- package/adapters/cursor/references/stack-resolution.md +51 -0
- package/adapters/cursor/references/stacks/_generic.md +90 -0
- package/adapters/cursor/references/stacks/go.md +138 -0
- package/adapters/cursor/references/stacks/python.md +163 -0
- package/adapters/cursor/references/stacks/rust.md +151 -0
- package/adapters/cursor/references/stacks/typescript.md +111 -0
- package/adapters/cursor/references/vendor-construct-inventory.md +49 -0
- package/adapters/cursor/scripts/forge-root.sh +50 -0
- package/adapters/cursor/skills/forge/forge.mdc +165 -0
- package/adapters/cursor/skills/forge-0-epic/forge-0-epic.mdc +303 -0
- package/adapters/cursor/skills/forge-0-epic/references/edit-mode.md +222 -0
- package/adapters/cursor/skills/forge-0-epic/references/epic-manifest-subcommands.md +64 -0
- package/adapters/cursor/skills/forge-1-prd/forge-1-prd.mdc +121 -0
- package/adapters/cursor/skills/forge-1-prd/references/prd-template.md +106 -0
- package/adapters/cursor/skills/forge-2-tech/forge-2-tech.mdc +198 -0
- package/adapters/cursor/skills/forge-2-tech/references/stack-discovery-checklist.md +95 -0
- package/adapters/cursor/skills/forge-3-specs/forge-3-specs.mdc +154 -0
- package/adapters/cursor/skills/forge-3-specs/references/spec-archetypes.md +106 -0
- package/adapters/cursor/skills/forge-3-specs/references/spec-examples.md +71 -0
- package/adapters/cursor/skills/forge-4-backlog/forge-4-backlog.mdc +146 -0
- package/adapters/cursor/skills/forge-5-loop/forge-5-loop.mdc +303 -0
- package/adapters/cursor/skills/forge-5-loop/references/result-reporting.md +63 -0
- package/adapters/cursor/skills/forge-5-loop/references/runner-contract.md +214 -0
- package/adapters/cursor/skills/forge-6-docs/forge-6-docs.mdc +179 -0
- package/adapters/cursor/skills/forge-6-docs/references/doc-conventions.md +126 -0
- package/adapters/cursor/skills/forge-fix/forge-fix.mdc +65 -0
- package/adapters/cursor/skills/forge-init/forge-init.mdc +30 -0
- package/adapters/cursor/skills/forge-verify/forge-verify.mdc +219 -0
- package/adapters/cursor/skills/forge-verify/references/verification-checklists.md +379 -0
- package/adapters/gemini/agents/forge-researcher.md +133 -0
- package/adapters/gemini/agents/forge-spec-writer.md +112 -0
- package/adapters/gemini/agents/forge-verifier.md +115 -0
- package/adapters/gemini/gemini-extension.json +54 -0
- package/adapters/gemini/references/epic-manifest-schema.json +120 -0
- package/adapters/gemini/references/forge-config-schema.json +166 -0
- package/adapters/gemini/references/pipeline-state-schema.json +110 -0
- package/adapters/gemini/references/portable-root.md +56 -0
- package/adapters/gemini/references/process-overview.md +123 -0
- package/adapters/gemini/references/ralph-loop-contract.md +221 -0
- package/adapters/gemini/references/shared-conventions.md +144 -0
- package/adapters/gemini/references/skill-frontmatter.schema.json +17 -0
- package/adapters/gemini/references/stack-resolution.md +51 -0
- package/adapters/gemini/references/stacks/_generic.md +90 -0
- package/adapters/gemini/references/stacks/go.md +138 -0
- package/adapters/gemini/references/stacks/python.md +163 -0
- package/adapters/gemini/references/stacks/rust.md +151 -0
- package/adapters/gemini/references/stacks/typescript.md +111 -0
- package/adapters/gemini/references/vendor-construct-inventory.md +49 -0
- package/adapters/gemini/scripts/forge-root.sh +50 -0
- package/adapters/gemini/skills/forge/forge.md +164 -0
- package/adapters/gemini/skills/forge-0-epic/forge-0-epic.md +302 -0
- package/adapters/gemini/skills/forge-0-epic/references/edit-mode.md +222 -0
- package/adapters/gemini/skills/forge-0-epic/references/epic-manifest-subcommands.md +64 -0
- package/adapters/gemini/skills/forge-1-prd/forge-1-prd.md +120 -0
- package/adapters/gemini/skills/forge-1-prd/references/prd-template.md +106 -0
- package/adapters/gemini/skills/forge-2-tech/forge-2-tech.md +197 -0
- package/adapters/gemini/skills/forge-2-tech/references/stack-discovery-checklist.md +95 -0
- package/adapters/gemini/skills/forge-3-specs/forge-3-specs.md +153 -0
- package/adapters/gemini/skills/forge-3-specs/references/spec-archetypes.md +106 -0
- package/adapters/gemini/skills/forge-3-specs/references/spec-examples.md +71 -0
- package/adapters/gemini/skills/forge-4-backlog/forge-4-backlog.md +145 -0
- package/adapters/gemini/skills/forge-5-loop/forge-5-loop.md +302 -0
- package/adapters/gemini/skills/forge-5-loop/references/result-reporting.md +63 -0
- package/adapters/gemini/skills/forge-5-loop/references/runner-contract.md +214 -0
- package/adapters/gemini/skills/forge-6-docs/forge-6-docs.md +178 -0
- package/adapters/gemini/skills/forge-6-docs/references/doc-conventions.md +126 -0
- package/adapters/gemini/skills/forge-fix/forge-fix.md +64 -0
- package/adapters/gemini/skills/forge-init/forge-init.md +29 -0
- package/adapters/gemini/skills/forge-verify/forge-verify.md +218 -0
- package/adapters/gemini/skills/forge-verify/references/verification-checklists.md +379 -0
- package/dist/agent-targets.d.ts +70 -0
- package/dist/agent-targets.js +111 -0
- package/dist/apply.d.ts +49 -0
- package/dist/apply.js +246 -0
- package/dist/cli.d.ts +94 -0
- package/dist/cli.js +508 -0
- package/dist/detect.d.ts +45 -0
- package/dist/detect.js +72 -0
- package/dist/fsutil.d.ts +56 -0
- package/dist/fsutil.js +175 -0
- package/dist/hash.d.ts +50 -0
- package/dist/hash.js +107 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +9 -0
- package/dist/manifest.d.ts +72 -0
- package/dist/manifest.js +222 -0
- package/dist/plan.d.ts +66 -0
- package/dist/plan.js +166 -0
- package/dist/rauf.d.ts +83 -0
- package/dist/rauf.js +118 -0
- package/dist/report.d.ts +35 -0
- package/dist/report.js +110 -0
- package/dist/source.d.ts +69 -0
- package/dist/source.js +164 -0
- package/dist/types.d.ts +264 -0
- package/dist/types.js +57 -0
- package/package.json +42 -0
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
---
|
|
2
|
+
# GENERATED — DO NOT EDIT. Source: skills/forge-6-docs/SKILL.md. Regenerate: python3 scripts/build-adapters.py
|
|
3
|
+
description: Generate developer-focused architecture documentation for a forge pipeline feature. Use when user runs /feature-forge:forge-6-docs or asks to generate docs after implementation is complete. Do NOT trigger for general documentation writing, README creation, or doc generation outside the forge pipeline.
|
|
4
|
+
globs: []
|
|
5
|
+
alwaysApply: false
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# forge-6-docs — Architecture Documentation Generator
|
|
9
|
+
|
|
10
|
+
Generate developer-focused architecture documentation for a feature, suitable for onboarding, reference, and maintenance.
|
|
11
|
+
|
|
12
|
+
## Prerequisites
|
|
13
|
+
|
|
14
|
+
Read and follow `references/shared-conventions.md` for feature name validation, configuration reading, and force mode handling before proceeding.
|
|
15
|
+
|
|
16
|
+
**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.
|
|
17
|
+
|
|
18
|
+
## Step 1: Read Context
|
|
19
|
+
|
|
20
|
+
Resolve the feature directory via the **Feature Directory Resolution** block in `references/shared-conventions.md` (so a standalone feature resolves to its flat `{specsDir}/{feature}/` path exactly as today, and an epic member resolves to its nested path). Use the resulting `{resolvedFeatureDir}` everywhere this skill previously wrote `{specsDir}/{feature}/`.
|
|
21
|
+
|
|
22
|
+
Read `{resolvedFeatureDir}/.pipeline-state.json` to understand what exists.
|
|
23
|
+
|
|
24
|
+
### Gather Sources
|
|
25
|
+
|
|
26
|
+
Load into context:
|
|
27
|
+
1. **Specs**: PRD.md, tech-spec.md, all implementation specs
|
|
28
|
+
2. **Implementation**: Read the actual source code for this feature's package
|
|
29
|
+
3. **Existing docs**: Check `{docsDir}/` for other features' docs to match conventions
|
|
30
|
+
4. **README**: Check if the feature package has its own README.md
|
|
31
|
+
|
|
32
|
+
### Implementation Completeness Check
|
|
33
|
+
|
|
34
|
+
Check `{resolvedFeatureDir}/backlog.json` (or `{backlogDir}/{feature}/backlog.json` if configured). Count items with status `complete` vs total. If implementation is less than 80% complete, use `AskUserQuestion` to warn: "Implementation is only N% complete. Documentation will be based primarily on specs and may need updates after implementation. Proceed?" If user proceeds, add a `PRE-IMPLEMENTATION` notice at the top of each generated doc.
|
|
35
|
+
|
|
36
|
+
Also check `.pipeline-state.json` for `stages.forge-5-loop`. If it exists and has status `in-progress` (some items incomplete), include this in the warning: "The rauf loop has not fully completed — {done}/{total} items done. Documentation may need updates after remaining items are implemented."
|
|
37
|
+
|
|
38
|
+
### Epic-Level Documentation (epic members only)
|
|
39
|
+
|
|
40
|
+
If the resolved feature has an `epic` back-pointer in its `.pipeline-state.json`, run:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
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)"
|
|
44
|
+
[ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
|
|
45
|
+
python3 "$R/scripts/epic-manifest.py" render-status "{epic}" --specs-dir "{specsDir}" --json
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
If `render-status` fails, skip the epic-level offer and proceed with the per-feature docs only; surface the error per the exit-1/exit-2 split in the **Feature Directory Resolution** block of `references/shared-conventions.md` (exit 1 → parse `{findings[]}` from stdout; exit 2 → surface the plain `Error:` stderr line verbatim).
|
|
49
|
+
|
|
50
|
+
**Only if `rollup.total > 0 AND rollup.complete == rollup.total`** (every member is complete-for-orchestration; the `total > 0` guard excludes an empty epic), use `AskUserQuestion` to offer:
|
|
51
|
+
|
|
52
|
+
"All {total} features in the '{epic}' epic are complete. Generate an **epic-level architecture document** spanning the features, in addition to {feature}'s per-feature docs?"
|
|
53
|
+
|
|
54
|
+
On yes, synthesize a doc at **`{docsDir}/{epic}/`** sourced from: the `EPIC.md` narrative, each member's per-feature docs, and the manifest contracts (each feature's `exposes`/`consumes`). When the epic-level doc is written, the Step 5 commit also stages `{docsDir}/{epic}/`.
|
|
55
|
+
|
|
56
|
+
If not all members are complete (or the feature has no `epic` back-pointer), **do not offer** — the per-feature doc flow proceeds unchanged.
|
|
57
|
+
|
|
58
|
+
Read `references/doc-conventions.md` for documentation standards.
|
|
59
|
+
|
|
60
|
+
## Step 2: Plan Documentation Structure
|
|
61
|
+
|
|
62
|
+
Based on feature complexity and existing doc conventions, propose a doc plan:
|
|
63
|
+
|
|
64
|
+
**Minimum (simple feature):**
|
|
65
|
+
```
|
|
66
|
+
{docsDir}/{feature}/
|
|
67
|
+
├── README.md — Overview, quick start, key concepts
|
|
68
|
+
└── api-reference.md — Exported APIs, types, configuration
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
**Standard (typical feature):**
|
|
72
|
+
```
|
|
73
|
+
{docsDir}/{feature}/
|
|
74
|
+
├── README.md — Overview, quick start, key concepts
|
|
75
|
+
├── architecture.md — Design decisions, data flow, component relationships
|
|
76
|
+
├── api-reference.md — Exported APIs, types, configuration
|
|
77
|
+
└── guides/
|
|
78
|
+
└── integration.md — How to integrate this feature into an app
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
**Comprehensive (complex feature):**
|
|
82
|
+
```
|
|
83
|
+
{docsDir}/{feature}/
|
|
84
|
+
├── README.md — Overview, quick start, key concepts
|
|
85
|
+
├── architecture.md — Design decisions, data flow, component relationships
|
|
86
|
+
├── api-reference.md — Exported APIs, types, configuration
|
|
87
|
+
├── configuration.md — All configuration options with examples
|
|
88
|
+
├── guides/
|
|
89
|
+
│ ├── getting-started.md — Step-by-step setup
|
|
90
|
+
│ ├── integration.md — How to integrate with other packages
|
|
91
|
+
│ └── troubleshooting.md — Common issues and solutions
|
|
92
|
+
└── decisions/
|
|
93
|
+
└── adr-001-*.md — Architecture decision records (if significant decisions were made)
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Present the plan and use `AskUserQuestion` to get the user's confirmation.
|
|
97
|
+
|
|
98
|
+
## Step 3: Write Documentation
|
|
99
|
+
|
|
100
|
+
### Key Principles
|
|
101
|
+
|
|
102
|
+
**Write for the reader, not the writer.**
|
|
103
|
+
- A developer encountering this feature for the first time should be able to understand it from the docs alone
|
|
104
|
+
- Lead with the "what" and "why" before the "how"
|
|
105
|
+
- Include code examples for every exported API
|
|
106
|
+
- Don't assume familiarity with the spec documents
|
|
107
|
+
|
|
108
|
+
**Be accurate to the implementation, not the spec.**
|
|
109
|
+
- If the implementation diverged from the spec, document the implementation
|
|
110
|
+
- Specs are the source of truth for design intent; code is the source of truth for behavior
|
|
111
|
+
- Read the actual source code to verify your documentation is correct
|
|
112
|
+
|
|
113
|
+
**Match existing conventions.**
|
|
114
|
+
- If other features' docs use a specific heading structure, follow it
|
|
115
|
+
- If they include diagrams, include diagrams
|
|
116
|
+
- If they use a specific tone (formal, casual, tutorial-style), match it
|
|
117
|
+
|
|
118
|
+
### README.md Structure
|
|
119
|
+
|
|
120
|
+
```markdown
|
|
121
|
+
# {Feature Name}
|
|
122
|
+
|
|
123
|
+
{One-paragraph description of what this feature does and why it exists.}
|
|
124
|
+
|
|
125
|
+
## Quick Start
|
|
126
|
+
|
|
127
|
+
{Minimal code to get started — import, configure, use.}
|
|
128
|
+
|
|
129
|
+
## Key Concepts
|
|
130
|
+
|
|
131
|
+
{Explain the domain model and core abstractions in plain language.}
|
|
132
|
+
|
|
133
|
+
## Package Exports
|
|
134
|
+
|
|
135
|
+
{Table of subpath exports and what each contains.}
|
|
136
|
+
|
|
137
|
+
| Export / Entry Point | Description |
|
|
138
|
+
|---------------------|-------------|
|
|
139
|
+
| `{module}` | Shared types and utilities |
|
|
140
|
+
| `{module}/server` | Server-side functionality |
|
|
141
|
+
| ... | ... |
|
|
142
|
+
|
|
143
|
+
Adapt export paths to match the project's module/package conventions.
|
|
144
|
+
|
|
145
|
+
## Configuration
|
|
146
|
+
|
|
147
|
+
{Key configuration options with defaults.}
|
|
148
|
+
|
|
149
|
+
## Further Reading
|
|
150
|
+
|
|
151
|
+
- [Architecture](./architecture.md) — Design decisions and data flow
|
|
152
|
+
- [API Reference](./api-reference.md) — Complete API documentation
|
|
153
|
+
- [Integration Guide](./guides/integration.md) — How to use with other packages
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
## Step 4: Review with User
|
|
157
|
+
|
|
158
|
+
Present the docs as text. Then use `AskUserQuestion` to collect feedback — do NOT include these questions in your text output:
|
|
159
|
+
|
|
160
|
+
"1. Does this accurately reflect the implementation? 2. Is the level of detail appropriate for your team? 3. Any areas that need more explanation?"
|
|
161
|
+
|
|
162
|
+
## Step 5: Update Pipeline State and Commit
|
|
163
|
+
|
|
164
|
+
Write pipeline state conforming to `references/pipeline-state-schema.json`.
|
|
165
|
+
|
|
166
|
+
1. Update `{resolvedFeatureDir}/.pipeline-state.json`:
|
|
167
|
+
- Set `currentStage` to `complete`
|
|
168
|
+
- Record `artifacts`
|
|
169
|
+
- Set `stages.forge-6-docs.basedOnVersions` to include versions for all completed upstream stages. Always include forge-1-prd, forge-2-tech, forge-3-specs. Include forge-4-backlog and forge-5-loop ONLY if they have status `complete`.
|
|
170
|
+
2. If `gitCommitAfterStage` is true, follow the Git Commit Protocol in `references/shared-conventions.md`: stage files (`git add {docsDir}/{feature}/ {resolvedFeatureDir}/` — and **also** `{docsDir}/{epic}/` when an epic-level doc was written in Step 1), attempt commit with message `"{commitPrefix}({feature}): complete architecture docs"`, then set `stages.forge-6-docs.status` to `complete` with commit hash only on success. If commit fails, leave status as `in-progress`.
|
|
171
|
+
4. Tell user: "Documentation complete. Feature pipeline for '{feature}' is finished!\n `/feature-forge:forge {feature}` to see the final pipeline status."
|
|
172
|
+
|
|
173
|
+
## Gotchas
|
|
174
|
+
|
|
175
|
+
- Don't just rephrase the specs. Documentation should explain the implemented system, not the planned system. Read the actual code.
|
|
176
|
+
- If the implementation doesn't exist yet (backlog hasn't been run), document based on specs but note prominently that docs are pre-implementation and may need updating.
|
|
177
|
+
- API reference should include actual function signatures from the code, not from the spec (they may differ).
|
|
178
|
+
- Don't generate docs that will immediately be stale. Focus on concepts, architecture, and patterns rather than line-by-line code walkthroughs.
|
|
179
|
+
- Include "When to use" and "When NOT to use" sections — they save developers more time than any other documentation pattern.
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# Documentation Conventions
|
|
2
|
+
|
|
3
|
+
Standards and patterns for feature architecture documentation.
|
|
4
|
+
|
|
5
|
+
## General Rules
|
|
6
|
+
|
|
7
|
+
- Write in present tense ("The auth module validates..." not "The auth module will validate...")
|
|
8
|
+
- Use second person for guides ("You can configure..." not "One can configure...")
|
|
9
|
+
- Include code examples for every exported function, class, or component
|
|
10
|
+
- Code examples must be runnable — no pseudocode, no incomplete snippets
|
|
11
|
+
- Use the project's primary language for all code examples
|
|
12
|
+
|
|
13
|
+
## Heading Structure
|
|
14
|
+
|
|
15
|
+
- H1: Feature name (only in README.md)
|
|
16
|
+
- H2: Major sections
|
|
17
|
+
- H3: Subsections
|
|
18
|
+
- Don't go deeper than H4
|
|
19
|
+
|
|
20
|
+
## Code Examples
|
|
21
|
+
|
|
22
|
+
The following examples use TypeScript. Adapt language and import syntax to your project's stack. The principle — always include imports, show complete runnable examples — applies to all languages.
|
|
23
|
+
|
|
24
|
+
Always include import statements:
|
|
25
|
+
```typescript
|
|
26
|
+
// Good
|
|
27
|
+
import { createAuthMiddleware } from '@repo/auth/server';
|
|
28
|
+
|
|
29
|
+
const middleware = createAuthMiddleware({ secret: process.env.JWT_SECRET });
|
|
30
|
+
|
|
31
|
+
// Bad — missing import, unclear where this comes from
|
|
32
|
+
const middleware = createAuthMiddleware({ secret: process.env.JWT_SECRET });
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Complete Quick Start Example
|
|
36
|
+
|
|
37
|
+
Here's a complete "Quick Start" section showing the expected quality:
|
|
38
|
+
|
|
39
|
+
```markdown
|
|
40
|
+
## Quick Start
|
|
41
|
+
|
|
42
|
+
Install the auth package:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
bun add @repo/auth
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Add the auth middleware to your Hono server:
|
|
49
|
+
|
|
50
|
+
```typescript
|
|
51
|
+
import { createAuthMiddleware } from '@repo/auth/server';
|
|
52
|
+
import { getConfig } from '@repo/config';
|
|
53
|
+
|
|
54
|
+
const config = getConfig();
|
|
55
|
+
|
|
56
|
+
app.use('*', createAuthMiddleware({
|
|
57
|
+
secret: config.auth.jwtSecret,
|
|
58
|
+
cookieName: 'session',
|
|
59
|
+
}));
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Access the session in any route handler:
|
|
63
|
+
|
|
64
|
+
```typescript
|
|
65
|
+
app.get('/api/me', (c) => {
|
|
66
|
+
const session = c.get('session');
|
|
67
|
+
if (!session) return c.json({ error: 'Not authenticated' }, 401);
|
|
68
|
+
return c.json({ userId: session.userId, roles: session.roles });
|
|
69
|
+
});
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
For full configuration options, see [API Reference](./api-reference.md).
|
|
73
|
+
For setting up OAuth providers, see [Integration Guide](./guides/integration.md).
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## API Reference Format
|
|
77
|
+
|
|
78
|
+
For each exported item:
|
|
79
|
+
|
|
80
|
+
```markdown
|
|
81
|
+
### `functionName(params): ReturnType`
|
|
82
|
+
|
|
83
|
+
Brief description of what this does.
|
|
84
|
+
|
|
85
|
+
**Parameters:**
|
|
86
|
+
- `param1` (`Type`) — Description
|
|
87
|
+
- `param2` (`Type`, optional) — Description. Defaults to `defaultValue`.
|
|
88
|
+
|
|
89
|
+
**Returns:** `ReturnType` — Description
|
|
90
|
+
|
|
91
|
+
**Throws:** `ErrorType` — When condition
|
|
92
|
+
|
|
93
|
+
**Example:**
|
|
94
|
+
\`\`\`typescript
|
|
95
|
+
import { functionName } from '@repo/feature';
|
|
96
|
+
|
|
97
|
+
const result = functionName({ param1: 'value' });
|
|
98
|
+
\`\`\`
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Diagrams
|
|
102
|
+
|
|
103
|
+
If the feature has complex data flow or component relationships, include a Mermaid diagram:
|
|
104
|
+
|
|
105
|
+
```markdown
|
|
106
|
+
\`\`\`mermaid
|
|
107
|
+
graph LR
|
|
108
|
+
A[Request] --> B[Auth Middleware]
|
|
109
|
+
B --> C{Valid Session?}
|
|
110
|
+
C -->|Yes| D[Route Handler]
|
|
111
|
+
C -->|No| E[401 Response]
|
|
112
|
+
\`\`\`
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Cross-References
|
|
116
|
+
|
|
117
|
+
When referencing other packages or features:
|
|
118
|
+
- Link to their docs if they exist: `[Configuration package](../config/README.md)`
|
|
119
|
+
- Use the package name in backticks: `@repo/config`
|
|
120
|
+
- Don't duplicate their documentation — link to it
|
|
121
|
+
|
|
122
|
+
## File Naming
|
|
123
|
+
|
|
124
|
+
- All lowercase with hyphens: `api-reference.md`, `getting-started.md`
|
|
125
|
+
- Guides go in a `guides/` subdirectory
|
|
126
|
+
- ADRs go in a `decisions/` subdirectory with format `adr-NNN-short-title.md`
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
---
|
|
2
|
+
# GENERATED — DO NOT EDIT. Source: skills/forge-fix/SKILL.md. Regenerate: python3 scripts/build-adapters.py
|
|
3
|
+
description: Apply fixes from the most recent forge-verify findings document. Use when user runs /feature-forge:forge-fix or asks to apply verification fixes for a forge feature. Do NOT trigger for general code fixes, bug fixes, or repairs outside the forge verification workflow.
|
|
4
|
+
globs: []
|
|
5
|
+
alwaysApply: false
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# forge-fix — Apply Verification Fixes
|
|
9
|
+
|
|
10
|
+
Apply fixes from the most recent forge-verify findings document, with step-level tracking for crash recovery.
|
|
11
|
+
|
|
12
|
+
## Prerequisites
|
|
13
|
+
|
|
14
|
+
Read and follow `references/shared-conventions.md` for feature name validation, configuration reading, and force mode handling before proceeding.
|
|
15
|
+
|
|
16
|
+
**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.
|
|
17
|
+
|
|
18
|
+
## Step 1: Locate Findings Document
|
|
19
|
+
|
|
20
|
+
1. Read `forge.config.json` for `specsDir` (default: `./specs`)
|
|
21
|
+
2. Resolve the feature directory via the **Feature Directory Resolution** block in `references/shared-conventions.md` (a standalone feature resolves to its flat `{specsDir}/{feature}/` path exactly as today; an epic member resolves to its nested path). Then find the most recent `VERIFY-*-*.md` file in `{resolvedFeatureDir}/.verification/`.
|
|
22
|
+
3. If no findings document exists, tell the user: "No verification findings found. Run `/feature-forge:forge-verify {feature}` first."
|
|
23
|
+
|
|
24
|
+
## Step 2: Parse Fix Execution Plan
|
|
25
|
+
|
|
26
|
+
1. Read the "Fix Execution Plan" section of the findings document
|
|
27
|
+
2. Identify all execution steps and their dependencies
|
|
28
|
+
3. Check for a `## Fix Progress` section at the bottom of the findings document — if present, some steps were already applied in a previous interrupted run
|
|
29
|
+
|
|
30
|
+
## Step 3: Handle User Decisions
|
|
31
|
+
|
|
32
|
+
If the "User Decisions Required" section has unresolved items:
|
|
33
|
+
1. Present each decision to the user with the context from the findings, using `AskUserQuestion` for each decision point. Only recommend a specific option if the findings provide clear evidence for it; otherwise present options neutrally.
|
|
34
|
+
2. Wait for answers before proceeding
|
|
35
|
+
3. Record decisions in the findings document under the "User Decisions Required" section (mark each as resolved)
|
|
36
|
+
|
|
37
|
+
## Step 4: Execute Fix Steps
|
|
38
|
+
|
|
39
|
+
For each step in the "Execution Steps" section, in order:
|
|
40
|
+
|
|
41
|
+
1. **Check if already applied:** If the step appears in the "Fix Progress" section as `[APPLIED]`, skip it
|
|
42
|
+
2. **Check dependencies:** If the step depends on another step, verify that step is marked as applied
|
|
43
|
+
3. **Apply the fix:** Execute the change described in the step's "Action" field
|
|
44
|
+
4. **Verify the change:** Re-read the modified file and check that the change is correct and consistent with the step's rationale
|
|
45
|
+
5. **Record progress:** Append to the `## Fix Progress` section at the bottom of the findings document:
|
|
46
|
+
```
|
|
47
|
+
- Step {N}: [APPLIED] {date} — {short summary of what was done}
|
|
48
|
+
```
|
|
49
|
+
6. If a step fails or produces unexpected results, STOP. Report the issue to the user. Do not continue to dependent steps.
|
|
50
|
+
|
|
51
|
+
## Step 5: Update Pipeline State and Commit
|
|
52
|
+
|
|
53
|
+
Follow the Git Commit Protocol in `references/shared-conventions.md`.
|
|
54
|
+
|
|
55
|
+
1. Update `{resolvedFeatureDir}/.pipeline-state.json`:
|
|
56
|
+
- Set the relevant `forge-verify-*` entry status to `findings-applied`
|
|
57
|
+
- Record `fixedAt` timestamp
|
|
58
|
+
2. If `gitCommitAfterStage` is true, follow the Git Commit Protocol: stage files (`git add {resolvedFeatureDir}/` — or `{specsDir}/{epic}/` for an epic member so the member-state change commits atomically with the epic subtree), attempt commit with message `"{commitPrefix}({feature}): apply {mode} verification fixes"`, then record commit hash only on success.
|
|
59
|
+
|
|
60
|
+
## Step 6: Next Steps
|
|
61
|
+
|
|
62
|
+
Tell the user:
|
|
63
|
+
"Fixes applied. Next steps:
|
|
64
|
+
- Run `/feature-forge:forge-verify {feature}` again to confirm all issues are resolved
|
|
65
|
+
- Or `/feature-forge:forge {feature}` to see pipeline status"
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
# GENERATED — DO NOT EDIT. Source: skills/forge-init/SKILL.md. Regenerate: python3 scripts/build-adapters.py
|
|
3
|
+
description: Initialize feature-forge configuration in the current project. Use when user runs /feature-forge:forge-init or asks to set up forge for the first time. Creates forge.config.json with defaults. Do NOT trigger for general project initialization or setup tasks outside the forge pipeline.
|
|
4
|
+
globs: []
|
|
5
|
+
alwaysApply: false
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Initialize Feature Forge
|
|
9
|
+
|
|
10
|
+
Run the initialization script to create `forge.config.json` with default settings:
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
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)"
|
|
14
|
+
[ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
|
|
15
|
+
bash "$R/scripts/forge-init.sh"
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
After initialization, the config file will contain defaults for:
|
|
19
|
+
- `specsDir`: `./specs`
|
|
20
|
+
- `docsDir`: `./docs/architecture`
|
|
21
|
+
- `backlogDir`: `null` (backlog lives alongside specs)
|
|
22
|
+
- `gitCommitAfterStage`: `true`
|
|
23
|
+
- `commitPrefix`: `forge`
|
|
24
|
+
- `stack`: `null` (detected during `/feature-forge:forge-2-tech`)
|
|
25
|
+
- `typeCheckCommand`: `null` (set during `/feature-forge:forge-2-tech`)
|
|
26
|
+
- `testCommand`: `null` (set during `/feature-forge:forge-2-tech`)
|
|
27
|
+
|
|
28
|
+
If `forge.config.json` already exists, the script will not overwrite it.
|
|
29
|
+
|
|
30
|
+
After initialization, start the pipeline with `/feature-forge:forge-1-prd <feature-name>`.
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
---
|
|
2
|
+
# GENERATED — DO NOT EDIT. Source: skills/forge-verify/SKILL.md. Regenerate: python3 scripts/build-adapters.py
|
|
3
|
+
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.
|
|
4
|
+
globs: []
|
|
5
|
+
alwaysApply: false
|
|
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
|
+
```
|