@garygentry/feature-forge 0.2.3 → 0.2.5
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/README.md +6 -1
- package/adapters/GENERATION-REPORT.md +5 -1
- package/adapters/claude/.feature-forge-bundle.json +1 -1
- package/adapters/claude/references/forge-config-schema.json +25 -3
- package/adapters/claude/references/pipeline-state-schema.json +3 -2
- package/adapters/claude/references/portable-root.md +6 -3
- package/adapters/claude/references/process-overview.md +10 -0
- package/adapters/claude/references/shared-conventions.md +27 -9
- package/adapters/claude/references/stage-exit-protocol.md +206 -0
- package/adapters/claude/scripts/epic-manifest.py +10 -0
- package/adapters/claude/scripts/forge-bootstrap.py +94 -16
- package/adapters/claude/scripts/forge-init.sh +7 -1
- package/adapters/claude/scripts/forge-root.sh +20 -1
- package/adapters/claude/scripts/forge-session.py +866 -31
- package/adapters/claude/skills/forge/SKILL.md +29 -15
- package/adapters/claude/skills/forge-0-epic/SKILL.md +19 -24
- package/adapters/claude/skills/forge-0-epic/references/edit-mode.md +6 -4
- package/adapters/claude/skills/forge-0-epic/references/epic-manifest-subcommands.md +1 -1
- package/adapters/claude/skills/forge-1-prd/SKILL.md +13 -4
- package/adapters/claude/skills/forge-2-tech/SKILL.md +13 -3
- package/adapters/claude/skills/forge-3-specs/SKILL.md +13 -3
- package/adapters/claude/skills/forge-4-backlog/SKILL.md +15 -5
- package/adapters/claude/skills/forge-5-loop/SKILL.md +19 -21
- package/adapters/claude/skills/forge-5-loop/references/result-reporting.md +10 -5
- package/adapters/claude/skills/forge-6-docs/SKILL.md +6 -6
- package/adapters/claude/skills/forge-bootstrap/SKILL.md +4 -4
- package/adapters/claude/skills/forge-fix/SKILL.md +29 -6
- package/adapters/claude/skills/forge-guide/SKILL.md +182 -0
- package/adapters/claude/skills/forge-init/SKILL.md +29 -1
- package/adapters/claude/skills/forge-verify/SKILL.md +46 -15
- package/adapters/claude/skills/forge-verify/references/verification-checklists.md +1 -1
- package/adapters/codex/.feature-forge-bundle.json +1 -1
- package/adapters/codex/references/forge-config-schema.json +25 -3
- package/adapters/codex/references/pipeline-state-schema.json +3 -2
- package/adapters/codex/references/portable-root.md +6 -3
- package/adapters/codex/references/process-overview.md +10 -0
- package/adapters/codex/references/shared-conventions.md +27 -9
- package/adapters/codex/references/stage-exit-protocol.md +206 -0
- package/adapters/codex/scripts/epic-manifest.py +10 -0
- package/adapters/codex/scripts/forge-bootstrap.py +94 -16
- package/adapters/codex/scripts/forge-init.sh +7 -1
- package/adapters/codex/scripts/forge-root.sh +20 -1
- package/adapters/codex/scripts/forge-session.py +866 -31
- package/adapters/codex/skills/forge/SKILL.md +34 -20
- package/adapters/codex/skills/forge-0-epic/SKILL.md +20 -25
- package/adapters/codex/skills/forge-0-epic/references/edit-mode.md +6 -4
- package/adapters/codex/skills/forge-0-epic/references/epic-manifest-subcommands.md +1 -1
- package/adapters/codex/skills/forge-1-prd/SKILL.md +13 -4
- package/adapters/codex/skills/forge-2-tech/SKILL.md +14 -4
- package/adapters/codex/skills/forge-3-specs/SKILL.md +13 -3
- package/adapters/codex/skills/forge-4-backlog/SKILL.md +15 -5
- package/adapters/codex/skills/forge-5-loop/SKILL.md +21 -23
- package/adapters/codex/skills/forge-5-loop/references/result-reporting.md +10 -5
- package/adapters/codex/skills/forge-6-docs/SKILL.md +6 -6
- package/adapters/codex/skills/forge-bootstrap/SKILL.md +4 -4
- package/adapters/codex/skills/forge-fix/SKILL.md +29 -6
- package/adapters/codex/skills/forge-guide/SKILL.md +191 -0
- package/adapters/codex/skills/forge-init/SKILL.md +29 -1
- package/adapters/codex/skills/forge-verify/SKILL.md +45 -14
- package/adapters/codex/skills/forge-verify/references/verification-checklists.md +1 -1
- package/adapters/copilot/.feature-forge-bundle.json +1 -1
- package/adapters/copilot/references/forge-config-schema.json +25 -3
- package/adapters/copilot/references/pipeline-state-schema.json +3 -2
- package/adapters/copilot/references/portable-root.md +6 -3
- package/adapters/copilot/references/process-overview.md +10 -0
- package/adapters/copilot/references/shared-conventions.md +27 -9
- package/adapters/copilot/references/stage-exit-protocol.md +206 -0
- package/adapters/copilot/scripts/epic-manifest.py +10 -0
- package/adapters/copilot/scripts/forge-bootstrap.py +94 -16
- package/adapters/copilot/scripts/forge-init.sh +7 -1
- package/adapters/copilot/scripts/forge-root.sh +20 -1
- package/adapters/copilot/scripts/forge-session.py +866 -31
- package/adapters/copilot/skills/forge/forge.md +34 -20
- package/adapters/copilot/skills/forge-0-epic/forge-0-epic.md +20 -25
- package/adapters/copilot/skills/forge-0-epic/references/edit-mode.md +6 -4
- package/adapters/copilot/skills/forge-0-epic/references/epic-manifest-subcommands.md +1 -1
- package/adapters/copilot/skills/forge-1-prd/forge-1-prd.md +13 -4
- package/adapters/copilot/skills/forge-2-tech/forge-2-tech.md +14 -4
- package/adapters/copilot/skills/forge-3-specs/forge-3-specs.md +13 -3
- package/adapters/copilot/skills/forge-4-backlog/forge-4-backlog.md +15 -5
- package/adapters/copilot/skills/forge-5-loop/forge-5-loop.md +21 -23
- package/adapters/copilot/skills/forge-5-loop/references/result-reporting.md +10 -5
- package/adapters/copilot/skills/forge-6-docs/forge-6-docs.md +6 -6
- package/adapters/copilot/skills/forge-bootstrap/forge-bootstrap.md +4 -4
- package/adapters/copilot/skills/forge-fix/forge-fix.md +29 -6
- package/adapters/copilot/skills/forge-guide/forge-guide.md +191 -0
- package/adapters/copilot/skills/forge-init/forge-init.md +29 -1
- package/adapters/copilot/skills/forge-verify/forge-verify.md +45 -14
- package/adapters/copilot/skills/forge-verify/references/verification-checklists.md +1 -1
- package/adapters/cursor/.feature-forge-bundle.json +1 -1
- package/adapters/cursor/references/forge-config-schema.json +25 -3
- package/adapters/cursor/references/pipeline-state-schema.json +3 -2
- package/adapters/cursor/references/portable-root.md +6 -3
- package/adapters/cursor/references/process-overview.md +10 -0
- package/adapters/cursor/references/shared-conventions.md +27 -9
- package/adapters/cursor/references/stage-exit-protocol.md +206 -0
- package/adapters/cursor/scripts/epic-manifest.py +10 -0
- package/adapters/cursor/scripts/forge-bootstrap.py +94 -16
- package/adapters/cursor/scripts/forge-init.sh +7 -1
- package/adapters/cursor/scripts/forge-root.sh +20 -1
- package/adapters/cursor/scripts/forge-session.py +866 -31
- package/adapters/cursor/skills/forge/forge.mdc +34 -20
- package/adapters/cursor/skills/forge-0-epic/forge-0-epic.mdc +20 -25
- package/adapters/cursor/skills/forge-0-epic/references/edit-mode.md +6 -4
- package/adapters/cursor/skills/forge-0-epic/references/epic-manifest-subcommands.md +1 -1
- package/adapters/cursor/skills/forge-1-prd/forge-1-prd.mdc +13 -4
- package/adapters/cursor/skills/forge-2-tech/forge-2-tech.mdc +14 -4
- package/adapters/cursor/skills/forge-3-specs/forge-3-specs.mdc +13 -3
- package/adapters/cursor/skills/forge-4-backlog/forge-4-backlog.mdc +15 -5
- package/adapters/cursor/skills/forge-5-loop/forge-5-loop.mdc +21 -23
- package/adapters/cursor/skills/forge-5-loop/references/result-reporting.md +10 -5
- package/adapters/cursor/skills/forge-6-docs/forge-6-docs.mdc +6 -6
- package/adapters/cursor/skills/forge-bootstrap/forge-bootstrap.mdc +4 -4
- package/adapters/cursor/skills/forge-fix/forge-fix.mdc +29 -6
- package/adapters/cursor/skills/forge-guide/forge-guide.mdc +192 -0
- package/adapters/cursor/skills/forge-init/forge-init.mdc +29 -1
- package/adapters/cursor/skills/forge-verify/forge-verify.mdc +45 -14
- package/adapters/cursor/skills/forge-verify/references/verification-checklists.md +1 -1
- package/adapters/gemini/.feature-forge-bundle.json +1 -1
- package/adapters/gemini/gemini-extension.json +5 -1
- package/adapters/gemini/references/forge-config-schema.json +25 -3
- package/adapters/gemini/references/pipeline-state-schema.json +3 -2
- package/adapters/gemini/references/portable-root.md +6 -3
- package/adapters/gemini/references/process-overview.md +10 -0
- package/adapters/gemini/references/shared-conventions.md +27 -9
- package/adapters/gemini/references/stage-exit-protocol.md +206 -0
- package/adapters/gemini/scripts/epic-manifest.py +10 -0
- package/adapters/gemini/scripts/forge-bootstrap.py +94 -16
- package/adapters/gemini/scripts/forge-init.sh +7 -1
- package/adapters/gemini/scripts/forge-root.sh +20 -1
- package/adapters/gemini/scripts/forge-session.py +866 -31
- package/adapters/gemini/skills/forge/forge.md +34 -20
- package/adapters/gemini/skills/forge-0-epic/forge-0-epic.md +20 -25
- package/adapters/gemini/skills/forge-0-epic/references/edit-mode.md +6 -4
- package/adapters/gemini/skills/forge-0-epic/references/epic-manifest-subcommands.md +1 -1
- package/adapters/gemini/skills/forge-1-prd/forge-1-prd.md +13 -4
- package/adapters/gemini/skills/forge-2-tech/forge-2-tech.md +14 -4
- package/adapters/gemini/skills/forge-3-specs/forge-3-specs.md +13 -3
- package/adapters/gemini/skills/forge-4-backlog/forge-4-backlog.md +15 -5
- package/adapters/gemini/skills/forge-5-loop/forge-5-loop.md +21 -23
- package/adapters/gemini/skills/forge-5-loop/references/result-reporting.md +10 -5
- package/adapters/gemini/skills/forge-6-docs/forge-6-docs.md +6 -6
- package/adapters/gemini/skills/forge-bootstrap/forge-bootstrap.md +4 -4
- package/adapters/gemini/skills/forge-fix/forge-fix.md +29 -6
- package/adapters/gemini/skills/forge-guide/forge-guide.md +191 -0
- package/adapters/gemini/skills/forge-init/forge-init.md +29 -1
- package/adapters/gemini/skills/forge-verify/forge-verify.md +45 -14
- package/adapters/gemini/skills/forge-verify/references/verification-checklists.md +1 -1
- package/dist/apply.js +34 -8
- package/dist/cli.js +40 -4
- package/dist/fsutil.d.ts +0 -12
- package/dist/fsutil.js +10 -1
- package/dist/manifest.d.ts +1 -1
- package/dist/plan.js +22 -2
- package/dist/rauf.d.ts +4 -4
- package/dist/rauf.js +3 -3
- package/dist/report.js +1 -1
- package/dist/types.d.ts +1 -1
- package/package.json +1 -1
|
@@ -4,15 +4,20 @@ These are the five verbatim result-report output templates for **Step 4b** of
|
|
|
4
4
|
`forge-5-loop/SKILL.md`. Pick **every** branch that applies (a run can be both
|
|
5
5
|
blocked and needs-human) and render its report.
|
|
6
6
|
|
|
7
|
-
**All items done
|
|
7
|
+
**All items done.** Print the completion summary, then close with the **warm-acceptable
|
|
8
|
+
variant** of the Stage Exit Protocol (single-sourced in
|
|
9
|
+
`references/stage-exit-protocol.md`) — the `forge-5-loop → forge-6-docs` boundary is the
|
|
10
|
+
one place where clearing before the next stage is optional:
|
|
8
11
|
```
|
|
9
12
|
Loop completed for {feature}. All {N} items implemented successfully.
|
|
10
|
-
|
|
11
|
-
Next steps:
|
|
12
|
-
- /feature-forge:forge-verify {feature} impl Verify the implementation
|
|
13
|
-
- /feature-forge:forge-6-docs {feature} Generate architecture docs
|
|
14
13
|
```
|
|
15
14
|
|
|
15
|
+
**The loop is complete — this is the one boundary where clearing before the next stage is optional.**
|
|
16
|
+
|
|
17
|
+
1. **Verify is already offered above.** Impl-verify is offered interactively right after this report (Step 5b for a standalone feature, Step 6.1 for an epic member) — run it there rather than as a second gate. It runs clean-room, so it needs no fresh session.
|
|
18
|
+
2. **Clearing is optional here — warm is fine.** `forge-6-docs` benefits from the still-warm context of what the loop actually did, so continuing in this same session is the easy default. A cold start also works — every artifact is on disk — but there is no need to force it.
|
|
19
|
+
3. **Then run `/feature-forge:forge-6-docs {feature}`** — in this warm session, or a fresh one if you prefer.
|
|
20
|
+
|
|
16
21
|
**Runner review pass.** A review flag (e.g. rauf's `--review`) makes the runner run
|
|
17
22
|
a post-loop review that **auto-creates and implements fix items** rather than handing
|
|
18
23
|
findings to the user — distinct from `forge-verify impl` (a clean-context audit that
|
|
@@ -43,18 +43,18 @@ Check `.pipeline-state.json` for `stages.forge-verify-impl`. If it is **absent**
|
|
|
43
43
|
If the resolved feature has an `epic` back-pointer in its `.pipeline-state.json`, run:
|
|
44
44
|
|
|
45
45
|
```bash
|
|
46
|
-
R="$(for d in "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done)"
|
|
46
|
+
R="$(bash -c 'for d in "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/cache/*/feature-forge/* "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done')"
|
|
47
47
|
[ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
|
|
48
48
|
python3 "$R/scripts/epic-manifest.py" render-status "{epic}" --specs-dir "{specsDir}" --json
|
|
49
49
|
```
|
|
50
50
|
|
|
51
51
|
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).
|
|
52
52
|
|
|
53
|
-
**Only if `rollup.total > 0 AND rollup.complete == rollup.total`** (every member is complete-for-orchestration; the `total > 0` guard excludes an empty epic),
|
|
53
|
+
**Only if `rollup.total > 0 AND rollup.complete == rollup.total`** (every member is complete-for-orchestration; the `total > 0` guard excludes an empty epic), offer the extra doc as a statement the user can take or leave — not a forced question:
|
|
54
54
|
|
|
55
|
-
"All {total} features in the '{epic}' epic are complete.
|
|
55
|
+
"All {total} features in the '{epic}' epic are complete. I can also generate an **epic-level architecture document** spanning the features, alongside {feature}'s per-feature docs — say the word and I'll add it."
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
If the user asks for it, 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}/`.
|
|
58
58
|
|
|
59
59
|
If not all members are complete (or the feature has no `epic` back-pointer), **do not offer** — the per-feature doc flow proceeds unchanged.
|
|
60
60
|
|
|
@@ -96,7 +96,7 @@ Based on feature complexity and existing doc conventions, propose a doc plan:
|
|
|
96
96
|
└── adr-001-*.md — Architecture decision records (if significant decisions were made)
|
|
97
97
|
```
|
|
98
98
|
|
|
99
|
-
Present the plan and
|
|
99
|
+
Present the plan as a statement and invite edits before writing — not a forced confirmation gate: "Here's the doc plan I'll generate. Tell me if you want to add, remove, or restructure any documents; otherwise I'll proceed." Write the docs unless the user asks for changes.
|
|
100
100
|
|
|
101
101
|
## Step 3: Write Documentation
|
|
102
102
|
|
|
@@ -175,7 +175,7 @@ Write pipeline state conforming to `references/pipeline-state-schema.json`.
|
|
|
175
175
|
- Set `currentStage` to `complete`
|
|
176
176
|
- Record `artifacts`
|
|
177
177
|
- 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`.
|
|
178
|
-
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"
|
|
178
|
+
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"` (marking `stages.forge-6-docs.status` `complete` with `commitHash: null` in that commit), then record the artifact-commit hash via the protocol's two-commit follow-up (never `--amend`) only on success. If commit fails, leave status as `in-progress`.
|
|
179
179
|
4. Tell user: "Documentation complete. Feature pipeline for '{feature}' is finished!\n `/feature-forge:forge {feature}` to see the final pipeline status."
|
|
180
180
|
|
|
181
181
|
## Gotchas
|
|
@@ -58,7 +58,7 @@ Every bash invocation begins with the byte-identical portable-root prelude, then
|
|
|
58
58
|
helper. Pass `--specs-dir ./specs` (the default) so the gate allow-lists the specs directory.
|
|
59
59
|
|
|
60
60
|
```bash
|
|
61
|
-
R="$(for d in "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done)"
|
|
61
|
+
R="$(bash -c 'for d in "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/cache/*/feature-forge/* "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done')"
|
|
62
62
|
[ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
|
|
63
63
|
python3 "$R/scripts/forge-bootstrap.py" check "<target-dir>" --json --specs-dir ./specs
|
|
64
64
|
```
|
|
@@ -135,7 +135,7 @@ when running under a Claude host (e.g. the host's question mechanism is availabl
|
|
|
135
135
|
`CLAUDE.md` only when `host == "claude"`.
|
|
136
136
|
|
|
137
137
|
```bash
|
|
138
|
-
R="$(for d in "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done)"
|
|
138
|
+
R="$(bash -c 'for d in "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/cache/*/feature-forge/* "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done')"
|
|
139
139
|
[ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
|
|
140
140
|
python3 "$R/scripts/forge-bootstrap.py" scaffold "<target-dir>" --json --answers '<Answers JSON>'
|
|
141
141
|
```
|
|
@@ -143,7 +143,7 @@ python3 "$R/scripts/forge-bootstrap.py" scaffold "<target-dir>" --json --answers
|
|
|
143
143
|
### Step 5 — verify
|
|
144
144
|
|
|
145
145
|
```bash
|
|
146
|
-
R="$(for d in "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done)"
|
|
146
|
+
R="$(bash -c 'for d in "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/cache/*/feature-forge/* "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done')"
|
|
147
147
|
[ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
|
|
148
148
|
python3 "$R/scripts/forge-bootstrap.py" verify "<target-dir>" --json --answers '<Answers JSON>'
|
|
149
149
|
```
|
|
@@ -169,7 +169,7 @@ and removes the sentinel before staging so it never enters history. Read
|
|
|
169
169
|
leave the sentinel in-progress (resumable) — do **not** declare success.
|
|
170
170
|
|
|
171
171
|
```bash
|
|
172
|
-
R="$(for d in "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done)"
|
|
172
|
+
R="$(bash -c 'for d in "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/cache/*/feature-forge/* "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done')"
|
|
173
173
|
[ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
|
|
174
174
|
python3 "$R/scripts/forge-bootstrap.py" commit "<target-dir>" --json --answers '<Answers JSON>' [--stage-only]
|
|
175
175
|
```
|
|
@@ -8,6 +8,17 @@ description: Apply fixes from the most recent forge-verify findings document. Us
|
|
|
8
8
|
|
|
9
9
|
Apply fixes from the most recent forge-verify findings document, with step-level tracking for crash recovery.
|
|
10
10
|
|
|
11
|
+
Usually invoked by the user, but an **`autoFix` caller** may also invoke this skill automatically
|
|
12
|
+
when `autoFix: true` is configured **and** its preconditions hold (the findings document has zero
|
|
13
|
+
unresolved decision points, the working tree is clean, and a mandatory re-verify passes afterward).
|
|
14
|
+
Two callers drive that chain: an **authoring stage's in-stage auto-verify** (the primary path — see
|
|
15
|
+
`references/stage-exit-protocol.md`, the in-stage verify block) and the **`/feature-forge:forge`
|
|
16
|
+
navigator's catch-up** (§3b). The **fix application** below is identical either way — this skill is
|
|
17
|
+
not "auto-aware" about *applying* findings; it always applies the latest findings document. The
|
|
18
|
+
**caller** owns the gating decisions, including the closing re-verify: the Step 6 gate is presented
|
|
19
|
+
**only on a direct invocation**, because under an `autoFix` chain the caller (stage skill or
|
|
20
|
+
navigator) runs the mandatory re-verify itself.
|
|
21
|
+
|
|
11
22
|
## Prerequisites
|
|
12
23
|
|
|
13
24
|
Read and follow `references/shared-conventions.md` for feature name validation, configuration reading, and force mode handling before proceeding.
|
|
@@ -54,14 +65,26 @@ Follow the Git Commit Protocol in `references/shared-conventions.md`.
|
|
|
54
65
|
1. Update `{resolvedFeatureDir}/.pipeline-state.json`:
|
|
55
66
|
- Set the relevant `forge-verify-*` entry status to `findings-applied`
|
|
56
67
|
- Record `fixedAt` timestamp
|
|
57
|
-
|
|
68
|
+
- Record `verifiedStageVersion` = the current `version` of the production stage entry
|
|
69
|
+
this verify covers (e.g. fixing `tech` findings → `stages["forge-2-tech"].version`).
|
|
70
|
+
This keeps the navigator's freshness ledger accurate after a fix, so the verified
|
|
71
|
+
stage reads as `fresh` and auto-verify does not needlessly re-fire on an unchanged
|
|
72
|
+
artifact. (If the fix itself bumped the production stage's `version`, use the new
|
|
73
|
+
value so the ledger reflects what was actually verified/fixed.)
|
|
74
|
+
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"` (writing `commitHash: null` in that commit), then record the artifact-commit hash via the protocol's two-commit follow-up (never `--amend`) only on success.
|
|
75
|
+
|
|
76
|
+
## Step 6: Re-verify Gate
|
|
77
|
+
|
|
78
|
+
Fixes are applied and recorded (`findings-applied`), so the stage reads **fresh** in the navigator's ledger (Step 5 set `verifiedStageVersion` to the current version). A re-verify is nonetheless the only thing that *confirms* the fixes actually resolved the findings, so on a **direct/manual** `forge-fix` invocation, **prompt** it rather than leaving it as a passive suggestion — this is the same **Standard Verify Gate** the stage skills stamp (`references/stage-exit-protocol.md`).
|
|
79
|
+
|
|
80
|
+
**Skip this gate when an `autoFix` caller invoked you as part of a chain** — the authoring stage's in-stage auto-verify (`references/stage-exit-protocol.md`, in-stage verify block) or the navigator's catch-up (`skills/forge/SKILL.md` §3b step 2b): there the caller owns the mandatory re-verify, so a second gate here would block the unattended flow or double the re-verify. Just return and let the caller proceed.
|
|
58
81
|
|
|
59
|
-
|
|
82
|
+
On a direct invocation, present the gate using the host's question mechanism with these three options — but only when the host has a question mechanism **and** the clean-room path is available (the host's subagent mechanism plus a dispatchable `forge-verifier` subagent):
|
|
83
|
+
- **Re-verify {feature} now** *(recommended)* — dispatch the clean-room `forge-verifier` subagent from this session in require-clean mode to confirm every finding is resolved; the digest returns here so any remaining issue keeps its context. One-time — it does **not** change config.
|
|
84
|
+
- **Re-verify now + enable auto-verify going forward** — re-verify now **and** patch `"autoVerify": true` into `forge.config.json` in place (preserve formatting and every other key) so future stages verify automatically, no prompt. This complements the `forge-init` opt-in. **Do not auto-commit this config change** — treat it like `notes`: a user-facing edit the user commits on their own cadence, never folded into a stage's artifact commit.
|
|
85
|
+
- **Skip for now** — proceed without re-verifying; the fixes are already recorded, so the stage stays `findings-applied` (fresh in the ledger). Run `/feature-forge:forge {feature}` when you want pipeline status.
|
|
60
86
|
|
|
61
|
-
|
|
62
|
-
"Fixes applied. Next steps:
|
|
63
|
-
- Run `/feature-forge:forge-verify {feature}` again to confirm all issues are resolved
|
|
64
|
-
- Or `/feature-forge:forge {feature}` to see pipeline status"
|
|
87
|
+
**Host / clean-room fallback (not a user-selectable option):** if the question mechanism, the host's subagent mechanism, or the `forge-verifier` subagent is unavailable, do **not** run clean-room — degrade to printing `/feature-forge:forge-verify {feature}` for the user to run inline/manually (mirroring `autoInvokeNextStage`), and offer the auto-verify enable as plain text only if a config write is possible.
|
|
65
88
|
|
|
66
89
|
---
|
|
67
90
|
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
---
|
|
2
|
+
# GENERATED — DO NOT EDIT. Source: skills/forge-guide/SKILL.md. Regenerate: python3 scripts/build-adapters.py
|
|
3
|
+
name: forge-guide
|
|
4
|
+
description: Explain what feature-forge is, when to use it, how to configure it, and its best practices — advisory guidance, not stage execution. Use when the user or another agent asks what feature-forge is, whether/when to adopt it, how the pipeline works conceptually, how to set up or configure forge.config.json, or for usage tips and best practices. Do NOT trigger to RUN a pipeline stage (use forge-1-prd … forge-6-docs), to show a specific feature's status (use forge), or for general software questions unrelated to feature-forge.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Feature Forge — Usage & Best-Practices Guide
|
|
8
|
+
|
|
9
|
+
You are the **guide** for feature-forge: an advisor, not an operator. Your job is to
|
|
10
|
+
explain *what* forge is, *when* to use it, *how* to configure it, and *what the best
|
|
11
|
+
practices are* — in plain language, grounded in the repo's own docs. You do **not**
|
|
12
|
+
run pipeline stages; when the user is ready to act, point them at the right skill.
|
|
13
|
+
|
|
14
|
+
## How to answer
|
|
15
|
+
|
|
16
|
+
1. Identify the topic (the argument, or infer from the question).
|
|
17
|
+
2. **Ground yourself in the canonical source before answering** — read the mapped
|
|
18
|
+
reference file(s) below rather than answering from memory. These are the source
|
|
19
|
+
of truth and stay current as the pipeline evolves.
|
|
20
|
+
3. Answer concisely, then end with the concrete next command (`/feature-forge:forge-*`)
|
|
21
|
+
or doc pointer the user should go to.
|
|
22
|
+
|
|
23
|
+
| Topic | Read first |
|
|
24
|
+
|-------|-----------|
|
|
25
|
+
| Pipeline architecture, stage-by-stage flow | `references/process-overview.md` |
|
|
26
|
+
| Cross-stage conventions (naming, state, git, branch, epic injection) | `references/shared-conventions.md` |
|
|
27
|
+
| Config keys + defaults | `references/forge-config-schema.json` |
|
|
28
|
+
| Stack detection / language profiles | `references/stack-resolution.md`, `references/stacks/*.md` |
|
|
29
|
+
| Loop runner interface, signals & version gate | `references/ralph-loop-contract.md` |
|
|
30
|
+
| Deep dives, glossary, troubleshooting | `references/process-overview.md`, `references/shared-conventions.md` |
|
|
31
|
+
|
|
32
|
+
Those `references/` files are the guaranteed grounding path — they ship in every install.
|
|
33
|
+
The project's `README.md`, `COMPATIBILITY.md`, and the hosted docs site are richer but are
|
|
34
|
+
**not** part of an installed bundle, so treat them as optional enrichment (offer the docs-site
|
|
35
|
+
URL to a human) and never block an answer on opening them — fall back to the `references/`
|
|
36
|
+
files and your own knowledge.
|
|
37
|
+
|
|
38
|
+
Do NOT actually invoke stage skills or write files — this skill only explains and directs.
|
|
39
|
+
|
|
40
|
+
## What feature-forge is
|
|
41
|
+
|
|
42
|
+
A **feature development pipeline** that refines a vague idea into shipped code through
|
|
43
|
+
discrete, auditable stages — like a compiler for features. Each stage narrows scope and
|
|
44
|
+
adds structure, reading the previous stage's artifacts as standalone contracts:
|
|
45
|
+
|
|
46
|
+
- **PRD** — *what* to build (requirements only, no technology).
|
|
47
|
+
- **Tech spec** — *how* to build it (design, grounded in the codebase).
|
|
48
|
+
- **Implementation specs** — build-ready detail (types, signatures, contracts, tests).
|
|
49
|
+
- **Backlog** — self-contained work items for autonomous execution.
|
|
50
|
+
- **Loop** — a fresh-context runner implements each item, tests, and commits.
|
|
51
|
+
- **Docs** — architecture reference generated from the real implementation.
|
|
52
|
+
|
|
53
|
+
`REQ-XXX-NN` requirement IDs form a traceability spine from PRD through implementation.
|
|
54
|
+
**Verification gates** are available after any stage and run clean-room in a fresh subagent.
|
|
55
|
+
|
|
56
|
+
## When to use it — and when not
|
|
57
|
+
|
|
58
|
+
**Use forge when:** you have a well-defined feature or small epic to ship; you want
|
|
59
|
+
requirements captured cleanly before coding; you value traceability, thorough spec
|
|
60
|
+
verification, and autonomous loop execution with fresh context per item; you want
|
|
61
|
+
reproducible, auditable artifacts.
|
|
62
|
+
|
|
63
|
+
**Skip forge when:** the work is an exploratory spike with still-fluid requirements
|
|
64
|
+
(though Stage 1's interview can help clarify them); it's a one-line bug fix or trivial
|
|
65
|
+
patch where pipeline overhead isn't justified; or you're only extending mature code
|
|
66
|
+
along established patterns, where new specs become noise.
|
|
67
|
+
|
|
68
|
+
**Anti-patterns to warn against:** skipping the PRD and jumping to tech spec (the value
|
|
69
|
+
comes from separating *what* from *how*); treating specs as living contracts (they're
|
|
70
|
+
pre-implementation — drop an `AGENTS.md`/`CLAUDE.md` in the specs dir telling agents to
|
|
71
|
+
ignore drift); forcing an epic for a single feature; relying on conversation memory to
|
|
72
|
+
carry context across stages instead of reading upstream artifacts.
|
|
73
|
+
|
|
74
|
+
## The pipeline at a glance
|
|
75
|
+
|
|
76
|
+
| Stage | Skill | Produces |
|
|
77
|
+
|-------|-------|----------|
|
|
78
|
+
| 0 (optional) | `forge-0-epic` | `epic-manifest.json` + `EPIC.md` (members, deps, `exposes`/`consumes` contracts) |
|
|
79
|
+
| 1 | `forge-1-prd` | `PRD.md` with `REQ-*` IDs |
|
|
80
|
+
| 2 | `forge-2-tech` | `tech-spec.md`; detects stack + test/typecheck commands |
|
|
81
|
+
| 3 | `forge-3-specs` | numbered spec suite + `TRACEABILITY.md` |
|
|
82
|
+
| 4 | `forge-4-backlog` | `backlog.json` (self-contained items) |
|
|
83
|
+
| 5 | `forge-5-loop` | implemented code, tested + committed per item |
|
|
84
|
+
| 6 | `forge-6-docs` | architecture docs from the real code |
|
|
85
|
+
| any | `forge-verify` → `forge-fix` | findings report → applied fixes |
|
|
86
|
+
| any | `forge` | status dashboard / navigator |
|
|
87
|
+
|
|
88
|
+
Drive the whole thing with the **navigator**: `/feature-forge:forge <feature>` shows the
|
|
89
|
+
current stage and offers the next; with `autoInvokeNextStage` it launches it directly.
|
|
90
|
+
|
|
91
|
+
## Setup & configuration
|
|
92
|
+
|
|
93
|
+
**First-time setup:** `/feature-forge:forge-init` (existing repo) creates `forge.config.json`
|
|
94
|
+
with defaults. `/feature-forge:forge-bootstrap` scaffolds a *greenfield* (empty) repo to a
|
|
95
|
+
green baseline. On non-Claude agents, install via `npx @garygentry/feature-forge install`.
|
|
96
|
+
|
|
97
|
+
**Key `forge.config.json` knobs** (authoritative list: `references/forge-config-schema.json`):
|
|
98
|
+
|
|
99
|
+
- **Paths** — `specsDir` (`./specs`), `docsDir` (`./docs/architecture`), `backlogDir`.
|
|
100
|
+
- **Git** — `gitCommitAfterStage` (true), `commitPrefix` (`forge`); commits use a two-commit
|
|
101
|
+
protocol so the stage's commit hash is recorded in state without `--amend`.
|
|
102
|
+
- **Branch** — `branchPerFeature` (true), `branchPrefix` (`forge/`): isolate each feature.
|
|
103
|
+
- **Stack** — `stack`, `typeCheckCommand`, `testCommand`: null until Stage 2 auto-detects them.
|
|
104
|
+
- **Context** — `contextWindowTokens`, `contextWarnThreshold` (0.7): the navigator warns to
|
|
105
|
+
clear your session / start a fresh session past this fullness. On 1M-context models set `contextWindowTokens` explicitly.
|
|
106
|
+
- **Verification** — `autoVerify` (false; when on, each authoring stage verifies in-stage before its exit block), `autoVerifyStages`, `autoFix` (false).
|
|
107
|
+
- **Stage flow** — `autoInvokeNextStage` (true on Claude, print-only elsewhere).
|
|
108
|
+
- **Loop** — `loopRunner` block (binary, command templates, version gate, agent selection);
|
|
109
|
+
defaults to **rauf** when absent. `workspaces` supports monorepos.
|
|
110
|
+
|
|
111
|
+
## Verification gates
|
|
112
|
+
|
|
113
|
+
`forge-verify <feature>` dispatches the read-only `forge-verifier` subagent to find gaps,
|
|
114
|
+
inconsistencies, and quality issues; it writes a findings doc, and `forge-fix` applies them.
|
|
115
|
+
Because verification runs in a **fresh subagent**, it's clean-room by construction — it never
|
|
116
|
+
needs a clear your session / start a fresh session, and it's safe to automate with `autoVerify: true`. When on, the just-completed
|
|
117
|
+
authoring stage runs verify **in-stage** — in the same session, right before its exit block — so
|
|
118
|
+
the digest and any fix land where the context still exists (the navigator only catches up if a
|
|
119
|
+
host couldn't run it clean-room). Fixing stays human-gated unless `autoFix: true`. The cost is one
|
|
120
|
+
extra clean-room verify per stage. **Always verify before Stage 5 (the loop)** — catching errors in
|
|
121
|
+
specs/backlog is far cheaper than mid-loop. Verifying after PRD and after backlog is also
|
|
122
|
+
recommended. A findings pass is fresh only while the artifact `version` matches what was
|
|
123
|
+
verified; revise upstream and downstream re-verifies.
|
|
124
|
+
|
|
125
|
+
## Context management
|
|
126
|
+
|
|
127
|
+
Each stage reads upstream artifacts as standalone contracts, so you can (and usually should)
|
|
128
|
+
clear your session / start a fresh session between them:
|
|
129
|
+
|
|
130
|
+
- **Clear** between PRD → tech, tech → specs, specs → backlog, backlog → loop.
|
|
131
|
+
- **Stay warm** mid-interview (PRD, tech spec) — the interview needs a continuous thread.
|
|
132
|
+
- **No clear needed** for any → verify (runs in a fresh subagent).
|
|
133
|
+
|
|
134
|
+
The navigator warns when the session passes `contextWarnThreshold` (default 70% full).
|
|
135
|
+
|
|
136
|
+
## Epics (large changes)
|
|
137
|
+
|
|
138
|
+
Use Stage 0 only when a change naturally splits into **several interdependent features** that
|
|
139
|
+
must agree on interfaces. `forge-0-epic` produces `epic-manifest.json` + `EPIC.md` with a
|
|
140
|
+
per-member charter, `exposes`/`consumes` contracts, and `dependsOn` edges. Each member then
|
|
141
|
+
runs the normal pipeline with epic context injected. At Stage 5 a **dependency gate** warns if
|
|
142
|
+
a member's dependencies are unmet. Epic support is purely additive — single-feature flows are
|
|
143
|
+
unchanged. Re-run `forge-0-epic` on an existing epic to enter edit mode.
|
|
144
|
+
|
|
145
|
+
## The loop
|
|
146
|
+
|
|
147
|
+
Stage 5 runs a configurable runner (**rauf** by default) that gives each backlog item a fresh
|
|
148
|
+
agent session — implement → run the verification command → commit on pass. This is why items
|
|
149
|
+
must be truly **self-contained**; context bleed breaks the model. Per-item signals:
|
|
150
|
+
|
|
151
|
+
- `RAUF_DONE` — item passed; loop continues.
|
|
152
|
+
- `RAUF_BLOCKED` — missing dependency / unclear requirement; set aside, loop continues others.
|
|
153
|
+
- `RAUF_NEEDS_HUMAN` — decision or secret needed; set aside, loop continues.
|
|
154
|
+
|
|
155
|
+
The loop doesn't pause on blocked items. Supply what's missing, then `rauf resume <path>` to
|
|
156
|
+
retry set-aside items. The runner refuses to start with a **dirty working tree** and enforces
|
|
157
|
+
a minimum runner version (the version gate is described in `references/ralph-loop-contract.md`).
|
|
158
|
+
|
|
159
|
+
## Best practices & gotchas
|
|
160
|
+
|
|
161
|
+
- Feature name is **required** for every stage command — never guess or infer it.
|
|
162
|
+
- Verify **before the loop**; a bad spec is cheap to fix now, expensive mid-loop.
|
|
163
|
+
- Keep backlog items self-contained — the loop has zero memory across items.
|
|
164
|
+
- Let stages commit for you; don't hand-edit `.pipeline-state.json` or backlog status.
|
|
165
|
+
- Re-running an upstream stage marks downstream stages **stale** — re-run them rather than
|
|
166
|
+
reaching for `--force`, which skips prerequisite checks and should be rare.
|
|
167
|
+
- Specs are pre-implementation artifacts, not living docs — don't cite them from generated code.
|
|
168
|
+
- Use the navigator (`/feature-forge:forge <feature>`) to orient; use `forge-verify` to inspect.
|
|
169
|
+
|
|
170
|
+
## Troubleshooting starters
|
|
171
|
+
|
|
172
|
+
- **Stage 5 won't start:** backlog exists and is verified? runner installed and ≥ min version?
|
|
173
|
+
working tree clean? See `references/ralph-loop-contract.md` for the runner contract and version gate.
|
|
174
|
+
- **Loop stopped mid-run:** check the signal — `BLOCKED`/`NEEDS_HUMAN` items are set aside, not
|
|
175
|
+
failures; the loop keeps going.
|
|
176
|
+
- **Downstream flagged stale:** an upstream stage was revised; re-run the downstream stage.
|
|
177
|
+
- **Where am I?** `/feature-forge:forge <feature>` renders the full pipeline status.
|
|
178
|
+
|
|
179
|
+
For anything deeper, ground yourself in `references/process-overview.md` and
|
|
180
|
+
`references/shared-conventions.md`, and point the *user* at the hosted docs site —
|
|
181
|
+
<https://garygentry.github.io/feature-forge/> — for the full guides and glossary.
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## Host execution notes
|
|
186
|
+
|
|
187
|
+
This skill was authored Claude-first; the body above refers to "the host's question mechanism", "the host's subagent mechanism", and "the host's background-execution mechanism". Use your runtime's equivalent for each — and if your runtime has no such tool:
|
|
188
|
+
|
|
189
|
+
- **User input:** ask the question directly and wait for the answer before proceeding. Do not skip a required question or assume an answer.
|
|
190
|
+
- **Subagents:** if your host cannot dispatch the named custom agent, run that step inline yourself.
|
|
191
|
+
- **Background / monitoring:** run long-lived commands in the foreground (or your host's background facility) and report progress as it arrives.
|
|
@@ -9,7 +9,7 @@ description: Initialize feature-forge configuration in the current project. Use
|
|
|
9
9
|
Run the initialization script to create `forge.config.json` with default settings:
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
|
-
R="$(for d in "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done)"
|
|
12
|
+
R="$(bash -c 'for d in "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/cache/*/feature-forge/* "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done')"
|
|
13
13
|
[ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
|
|
14
14
|
bash "$R/scripts/forge-init.sh"
|
|
15
15
|
```
|
|
@@ -26,9 +26,37 @@ After initialization, the config file will contain defaults for:
|
|
|
26
26
|
- `autoInvokeNextStage`: `true` (the navigator auto-starts the next stage after you confirm; set `false` to only print the command)
|
|
27
27
|
- `contextWindowTokens`: `null` (the navigator infers the context window; set to your model's window, e.g. `1000000` for a 1M-context model, for accurate context-usage advice)
|
|
28
28
|
- `contextWarnThreshold`: `0.7` (fraction of the window past which the navigator suggests a clean session)
|
|
29
|
+
- `autoVerify`: `false` (set `true` to run `forge-verify` automatically after each authoring stage completes — in-stage, in the same session, before the exit block; it costs an extra clean-room verify per stage, so it trades a little time/tokens for catching errors early)
|
|
30
|
+
- `autoVerifyStages`: `{}` (per-stage overrides for `autoVerify`)
|
|
31
|
+
- `autoFix`: `false` (set `true` to chain `forge-fix` after an auto-verify finds issues)
|
|
29
32
|
|
|
30
33
|
If `forge.config.json` already exists, the script will not overwrite it.
|
|
31
34
|
|
|
35
|
+
## Offer auto-verify
|
|
36
|
+
|
|
37
|
+
The template writes `autoVerify: false`. After the config is created (and only when the script
|
|
38
|
+
actually created it — skip this if it reported the file already exists), offer to turn
|
|
39
|
+
auto-verify on, then write the choice back into `forge.config.json`.
|
|
40
|
+
|
|
41
|
+
If the host's question mechanism is available, ask exactly one question:
|
|
42
|
+
|
|
43
|
+
> **Enable auto-verify?** Verification runs in a clean-room subagent in-stage after each
|
|
44
|
+
> authoring stage completes — in the same session, before the exit block, so any fix
|
|
45
|
+
> decision keeps its context. It never needs a clear your session / start a fresh session and only returns a compact digest.
|
|
46
|
+
> **Recommended: on.** (Change later by editing `autoVerify` in `forge.config.json`.)
|
|
47
|
+
|
|
48
|
+
Options: **Enable (recommended)** / **Leave off**.
|
|
49
|
+
|
|
50
|
+
- On **Enable**: patch `"autoVerify": false` → `"autoVerify": true` in the generated
|
|
51
|
+
`forge.config.json` in place, preserving formatting and every other key.
|
|
52
|
+
- On **Leave off**: leave the config as written (`autoVerify: false`).
|
|
53
|
+
|
|
54
|
+
If the host lacks a structured question tool but can still prompt the user (e.g. Codex asks in
|
|
55
|
+
plain text), use that — ask the one question directly and wait for the reply; it is the same
|
|
56
|
+
choice, just rendered differently. Only when the host has **no** way to ask at all (a fully
|
|
57
|
+
non-interactive / headless run) do you skip the prompt: leave `autoVerify: false` and print the
|
|
58
|
+
one-line note `Set "autoVerify": true in forge.config.json to verify automatically after each stage.`
|
|
59
|
+
|
|
32
60
|
After initialization, start the pipeline with `/feature-forge:forge-1-prd <feature-name>`.
|
|
33
61
|
|
|
34
62
|
---
|
|
@@ -47,7 +47,7 @@ Pick based on how many checks the mode carries (see the per-mode totals in Step
|
|
|
47
47
|
|
|
48
48
|
The verifier(s) are read-only — they return findings as their response; **you** (the
|
|
49
49
|
parent) assemble and write the single document to
|
|
50
|
-
`{
|
|
50
|
+
`{resolvedFeatureDir}/.verification/VERIFY-{mode}-{YYYY-MM-DD}.md`. When you fanned out:
|
|
51
51
|
1. Concatenate all instances' findings and **renumber `V-NNN` IDs uniquely** across the
|
|
52
52
|
merged set.
|
|
53
53
|
2. **Dedup** overlaps — when two instances flag the same file+location+issue (e.g. a
|
|
@@ -72,15 +72,39 @@ without subagents), fall back to running verification inline in the current sess
|
|
|
72
72
|
|
|
73
73
|
**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.
|
|
74
74
|
|
|
75
|
+
### Require-clean (`auto`) mode — unattended auto-verify
|
|
76
|
+
|
|
77
|
+
When the navigator auto-invokes this skill (its `autoVerify` path), it passes a
|
|
78
|
+
**require-clean** signal (e.g. args include `--require-clean`, or the invocation is
|
|
79
|
+
described as auto-verify). In this mode the clean-room guarantee is load-bearing: the
|
|
80
|
+
whole reason auto-verify is safe to run without a clear your session / start a fresh session is that the `forge-verifier`
|
|
81
|
+
subagent inherits none of the dispatching session's context. Running inline would break
|
|
82
|
+
that — it would consume the dispatching session's context and invalidate the no-clear
|
|
83
|
+
justification.
|
|
84
|
+
|
|
85
|
+
So in require-clean mode, **do NOT fall back to inline execution**. If the host's subagent mechanism
|
|
86
|
+
or `forge-verifier` subagent is not dispatchable, return a **sentinel** instead of doing
|
|
87
|
+
any work:
|
|
88
|
+
|
|
89
|
+
> `CLEAN_ROOM_UNAVAILABLE: forge-verifier subagent not dispatchable — verify not run.`
|
|
90
|
+
|
|
91
|
+
Do not analyze artifacts, do not write a findings document, and do not touch pipeline
|
|
92
|
+
state. The navigator detects this sentinel and degrades to its manual verify gate (Tier
|
|
93
|
+
2/3), so verify state stays outstanding and the stage is never marked verified on false
|
|
94
|
+
assurance. **Manual / interactive invocation** (the normal `/feature-forge:forge-verify`
|
|
95
|
+
path, no require-clean signal) keeps the inline fallback above unchanged.
|
|
96
|
+
|
|
75
97
|
## Prerequisites
|
|
76
98
|
|
|
77
99
|
Read and follow `references/shared-conventions.md` for feature name validation, configuration reading, and force mode handling before proceeding.
|
|
78
100
|
|
|
101
|
+
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 `{specsDir}/{epic}/{feature}/` path). Use the resulting `{resolvedFeatureDir}` everywhere this skill reads or writes a per-feature artifact or state file — the `{specsDir}/{feature}/…` forms below are shorthand for the resolved path, not a literal flat layout. This does not apply to **epic mode**, whose paths are epic-scoped (`{specsDir}/{epic}/…`) by design.
|
|
102
|
+
|
|
79
103
|
**Turn structure reminder:** Output analysis/context as text, then route ALL questions through the host's question mechanism. Never embed questions in text output — the user will not be prompted and the session will stall.
|
|
80
104
|
|
|
81
105
|
## Step 1: Read Configuration and Determine Mode
|
|
82
106
|
|
|
83
|
-
Read `{
|
|
107
|
+
Read `{resolvedFeatureDir}/.pipeline-state.json` to understand current pipeline state.
|
|
84
108
|
|
|
85
109
|
### Mode Selection
|
|
86
110
|
|
|
@@ -100,16 +124,16 @@ If ambiguous, use the host's question mechanism to ask which stage to verify.
|
|
|
100
124
|
Load into context ALL artifacts for this feature based on mode:
|
|
101
125
|
|
|
102
126
|
**For prd mode:**
|
|
103
|
-
- `{
|
|
127
|
+
- `{resolvedFeatureDir}/PRD.md`
|
|
104
128
|
|
|
105
129
|
**For tech mode:**
|
|
106
|
-
- `{
|
|
107
|
-
- `{
|
|
130
|
+
- `{resolvedFeatureDir}/PRD.md`
|
|
131
|
+
- `{resolvedFeatureDir}/tech-spec.md`
|
|
108
132
|
|
|
109
133
|
**For specs mode:**
|
|
110
|
-
- `{
|
|
111
|
-
- `{
|
|
112
|
-
- `{
|
|
134
|
+
- `{resolvedFeatureDir}/PRD.md`
|
|
135
|
+
- `{resolvedFeatureDir}/tech-spec.md`
|
|
136
|
+
- `{resolvedFeatureDir}/##-*.md` (all implementation specs)
|
|
113
137
|
|
|
114
138
|
**For backlog mode:**
|
|
115
139
|
- All of the above, PLUS
|
|
@@ -150,7 +174,7 @@ Every finding must include:
|
|
|
150
174
|
|
|
151
175
|
## Step 4: Write Findings Document
|
|
152
176
|
|
|
153
|
-
Ensure the `.verification/` subdirectory exists, then write findings to `{
|
|
177
|
+
Ensure the `.verification/` subdirectory exists, then write findings to `{resolvedFeatureDir}/.verification/VERIFY-{mode}-{YYYY-MM-DD}.md`.
|
|
154
178
|
|
|
155
179
|
**For epic mode**, the target is `{specsDir}/{epic}/.verification/VERIFY-epic-{YYYY-MM-DD}.md` (the same format, with `{mode}=epic`).
|
|
156
180
|
|
|
@@ -186,9 +210,16 @@ Do NOT embed this question in your text output.
|
|
|
186
210
|
|
|
187
211
|
Write pipeline state conforming to `references/pipeline-state-schema.json`.
|
|
188
212
|
|
|
189
|
-
Update `{
|
|
190
|
-
- Set the relevant verify entry status to `findings-reported`
|
|
213
|
+
Update `{resolvedFeatureDir}/.pipeline-state.json`:
|
|
214
|
+
- Set the relevant verify entry status to `findings-reported` (or `passed` when there
|
|
215
|
+
are zero findings)
|
|
191
216
|
- Record `findingsFile`, `findingsCount`, `verifiedAt`
|
|
217
|
+
- Record `verifiedStageVersion` = the current `version` of the production stage entry
|
|
218
|
+
this verify covers (e.g. verifying `tech` → `stages["forge-2-tech"].version`). This
|
|
219
|
+
feeds the navigator's freshness ledger: a later revision to that artifact bumps its
|
|
220
|
+
`version`, so the recorded value no longer matches and auto-verify re-fires. Omitting
|
|
221
|
+
this leaves the verify looking stale (safe: the navigator re-verifies rather than
|
|
222
|
+
skips).
|
|
192
223
|
|
|
193
224
|
Do NOT mark as `findings-applied` — that happens after the fix pass.
|
|
194
225
|
|
|
@@ -213,13 +244,13 @@ Do NOT mark as `findings-applied` — that happens after the fix pass.
|
|
|
213
244
|
- Don't verify things that are intentionally left open (check the PRD's "Open Questions" section).
|
|
214
245
|
- 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.
|
|
215
246
|
- 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.
|
|
216
|
-
- 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 {
|
|
247
|
+
- 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 {resolvedFeatureDir} --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.
|
|
217
248
|
- For specs verification, also run the deterministic traceability validator to supplement agent-driven traceability checks. Include any uncovered requirements or orphaned references as findings:
|
|
218
249
|
|
|
219
250
|
```bash
|
|
220
|
-
R="$(for d in "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done)"
|
|
251
|
+
R="$(bash -c 'for d in "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/cache/*/feature-forge/* "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done')"
|
|
221
252
|
[ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
|
|
222
|
-
python3 "$R/scripts/validate-traceability.py" {
|
|
253
|
+
python3 "$R/scripts/validate-traceability.py" {resolvedFeatureDir}/PRD.md {resolvedFeatureDir}/ --json
|
|
223
254
|
```
|
|
224
255
|
|
|
225
256
|
---
|
|
@@ -192,7 +192,7 @@ findings to E01/E02/E03/E08. Then perform the judgment checks E04–E07 by readi
|
|
|
192
192
|
manifest, EPIC.md, and completed members' specs.
|
|
193
193
|
|
|
194
194
|
```bash
|
|
195
|
-
R="$(for d in "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done)"
|
|
195
|
+
R="$(bash -c 'for d in "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/cache/*/feature-forge/* "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done')"
|
|
196
196
|
[ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
|
|
197
197
|
python3 "$R/scripts/epic-manifest.py" validate "{epic}" --specs-dir "{specsDir}" --json
|
|
198
198
|
```
|
package/dist/apply.js
CHANGED
|
@@ -91,8 +91,9 @@ async function applyCopyInstall(planned, ctx) {
|
|
|
91
91
|
if (!placementResult.ok)
|
|
92
92
|
return fail(ctx, planned, placementResult.error);
|
|
93
93
|
// No-op short-circuit (REQ-IDEM-01): every action — primary AND placement — unchanged ⇒ zero
|
|
94
|
-
// writes, manifest untouched
|
|
95
|
-
|
|
94
|
+
// writes, manifest untouched — UNLESS manifest metadata (raufPin) drifted, which must persist
|
|
95
|
+
// even with no file change (F1) so report / on-disk manifest / a later `list` agree.
|
|
96
|
+
if (allUnchanged(planned) && !manifestNeedsRewrite(ctx)) {
|
|
96
97
|
return success(ctx, planned);
|
|
97
98
|
}
|
|
98
99
|
const manifest = buildManifest({
|
|
@@ -113,6 +114,18 @@ async function applyCopyInstall(planned, ctx) {
|
|
|
113
114
|
return fail(ctx, planned, wrote.error);
|
|
114
115
|
return success(ctx, planned);
|
|
115
116
|
}
|
|
117
|
+
/**
|
|
118
|
+
* True when manifest metadata diverges from the prior manifest, so the manifest must be rewritten
|
|
119
|
+
* even when every file action is "unchanged" (F1). Today the only such field is `raufPin`; a null
|
|
120
|
+
* prior manifest also counts (there is nothing recorded yet). `updatedAt` is deliberately NOT a
|
|
121
|
+
* trigger — it is a consequence of writing, so keying on it would defeat the idempotency short-circuit.
|
|
122
|
+
*/
|
|
123
|
+
function manifestNeedsRewrite(ctx) {
|
|
124
|
+
const prior = ctx.priorManifest;
|
|
125
|
+
if (prior === null)
|
|
126
|
+
return true;
|
|
127
|
+
return prior.raufPin !== ctx.raufPin;
|
|
128
|
+
}
|
|
116
129
|
/** True iff every planned action — primary files and all placement files — is "unchanged". */
|
|
117
130
|
function allUnchanged(planned) {
|
|
118
131
|
return (planned.files.every((f) => f.action === "unchanged") &&
|
|
@@ -164,8 +177,8 @@ async function applySymlinkInstall(planned, ctx) {
|
|
|
164
177
|
const primary = planned.files;
|
|
165
178
|
const primaryUntouched = primary.every((f) => f.action === "unchanged") ||
|
|
166
179
|
primary.every((f) => f.action === "skip-modified");
|
|
167
|
-
// Nothing changed anywhere ⇒ zero writes, manifest untouched.
|
|
168
|
-
if (allUnchanged(planned)) {
|
|
180
|
+
// Nothing changed anywhere ⇒ zero writes, manifest untouched — unless raufPin drifted (F1).
|
|
181
|
+
if (allUnchanged(planned) && !manifestNeedsRewrite(ctx)) {
|
|
169
182
|
return success(ctx, planned);
|
|
170
183
|
}
|
|
171
184
|
// The recorded mode/link reflect the primary namespace dir: only (re)link when it actually changed
|
|
@@ -285,12 +298,25 @@ async function applyMirror(pl, ctx, source, prior) {
|
|
|
285
298
|
case "skip-modified": {
|
|
286
299
|
// Carry the prior record forward; if none exists (e.g. a v1→v2 manifest migration where the
|
|
287
300
|
// file is already on disk), reconstruct it by hashing the destination so the inventory stays
|
|
288
|
-
// faithful rather than silently dropping an unrecorded-but-present file.
|
|
301
|
+
// faithful rather than silently dropping an unrecorded-but-present file. Guard the hash: a
|
|
302
|
+
// TOCTOU vanish (file removed after planning) must yield an err Result, never throw ENOENT
|
|
303
|
+
// out of apply (REQ-OBS-03 — a throw would abort every sibling agent at the CLI boundary).
|
|
289
304
|
const p = priorByPath.get(fa.relpath);
|
|
290
|
-
if (p !== undefined)
|
|
305
|
+
if (p !== undefined) {
|
|
291
306
|
inventory.push(p);
|
|
292
|
-
|
|
293
|
-
|
|
307
|
+
}
|
|
308
|
+
else {
|
|
309
|
+
try {
|
|
310
|
+
inventory.push({ path: fa.relpath, sha256: sha256File(destAbs) });
|
|
311
|
+
}
|
|
312
|
+
catch {
|
|
313
|
+
return err({
|
|
314
|
+
code: "UNEXPECTED",
|
|
315
|
+
agent: ctx.agent,
|
|
316
|
+
message: `mirror file "${fa.relpath}" vanished before it could be recorded (${destAbs})`,
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
}
|
|
294
320
|
break;
|
|
295
321
|
}
|
|
296
322
|
}
|