@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,153 @@
|
|
|
1
|
+
---
|
|
2
|
+
# GENERATED — DO NOT EDIT. Source: skills/forge-3-specs/SKILL.md. Regenerate: python3 scripts/build-adapters.py
|
|
3
|
+
name: forge-3-specs
|
|
4
|
+
description: Generate numbered implementation spec documents from PRD and tech spec in the forge pipeline. Use when user runs /feature-forge:forge-3-specs or asks to create detailed implementation specs for a forge feature after tech spec completion. Do NOT trigger for general specification writing, design docs, or implementation planning outside the forge pipeline.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# forge-3-specs — Implementation Spec Suite Generator
|
|
8
|
+
|
|
9
|
+
Generate a comprehensive suite of numbered implementation specification documents that provide everything needed to implement a feature.
|
|
10
|
+
|
|
11
|
+
## Prerequisites
|
|
12
|
+
|
|
13
|
+
Read and follow `references/shared-conventions.md` for feature name validation, configuration reading, and force mode handling before proceeding.
|
|
14
|
+
|
|
15
|
+
**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.
|
|
16
|
+
|
|
17
|
+
## Step 1: Validate Prerequisites
|
|
18
|
+
|
|
19
|
+
**Resolve the feature directory first** via the **Feature Directory Resolution** block in `references/shared-conventions.md`, setting `{resolvedFeatureDir}`.
|
|
20
|
+
|
|
21
|
+
**Prerequisite check:** Read `{resolvedFeatureDir}/.pipeline-state.json`. If not in force mode, both `forge-1-prd` and `forge-2-tech` must be `complete`. If not, STOP and tell the user which prerequisites are missing.
|
|
22
|
+
|
|
23
|
+
Read both `{resolvedFeatureDir}/PRD.md` and `{resolvedFeatureDir}/tech-spec.md` into context.
|
|
24
|
+
|
|
25
|
+
After reading the PRD and tech spec, invoke the **Epic Context Injection** block in `references/shared-conventions.md`. It self-gates on the resolved feature's `epic` back-pointer: for a standalone feature it is a no-op; for an epic member it loads EPIC.md, this feature's charter, and the completed direct dependencies' specs into context before the spec suite is planned.
|
|
26
|
+
|
|
27
|
+
## Step 2: Examine Existing Context
|
|
28
|
+
|
|
29
|
+
1. **Read the PRD and tech spec thoroughly**: These are your source of truth
|
|
30
|
+
2. **Examine the existing codebase**: Look at how other packages are structured, what patterns they follow, what types they export
|
|
31
|
+
3. **Check other features' implementation specs**: Look at `{specsDir}/*/[0-9][0-9]-*.md` AND `{specsDir}/*/*/[0-9][0-9]-*.md` (depth-2, for epic-nested features) for consistency in format and depth. Subject to the **feature-shaped-dir bound**: only treat a matched directory as a feature if it directly contains a `.pipeline-state.json` (per the Feature Directory Resolution block) — ignore `EPIC.md` directories and other non-feature subtrees. Flat-only trees gain no new matches from the depth-2 glob, so standalone behavior is unchanged (REQ-COMPAT-01).
|
|
32
|
+
4. **Read integration target code**: For every package listed as an integration point in the tech spec, read its actual source — types, exports, patterns. For every integration point, include the EXACT function signature and import path you read from the source code. Include the file path where you found it. If you cannot locate an expected export, say so explicitly: 'WARNING: Could not locate X export in {module} — verify this exists before implementing.'
|
|
33
|
+
5. **Read spec examples**: Read `references/spec-examples.md` for the expected depth and quality of spec sections. These examples are your quality bar.
|
|
34
|
+
|
|
35
|
+
## Step 3: Plan the Document Suite
|
|
36
|
+
|
|
37
|
+
Read `references/spec-archetypes.md` for the menu of document types.
|
|
38
|
+
|
|
39
|
+
Based on the feature's complexity, propose a document plan to the user before writing. Output the document list as text, then use `AskUserQuestion` for the question — do NOT include the question in your text output.
|
|
40
|
+
|
|
41
|
+
**Example text output (no question here):**
|
|
42
|
+
```
|
|
43
|
+
I'll create the following spec documents for {feature}:
|
|
44
|
+
|
|
45
|
+
Required:
|
|
46
|
+
00-core-definitions.md — Type definitions, error hierarchy, shared contracts
|
|
47
|
+
01-architecture-layout.md — Directory structure, exports map, dependency graph
|
|
48
|
+
NN-testing-strategy.md — Test approach, coverage targets, fixture patterns
|
|
49
|
+
|
|
50
|
+
Feature-specific:
|
|
51
|
+
02-{subsystem-a}.md — {Brief description}
|
|
52
|
+
03-{subsystem-b}.md — {Brief description}
|
|
53
|
+
04-integration-points.md — Integration with existing project modules
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
**Then call `AskUserQuestion`** with: "Does this look right? Should I add or remove any documents?"
|
|
57
|
+
|
|
58
|
+
**Incremental artifact tracking:** After each spec document is written (by you or a writer subagent), immediately update the `artifacts` array in `.pipeline-state.json` with the new file path. This enables crash recovery if the session is interrupted mid-suite (see shared-conventions.md "Crash Recovery").
|
|
59
|
+
|
|
60
|
+
## Step 4: Write the Spec Suite
|
|
61
|
+
|
|
62
|
+
The suite has a hard internal dependency: every domain/integration doc references the
|
|
63
|
+
shared types and layout from `00-core-definitions.md` and `01-architecture-layout.md`.
|
|
64
|
+
So author in two phases — a sequential foundation, then a parallel fan-out.
|
|
65
|
+
|
|
66
|
+
### 4a. Foundation pass (sequential, you author)
|
|
67
|
+
|
|
68
|
+
Write `00-core-definitions.md` and `01-architecture-layout.md` yourself, in the main
|
|
69
|
+
session, **before** anything else. Every later document depends on these shared types
|
|
70
|
+
and the directory/exports map, so they must exist and be stable first.
|
|
71
|
+
|
|
72
|
+
### 4b. Domain fan-out (parallel `forge-spec-writer` subagents)
|
|
73
|
+
|
|
74
|
+
Once the foundation is written, dispatch the remaining numbered docs in parallel — **one
|
|
75
|
+
`forge-spec-writer` subagent per document, in a single message with multiple Agent
|
|
76
|
+
calls** (the `superpowers:dispatching-parallel-agents` pattern). Each writer is given:
|
|
77
|
+
- the PRD and tech-spec,
|
|
78
|
+
- the just-written `00-core-definitions.md` and `01-architecture-layout.md` (so it builds
|
|
79
|
+
on the shared types, not its own),
|
|
80
|
+
- the stack profile path `references/stacks/{stack}.md` (if `stack` is set in config),
|
|
81
|
+
- the quality bar in `references/spec-examples.md`,
|
|
82
|
+
- the **exact single filename it must write** and the archetype slice (from
|
|
83
|
+
`references/spec-archetypes.md`) it covers.
|
|
84
|
+
- **(epic members only — additive context):** the relevant `EPIC.md` Contracts section(s)
|
|
85
|
+
for this feature, and the `tech-spec.md` of each completed direct dependency at {paths} — so
|
|
86
|
+
the doc is written against real upstream contracts, not guesses.
|
|
87
|
+
|
|
88
|
+
Each writer authors **only its one assigned file** and returns a short **manifest** of
|
|
89
|
+
the `REQ-XXX-NN` IDs it covered (feeds Step 5 traceability). Author `NN-testing-strategy.md`
|
|
90
|
+
last (it can be its own writer, or you author it once the others' shapes are known).
|
|
91
|
+
|
|
92
|
+
**Fallback (no subagents available):** author the documents yourself in batches of 3–5,
|
|
93
|
+
foundation first; after each batch, optionally commit
|
|
94
|
+
(`git add {specsDir}/{feature}/ && git commit -m "{commitPrefix}({feature}): specs batch {n}"`)
|
|
95
|
+
and re-read only `00-core-definitions.md` plus the upstream docs the next batch needs —
|
|
96
|
+
do not reload everything. This keeps quality up under context pressure.
|
|
97
|
+
|
|
98
|
+
### Quality requirements (every document, whoever writes it)
|
|
99
|
+
|
|
100
|
+
1. Number sequentially: `00-`, `01-`, `02-`, etc.
|
|
101
|
+
2. Every implementation detail MUST trace to either a PRD requirement (REQ-XXX-NN) or a tech-spec decision
|
|
102
|
+
3. Before the body, include a `## Requirement Coverage` table mapping every REQ-XXX-NN this document covers to the section that implements it
|
|
103
|
+
4. Include complete type definitions, data structures, and function signatures in the project's language — not pseudocode. If a stack profile exists at `references/stacks/{stack}.md` (where `{stack}` comes from `forge.config.json`), follow its conventions for type definitions, error hierarchies, and documentation comments.
|
|
104
|
+
5. Include error handling for every operation
|
|
105
|
+
6. Include example usage where it aids clarity
|
|
106
|
+
7. Cross-reference other spec documents by filename when one document depends on definitions from another
|
|
107
|
+
|
|
108
|
+
### Document Conventions
|
|
109
|
+
|
|
110
|
+
- Filename format: `{specsDir}/{feature}/##-<descriptive-name>.md`
|
|
111
|
+
- Each document should be self-contained enough that an engineer could implement it without reading other spec docs (though cross-references help for context)
|
|
112
|
+
- Include a "Dependencies" section listing which other spec docs must be implemented first
|
|
113
|
+
- Include a "Verification" section describing how to confirm the implementation matches the spec
|
|
114
|
+
|
|
115
|
+
## Step 5: Cross-Reference Validation
|
|
116
|
+
|
|
117
|
+
After writing all documents, verify:
|
|
118
|
+
|
|
119
|
+
1. Every PRD requirement has coverage in at least one spec document
|
|
120
|
+
2. Every tech-spec decision is reflected in the implementation specs
|
|
121
|
+
3. Cross-references between spec documents are consistent (no broken references)
|
|
122
|
+
4. Type definitions used across documents are consistent
|
|
123
|
+
5. No orphaned implementation details that don't trace to requirements
|
|
124
|
+
6. Produce a traceability matrix: a markdown table mapping every REQ-XXX-NN from the PRD to the spec document and section that implements it. Write this to `{resolvedFeatureDir}/TRACEABILITY.md`
|
|
125
|
+
|
|
126
|
+
List any gaps or inconsistencies found and resolve them.
|
|
127
|
+
|
|
128
|
+
## Step 6: Review with User
|
|
129
|
+
|
|
130
|
+
Present a summary of all documents created as text, with key decisions highlighted. Then use `AskUserQuestion` to collect feedback — do NOT include these questions in your text output:
|
|
131
|
+
|
|
132
|
+
"1. Does the level of detail match what you need? 2. Any areas that need more depth? 3. Any missing subsystems or concerns?"
|
|
133
|
+
|
|
134
|
+
## Step 7: Update Pipeline State and Commit
|
|
135
|
+
|
|
136
|
+
Write pipeline state conforming to `references/pipeline-state-schema.json`.
|
|
137
|
+
|
|
138
|
+
1. Update `{resolvedFeatureDir}/.pipeline-state.json`:
|
|
139
|
+
- Set `currentStage` to `forge-4-backlog` (or verification if they want to verify first)
|
|
140
|
+
- Record all created files in `artifacts`, including `TRACEABILITY.md`
|
|
141
|
+
- Set `stages.forge-3-specs.basedOnVersions` to `{"forge-1-prd": <current version>, "forge-2-tech": <current version>}`
|
|
142
|
+
- Check downstream stages (forge-4-backlog, forge-5-loop, forge-6-docs). If any have `basedOnVersions` referencing older versions, set their status to `stale`
|
|
143
|
+
2. Use `AskUserQuestion` to ask about notes to persist
|
|
144
|
+
3. If `gitCommitAfterStage` is true, follow the Git Commit Protocol in `references/shared-conventions.md`: stage files, attempt commit with message `"{commitPrefix}({feature}): complete implementation specs v{n}"`, then set `stages.forge-3-specs.status` to `complete` with commit hash only on success. If commit fails, leave status as `in-progress`.
|
|
145
|
+
5. Tell the user: "Implementation specs complete. Next steps:\n - `/feature-forge:forge-verify {feature}` to verify the specs (strongly recommended)\n - `/feature-forge:forge-4-backlog {feature}` to generate the backlog\n - `/feature-forge:forge {feature}` to see full pipeline status"
|
|
146
|
+
|
|
147
|
+
## Gotchas
|
|
148
|
+
|
|
149
|
+
- Don't create specs for things that are already fully specified in the tech spec. If the tech spec has complete type definitions, the implementation spec should reference them, not duplicate them.
|
|
150
|
+
- Every spec document should include complete type definitions and function signatures in the project's language with documentation comments. The backlog generator and implementing engineer depend on these being exact, not approximate.
|
|
151
|
+
- Resist the urge to create too many documents. Each document should represent a major concern. If a "document" would be under 50 lines, it probably belongs as a section in another document.
|
|
152
|
+
- Watch for implicit dependencies between subsystems. If subsystem A's types are used by subsystem B, the spec should explicitly state this and ensure the types are defined in the shared types document.
|
|
153
|
+
- If the feature is large, the spec suite might be 8-12 documents. If it's simple, 3-4 is fine. Match complexity to the feature, not a fixed template.
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# Implementation Spec Archetypes
|
|
2
|
+
|
|
3
|
+
This reference defines the types of implementation spec documents and their internal structure. Use this to plan which documents a feature needs.
|
|
4
|
+
|
|
5
|
+
## Always Required
|
|
6
|
+
|
|
7
|
+
### 00-core-definitions.md
|
|
8
|
+
The shared type system and data contracts for the feature. Every other spec document references definitions here.
|
|
9
|
+
|
|
10
|
+
**Sections:**
|
|
11
|
+
- Type aliases, union types, enums, or language-equivalent constructs
|
|
12
|
+
- Core types/interfaces/structs with documentation comments on every field
|
|
13
|
+
- Error/exception hierarchy (base error, domain-specific errors, each with typed properties)
|
|
14
|
+
- Constants and enumerations
|
|
15
|
+
- Utility types (if any)
|
|
16
|
+
|
|
17
|
+
**Rules:**
|
|
18
|
+
- Every type must have documentation comments explaining its purpose (JSDoc, docstrings, godoc, etc.)
|
|
19
|
+
- Error types must include `code`, `message`, and domain-specific context fields
|
|
20
|
+
- Export everything through the module's entry point following project conventions
|
|
21
|
+
|
|
22
|
+
### 01-architecture-layout.md
|
|
23
|
+
How the feature is structured in the project.
|
|
24
|
+
|
|
25
|
+
**Sections:**
|
|
26
|
+
- Directory tree (full, not abbreviated)
|
|
27
|
+
- Project manifest: name, exports/entry points, dependencies, build scripts
|
|
28
|
+
- Build/compiler configuration: key options
|
|
29
|
+
- Module export structure: what each entry point exposes
|
|
30
|
+
- Build and deployment considerations
|
|
31
|
+
|
|
32
|
+
**Rules:**
|
|
33
|
+
- Exports/entry points must be explicit — list every public module or subpath
|
|
34
|
+
- Dependencies should distinguish runtime vs dev dependencies
|
|
35
|
+
- Internal project dependencies must reference exact module/package names
|
|
36
|
+
|
|
37
|
+
### NN-testing-strategy.md (always last numbered document)
|
|
38
|
+
How to test this feature.
|
|
39
|
+
|
|
40
|
+
**Sections:**
|
|
41
|
+
- Testing framework and tooling (match project conventions — e.g., vitest, pytest, go test)
|
|
42
|
+
- Unit test approach: what to test, what to mock
|
|
43
|
+
- Integration test approach: how to test cross-package interactions
|
|
44
|
+
- Test fixtures and factories
|
|
45
|
+
- Coverage targets
|
|
46
|
+
- Test file location conventions
|
|
47
|
+
|
|
48
|
+
## Conditionally Required
|
|
49
|
+
|
|
50
|
+
### ##-{domain-concern}.md (one per major subsystem)
|
|
51
|
+
Use when the feature has distinct subsystems that warrant separate specification.
|
|
52
|
+
|
|
53
|
+
**Examples:** `02-provider-registry.md`, `03-streaming-engine.md`, `04-prompt-templates.md`
|
|
54
|
+
|
|
55
|
+
**Sections:**
|
|
56
|
+
- Purpose and scope (which PRD requirements this covers)
|
|
57
|
+
- Public API: exported functions, classes, or components with full signatures
|
|
58
|
+
- Internal implementation: key algorithms, data flows, state management
|
|
59
|
+
- Configuration: what's configurable, defaults, validation
|
|
60
|
+
- Error handling: what can fail, how errors are typed and surfaced
|
|
61
|
+
- Dependencies: on types from 00, on other subsystems, on external packages
|
|
62
|
+
|
|
63
|
+
### ##-integration-points.md
|
|
64
|
+
Use when the feature interacts with existing modules or packages.
|
|
65
|
+
|
|
66
|
+
**Sections:**
|
|
67
|
+
- Integration map: which packages, which direction (depends-on vs depended-upon-by)
|
|
68
|
+
- For each integration point:
|
|
69
|
+
- Which types/interfaces are shared
|
|
70
|
+
- Data flow description
|
|
71
|
+
- Import paths and barrel exports
|
|
72
|
+
- Any adapter or bridge code needed
|
|
73
|
+
- Migration considerations: does integration require changes to existing packages?
|
|
74
|
+
|
|
75
|
+
### ##-ui-components.md
|
|
76
|
+
Use when the feature has a frontend surface.
|
|
77
|
+
|
|
78
|
+
**Sections:**
|
|
79
|
+
- Component tree / hierarchy
|
|
80
|
+
- Props interfaces for each component
|
|
81
|
+
- State management approach
|
|
82
|
+
- Styling approach (consistent with project conventions)
|
|
83
|
+
- Responsive behavior
|
|
84
|
+
- Accessibility requirements (ARIA, keyboard navigation)
|
|
85
|
+
|
|
86
|
+
### ##-data-migration.md
|
|
87
|
+
Use when the feature involves schema changes or data migration.
|
|
88
|
+
|
|
89
|
+
**Sections:**
|
|
90
|
+
- Schema definition (using project's ORM/migration tool, or raw SQL — match project conventions)
|
|
91
|
+
- Migration steps
|
|
92
|
+
- Rollback strategy
|
|
93
|
+
- Data seeding / fixtures
|
|
94
|
+
- Zero-downtime migration considerations (if applicable)
|
|
95
|
+
|
|
96
|
+
## Document Quality Checklist
|
|
97
|
+
|
|
98
|
+
Before finalizing any spec document, verify:
|
|
99
|
+
|
|
100
|
+
- [ ] Every section references PRD requirement IDs
|
|
101
|
+
- [ ] All code is valid syntax in the project's language (not pseudocode)
|
|
102
|
+
- [ ] All type references resolve to definitions in 00-core-definitions.md or clearly stated external packages
|
|
103
|
+
- [ ] Error scenarios are covered, not just happy paths
|
|
104
|
+
- [ ] Cross-references to other spec docs use exact filenames
|
|
105
|
+
- [ ] A "Dependencies" section states which other spec docs must be implemented first
|
|
106
|
+
- [ ] A "Verification" section describes how to confirm correct implementation
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Spec Examples — Quality Bar
|
|
2
|
+
|
|
3
|
+
These examples demonstrate the expected depth and quality for implementation spec sections. Match this level of detail.
|
|
4
|
+
|
|
5
|
+
> **Note:** The following examples use TypeScript. Adapt the language, idioms, and documentation style to match your project's stack. The STRUCTURE and DEPTH shown here is the quality bar regardless of language. See `references/stacks/{stack}.md` for language-specific conventions.
|
|
6
|
+
|
|
7
|
+
## Example: Function Specification (from a session management spec)
|
|
8
|
+
|
|
9
|
+
### 3.2 Token Refresh (REQ-AUTH-05, REQ-SEC-03)
|
|
10
|
+
|
|
11
|
+
Refresh an expiring session token without requiring re-authentication.
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
/**
|
|
15
|
+
* Refresh a session token if it's within the refresh threshold.
|
|
16
|
+
* Returns a new token with an extended expiry, or null if the session
|
|
17
|
+
* is not eligible for refresh (expired, revoked, or outside threshold).
|
|
18
|
+
*
|
|
19
|
+
* @param currentToken - The JWT string from the session cookie
|
|
20
|
+
* @param options - Refresh configuration
|
|
21
|
+
* @returns New session token string, or null if refresh is not possible
|
|
22
|
+
* @throws {SessionExpiredError} If the token has already expired
|
|
23
|
+
* @throws {TokenValidationError} If the token signature is invalid
|
|
24
|
+
*/
|
|
25
|
+
export async function refreshSessionToken(
|
|
26
|
+
currentToken: string,
|
|
27
|
+
options: RefreshOptions
|
|
28
|
+
): Promise<string | null>;
|
|
29
|
+
|
|
30
|
+
interface RefreshOptions {
|
|
31
|
+
/** Maximum age of a token eligible for refresh. Default: SESSION_DURATION_MS */
|
|
32
|
+
maxAge?: number;
|
|
33
|
+
/** How close to expiry before refresh is allowed. Default: REFRESH_THRESHOLD_MS */
|
|
34
|
+
refreshThreshold?: number;
|
|
35
|
+
/** Secret key for signing the new token */
|
|
36
|
+
signingKey: CryptoKey;
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
**Error Handling:**
|
|
41
|
+
- `SessionExpiredError` (code: `SESSION_EXPIRED`): Token's `exp` claim is in the past. Client must re-authenticate.
|
|
42
|
+
- `TokenValidationError` (code: `TOKEN_INVALID`): Signature verification failed. Token may have been tampered with. Log a security warning.
|
|
43
|
+
- Returns `null` (no error): Token is valid but not yet within the refresh threshold. No action needed.
|
|
44
|
+
|
|
45
|
+
**Dependencies:**
|
|
46
|
+
- Types from `00-core-definitions.md`: `SessionToken`, `SessionExpiredError`, `TokenValidationError`, `RefreshOptions`
|
|
47
|
+
- Constants from `00-core-definitions.md`: `SESSION_DURATION_MS`, `REFRESH_THRESHOLD_MS`
|
|
48
|
+
- `jose` library for JWT verification and signing
|
|
49
|
+
|
|
50
|
+
**Verification:**
|
|
51
|
+
- [ ] `refreshSessionToken` returns a new token when called with a token within the refresh threshold
|
|
52
|
+
- [ ] Returns `null` for a valid token outside the refresh threshold
|
|
53
|
+
- [ ] Throws `SessionExpiredError` for an expired token
|
|
54
|
+
- [ ] Throws `TokenValidationError` for a token with an invalid signature
|
|
55
|
+
- [ ] New token has an expiry of `SESSION_DURATION_MS` from the current time
|
|
56
|
+
|
|
57
|
+
## Example: Requirement Coverage Header
|
|
58
|
+
|
|
59
|
+
Every spec document should begin with a requirement coverage section:
|
|
60
|
+
|
|
61
|
+
```markdown
|
|
62
|
+
## Requirement Coverage
|
|
63
|
+
|
|
64
|
+
| REQ ID | Requirement | Section |
|
|
65
|
+
|--------|-------------|---------|
|
|
66
|
+
| REQ-AUTH-05 | Token refresh without re-auth | 3.2 |
|
|
67
|
+
| REQ-SEC-03 | Session expiry management | 3.1, 3.2 |
|
|
68
|
+
| REQ-PERF-02 | Token validation under 10ms | 3.3 |
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
This makes traceability explicit and auditable.
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
---
|
|
2
|
+
# GENERATED — DO NOT EDIT. Source: skills/forge-4-backlog/SKILL.md. Regenerate: python3 scripts/build-adapters.py
|
|
3
|
+
name: forge-4-backlog
|
|
4
|
+
description: Generate a structured backlog.json from forge implementation specs, then validate it via the loop runner. Use when user runs /feature-forge:forge-4-backlog or asks to create a backlog for a forge feature after specs are complete. This is the canonical backlog generator for the forge pipeline. Do NOT trigger for standalone backlog creation outside the forge pipeline context.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# forge-4-backlog — Backlog Generator (pipeline orchestrator)
|
|
8
|
+
|
|
9
|
+
Generate a complete, validated `backlog.json` from the implementation spec
|
|
10
|
+
suite, ready for the loop runner.
|
|
11
|
+
|
|
12
|
+
This skill is a **thin orchestrator**: it owns the *pipeline* concerns
|
|
13
|
+
(prerequisite checks, spec loading, plan review, validation, pipeline-state and
|
|
14
|
+
commit). The actual **authoring craft** — granularity, acceptance criteria,
|
|
15
|
+
`agentDelegation`, the schema, examples — lives in the rauf plugin's
|
|
16
|
+
**`author-backlog`** skill, which this skill delegates to. That keeps a single
|
|
17
|
+
home for backlog-authoring knowledge, shared with the repo-wide ad-hoc flow.
|
|
18
|
+
|
|
19
|
+
## Prerequisites
|
|
20
|
+
|
|
21
|
+
Read and follow `references/shared-conventions.md` for feature name validation, configuration reading, and force mode handling before proceeding. Resolve the feature directory `{resolvedFeatureDir}` via the **Feature Directory Resolution** block in `references/shared-conventions.md` — do not hardcode `{specsDir}/{feature}/` (see Step 1).
|
|
22
|
+
|
|
23
|
+
Resolve the **backlog directory** `{backlogDir}`:
|
|
24
|
+
- **`backlogDir` unset (default):** the backlog lives at the resolved feature directory — `{resolvedFeatureDir}/backlog.json` — for both flat and nested features, exactly as today.
|
|
25
|
+
- **`backlogDir` configured:** compose a **per-feature subpath** — `{backlogDir}/{feature}/` — so each epic member's backlog stays independent (the authored file lands at `{backlogDir}/{feature}/backlog.json`). A bare shared `backlogDir` would collide across a multi-feature epic and violate REQ-COMPAT-03; the `{feature}` segment prevents that. Standalone features under a configured `backlogDir` likewise resolve to `{backlogDir}/{feature}/`, which is backward-compatible because each standalone feature name is already unique.
|
|
26
|
+
|
|
27
|
+
This is the **single** place this rule is implemented. forge-5-loop's backlog-file check must read the same composed `{backlogDir}/{feature}/backlog.json` (that matching forge-5-loop edit lands in item 016), and forge-verify's backlog-mode load uses the same path. rauf itself is unchanged: backlogs remain per-feature and rauf is still launched against a single per-feature backlog path — only the *path composition* changes (REQ-COMPAT-03).
|
|
28
|
+
|
|
29
|
+
**Let `{resolvedBacklogDir}` denote the composed target of this rule** — i.e. `{backlogDir}/{feature}` when a `backlogDir` is configured, else `{resolvedFeatureDir}`. Every downstream step below (authoring, validation) uses `{resolvedBacklogDir}`, never the bare config value, so the per-feature `{feature}` segment is never dropped.
|
|
30
|
+
|
|
31
|
+
Resolve the **loop runner** from the `loopRunner` block in `forge.config.json`, filling missing fields from the defaults in `references/forge-config-schema.json` (defaults to rauf). You need its `bin`, `validateCommand`, `versionCommand`, `minRunnerVersion`, and `installHint`.
|
|
32
|
+
|
|
33
|
+
**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.
|
|
34
|
+
|
|
35
|
+
## Step 1: Validate Prerequisites
|
|
36
|
+
|
|
37
|
+
**Resolve the feature directory first.** Invoke the **Feature Directory Resolution** block in `references/shared-conventions.md` to turn the bare feature name into `{resolvedFeatureDir}` (exit 0 → stdout is the absolute dir; exit ≥ 1 → STOP and surface the finding verbatim). Read state and specs from `{resolvedFeatureDir}/` everywhere this skill previously wrote `{specsDir}/{feature}/`. Standalone features resolve to their flat path exactly as today.
|
|
38
|
+
|
|
39
|
+
**Prerequisite check:** Read `{resolvedFeatureDir}/.pipeline-state.json`. If not in force mode, stages `forge-1-prd`, `forge-2-tech`, and `forge-3-specs` must all be `complete`. If not, STOP and tell the user which prerequisites are missing.
|
|
40
|
+
|
|
41
|
+
**Strongly recommended:** Check if specs have been verified. If not, use `AskUserQuestion` to warn: "Specs haven't been verified yet. It's recommended to run `/feature-forge:forge-verify {feature}` first. Continue anyway?"
|
|
42
|
+
|
|
43
|
+
## Step 2: Load All Specs
|
|
44
|
+
|
|
45
|
+
Read all spec documents into context:
|
|
46
|
+
- `{resolvedFeatureDir}/PRD.md`
|
|
47
|
+
- `{resolvedFeatureDir}/tech-spec.md`
|
|
48
|
+
- `{resolvedFeatureDir}/##-*.md` (all implementation specs)
|
|
49
|
+
|
|
50
|
+
If the spec suite is large (8+ documents), focus on loading the architecture layout (01-*), shared types (00-*), and testing strategy documents first. Load individual subsystem specs as needed when writing the corresponding backlog items, rather than loading all specs simultaneously.
|
|
51
|
+
|
|
52
|
+
## Step 3: Plan the Backlog
|
|
53
|
+
|
|
54
|
+
Before writing any JSON, walk the specs and create a backlog plan: discrete work items, ordered by dependency (foundation first), with priorities, each scoped for a single loop iteration.
|
|
55
|
+
|
|
56
|
+
Present the plan as a numbered list:
|
|
57
|
+
```
|
|
58
|
+
Proposed backlog for {feature} ({N} items):
|
|
59
|
+
|
|
60
|
+
001 [P1] Scaffold module with project manifest, build config, and entry points
|
|
61
|
+
Depends on: (none)
|
|
62
|
+
Specs: 00-core-definitions.md, 01-architecture-layout.md
|
|
63
|
+
|
|
64
|
+
002 [P1] Implement shared types and error hierarchy
|
|
65
|
+
Depends on: 001
|
|
66
|
+
Specs: 00-core-definitions.md
|
|
67
|
+
...
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
After presenting the plan as text, use `AskUserQuestion` to ask: "Does this breakdown look right? Any items to split, merge, or reorder?" Do NOT include this question in your text output. Wait for the user's response before generating the JSON.
|
|
71
|
+
|
|
72
|
+
## Step 4: Author backlog.json — delegate to `author-backlog`
|
|
73
|
+
|
|
74
|
+
**Invoke the rauf plugin's `author-backlog` skill** (via the Skill tool) to write
|
|
75
|
+
`{resolvedBacklogDir}/backlog.json`. Pass it:
|
|
76
|
+
|
|
77
|
+
- the target backlog directory `{resolvedBacklogDir}`,
|
|
78
|
+
- the approved plan from Step 3,
|
|
79
|
+
- the spec context loaded in Step 2,
|
|
80
|
+
- the project's `typeCheckCommand` / `testCommand` (from `forge.config.json`) so acceptance criteria are concrete and runnable.
|
|
81
|
+
|
|
82
|
+
`author-backlog` owns all item-quality rules (granularity hard limits, self-contained descriptions, acceptance criteria, `agentDelegation`, the correct `type`/`status` enums, `dependsOn`, `specReferences`, the schema source). Do not re-encode them here — follow whatever it produces.
|
|
83
|
+
|
|
84
|
+
> **If the rauf plugin / `author-backlog` skill is not available:** fall back to
|
|
85
|
+
> authoring inline using the schema source rule (prefer the project's installed
|
|
86
|
+
> `{stateDir}/backlog.schema.json`, else the published `$id`
|
|
87
|
+
> `https://raw.githubusercontent.com/garygentry/rauf/main/schemas/backlog.schema.json`),
|
|
88
|
+
> and tell the user the rauf plugin provides richer authoring guidance.
|
|
89
|
+
|
|
90
|
+
**Forge-specific item requirements** layered on top of `author-backlog`'s output:
|
|
91
|
+
- `specReferences` must be paths **relative to the project root** (e.g. `specs/auth/00-core-definitions.md`), NOT relative to the backlog file. The validator resolves them from the project root (not from `--specs-dir`, which only gates the check).
|
|
92
|
+
|
|
93
|
+
> **Backlog schema & rauf contract are unchanged (REQ-COMPAT-03).** Epic membership adds **no** fields to backlog items — dependency edges live in the epic manifest, never in any backlog item. The JSON written here is byte-for-byte the same shape as a pre-epic standalone feature's backlog, and rauf is still launched against a single per-feature backlog path. Only the *path composition* changes (the `{feature}` segment in the backlog-directory rule above), not the schema or rauf's CLI surface.
|
|
94
|
+
|
|
95
|
+
## Step 5: Validate via the loop runner
|
|
96
|
+
|
|
97
|
+
Validate the generated backlog by running the runner's **validate command**
|
|
98
|
+
(`loopRunner.validateCommand`), rendered with `{resolvedBacklogDir}` and `{specsDir}`
|
|
99
|
+
substituted — the rauf default:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
rauf backlog validate . --backlog {resolvedBacklogDir} --specs-dir {specsDir} --json
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Interpret the result:
|
|
106
|
+
- **exit 0** → valid (warnings allowed). Proceed.
|
|
107
|
+
- **exit 1** → validation findings. Parse `{ valid, findings[] }`, fix the items, re-run. Do NOT present the backlog to the user until it validates.
|
|
108
|
+
- **exit 2** → usage/IO error (unreadable file, bad JSON). Fix and re-run.
|
|
109
|
+
|
|
110
|
+
> **forge-4 runs before forge-5's install gate**, so the runner may not be set
|
|
111
|
+
> up yet. Degrade gracefully rather than hard-failing:
|
|
112
|
+
> 1. First run `loopRunner.versionCommand` (`rauf version --json`). If the
|
|
113
|
+
> binary is **missing**, or its version is **< `minRunnerVersion`**
|
|
114
|
+
> (semver-compare), do NOT block authoring: keep the authored backlog, emit a
|
|
115
|
+
> loud warning with `loopRunner.installHint`, mark validation as skipped, and
|
|
116
|
+
> continue to Step 6. forge-5 will enforce the gate before running.
|
|
117
|
+
> 2. If the binary is present and new enough but the project isn't set up
|
|
118
|
+
> (`validate` reports the project marker missing), likewise warn and continue
|
|
119
|
+
> — validation will run cleanly once `rauf install .` has been done.
|
|
120
|
+
|
|
121
|
+
## Step 6: Review with User
|
|
122
|
+
|
|
123
|
+
Present a summary: total items N, dependency-chain depth, estimated loop iterations (`ceil(pendingItems * loopIterationMultiplier)`). Note whether validation passed or was skipped (runner not yet available).
|
|
124
|
+
|
|
125
|
+
Use `AskUserQuestion` to ask: "Ready to proceed, or any adjustments needed?"
|
|
126
|
+
|
|
127
|
+
## Step 7: Update Pipeline State and Commit
|
|
128
|
+
|
|
129
|
+
Write pipeline state conforming to `references/pipeline-state-schema.json`. Follow the Git Commit Protocol in `references/shared-conventions.md`.
|
|
130
|
+
|
|
131
|
+
1. Update `{resolvedFeatureDir}/.pipeline-state.json`:
|
|
132
|
+
- Record `artifacts` (path to backlog.json)
|
|
133
|
+
- Set `stages.forge-4-backlog.basedOnVersions` to `{"forge-1-prd": <current version>, "forge-2-tech": <current version>, "forge-3-specs": <current version>}`
|
|
134
|
+
- Set `currentStage` to `forge-5-loop`
|
|
135
|
+
- Check downstream stages (`forge-5-loop`, `forge-6-docs`). If any have `basedOnVersions` referencing an older version of `forge-4-backlog`, set their status to `stale`.
|
|
136
|
+
2. Use `AskUserQuestion` to ask about notes to persist
|
|
137
|
+
3. If `gitCommitAfterStage` is true, follow the Git Commit Protocol: stage files, attempt commit, then set status to `complete` with commit hash only on success. If commit fails, leave status as `in-progress`.
|
|
138
|
+
4. If verification was available but the user chose to skip it, record `stages.forge-verify-backlog.status` as `"skipped"` in pipeline state.
|
|
139
|
+
5. Tell user: "Backlog complete with {N} items. Next steps:\n - `/feature-forge:forge-verify {feature}` to verify the backlog\n - `/feature-forge:forge-5-loop {feature}` to run the loop\n - `/feature-forge:forge {feature}` to see full pipeline status"
|
|
140
|
+
|
|
141
|
+
## Gotchas
|
|
142
|
+
|
|
143
|
+
- The loop runs each item in a FRESH context. Every item description must be self-contained — `author-backlog` enforces this, but double-check Step-3 plan items aren't "same as above."
|
|
144
|
+
- Spec references must be project-root-relative paths that actually exist — the validate command enforces this when `--specs-dir` is passed (resolving them from the project root).
|
|
145
|
+
- Don't present a backlog to the user before it validates (or before you've explicitly recorded that validation was skipped because the runner isn't installed yet).
|