@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,214 @@
|
|
|
1
|
+
# forge-5-loop — Loop-Runner Contract (launch, supervision, model precedence)
|
|
2
|
+
|
|
3
|
+
This file holds the detailed loop-runner contract relocated out of
|
|
4
|
+
`forge-5-loop/SKILL.md`: the event-stream vs. log-fallback **launch** detail
|
|
5
|
+
(Steps 3b/3d/3e), the structured-surface **monitoring** caveats, the **model
|
|
6
|
+
precedence** rule, and the **optional-flags catalog** referenced from Step 2d.
|
|
7
|
+
Every command below is rendered from `loopRunner` with token substitution, as in
|
|
8
|
+
the skill body.
|
|
9
|
+
|
|
10
|
+
## Model selection precedence (Step 2d)
|
|
11
|
+
|
|
12
|
+
The runner picks the per-iteration model by precedence (highest wins):
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
item.model > --model / options > project default > provider default
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
So a backlog item's own `model` field overrides a `--model` flag passed to the
|
|
19
|
+
run, which overrides the project's configured default, which overrides the
|
|
20
|
+
runner/provider default. Pass `--model <model>` (optional flag below) to override
|
|
21
|
+
the project default for the whole run.
|
|
22
|
+
|
|
23
|
+
## Agent selection (Step 2d)
|
|
24
|
+
|
|
25
|
+
This section is **parallel** to `## Model selection precedence` above: it governs
|
|
26
|
+
which **coding agent** rauf drives for the run. The entire surface is
|
|
27
|
+
**presence-gated** on `loopRunner.agentArgument` — when that field is absent or
|
|
28
|
+
empty, there is no selector, no probe, and no `{agent}` substitution, and Step 2d /
|
|
29
|
+
Step 3c are byte-identical to today (capability gate;
|
|
30
|
+
`02-config-schema-and-gating.md`, REQ-PLUG-02). The rest assumes the gate is on.
|
|
31
|
+
|
|
32
|
+
**Precedence (highest wins):**
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
item.provider > --agent (run selection) > loopRunner.defaultAgent (project) > runner default (claude-cli)
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
**Run-layer mapping — why forge never re-implements rauf's resolver.** forge owns
|
|
39
|
+
**only** its run and project layers and collapses them into **one** value
|
|
40
|
+
(`resolve()`: `run_selection or defaultAgent or none`), which it emits as a single
|
|
41
|
+
`--agent {agent}` occupying rauf's **run layer only**. rauf alone resolves
|
|
42
|
+
item-vs-run via its own 5-layer resolver, sitting the per-item `BacklogItem.provider`
|
|
43
|
+
**above** forge's run layer — so a run selection can never clobber a deliberate
|
|
44
|
+
per-item agent. forge **never reads, writes, or overrides** `BacklogItem.provider`
|
|
45
|
+
(REQ-AGENT-05). When forge sends nothing (the default path), rauf applies its own
|
|
46
|
+
default `claude-cli`, byte-identical to today. Empty/whitespace selections are
|
|
47
|
+
treated as unset, and an explicit pick of the runner default id collapses to the
|
|
48
|
+
default path (append nothing, run no probe). See
|
|
49
|
+
`03-selection-resolution-observability.md §3–§4`.
|
|
50
|
+
|
|
51
|
+
**Availability pre-check + disambiguation.** For a **non-default** resolved id only,
|
|
52
|
+
forge runs `loopRunner.agentsProbeCommand` **once** (no retries) and classifies the
|
|
53
|
+
id by **membership** in the advertised set (`{ row.id for row in agents }`), then the
|
|
54
|
+
matching row's `available` flag — **never** by exit code, because `rauf agents
|
|
55
|
+
--json` always exits 0 (an unknown id is simply absent; a known-unavailable one is
|
|
56
|
+
present with `available: false`):
|
|
57
|
+
|
|
58
|
+
- **UNKNOWN** (`∉` advertised set): hard-reject **before any loop side-effect**,
|
|
59
|
+
listing the sorted valid ids; **no proceed-anyway**; the value never interpolates
|
|
60
|
+
into `{agent}` (the advertised set IS the allow-list — REQ-SEC-01).
|
|
61
|
+
- **UNAVAILABLE** (member, `available == False`): warn with the row's `detail`, then
|
|
62
|
+
offer **proceed-anyway OR choose-another** — never silent.
|
|
63
|
+
- **AVAILABLE** (member, `available == True`): proceed; the validated id fills
|
|
64
|
+
`{agent}`.
|
|
65
|
+
- **Probe failure** (non-zero exit / unparseable / wrong shape / empty `agents[]` /
|
|
66
|
+
row missing `id`): surface it and offer **choose-another OR abort**; never launch
|
|
67
|
+
the non-default agent unvalidated, never silently fall back to the default.
|
|
68
|
+
|
|
69
|
+
The default / `claude-cli` path runs **no** probe (zero extra cost). See
|
|
70
|
+
`04-availability-precheck.md` for the full pre-check, classification, and allow-list,
|
|
71
|
+
and `02-config-schema-and-gating.md` for the capability gate.
|
|
72
|
+
|
|
73
|
+
## Optional flags catalog (Step 2d, rauf)
|
|
74
|
+
|
|
75
|
+
These are the optional flags the user may add to the rendered run command. If the
|
|
76
|
+
user requests additional flags, append them to the rendered run command.
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
--agent <id> Coding agent rauf drives this run (see Agent selection below).
|
|
80
|
+
Only the runner's advertised ids are valid; an unknown id is
|
|
81
|
+
rejected before launch. Shown only when the runner advertises
|
|
82
|
+
an agent surface (loopRunner.agentArgument present).
|
|
83
|
+
--review Run a review pass after all iterations (extra agent session)
|
|
84
|
+
--model <model> Override the model (see precedence above)
|
|
85
|
+
--timeout <min> Per-session timeout in minutes (default: 60)
|
|
86
|
+
--retry-blocked Unblock and retry previously blocked items
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Launch detail (Step 3b — background process)
|
|
90
|
+
|
|
91
|
+
Launch the loop **backgrounded** so it survives session end and does not block the
|
|
92
|
+
session, and prefer the machine-readable event stream so the session can supervise
|
|
93
|
+
it live.
|
|
94
|
+
|
|
95
|
+
- **If `loopRunner.eventStreamCommand` is configured (default for rauf):** render it
|
|
96
|
+
(it appends `--ndjson` to the run) and launch via the Bash tool with
|
|
97
|
+
`run_in_background: true`, redirecting stdout to a stable events file:
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
mkdir -p {backlogDir}/{loopRunner.stateDir} && {rendered eventStreamCommand} > {backlogDir}/{loopRunner.stateDir}/events.ndjson 2>&1
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
(The `mkdir -p` guards the very first run, before the runner has created its
|
|
104
|
+
state dir.) This emits one JSON event per line **and** keeps the loop detached. The background
|
|
105
|
+
task's exit notification remains the single authoritative terminal signal (Step 4).
|
|
106
|
+
- **Fallback (runner has no `eventStreamCommand`):** launch the plain `runCommand`
|
|
107
|
+
with `run_in_background: true`. The session will then supervise by tailing the
|
|
108
|
+
human log (3d fallback) instead of the NDJSON file.
|
|
109
|
+
|
|
110
|
+
Loop runs can take significant time (minutes to hours depending on backlog size).
|
|
111
|
+
|
|
112
|
+
## Arm a Monitor on the event stream (Step 3d)
|
|
113
|
+
|
|
114
|
+
Arm the **`Monitor` tool** on the structured event stream so events flow back into
|
|
115
|
+
this session as they happen. Use **`persistent: true`** — runs can exceed `Monitor`'s
|
|
116
|
+
maximum `timeout_ms` (1 hour), and a bounded timeout would silently stop watching a
|
|
117
|
+
still-running loop.
|
|
118
|
+
|
|
119
|
+
**Coverage-complete filter (silence is not success).** The filter MUST match every
|
|
120
|
+
terminal and exception state, not just the happy path — otherwise a crash or hang
|
|
121
|
+
looks identical to "still running." Monitor command (NDJSON path):
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
tail -n +1 -f {backlogDir}/{loopRunner.stateDir}/events.ndjson 2>&1 \
|
|
125
|
+
| jq -rc --unbuffered 'select(.type | test("item_completed|item_blocked|needs_human|signal_parsed|loop_completed|loop_error|loop_cancelled|llm_stuck_warning"))'
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
- **Fallback (log tail, no NDJSON):** match the runner's **structured prose
|
|
129
|
+
prefixes**, never the `RAUF_*` tokens (those leak inside agent output and
|
|
130
|
+
false-match). For rauf:
|
|
131
|
+
|
|
132
|
+
```
|
|
133
|
+
tail -n +1 -f {backlogDir}/{loopRunner.stateDir}/{loopRunner.logFile} \
|
|
134
|
+
| grep -E --line-buffered 'Item [^ ]+ (completed|blocked):|Item [^ ]+ needs human input|Loop completed|Loop error:|Circuit breaker:'
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
(Match `needs human input` **without** a trailing colon — the runner writes
|
|
138
|
+
`needs human input (set aside):`.)
|
|
139
|
+
|
|
140
|
+
If the Monitor is ever auto-stopped for event volume, re-arm with a tighter filter
|
|
141
|
+
(drop `item_completed`, keep the exception/terminal events).
|
|
142
|
+
|
|
143
|
+
## React to events as they land (Step 3e)
|
|
144
|
+
|
|
145
|
+
Each Monitor event arrives as a message. React per type — but keep the user signal
|
|
146
|
+
high and the noise low:
|
|
147
|
+
|
|
148
|
+
- **`item_completed`** → increment a running tally. These land minutes apart, so they
|
|
149
|
+
won't trip the volume auto-stop; still, surface a coalesced milestone ("12/30 done")
|
|
150
|
+
rather than echoing every line. For an exact breakdown, run the one-shot
|
|
151
|
+
`{rendered statusJsonCommand}` and report `done/total` from `backlogSummary`.
|
|
152
|
+
- **`needs_human`** (or `signal_parsed` with `signal: "needs_human"`) → **surface
|
|
153
|
+
immediately** and send a **`PushNotification`** (an hours-long run means the user has
|
|
154
|
+
likely stepped away). **Important — the loop is NOT paused:** the runner has set that
|
|
155
|
+
item aside and kept working other items. So report *what* needs a human and *which*
|
|
156
|
+
item, then either (a) collect the user's answer via `AskUserQuestion` to **stage a
|
|
157
|
+
post-run retry**, or (b) offer to **cancel the run early** if the answer changes the
|
|
158
|
+
whole plan. Do not tell the user the loop is waiting on their reply — it isn't.
|
|
159
|
+
- **`item_blocked`** → surface the blocked item + reason now (visibility) and
|
|
160
|
+
accumulate for the final summary. Use `{rendered statusJsonCommand}` to distinguish a
|
|
161
|
+
genuine `blocked` from a runner-`deferred` "false block" (`backlogSummary.deferred`).
|
|
162
|
+
- **`loop_error`** → a real failure (this is also what a circuit-breaker halt — too many
|
|
163
|
+
consecutive infra failures — emits). Surface now and `PushNotification`. Offer
|
|
164
|
+
inspection / `--force` / re-run as appropriate.
|
|
165
|
+
- **Stall detection** → rauf emits an **`llm_stuck_warning`** event when an iteration
|
|
166
|
+
stops making progress; the filter above includes it, so surface it live (a hang
|
|
167
|
+
warning, not yet a failure) and offer `--force` if it persists. If you instead want to
|
|
168
|
+
probe on quiet, run `{rendered watchCommand}` (or read
|
|
169
|
+
`{backlogDir}/{loopRunner.stateDir}/iteration-status.json`) and key off its
|
|
170
|
+
`stuckWarning` flag. Do **not** infer a stall from `state.json.updatedAt` alone — it is
|
|
171
|
+
not a liveness proof.
|
|
172
|
+
|
|
173
|
+
## Inform-user output template (Step 3c)
|
|
174
|
+
|
|
175
|
+
This is the verbatim "Loop started…" output the session shows the user after
|
|
176
|
+
launch. Commands are the rendered `loopRunner` monitoring commands.
|
|
177
|
+
|
|
178
|
+
When the agent surface is gated on (`loopRunner.agentArgument` present), add the
|
|
179
|
+
`Coding agent:` line shown below immediately after the opening `Loop started …`
|
|
180
|
+
line, using the same `sourceLabel` mapping as the Step 2d confirmation
|
|
181
|
+
(`RUN` → `"per-run selection"`, `PROJECT` →
|
|
182
|
+
`"project default (loopRunner.defaultAgent)"`, `DEFAULT` →
|
|
183
|
+
`"runner default — claude-cli"`). When the gate is off, the line is **absent** and
|
|
184
|
+
the template is byte-identical to today (REQ-PLUG-02). When the launch proceeded via
|
|
185
|
+
the UNAVAILABLE *proceed-anyway* path, use the audit variant instead:
|
|
186
|
+
|
|
187
|
+
```
|
|
188
|
+
Coding agent: {resolved.agent or claude-cli} (source: {sourceLabel}).
|
|
189
|
+
Coding agent: {resolved.agent} (source: {sourceLabel}; proceeded despite unavailability warning).
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
(The two lines above are alternatives — the first is the normal line; the second
|
|
193
|
+
replaces it only on the proceed-anyway path. This is session-side prose only; it
|
|
194
|
+
introduces no new event type, so the Step 3d Monitor filter is unchanged.)
|
|
195
|
+
|
|
196
|
+
```
|
|
197
|
+
Loop started for {feature} ({N} items to process).
|
|
198
|
+
Coding agent: {resolved.agent or claude-cli} (source: {sourceLabel}). # only when the agent surface is gated on
|
|
199
|
+
This session is now monitoring it live — I'll report milestones and stop you in if
|
|
200
|
+
the loop needs a human. The loop also runs detached and survives this session ending.
|
|
201
|
+
Each item gets a fresh agent session with full context from the backlog and specs.
|
|
202
|
+
|
|
203
|
+
Watch directly if you like (another terminal or `!` prefix):
|
|
204
|
+
{rendered statusCommand} # one-shot status
|
|
205
|
+
{rendered followCommand} # stream live events (human)
|
|
206
|
+
{rendered logCommand} # tail log file
|
|
207
|
+
{rendered listCommand} # check item statuses
|
|
208
|
+
|
|
209
|
+
State files are at: {backlogDir}/{loopRunner.stateDir}/
|
|
210
|
+
- state.json (loop state)
|
|
211
|
+
- events.ndjson (structured event stream this session is watching)
|
|
212
|
+
- {loopRunner.logFile} (human event log)
|
|
213
|
+
- iteration-status.json (live activity, incl. stuckWarning)
|
|
214
|
+
```
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
---
|
|
2
|
+
# GENERATED — DO NOT EDIT. Source: skills/forge-6-docs/SKILL.md. Regenerate: python3 scripts/build-adapters.py
|
|
3
|
+
name: forge-6-docs
|
|
4
|
+
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.
|
|
5
|
+
argument-hint: <feature-name>
|
|
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
|
+
name: forge-fix
|
|
4
|
+
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.
|
|
5
|
+
argument-hint: <feature-name>
|
|
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,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
# GENERATED — DO NOT EDIT. Source: skills/forge-init/SKILL.md. Regenerate: python3 scripts/build-adapters.py
|
|
3
|
+
name: forge-init
|
|
4
|
+
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.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Initialize Feature Forge
|
|
8
|
+
|
|
9
|
+
Run the initialization script to create `forge.config.json` with default settings:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
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)"
|
|
13
|
+
[ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
|
|
14
|
+
bash "$R/scripts/forge-init.sh"
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
After initialization, the config file will contain defaults for:
|
|
18
|
+
- `specsDir`: `./specs`
|
|
19
|
+
- `docsDir`: `./docs/architecture`
|
|
20
|
+
- `backlogDir`: `null` (backlog lives alongside specs)
|
|
21
|
+
- `gitCommitAfterStage`: `true`
|
|
22
|
+
- `commitPrefix`: `forge`
|
|
23
|
+
- `stack`: `null` (detected during `/feature-forge:forge-2-tech`)
|
|
24
|
+
- `typeCheckCommand`: `null` (set during `/feature-forge:forge-2-tech`)
|
|
25
|
+
- `testCommand`: `null` (set during `/feature-forge:forge-2-tech`)
|
|
26
|
+
|
|
27
|
+
If `forge.config.json` already exists, the script will not overwrite it.
|
|
28
|
+
|
|
29
|
+
After initialization, start the pipeline with `/feature-forge:forge-1-prd <feature-name>`.
|