@garygentry/feature-forge 0.1.5 → 0.2.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/README.md +18 -0
- package/adapters/GENERATION-REPORT.md +12 -12
- package/adapters/claude/.feature-forge-bundle.json +6 -0
- package/adapters/claude/references/portable-root.md +8 -5
- package/adapters/claude/references/process-overview.md +1 -1
- package/adapters/claude/references/shared-conventions.md +24 -5
- package/adapters/claude/references/stack-resolution.md +4 -1
- package/adapters/claude/references/stacks/go.md +1 -1
- package/adapters/claude/references/stacks/python.md +1 -1
- package/adapters/claude/references/stacks/rust.md +1 -1
- package/adapters/claude/references/stacks/typescript.md +1 -1
- package/adapters/claude/scripts/epic-manifest.py +1379 -0
- package/adapters/claude/scripts/forge-bootstrap.py +991 -0
- package/adapters/claude/scripts/forge-init.sh +44 -0
- package/adapters/claude/scripts/forge-root.sh +30 -8
- package/adapters/claude/scripts/validate-traceability.py +150 -0
- package/adapters/claude/skills/forge/SKILL.md +5 -5
- package/adapters/claude/skills/forge-0-epic/SKILL.md +6 -10
- package/adapters/claude/skills/forge-0-epic/references/edit-mode.md +2 -2
- package/adapters/claude/skills/forge-0-epic/references/epic-manifest-subcommands.md +1 -1
- package/adapters/claude/skills/forge-1-prd/SKILL.md +2 -2
- package/adapters/claude/skills/forge-2-tech/SKILL.md +8 -7
- package/adapters/claude/skills/forge-2-tech/references/stack-discovery-checklist.md +4 -4
- package/adapters/claude/skills/forge-3-specs/SKILL.md +1 -1
- package/adapters/claude/skills/forge-4-backlog/SKILL.md +2 -2
- package/adapters/claude/skills/forge-5-loop/SKILL.md +2 -2
- package/adapters/claude/skills/forge-6-docs/SKILL.md +2 -2
- package/adapters/claude/skills/forge-bootstrap/SKILL.md +4 -4
- package/adapters/claude/skills/forge-fix/SKILL.md +1 -1
- package/adapters/claude/skills/forge-init/SKILL.md +1 -1
- package/adapters/claude/skills/forge-verify/SKILL.md +7 -2
- package/adapters/claude/skills/forge-verify/references/verification-checklists.md +1 -1
- package/adapters/codex/.feature-forge-bundle.json +6 -0
- package/adapters/codex/agents/{forge-researcher.md → forge-researcher.toml} +4 -4
- package/adapters/codex/agents/{forge-spec-writer.md → forge-spec-writer.toml} +4 -4
- package/adapters/codex/agents/{forge-verifier.md → forge-verifier.toml} +4 -4
- package/adapters/codex/references/portable-root.md +8 -5
- package/adapters/codex/references/process-overview.md +1 -1
- package/adapters/codex/references/shared-conventions.md +24 -5
- package/adapters/codex/references/stack-resolution.md +4 -1
- package/adapters/codex/references/stacks/go.md +1 -1
- package/adapters/codex/references/stacks/python.md +1 -1
- package/adapters/codex/references/stacks/rust.md +1 -1
- package/adapters/codex/references/stacks/typescript.md +1 -1
- package/adapters/codex/scripts/epic-manifest.py +1379 -0
- package/adapters/codex/scripts/forge-bootstrap.py +991 -0
- package/adapters/codex/scripts/forge-init.sh +44 -0
- package/adapters/codex/scripts/forge-root.sh +30 -8
- package/adapters/codex/scripts/validate-traceability.py +150 -0
- package/adapters/codex/skills/forge/{forge.md → SKILL.md} +16 -6
- package/adapters/codex/skills/forge-0-epic/{forge-0-epic.md → SKILL.md} +26 -20
- package/adapters/codex/skills/forge-0-epic/references/edit-mode.md +2 -2
- package/adapters/codex/skills/forge-0-epic/references/epic-manifest-subcommands.md +1 -1
- package/adapters/codex/skills/forge-1-prd/{forge-1-prd.md → SKILL.md} +18 -8
- package/adapters/codex/skills/forge-2-tech/{forge-2-tech.md → SKILL.md} +26 -15
- package/adapters/codex/skills/forge-2-tech/references/stack-discovery-checklist.md +4 -4
- package/adapters/codex/skills/forge-3-specs/{forge-3-specs.md → SKILL.md} +16 -6
- package/adapters/codex/skills/forge-4-backlog/{forge-4-backlog.md → SKILL.md} +15 -5
- package/adapters/codex/skills/forge-5-loop/{forge-5-loop.md → SKILL.md} +27 -17
- package/adapters/codex/skills/forge-6-docs/{forge-6-docs.md → SKILL.md} +17 -7
- package/adapters/codex/skills/forge-bootstrap/{forge-bootstrap.md → SKILL.md} +17 -7
- package/adapters/codex/skills/forge-fix/{forge-fix.md → SKILL.md} +12 -2
- package/adapters/codex/skills/forge-init/{forge-init.md → SKILL.md} +11 -1
- package/adapters/codex/skills/forge-verify/{forge-verify.md → SKILL.md} +24 -9
- package/adapters/codex/skills/forge-verify/references/verification-checklists.md +1 -1
- package/adapters/copilot/.feature-forge-bundle.json +6 -0
- package/adapters/copilot/references/portable-root.md +8 -5
- package/adapters/copilot/references/process-overview.md +1 -1
- package/adapters/copilot/references/shared-conventions.md +24 -5
- package/adapters/copilot/references/stack-resolution.md +4 -1
- package/adapters/copilot/references/stacks/go.md +1 -1
- package/adapters/copilot/references/stacks/python.md +1 -1
- package/adapters/copilot/references/stacks/rust.md +1 -1
- package/adapters/copilot/references/stacks/typescript.md +1 -1
- package/adapters/copilot/scripts/epic-manifest.py +1379 -0
- package/adapters/copilot/scripts/forge-bootstrap.py +991 -0
- package/adapters/copilot/scripts/forge-init.sh +44 -0
- package/adapters/copilot/scripts/forge-root.sh +30 -8
- package/adapters/copilot/scripts/validate-traceability.py +150 -0
- package/adapters/copilot/skills/forge/forge.md +16 -6
- package/adapters/copilot/skills/forge-0-epic/forge-0-epic.md +26 -20
- package/adapters/copilot/skills/forge-0-epic/references/edit-mode.md +2 -2
- package/adapters/copilot/skills/forge-0-epic/references/epic-manifest-subcommands.md +1 -1
- package/adapters/copilot/skills/forge-1-prd/forge-1-prd.md +18 -8
- package/adapters/copilot/skills/forge-2-tech/forge-2-tech.md +26 -15
- package/adapters/copilot/skills/forge-2-tech/references/stack-discovery-checklist.md +4 -4
- package/adapters/copilot/skills/forge-3-specs/forge-3-specs.md +16 -6
- package/adapters/copilot/skills/forge-4-backlog/forge-4-backlog.md +15 -5
- package/adapters/copilot/skills/forge-5-loop/forge-5-loop.md +27 -17
- package/adapters/copilot/skills/forge-6-docs/forge-6-docs.md +17 -7
- package/adapters/copilot/skills/forge-bootstrap/forge-bootstrap.md +17 -7
- package/adapters/copilot/skills/forge-fix/forge-fix.md +12 -2
- package/adapters/copilot/skills/forge-init/forge-init.md +11 -1
- package/adapters/copilot/skills/forge-verify/forge-verify.md +24 -9
- package/adapters/copilot/skills/forge-verify/references/verification-checklists.md +1 -1
- package/adapters/cursor/.feature-forge-bundle.json +6 -0
- package/adapters/cursor/references/portable-root.md +8 -5
- package/adapters/cursor/references/process-overview.md +1 -1
- package/adapters/cursor/references/shared-conventions.md +24 -5
- package/adapters/cursor/references/stack-resolution.md +4 -1
- package/adapters/cursor/references/stacks/go.md +1 -1
- package/adapters/cursor/references/stacks/python.md +1 -1
- package/adapters/cursor/references/stacks/rust.md +1 -1
- package/adapters/cursor/references/stacks/typescript.md +1 -1
- package/adapters/cursor/scripts/epic-manifest.py +1379 -0
- package/adapters/cursor/scripts/forge-bootstrap.py +991 -0
- package/adapters/cursor/scripts/forge-init.sh +44 -0
- package/adapters/cursor/scripts/forge-root.sh +30 -8
- package/adapters/cursor/scripts/validate-traceability.py +150 -0
- package/adapters/cursor/skills/forge/forge.mdc +16 -6
- package/adapters/cursor/skills/forge-0-epic/forge-0-epic.mdc +26 -20
- package/adapters/cursor/skills/forge-0-epic/references/edit-mode.md +2 -2
- package/adapters/cursor/skills/forge-0-epic/references/epic-manifest-subcommands.md +1 -1
- package/adapters/cursor/skills/forge-1-prd/forge-1-prd.mdc +18 -8
- package/adapters/cursor/skills/forge-2-tech/forge-2-tech.mdc +26 -15
- package/adapters/cursor/skills/forge-2-tech/references/stack-discovery-checklist.md +4 -4
- package/adapters/cursor/skills/forge-3-specs/forge-3-specs.mdc +16 -6
- package/adapters/cursor/skills/forge-4-backlog/forge-4-backlog.mdc +15 -5
- package/adapters/cursor/skills/forge-5-loop/forge-5-loop.mdc +27 -17
- package/adapters/cursor/skills/forge-6-docs/forge-6-docs.mdc +17 -7
- package/adapters/cursor/skills/forge-bootstrap/forge-bootstrap.mdc +17 -7
- package/adapters/cursor/skills/forge-fix/forge-fix.mdc +12 -2
- package/adapters/cursor/skills/forge-init/forge-init.mdc +11 -1
- package/adapters/cursor/skills/forge-verify/forge-verify.mdc +24 -9
- package/adapters/cursor/skills/forge-verify/references/verification-checklists.md +1 -1
- package/adapters/gemini/.feature-forge-bundle.json +6 -0
- package/adapters/gemini/gemini-extension.json +1 -1
- package/adapters/gemini/references/portable-root.md +8 -5
- package/adapters/gemini/references/process-overview.md +1 -1
- package/adapters/gemini/references/shared-conventions.md +24 -5
- package/adapters/gemini/references/stack-resolution.md +4 -1
- package/adapters/gemini/references/stacks/go.md +1 -1
- package/adapters/gemini/references/stacks/python.md +1 -1
- package/adapters/gemini/references/stacks/rust.md +1 -1
- package/adapters/gemini/references/stacks/typescript.md +1 -1
- package/adapters/gemini/scripts/epic-manifest.py +1379 -0
- package/adapters/gemini/scripts/forge-bootstrap.py +991 -0
- package/adapters/gemini/scripts/forge-init.sh +44 -0
- package/adapters/gemini/scripts/forge-root.sh +30 -8
- package/adapters/gemini/scripts/validate-traceability.py +150 -0
- package/adapters/gemini/skills/forge/forge.md +16 -6
- package/adapters/gemini/skills/forge-0-epic/forge-0-epic.md +26 -20
- package/adapters/gemini/skills/forge-0-epic/references/edit-mode.md +2 -2
- package/adapters/gemini/skills/forge-0-epic/references/epic-manifest-subcommands.md +1 -1
- package/adapters/gemini/skills/forge-1-prd/forge-1-prd.md +18 -8
- package/adapters/gemini/skills/forge-2-tech/forge-2-tech.md +26 -15
- package/adapters/gemini/skills/forge-2-tech/references/stack-discovery-checklist.md +4 -4
- package/adapters/gemini/skills/forge-3-specs/forge-3-specs.md +16 -6
- package/adapters/gemini/skills/forge-4-backlog/forge-4-backlog.md +15 -5
- package/adapters/gemini/skills/forge-5-loop/forge-5-loop.md +27 -17
- package/adapters/gemini/skills/forge-6-docs/forge-6-docs.md +17 -7
- package/adapters/gemini/skills/forge-bootstrap/forge-bootstrap.md +17 -7
- package/adapters/gemini/skills/forge-fix/forge-fix.md +12 -2
- package/adapters/gemini/skills/forge-init/forge-init.md +11 -1
- package/adapters/gemini/skills/forge-verify/forge-verify.md +24 -9
- package/adapters/gemini/skills/forge-verify/references/verification-checklists.md +1 -1
- package/dist/agent-targets.d.ts +20 -4
- package/dist/agent-targets.js +29 -4
- package/dist/apply.js +245 -18
- package/dist/cli.js +12 -6
- package/dist/hash.d.ts +5 -0
- package/dist/hash.js +7 -0
- package/dist/manifest.d.ts +3 -1
- package/dist/manifest.js +58 -2
- package/dist/placements.d.ts +69 -0
- package/dist/placements.js +116 -0
- package/dist/plan.d.ts +7 -0
- package/dist/plan.js +87 -1
- package/dist/report.js +21 -0
- package/dist/source.d.ts +4 -3
- package/dist/source.js +4 -3
- package/dist/types.d.ts +162 -18
- package/dist/types.js +42 -11
- package/package.json +1 -1
- package/adapters/codex/agents/openai.yaml +0 -10
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Initialize feature-forge configuration in the current project.
|
|
3
|
+
# Creates forge.config.json with sensible defaults.
|
|
4
|
+
|
|
5
|
+
set -euo pipefail
|
|
6
|
+
|
|
7
|
+
CONFIG_FILE="forge.config.json"
|
|
8
|
+
|
|
9
|
+
if [ -f "$CONFIG_FILE" ]; then
|
|
10
|
+
echo "⚠️ $CONFIG_FILE already exists. Skipping."
|
|
11
|
+
exit 0
|
|
12
|
+
fi
|
|
13
|
+
|
|
14
|
+
cat > "$CONFIG_FILE" << 'EOF'
|
|
15
|
+
{
|
|
16
|
+
"specsDir": "./specs",
|
|
17
|
+
"docsDir": "./docs/architecture",
|
|
18
|
+
"backlogDir": null,
|
|
19
|
+
"gitCommitAfterStage": true,
|
|
20
|
+
"commitPrefix": "forge",
|
|
21
|
+
"stack": null,
|
|
22
|
+
"typeCheckCommand": null,
|
|
23
|
+
"testCommand": null,
|
|
24
|
+
"loopIterationMultiplier": 1.5
|
|
25
|
+
}
|
|
26
|
+
EOF
|
|
27
|
+
|
|
28
|
+
echo "✅ Created $CONFIG_FILE with defaults."
|
|
29
|
+
echo ""
|
|
30
|
+
echo "Defaults:"
|
|
31
|
+
echo " specsDir: ./specs"
|
|
32
|
+
echo " docsDir: ./docs/architecture"
|
|
33
|
+
echo " backlogDir: null (defaults to {specsDir}/{feature}/backlog.json)"
|
|
34
|
+
echo " gitCommitAfterStage: true"
|
|
35
|
+
echo " commitPrefix: forge"
|
|
36
|
+
echo " stack: null (auto-detected during forge-2-tech)"
|
|
37
|
+
echo " typeCheckCommand: null (auto-detected during forge-2-tech)"
|
|
38
|
+
echo " testCommand: null (auto-detected during forge-2-tech)"
|
|
39
|
+
echo " loopIterationMultiplier: 1.5 (multiplier for loop iterations)"
|
|
40
|
+
echo ""
|
|
41
|
+
echo "The loop runner defaults to rauf. To target a different ralph-style runner,"
|
|
42
|
+
echo "add a \"loopRunner\" block (see references/forge-config-schema.json)."
|
|
43
|
+
echo ""
|
|
44
|
+
echo "Edit $CONFIG_FILE to customize paths and stack settings for your project."
|
|
@@ -13,13 +13,17 @@
|
|
|
13
13
|
set -euo pipefail
|
|
14
14
|
|
|
15
15
|
# Sentinel predicate (00-core-definitions.md §2 / SENTINEL_FILES). A directory is a valid
|
|
16
|
-
#
|
|
17
|
-
#
|
|
16
|
+
# feature-forge root iff it carries the neutral bundle sentinel `.feature-forge-bundle.json`
|
|
17
|
+
# (emitted into EVERY per-agent adapter bundle) OR the legacy Claude plugin manifest
|
|
18
|
+
# `.claude-plugin/plugin.json` (the canon repo root + the Claude bundle). Content-based, so it
|
|
19
|
+
# identifies a feature-forge install under ANY agent's directory layout — not just Claude's.
|
|
18
20
|
is_root() { # $1 = candidate dir
|
|
19
|
-
[ -f "$1
|
|
21
|
+
[ -f "$1/.feature-forge-bundle.json" ] || [ -f "$1/.claude-plugin/plugin.json" ]
|
|
20
22
|
}
|
|
21
23
|
|
|
22
|
-
# ── Step 1: self-location — parent of this script's dir is the
|
|
24
|
+
# ── Step 1: self-location — parent of this script's dir is the install root. ─────────────
|
|
25
|
+
# This is the PRIMARY path: a bundle ships its own scripts/forge-root.sh, so the parent of
|
|
26
|
+
# this script's dir is that bundle's root under any agent's layout.
|
|
23
27
|
self_dir="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)"
|
|
24
28
|
root="$(cd -- "$self_dir/.." && pwd -P)"
|
|
25
29
|
if is_root "$root"; then
|
|
@@ -27,11 +31,23 @@ if is_root "$root"; then
|
|
|
27
31
|
exit 0
|
|
28
32
|
fi
|
|
29
33
|
|
|
30
|
-
# ── Step 2: candidate-root probe (authoritative multi-root list; extend here first).
|
|
31
|
-
# Globs that match nothing expand to themselves; the is_root test rejects such literals.
|
|
34
|
+
# ── Step 2: candidate-root probe (authoritative multi-agent root list; extend here first). ─
|
|
35
|
+
# Globs that match nothing expand to themselves; the is_root test rejects such literals. Covers
|
|
36
|
+
# every supported agent's install destination under BOTH global ($HOME) and project ($PWD) scope,
|
|
37
|
+
# matching the installer's per-agent layout: claude .claude/skills, codex .agents/skills, copilot
|
|
38
|
+
# .github/feature-forge, cursor .cursor/rules, gemini .gemini/extensions.
|
|
32
39
|
for candidate in \
|
|
33
40
|
"$HOME/.claude/skills/feature-forge" \
|
|
41
|
+
"$PWD/.claude/skills/feature-forge" \
|
|
34
42
|
"$HOME"/.claude/plugins/*/feature-forge \
|
|
43
|
+
"$HOME/.agents/skills/feature-forge" \
|
|
44
|
+
"$PWD/.agents/skills/feature-forge" \
|
|
45
|
+
"$HOME/.github/feature-forge" \
|
|
46
|
+
"$PWD/.github/feature-forge" \
|
|
47
|
+
"$HOME/.cursor/rules/feature-forge" \
|
|
48
|
+
"$PWD/.cursor/rules/feature-forge" \
|
|
49
|
+
"$HOME/.gemini/extensions/feature-forge" \
|
|
50
|
+
"$PWD/.gemini/extensions/feature-forge" \
|
|
35
51
|
; do
|
|
36
52
|
if is_root "$candidate"; then
|
|
37
53
|
printf '%s\n' "$candidate"
|
|
@@ -39,12 +55,18 @@ for candidate in \
|
|
|
39
55
|
fi
|
|
40
56
|
done
|
|
41
57
|
|
|
42
|
-
# ── Step 3: env fallback —
|
|
58
|
+
# ── Step 3: env fallback — neutral FEATURE_FORGE_ROOT, then the legacy CLAUDE_PLUGIN_ROOT. ─
|
|
59
|
+
# The neutral override works for every agent; CLAUDE_PLUGIN_ROOT is kept only for backwards
|
|
60
|
+
# compatibility with existing Claude installs (C-4).
|
|
61
|
+
if [ -n "${FEATURE_FORGE_ROOT:-}" ] && is_root "$FEATURE_FORGE_ROOT"; then
|
|
62
|
+
printf '%s\n' "$FEATURE_FORGE_ROOT"
|
|
63
|
+
exit 0
|
|
64
|
+
fi
|
|
43
65
|
if [ -n "${CLAUDE_PLUGIN_ROOT:-}" ] && is_root "$CLAUDE_PLUGIN_ROOT"; then
|
|
44
66
|
printf '%s\n' "$CLAUDE_PLUGIN_ROOT"
|
|
45
67
|
exit 0
|
|
46
68
|
fi
|
|
47
69
|
|
|
48
70
|
# ── Step 4: failure — actionable message to stderr, exit 1 (REQ-RES-04). ─────────────────
|
|
49
|
-
echo "feature-forge: cannot locate
|
|
71
|
+
echo "feature-forge: cannot locate install root. Set FEATURE_FORGE_ROOT to the bundle dir, or run from an installed skill dir." >&2
|
|
50
72
|
exit 1
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Validate requirement traceability between PRD and implementation specs.
|
|
3
|
+
|
|
4
|
+
Extracts REQ-XXX-NN identifiers from a PRD file and checks that every
|
|
5
|
+
requirement is referenced in at least one implementation spec document.
|
|
6
|
+
Also reports orphaned references (IDs found in specs but not in PRD).
|
|
7
|
+
|
|
8
|
+
Usage:
|
|
9
|
+
python validate-traceability.py <prd-path> <specs-dir> [--json]
|
|
10
|
+
|
|
11
|
+
Exit codes:
|
|
12
|
+
0 = all requirements covered, no orphans
|
|
13
|
+
1 = gaps or orphans found
|
|
14
|
+
2 = file not found or read error
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
import argparse
|
|
18
|
+
import json
|
|
19
|
+
import re
|
|
20
|
+
import sys
|
|
21
|
+
from pathlib import Path
|
|
22
|
+
|
|
23
|
+
REQ_PATTERN = re.compile(r"REQ-[A-Z]+-\d+")
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def extract_req_ids(text: str) -> set[str]:
|
|
27
|
+
"""Extract all unique REQ-XXX-NN identifiers from text."""
|
|
28
|
+
return set(REQ_PATTERN.findall(text))
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def main() -> int:
|
|
32
|
+
parser = argparse.ArgumentParser(
|
|
33
|
+
description="Validate requirement traceability between PRD and specs"
|
|
34
|
+
)
|
|
35
|
+
parser.add_argument("prd_path", help="Path to PRD.md file")
|
|
36
|
+
parser.add_argument("specs_dir", help="Directory containing ##-*.md spec files")
|
|
37
|
+
parser.add_argument(
|
|
38
|
+
"--json", action="store_true", dest="json_output", help="Output as JSON"
|
|
39
|
+
)
|
|
40
|
+
args = parser.parse_args()
|
|
41
|
+
|
|
42
|
+
prd_path = Path(args.prd_path)
|
|
43
|
+
specs_dir = Path(args.specs_dir)
|
|
44
|
+
|
|
45
|
+
# Read PRD
|
|
46
|
+
if not prd_path.exists():
|
|
47
|
+
print(f"Error: PRD file not found: {prd_path}", file=sys.stderr)
|
|
48
|
+
return 2
|
|
49
|
+
|
|
50
|
+
try:
|
|
51
|
+
prd_text = prd_path.read_text()
|
|
52
|
+
except OSError as e:
|
|
53
|
+
print(f"Error reading PRD: {e}", file=sys.stderr)
|
|
54
|
+
return 2
|
|
55
|
+
|
|
56
|
+
prd_reqs = extract_req_ids(prd_text)
|
|
57
|
+
|
|
58
|
+
if not prd_reqs:
|
|
59
|
+
print(f"Warning: No REQ-XXX-NN identifiers found in {prd_path}", file=sys.stderr)
|
|
60
|
+
|
|
61
|
+
# Read spec files (##-*.md pattern)
|
|
62
|
+
if not specs_dir.exists():
|
|
63
|
+
print(f"Error: Specs directory not found: {specs_dir}", file=sys.stderr)
|
|
64
|
+
return 2
|
|
65
|
+
|
|
66
|
+
spec_files = sorted(specs_dir.glob("[0-9][0-9]-*.md"))
|
|
67
|
+
if not spec_files:
|
|
68
|
+
print(f"Warning: No spec files matching ##-*.md found in {specs_dir}", file=sys.stderr)
|
|
69
|
+
|
|
70
|
+
# Track which specs cover which requirements
|
|
71
|
+
spec_reqs: dict[str, set[str]] = {}
|
|
72
|
+
all_spec_reqs: set[str] = set()
|
|
73
|
+
|
|
74
|
+
for spec_file in spec_files:
|
|
75
|
+
try:
|
|
76
|
+
text = spec_file.read_text()
|
|
77
|
+
reqs = extract_req_ids(text)
|
|
78
|
+
spec_reqs[spec_file.name] = reqs
|
|
79
|
+
all_spec_reqs |= reqs
|
|
80
|
+
except OSError as e:
|
|
81
|
+
print(f"Warning: Could not read {spec_file}: {e}", file=sys.stderr)
|
|
82
|
+
|
|
83
|
+
# Also check TRACEABILITY.md if it exists
|
|
84
|
+
traceability_file = specs_dir / "TRACEABILITY.md"
|
|
85
|
+
if traceability_file.exists():
|
|
86
|
+
try:
|
|
87
|
+
text = traceability_file.read_text()
|
|
88
|
+
trace_reqs = extract_req_ids(text)
|
|
89
|
+
spec_reqs["TRACEABILITY.md"] = trace_reqs
|
|
90
|
+
all_spec_reqs |= trace_reqs
|
|
91
|
+
except OSError:
|
|
92
|
+
pass
|
|
93
|
+
|
|
94
|
+
# Analysis
|
|
95
|
+
uncovered = sorted(prd_reqs - all_spec_reqs)
|
|
96
|
+
orphaned = sorted(all_spec_reqs - prd_reqs)
|
|
97
|
+
|
|
98
|
+
# Per-requirement coverage map
|
|
99
|
+
coverage: dict[str, list[str]] = {}
|
|
100
|
+
for req_id in sorted(prd_reqs):
|
|
101
|
+
covering_specs = [
|
|
102
|
+
name for name, reqs in spec_reqs.items() if req_id in reqs
|
|
103
|
+
]
|
|
104
|
+
coverage[req_id] = covering_specs
|
|
105
|
+
|
|
106
|
+
has_issues = bool(uncovered or orphaned)
|
|
107
|
+
|
|
108
|
+
if args.json_output:
|
|
109
|
+
result = {
|
|
110
|
+
"prd_file": str(prd_path),
|
|
111
|
+
"specs_dir": str(specs_dir),
|
|
112
|
+
"total_requirements": len(prd_reqs),
|
|
113
|
+
"total_spec_files": len(spec_files),
|
|
114
|
+
"uncovered_requirements": uncovered,
|
|
115
|
+
"orphaned_references": orphaned,
|
|
116
|
+
"coverage": coverage,
|
|
117
|
+
"valid": not has_issues,
|
|
118
|
+
}
|
|
119
|
+
print(json.dumps(result, indent=2))
|
|
120
|
+
else:
|
|
121
|
+
print(f"PRD: {prd_path} ({len(prd_reqs)} requirements)")
|
|
122
|
+
print(f"Specs: {specs_dir} ({len(spec_files)} spec files)")
|
|
123
|
+
print()
|
|
124
|
+
|
|
125
|
+
if uncovered:
|
|
126
|
+
print(f"UNCOVERED REQUIREMENTS ({len(uncovered)}):")
|
|
127
|
+
for req_id in uncovered:
|
|
128
|
+
print(f" - {req_id}: not found in any spec file")
|
|
129
|
+
print()
|
|
130
|
+
|
|
131
|
+
if orphaned:
|
|
132
|
+
print(f"ORPHANED REFERENCES ({len(orphaned)}):")
|
|
133
|
+
for req_id in orphaned:
|
|
134
|
+
sources = [
|
|
135
|
+
name for name, reqs in spec_reqs.items() if req_id in reqs
|
|
136
|
+
]
|
|
137
|
+
print(f" - {req_id}: found in {', '.join(sources)} but not in PRD")
|
|
138
|
+
print()
|
|
139
|
+
|
|
140
|
+
if not has_issues:
|
|
141
|
+
print("All requirements covered. No orphaned references.")
|
|
142
|
+
else:
|
|
143
|
+
total_issues = len(uncovered) + len(orphaned)
|
|
144
|
+
print(f"Found {total_issues} issue(s).")
|
|
145
|
+
|
|
146
|
+
return 1 if has_issues else 0
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
if __name__ == "__main__":
|
|
150
|
+
sys.exit(main())
|
|
@@ -29,7 +29,7 @@ For pipeline architecture details, read `references/process-overview.md`.
|
|
|
29
29
|
|
|
30
30
|
1. **Epics first.** Identify epic directories as any `{specsDir}/*/` that directly contains an `epic-manifest.json` **and no `.pipeline-state.json` of its own** (an epic root is never itself a feature). For each epic, run:
|
|
31
31
|
```bash
|
|
32
|
-
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)"
|
|
32
|
+
R="$(for d in "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done)"
|
|
33
33
|
[ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
|
|
34
34
|
python3 "$R/scripts/epic-manifest.py" render-status "{epic}" --specs-dir "{specsDir}" --json
|
|
35
35
|
```
|
|
@@ -83,7 +83,7 @@ Use these status indicators:
|
|
|
83
83
|
When the named argument is an epic (`{specsDir}/{name}/epic-manifest.json` exists), render the epic dashboard instead of a per-feature one. Run:
|
|
84
84
|
|
|
85
85
|
```bash
|
|
86
|
-
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)"
|
|
86
|
+
R="$(for d in "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done)"
|
|
87
87
|
[ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
|
|
88
88
|
python3 "$R/scripts/epic-manifest.py" render-status "{epic}" --specs-dir "{specsDir}" --json
|
|
89
89
|
```
|
|
@@ -142,18 +142,18 @@ Commands:
|
|
|
142
142
|
Support these sub-commands for pipeline lifecycle management:
|
|
143
143
|
- `/feature-forge:forge pause {feature}` — Set `pipelineStatus` to `"paused"`. Do NOT modify `currentStage` or any stage statuses. The pipeline freezes exactly as-is. Show a confirmation.
|
|
144
144
|
- `/feature-forge:forge resume {feature}` — Set `pipelineStatus` back to `"active"`. Calculate how long the feature was paused (from `updatedAt` to now). If paused for more than 24 hours, show a hint: "This feature was paused for {duration}. Session context may have been lost — consider re-running `/feature-forge:forge-{currentStage} {feature}` to rebuild context."
|
|
145
|
-
- `/feature-forge:forge abandon {feature}` — Set `pipelineStatus` to `"abandoned"`. Use `AskUserQuestion` to confirm
|
|
145
|
+
- `/feature-forge:forge abandon {feature}` — Set `pipelineStatus` to `"abandoned"`. Use `AskUserQuestion` to confirm first, and state what's reversible: abandoning does not delete artifacts and can be undone with `/feature-forge:forge resume {feature}`, so the cost is low — but if the user really means "stop and discard," point out that `pause` is the better choice when they're only setting it aside. Offer **Abandon** · **Pause instead** · **Cancel**.
|
|
146
146
|
|
|
147
147
|
**Epic lifecycle.** When the argument names an **epic** (`{specsDir}/{name}/epic-manifest.json` exists), `pause` / `resume` / `abandon` operate on the epic manifest, not a `.pipeline-state.json`:
|
|
148
148
|
|
|
149
149
|
- Set the manifest's top-level `status` (`paused` / `active` / `abandoned`) via the helper's `set-status` mutator — an atomic write that also bumps `updatedAt`:
|
|
150
150
|
```bash
|
|
151
|
-
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)"
|
|
151
|
+
R="$(for d in "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done)"
|
|
152
152
|
[ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
|
|
153
153
|
python3 "$R/scripts/epic-manifest.py" set-status "{epic}" --status paused --specs-dir "{specsDir}"
|
|
154
154
|
```
|
|
155
155
|
For `complete`, do **not** set the status directly — completion is *derived* from member states (the rollup), so the manifest `status` is a lifecycle flag, never a completion signal.
|
|
156
|
-
- **Member feature states are NOT silently mutated.** Pausing/abandoning the epic changes only the manifest `status`. Before doing so, use `AskUserQuestion` to make the relationship explicit: "Pausing the epic does not pause its in-flight member features. {N} members are active. Pause the epic only, or also pause each member?" If the user opts to pause members too, update each member's own `pipelineStatus` **individually and visibly** (one explicit action per member), never as a hidden side-effect.
|
|
156
|
+
- **Member feature states are NOT silently mutated.** Pausing/abandoning the epic changes only the manifest `status`. Before doing so, use `AskUserQuestion` to make the relationship explicit and frame the trade-off: "Pausing the epic does not pause its in-flight member features. {N} members are active. Pause the epic only, or also pause each member?" Recommend **epic only** when members are mid-stage and the user just wants to stop *new* orchestration; recommend **also pause members** when the intent is a hard freeze of all in-flight work. If the user opts to pause members too, update each member's own `pipelineStatus` **individually and visibly** (one explicit action per member), never as a hidden side-effect.
|
|
157
157
|
- Commit the change via the Git Commit Protocol, staging `{specsDir}/{epic}/`.
|
|
158
158
|
|
|
159
159
|
When listing features, show active pipelines by default. Include a count of paused/abandoned: "3 active pipelines (1 paused, 1 abandoned — use `/feature-forge:forge list all` to see them)."
|
|
@@ -39,7 +39,7 @@ checks but still load any on-disk artifacts.
|
|
|
39
39
|
plugin path and the configured specs dir:
|
|
40
40
|
|
|
41
41
|
```bash
|
|
42
|
-
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)"
|
|
42
|
+
R="$(for d in "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done)"
|
|
43
43
|
[ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
|
|
44
44
|
python3 "$R/scripts/epic-manifest.py" <subcommand> ... --specs-dir "{specsDir}"
|
|
45
45
|
```
|
|
@@ -73,7 +73,7 @@ Resolve the epic subtree path `{specsDir}/{epic}/` and decide which branch to ru
|
|
|
73
73
|
epic, confirm the epic name itself does not collide with any existing feature or epic:
|
|
74
74
|
|
|
75
75
|
```bash
|
|
76
|
-
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)"
|
|
76
|
+
R="$(for d in "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done)"
|
|
77
77
|
[ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
|
|
78
78
|
python3 "$R/scripts/epic-manifest.py" check-name "{epic}" --specs-dir "{specsDir}"
|
|
79
79
|
```
|
|
@@ -111,15 +111,13 @@ The epic `name` is the validated CLI argument from Step 0 — do NOT prompt for
|
|
|
111
111
|
Drive a decomposition dialogue. Output your analysis as text first (how the goal might split,
|
|
112
112
|
right-sizing guidance: each feature should be a single pipeline-sized unit — a unit forge-1-prd
|
|
113
113
|
through forge-5-loop would carry end-to-end — not item-level interleaving). Then use
|
|
114
|
-
`AskUserQuestion` to elicit the candidate feature list.
|
|
115
|
-
these two features really one?" and "Is any one of these really two?" Iterate until the user
|
|
116
|
-
confirms the set.
|
|
114
|
+
`AskUserQuestion` to elicit the candidate feature list. Per the **Decision Support** protocol in `references/shared-conventions.md`, lead with a **recommended decomposition** and a one-line rationale rather than asking the user to invent it unaided, then probe its seams ("Is any of these two really one? Is any one really two?"), naming the trade-off (more features = more parallelism but more edges). Iterate until the user confirms.
|
|
117
115
|
|
|
118
116
|
For **each** proposed feature name, before accepting it into the set, enforce global uniqueness
|
|
119
117
|
and name safety via the helper:
|
|
120
118
|
|
|
121
119
|
```bash
|
|
122
|
-
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)"
|
|
120
|
+
R="$(for d in "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done)"
|
|
123
121
|
[ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
|
|
124
122
|
python3 "$R/scripts/epic-manifest.py" check-name "{feature}" --specs-dir "{specsDir}"
|
|
125
123
|
```
|
|
@@ -155,9 +153,7 @@ the structured arrays are the source of truth; EPIC.md renders them as prose lat
|
|
|
155
153
|
For each feature, use `AskUserQuestion`: "Which sibling features must be complete before this
|
|
156
154
|
one can build?" → populates `dependsOn: [names]`.
|
|
157
155
|
|
|
158
|
-
**Seed the suggestion from `consumes`:** a `consumes.from` X strongly implies `dependsOn` X.
|
|
159
|
-
Offer the union of each feature's `consumes.from` set as the default, but let the user confirm —
|
|
160
|
-
`dependsOn` is the authoritative edge set.
|
|
156
|
+
**Seed the suggestion from `consumes`:** a `consumes.from` X strongly implies `dependsOn` X. Per the **Decision Support** protocol, offer the union of each feature's `consumes.from` set as the **recommended default**, evidence-backed — but flag the cost (each edge serializes the loop and blocks dependents, so add only what contracts require). User confirms/overrides; `dependsOn` is authoritative.
|
|
161
157
|
|
|
162
158
|
The `features[]` array order is the user-declared sequence from C2 (order is a presentation
|
|
163
159
|
sequence, **not** a dependency ordering). Preserve the C2 order unless the user asks to reorder.
|
|
@@ -181,7 +177,7 @@ For the *initial* creation write the skill writes the file directly — atomic g
|
|
|
181
177
|
required for in-place mutation, which is the helper mutators' job. Creating the epic dir first creates `{specsDir}/`, so after writing the manifest invoke the **Specs Directory Hygiene** block in `references/shared-conventions.md` (idempotent; stage anything it writes with this stage's commit). Then validate:
|
|
182
178
|
|
|
183
179
|
```bash
|
|
184
|
-
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)"
|
|
180
|
+
R="$(for d in "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done)"
|
|
185
181
|
[ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
|
|
186
182
|
python3 "$R/scripts/epic-manifest.py" validate "{epic}" --specs-dir "{specsDir}" --json
|
|
187
183
|
```
|
|
@@ -16,7 +16,7 @@ question goes through `AskUserQuestion`.
|
|
|
16
16
|
Before offering any edit, validate the existing manifest:
|
|
17
17
|
|
|
18
18
|
```bash
|
|
19
|
-
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)"
|
|
19
|
+
R="$(for d in "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done)"
|
|
20
20
|
[ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
|
|
21
21
|
python3 "$R/scripts/epic-manifest.py" validate "{epic}" --specs-dir "{specsDir}" --json
|
|
22
22
|
```
|
|
@@ -77,7 +77,7 @@ status is **not** `not-started`, warn the user. Read the **live** status (never
|
|
|
77
77
|
completion in prose):
|
|
78
78
|
|
|
79
79
|
```bash
|
|
80
|
-
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)"
|
|
80
|
+
R="$(for d in "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done)"
|
|
81
81
|
[ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
|
|
82
82
|
python3 "$R/scripts/epic-manifest.py" render-status "{epic}" --specs-dir "{specsDir}" --json
|
|
83
83
|
```
|
|
@@ -12,7 +12,7 @@ the write if it would introduce a cycle, dangling ref, duplicate, or schema viol
|
|
|
12
12
|
flag surface (owned by 02 §7):
|
|
13
13
|
|
|
14
14
|
```bash
|
|
15
|
-
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)"
|
|
15
|
+
R="$(for d in "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done)"
|
|
16
16
|
[ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
|
|
17
17
|
# Add a feature — seeds EMPTY exposes/consumes; contracts are populated below.
|
|
18
18
|
python3 "$R/scripts/epic-manifest.py" add-feature "{epic}" "{feature}" \
|
|
@@ -65,12 +65,12 @@ A technology constraint is valid when it stems from organizational mandate, exis
|
|
|
65
65
|
|
|
66
66
|
**Pacing:** Cover one topic area at a time, asking 2-3 related questions per `AskUserQuestion` call. After receiving answers, probe deeper on anything incomplete before moving to the next topic. Signal progress in your text before the next question batch.
|
|
67
67
|
|
|
68
|
-
**Question strategies** (use these as content for `AskUserQuestion`, not as inline prose):
|
|
68
|
+
**Question strategies** (use these as content for `AskUserQuestion`, not as inline prose). The PRD stays at the requirements level (the *what*, not the *how* — that's forge-2-tech), so most questions are open elicitation. But whenever you offer the user a *choice* (scope boundary, MVP cut, a non-functional target), apply the **Decision Support** protocol in `references/shared-conventions.md`: propose a sensible default with its trade-off rather than an empty menu — e.g. "I'd scope V1 to X and defer Y; that ships sooner but means Y waits. Agree?":
|
|
69
69
|
- Probe deeper after each answer: failure modes, stakeholders, minimum viable version
|
|
70
70
|
- Challenge assumptions: which users specifically, what does "fast" mean quantitatively
|
|
71
71
|
- Identify edge cases: empty input, concurrent access, scale
|
|
72
72
|
- Capture non-functional requirements: performance, security, accessibility, observability
|
|
73
|
-
- Ask about what's OUT of scope — as important as what's in scope
|
|
73
|
+
- Ask about what's OUT of scope — as important as what's in scope; when proposing a scope line, recommend one and name what each side gives up
|
|
74
74
|
|
|
75
75
|
**Completion criteria:** The interview is complete when:
|
|
76
76
|
1. Every category in `references/prd-template.md` has been covered with at least one question
|
|
@@ -56,7 +56,7 @@ If the `forge-researcher` subagent is not available, perform the research inline
|
|
|
56
56
|
### Manual Research (fallback)
|
|
57
57
|
|
|
58
58
|
1. **Read the PRD thoroughly**: Understand all requirements and constraints
|
|
59
|
-
2. **Check for project-level stack decisions**: Look for `.claude/references/stack-decisions.md`
|
|
59
|
+
2. **Check for project-level stack decisions**: Look for a project stack-decisions file, first existing path wins: `.feature-forge/stack-decisions.md` (preferred), then `.agents/references/stack-decisions.md`, then `.claude/references/stack-decisions.md` (legacy alias). If present, read it — these are established technology choices that should be respected unless there's a strong reason to deviate.
|
|
60
60
|
3. **Read the plugin's default stack reference**: Read `references/stack-discovery-checklist.md` for general stack context (only if no project-level override exists)
|
|
61
61
|
4. **Examine the existing codebase**: Look at `package.json` files, existing packages, directory structure, and established patterns. Understand what conventions are already in place.
|
|
62
62
|
5. **Review other features' tech specs**: Check `{specsDir}/*/tech-spec.md` and `{specsDir}/*/*/tech-spec.md` (depth-2, to find nested epic members) for consistency in approach and to identify shared infrastructure. Apply the **feature-shaped-dir bound**: only treat a directory as a feature if it directly contains a `.pipeline-state.json` (filter matches whose parent directory holds one, or enumerate members via the helper). A flat-only tree has no depth-2 feature dirs, so this gains no new matches there (REQ-COMPAT-01).
|
|
@@ -69,7 +69,7 @@ After researching the codebase, identify the primary stack (language, build tool
|
|
|
69
69
|
1. Check if `forge.config.json` already has a `stack` field — if so, use it
|
|
70
70
|
2. Otherwise, detect from project files and use `AskUserQuestion` to confirm: "I detected this as a {stack} project. Correct?"
|
|
71
71
|
3. Update `forge.config.json` with `stack`, `typeCheckCommand`, and `testCommand`
|
|
72
|
-
4. Verify that a matching stack profile exists at `references/stacks/{stack}.md`. If it does, load it for stack-specific guidance during this and all subsequent stages. If no profile exists, inform the user: "No dedicated profile for {stack}. Using generic fallback — spec conventions, verification checks, and examples will be language-neutral. Consider creating a project-level override at `.
|
|
72
|
+
4. Verify that a matching stack profile exists at `references/stacks/{stack}.md`. If it does, load it for stack-specific guidance during this and all subsequent stages. If no profile exists, inform the user: "No dedicated profile for {stack}. Using generic fallback — spec conventions, verification checks, and examples will be language-neutral. Consider creating a project-level override at `.feature-forge/stack-decisions.md`." Then load `references/stacks/_generic.md`.
|
|
73
73
|
|
|
74
74
|
## Step 3: Conduct the Interview
|
|
75
75
|
|
|
@@ -83,11 +83,12 @@ Interview the user about technology decisions. Unlike the PRD interview, here yo
|
|
|
83
83
|
|
|
84
84
|
**First message pattern:** Output the research summary as text, then use `AskUserQuestion` to confirm the stack and ask about the first decision area (typically package/module structure). Wait for the user to respond before proceeding to subsequent areas.
|
|
85
85
|
|
|
86
|
-
**Question strategies** (use these as content for `AskUserQuestion`, not as inline prose):
|
|
87
|
-
- For each PRD requirement, propose a technical approach and ask for confirmation or alternatives
|
|
88
|
-
-
|
|
89
|
-
- Challenge over-engineering: does the feature need this, or is a simpler approach sufficient?
|
|
90
|
-
- Ask about every integration point and how the feature interacts with existing modules
|
|
86
|
+
**Question strategies** (use these as content for `AskUserQuestion`, not as inline prose). Follow the **Decision Support** protocol in `references/shared-conventions.md` — this interview is the richest decision surface in the pipeline, so don't just list options; lead with a recommended approach, put the trade-off in each option's description, and give a one-line rationale:
|
|
87
|
+
- For each PRD requirement, propose a technical approach **with its trade-off and your recommendation**, then ask for confirmation or alternatives — don't present competing approaches flatly. You've just researched the codebase; spend that research here.
|
|
88
|
+
- Recommend approaches consistent with the established stack, and say *why* the convention favors it (evidence-backed mode). Where the choice is genuine taste (e.g. folder layout, naming), give a default but flag it as preference.
|
|
89
|
+
- Challenge over-engineering: does the feature need this, or is a simpler approach sufficient? Frame the simpler option's trade-off (less flexibility now vs. less to maintain).
|
|
90
|
+
- Ask about every integration point and how the feature interacts with existing modules.
|
|
91
|
+
- For competing module structures or code-shape choices, use the `AskUserQuestion` `preview` field to show the candidates side-by-side.
|
|
91
92
|
|
|
92
93
|
**Parking lot:** If the user raises a concern that belongs to a different pipeline stage (e.g., backlog granularity, documentation format), acknowledge it and note it in the pipeline state's `notes` field: "Good point — I've noted that for the [specs/backlog/docs stage]. Let's continue with the tech spec."
|
|
93
94
|
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
# Stack Discovery Checklist (Plugin Default)
|
|
2
2
|
|
|
3
|
-
This file contains a default stack discovery protocol for the feature-forge plugin. Projects can override this by placing a `stack-decisions.md`
|
|
3
|
+
This file contains a default stack discovery protocol for the feature-forge plugin. Projects can override this by placing a `stack-decisions.md` at `.feature-forge/stack-decisions.md` (preferred; legacy alias `.claude/references/stack-decisions.md`) in the project root.
|
|
4
4
|
|
|
5
5
|
## Note to Agent
|
|
6
6
|
|
|
7
|
-
This is a DISCOVERY PROTOCOL — it helps you identify what stack the project uses. It is NOT a set of decisions. Always check `.claude/references/stack-decisions.md`
|
|
7
|
+
This is a DISCOVERY PROTOCOL — it helps you identify what stack the project uses. It is NOT a set of decisions. Always check for a project stack-decisions file first (`.feature-forge/stack-decisions.md`, then `.agents/references/stack-decisions.md`, then the legacy `.claude/references/stack-decisions.md`) — if present, it takes precedence.
|
|
8
8
|
|
|
9
9
|
After discovering the stack, check if `references/stacks/{stack}.md` exists in the plugin for stack-specific guidance. See `references/stack-resolution.md` for the full resolution protocol.
|
|
10
10
|
|
|
11
11
|
## Purpose
|
|
12
12
|
|
|
13
|
-
This is a default discovery guide for understanding a project's technology stack. Projects should create `.claude/references/stack-decisions.md` with their actual stack decisions, which takes precedence over this checklist.
|
|
13
|
+
This is a default discovery guide for understanding a project's technology stack. Projects should create `.feature-forge/stack-decisions.md` (legacy alias: `.claude/references/stack-decisions.md`) with their actual stack decisions, which takes precedence over this checklist.
|
|
14
14
|
|
|
15
15
|
## Stack Discovery Protocol
|
|
16
16
|
|
|
@@ -68,7 +68,7 @@ Examine the dependency manifest for:
|
|
|
68
68
|
|
|
69
69
|
## How to Create a Project-Level Override
|
|
70
70
|
|
|
71
|
-
Create `.claude/references/stack-decisions.md` in your project root with your specific stack decisions. See `references/stacks/typescript.md` or `references/stacks/python.md` for stack-specific examples of what to include.
|
|
71
|
+
Create `.feature-forge/stack-decisions.md` (legacy alias: `.claude/references/stack-decisions.md`) in your project root with your specific stack decisions. See `references/stacks/typescript.md` or `references/stacks/python.md` for stack-specific examples of what to include.
|
|
72
72
|
|
|
73
73
|
```markdown
|
|
74
74
|
# Stack Decisions
|
|
@@ -54,7 +54,7 @@ Feature-specific:
|
|
|
54
54
|
04-integration-points.md — Integration with existing project modules
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
-
**Then call `AskUserQuestion`**
|
|
57
|
+
**Then call `AskUserQuestion`** following the **Decision Support** protocol in `references/shared-conventions.md`: recommend this plan as the default (it's your evidence-backed read of the feature's complexity) and name the trade-off so the user can push back knowingly — more documents means finer separation of concerns but more to keep in sync; fewer means tighter docs but risks one document carrying multiple concerns. Lead with: "I recommend this plan. Add or remove any documents?" Note the guidance below — resist splitting a concern into a sub-50-line document.
|
|
58
58
|
|
|
59
59
|
**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").
|
|
60
60
|
|
|
@@ -39,7 +39,7 @@ Resolve the **loop runner** from the `loopRunner` block in `forge.config.json`,
|
|
|
39
39
|
|
|
40
40
|
**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.
|
|
41
41
|
|
|
42
|
-
**Strongly recommended:** Check if specs have been verified. If not, use `AskUserQuestion` to warn: "Specs haven't been verified yet.
|
|
42
|
+
**Strongly recommended:** Check if specs have been verified. If not, use `AskUserQuestion` to warn with the cost of skipping: "Specs haven't been verified yet. Recommended: run `/feature-forge:forge-verify {feature}` first — unverified specs can carry gaps or contradictions that get baked into backlog items and only surface mid-loop, where they're far more expensive to fix. Continue anyway?" Offer **Verify first (recommended)** · **Continue without verifying**.
|
|
43
43
|
|
|
44
44
|
## Step 2: Load All Specs
|
|
45
45
|
|
|
@@ -68,7 +68,7 @@ Proposed backlog for {feature} ({N} items):
|
|
|
68
68
|
...
|
|
69
69
|
```
|
|
70
70
|
|
|
71
|
-
After presenting the plan as text, use `AskUserQuestion` to
|
|
71
|
+
After presenting the plan as text, use `AskUserQuestion` following the **Decision Support** protocol in `references/shared-conventions.md`: recommend this breakdown as the default (it's your evidence-backed read of the specs and dependency order) and name the trade-off that governs item granularity — finer items are each easier to verify in one loop iteration but multiply coordination and dependency edges; coarser items mean fewer handoffs but risk an item too big to complete or verify in a single iteration. Lead with: "I recommend this breakdown. 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.
|
|
72
72
|
|
|
73
73
|
## Step 4: Author backlog.json — delegate to `author-backlog`
|
|
74
74
|
|
|
@@ -52,7 +52,7 @@ Read `{resolvedFeatureDir}/.pipeline-state.json`. If not in force mode, `stages.
|
|
|
52
52
|
|
|
53
53
|
Check if `stages.forge-verify-backlog` exists and has status `passed` or `findings-applied`. If not, use `AskUserQuestion` to warn:
|
|
54
54
|
|
|
55
|
-
"Backlog hasn't been verified yet.
|
|
55
|
+
"Backlog hasn't been verified yet. Recommended: run `/feature-forge:forge-verify {feature}` first — the loop implements items autonomously and commits as it goes, so a bad item (wrong scope, missing dependency, untestable acceptance criteria) is far cheaper to catch now than after several commits build on it. Continue anyway?" Offer **Verify first (recommended)** · **Continue without verifying**.
|
|
56
56
|
|
|
57
57
|
### 1b-epic. Epic Dependency Gate
|
|
58
58
|
|
|
@@ -61,7 +61,7 @@ Read the resolved feature's `.pipeline-state.json`. **If it has no `epic` key, s
|
|
|
61
61
|
1. Run `render-status "{epic}" --specs-dir "{specsDir}" --json` via the helper:
|
|
62
62
|
|
|
63
63
|
```bash
|
|
64
|
-
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)"
|
|
64
|
+
R="$(for d in "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done)"
|
|
65
65
|
[ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
|
|
66
66
|
python3 "$R/scripts/epic-manifest.py" \
|
|
67
67
|
render-status "{epic}" --specs-dir "{specsDir}" --json
|
|
@@ -37,14 +37,14 @@ Also check `.pipeline-state.json` for `stages.forge-5-loop`. If it exists and ha
|
|
|
37
37
|
|
|
38
38
|
### Impl-Verify Backstop
|
|
39
39
|
|
|
40
|
-
Check `.pipeline-state.json` for `stages.forge-verify-impl`. If it is **absent** or has status `"skipped"`, use `AskUserQuestion` to warn: "Implementation hasn't been verified yet.
|
|
40
|
+
Check `.pipeline-state.json` for `stages.forge-verify-impl`. If it is **absent** or has status `"skipped"`, use `AskUserQuestion` to warn with the cost of skipping: "Implementation hasn't been verified yet. Recommended: run `/feature-forge:forge-verify {feature} impl` first to audit the loop's output — docs generated over unverified code can document bugs or gaps as if they were intended behavior, and readers will trust them. Generate docs anyway?" Offer **Verify first (recommended)** · **Generate docs anyway**. This mirrors `forge-4-backlog`'s pre-stage verification check and backstops a skipped impl-verify regardless of how the loop ended. If `stages.forge-verify-impl` shows it already ran (`findings-applied`, `findings-reported`, or `passed`), proceed with no warning.
|
|
41
41
|
|
|
42
42
|
### Epic-Level Documentation (epic members only)
|
|
43
43
|
|
|
44
44
|
If the resolved feature has an `epic` back-pointer in its `.pipeline-state.json`, run:
|
|
45
45
|
|
|
46
46
|
```bash
|
|
47
|
-
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)"
|
|
47
|
+
R="$(for d in "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done)"
|
|
48
48
|
[ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
|
|
49
49
|
python3 "$R/scripts/epic-manifest.py" render-status "{epic}" --specs-dir "{specsDir}" --json
|
|
50
50
|
```
|
|
@@ -59,7 +59,7 @@ Every bash invocation begins with the byte-identical portable-root prelude, then
|
|
|
59
59
|
helper. Pass `--specs-dir ./specs` (the default) so the gate allow-lists the specs directory.
|
|
60
60
|
|
|
61
61
|
```bash
|
|
62
|
-
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)"
|
|
62
|
+
R="$(for d in "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done)"
|
|
63
63
|
[ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
|
|
64
64
|
python3 "$R/scripts/forge-bootstrap.py" check "<target-dir>" --json --specs-dir ./specs
|
|
65
65
|
```
|
|
@@ -136,7 +136,7 @@ when running under a Claude host (e.g. `AskUserQuestion` is available), else `"c
|
|
|
136
136
|
`CLAUDE.md` only when `host == "claude"`.
|
|
137
137
|
|
|
138
138
|
```bash
|
|
139
|
-
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)"
|
|
139
|
+
R="$(for d in "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done)"
|
|
140
140
|
[ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
|
|
141
141
|
python3 "$R/scripts/forge-bootstrap.py" scaffold "<target-dir>" --json --answers '<Answers JSON>'
|
|
142
142
|
```
|
|
@@ -144,7 +144,7 @@ python3 "$R/scripts/forge-bootstrap.py" scaffold "<target-dir>" --json --answers
|
|
|
144
144
|
### Step 5 — verify
|
|
145
145
|
|
|
146
146
|
```bash
|
|
147
|
-
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)"
|
|
147
|
+
R="$(for d in "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done)"
|
|
148
148
|
[ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
|
|
149
149
|
python3 "$R/scripts/forge-bootstrap.py" verify "<target-dir>" --json --answers '<Answers JSON>'
|
|
150
150
|
```
|
|
@@ -170,7 +170,7 @@ and removes the sentinel before staging so it never enters history. Read
|
|
|
170
170
|
leave the sentinel in-progress (resumable) — do **not** declare success.
|
|
171
171
|
|
|
172
172
|
```bash
|
|
173
|
-
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)"
|
|
173
|
+
R="$(for d in "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done)"
|
|
174
174
|
[ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
|
|
175
175
|
python3 "$R/scripts/forge-bootstrap.py" commit "<target-dir>" --json --answers '<Answers JSON>' [--stage-only]
|
|
176
176
|
```
|
|
@@ -30,7 +30,7 @@ Read and follow `references/shared-conventions.md` for feature name validation,
|
|
|
30
30
|
## Step 3: Handle User Decisions
|
|
31
31
|
|
|
32
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.
|
|
33
|
+
1. Present each decision to the user with the context from the findings, using `AskUserQuestion` for each decision point. Follow the **Decision Support** protocol in `references/shared-conventions.md`: lead with a recommended option and put the trade-off in each option's description. When the findings provide clear evidence, recommend with confidence and cite it. When they don't, still offer a sensible default with the trade-offs, but flag it plainly as a judgment call rather than going neutral — a defaulted recommendation beats an unguided option dump.
|
|
34
34
|
2. Wait for answers before proceeding
|
|
35
35
|
3. Record decisions in the findings document under the "User Decisions Required" section (mark each as resolved)
|
|
36
36
|
|
|
@@ -9,7 +9,7 @@ description: Initialize feature-forge configuration in the current project. Use
|
|
|
9
9
|
Run the initialization script to create `forge.config.json` with default settings:
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
|
-
R="$(for d in "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/*/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done)"
|
|
12
|
+
R="$(for d in "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done)"
|
|
13
13
|
[ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
|
|
14
14
|
bash "$R/scripts/forge-init.sh"
|
|
15
15
|
```
|