forge-dev-framework 1.0.1 → 1.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/.claude/commands/forge/README.md +281 -0
- package/.claude/commands/forge/add-phase.md +90 -0
- package/.claude/commands/forge/complete-milestone.md +130 -0
- package/.claude/commands/forge/config.md +115 -0
- package/.claude/commands/forge/convert.md +31 -0
- package/.claude/commands/forge/debug.md +31 -0
- package/.claude/commands/forge/discuss.md +78 -0
- package/.claude/commands/forge/execute.md +85 -0
- package/.claude/commands/forge/generate.md +21 -0
- package/.claude/commands/forge/help.md +18 -0
- package/.claude/commands/forge/init.md +21 -0
- package/.claude/commands/forge/insert-phase.md +99 -0
- package/.claude/commands/forge/new-milestone.md +114 -0
- package/.claude/commands/forge/new-project.md +24 -0
- package/.claude/commands/forge/pause-work.md +111 -0
- package/.claude/commands/forge/plan.md +129 -0
- package/.claude/commands/forge/quick.md +41 -0
- package/.claude/commands/forge/remove-phase.md +92 -0
- package/.claude/commands/forge/resume.md +22 -0
- package/.claude/commands/forge/status.md +87 -0
- package/.claude/commands/forge/team-add.md +24 -0
- package/.claude/commands/forge/team-create.md +22 -0
- package/.claude/commands/forge/team-remove.md +24 -0
- package/.claude/commands/forge/team-start.md +22 -0
- package/.claude/commands/forge/team-view.md +18 -0
- package/.claude/commands/forge/verify.md +95 -0
- package/.claude/hooks/forge-context-cleanup.cjs +79 -0
- package/.claude/hooks/forge-event-guard.cjs +36 -0
- package/.claude/hooks/forge-size-guard.cjs +55 -0
- package/.claude/rules/api-patterns.md +13 -98
- package/.claude/rules/context-efficiency.md +10 -0
- package/.claude/rules/security-baseline.md +18 -204
- package/.claude/rules/testing-standards.md +16 -177
- package/.claude/rules/ui-conventions.md +17 -142
- package/README.md +1 -0
- package/bin/forge.js +5 -3
- package/dist/bin/forge.js +5 -3
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +15 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/commands/convert.d.ts +6 -0
- package/dist/commands/convert.d.ts.map +1 -0
- package/dist/commands/convert.js +132 -0
- package/dist/commands/convert.js.map +1 -0
- package/dist/commands/generate.d.ts.map +1 -1
- package/dist/commands/generate.js +3 -2
- package/dist/commands/generate.js.map +1 -1
- package/dist/commands/index.d.ts +4 -4
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +4 -4
- package/dist/commands/index.js.map +1 -1
- package/dist/generators/gsd-converter.d.ts +100 -0
- package/dist/generators/gsd-converter.d.ts.map +1 -0
- package/dist/generators/gsd-converter.js +335 -0
- package/dist/generators/gsd-converter.js.map +1 -0
- package/dist/templates/.claude/rules/api-patterns.md.template +212 -0
- package/dist/templates/.claude/rules/security-baseline.md.template +322 -0
- package/dist/templates/.claude/rules/testing-standards.md.template +280 -0
- package/dist/templates/.claude/rules/ui-conventions.md.template +264 -0
- package/dist/templates/.planning/forge.config.json.template +75 -0
- package/dist/templates/CLAUDE.md.template +161 -0
- package/dist/templates/PLAN.md.template +177 -0
- package/dist/templates/PROJECT.md.template +156 -0
- package/dist/templates/REQUIREMENTS.md.template +221 -0
- package/dist/templates/ROADMAP.md.template +130 -0
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +2 -2
- package/dist/types/index.js.map +1 -1
- package/dist/utils/index.d.ts +5 -5
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +5 -5
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/template-client.d.ts.map +1 -1
- package/dist/utils/template-client.js +3 -2
- package/dist/utils/template-client.js.map +1 -1
- package/package.json +6 -4
- package/dist/git/__tests__/worktree.test.d.ts +0 -5
- package/dist/git/__tests__/worktree.test.d.ts.map +0 -1
- package/dist/git/__tests__/worktree.test.js +0 -121
- package/dist/git/__tests__/worktree.test.js.map +0 -1
- package/dist/git/codeowners.d.ts +0 -101
- package/dist/git/codeowners.d.ts.map +0 -1
- package/dist/git/codeowners.js +0 -216
- package/dist/git/codeowners.js.map +0 -1
- package/dist/git/commit.d.ts +0 -135
- package/dist/git/commit.d.ts.map +0 -1
- package/dist/git/commit.js +0 -223
- package/dist/git/commit.js.map +0 -1
- package/dist/git/hooks/commit-msg.d.ts +0 -8
- package/dist/git/hooks/commit-msg.d.ts.map +0 -1
- package/dist/git/hooks/commit-msg.js +0 -34
- package/dist/git/hooks/commit-msg.js.map +0 -1
- package/dist/git/hooks/pre-commit.d.ts +0 -8
- package/dist/git/hooks/pre-commit.d.ts.map +0 -1
- package/dist/git/hooks/pre-commit.js +0 -34
- package/dist/git/hooks/pre-commit.js.map +0 -1
- package/dist/git/pre-commit-hooks.d.ts +0 -117
- package/dist/git/pre-commit-hooks.d.ts.map +0 -1
- package/dist/git/pre-commit-hooks.js +0 -270
- package/dist/git/pre-commit-hooks.js.map +0 -1
- package/dist/git/wipe-protocol.d.ts +0 -281
- package/dist/git/wipe-protocol.d.ts.map +0 -1
- package/dist/git/wipe-protocol.js +0 -237
- package/dist/git/wipe-protocol.js.map +0 -1
- package/dist/git/worktree.d.ts +0 -69
- package/dist/git/worktree.d.ts.map +0 -1
- package/dist/git/worktree.js +0 -202
- package/dist/git/worktree.js.map +0 -1
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: forge:plan
|
|
3
|
+
description: Research-first multi-plan generation with wave-based execution ordering.
|
|
4
|
+
argument-hint: <phase-name> [--research] [--skip-research] [--gaps] [--skip-verify]
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Write
|
|
8
|
+
- Bash
|
|
9
|
+
- Glob
|
|
10
|
+
- Grep
|
|
11
|
+
- Task
|
|
12
|
+
- TaskCreate
|
|
13
|
+
- TeamCreate
|
|
14
|
+
- WebSearch
|
|
15
|
+
- WebFetch
|
|
16
|
+
- AskUserQuestion
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
Generate research-backed multi-plan breakdown for phase $ARGUMENTS. Each research finding that needs addressing becomes a separate plan file with 2-3 tasks. Plans are grouped into waves for parallel execution.
|
|
20
|
+
|
|
21
|
+
**Read first:** REQUIREMENTS.md, ROADMAP.md, .planning/phases/{phase}/CONTEXT.md (if exists), state/STATE.json
|
|
22
|
+
|
|
23
|
+
**Steps:**
|
|
24
|
+
|
|
25
|
+
1. **Parse arguments** — Extract phase name and flags from `$ARGUMENTS`:
|
|
26
|
+
- `--research` — force re-run research even if RESEARCH.md exists
|
|
27
|
+
- `--skip-research` — skip research step entirely
|
|
28
|
+
- `--gaps` — generate gap closure plans only (used after verify)
|
|
29
|
+
- `--skip-verify` — skip plan verification step
|
|
30
|
+
|
|
31
|
+
2. **Check for existing plans** — Look for `.planning/phases/{phase}/*-PLAN.md` files.
|
|
32
|
+
- If plan files exist, use AskUserQuestion with options:
|
|
33
|
+
a) "Add more plans" — continue numbering from highest existing plan number
|
|
34
|
+
b) "Verify existing plans" — route to `/forge:verify {phase}`
|
|
35
|
+
c) "Execute existing plans" — route to `/forge:execute {phase}`
|
|
36
|
+
d) "Replan from scratch" — delete existing plan files, regenerate from research
|
|
37
|
+
- If no plans exist, proceed to research.
|
|
38
|
+
|
|
39
|
+
3. **Research phase** (unless `--skip-research` or `--gaps`):
|
|
40
|
+
- Check if `.planning/phases/{phase}/{phase}-RESEARCH.md` exists.
|
|
41
|
+
- If exists and no `--research` flag, ask: use existing research or re-run?
|
|
42
|
+
- If research needed, spawn a researcher agent via Task tool (subagent_type: "general-purpose"):
|
|
43
|
+
- **Researcher reads:** CONTEXT.md to constrain research scope:
|
|
44
|
+
- **Locked decisions** → research these deeply, find best practices, don't explore alternatives
|
|
45
|
+
- **Claude's discretion** → research multiple options, recommend one with rationale
|
|
46
|
+
- **Deferred ideas** → ignore completely, do not research
|
|
47
|
+
- **Researcher uses:** WebSearch (include current year in queries), WebFetch (official docs), Grep/Glob (codebase patterns to follow)
|
|
48
|
+
- **Researcher produces** `{phase}-RESEARCH.md` with sections:
|
|
49
|
+
```
|
|
50
|
+
# {Phase} Research
|
|
51
|
+
## User Constraints (from CONTEXT.md)
|
|
52
|
+
## Summary
|
|
53
|
+
## Recommended Stack (specific versions)
|
|
54
|
+
## Architecture Patterns
|
|
55
|
+
## Don't Hand-Roll (use existing libraries)
|
|
56
|
+
## Common Pitfalls
|
|
57
|
+
## Code Examples
|
|
58
|
+
## Sources
|
|
59
|
+
[Each with confidence: HIGH | MEDIUM | LOW]
|
|
60
|
+
```
|
|
61
|
+
- Each major research finding becomes a candidate for a separate plan
|
|
62
|
+
|
|
63
|
+
4. **Generate multi-plan breakdown** — Spawn a planner agent via Task tool (subagent_type: "general-purpose"):
|
|
64
|
+
- **Planner reads:** CONTEXT.md (locked decisions), RESEARCH.md, REQUIREMENTS.md, STATE.json, existing codebase patterns
|
|
65
|
+
- **Planner decomposes** the phase into multiple plan files, each covering one coherent unit of work with 2-3 tasks
|
|
66
|
+
- **Each plan file** gets YAML frontmatter:
|
|
67
|
+
```yaml
|
|
68
|
+
---
|
|
69
|
+
phase: {phase-name}
|
|
70
|
+
plan: 01
|
|
71
|
+
wave: 1
|
|
72
|
+
depends_on: []
|
|
73
|
+
files_modified: [src/foo.ts, src/bar.ts]
|
|
74
|
+
autonomous: true
|
|
75
|
+
gap_closure: false
|
|
76
|
+
---
|
|
77
|
+
```
|
|
78
|
+
- **Plan body** contains:
|
|
79
|
+
- Objective (what this plan builds and why)
|
|
80
|
+
- Context references (which CONTEXT.md decisions apply)
|
|
81
|
+
- Tasks in XML format:
|
|
82
|
+
```xml
|
|
83
|
+
<task name="descriptive-name" type="auto">
|
|
84
|
+
<files>src/foo.ts, src/bar.ts</files>
|
|
85
|
+
<action>What to implement, specifically</action>
|
|
86
|
+
<verify>npm test, specific checks</verify>
|
|
87
|
+
<done>Concrete completion criteria</done>
|
|
88
|
+
</task>
|
|
89
|
+
```
|
|
90
|
+
- Success criteria for the plan as a whole
|
|
91
|
+
- **Write to:** `.planning/phases/{phase}/{phase}-01-PLAN.md`, `{phase}-02-PLAN.md`, etc.
|
|
92
|
+
- **Build dependency graph and assign waves:**
|
|
93
|
+
- Independent plans → same wave (can execute in parallel)
|
|
94
|
+
- Plans that depend on others → higher wave number
|
|
95
|
+
- `wave = max(waves[dep] for dep in depends_on) + 1`
|
|
96
|
+
- Wave 1 plans have no dependencies
|
|
97
|
+
|
|
98
|
+
5. **Verify plans** (unless `--skip-verify`):
|
|
99
|
+
- Check: requirements coverage across all plans, task completeness, dependency correctness, no circular deps, scope matches CONTEXT.md (no deferred ideas included)
|
|
100
|
+
- If issues found, revision loop (max 3 iterations): targeted fixes, not full replan
|
|
101
|
+
- If passes, proceed
|
|
102
|
+
|
|
103
|
+
6. **Present results:**
|
|
104
|
+
```
|
|
105
|
+
Phase {X}: {Name} — {N} plan(s) in {M} wave(s)
|
|
106
|
+
|
|
107
|
+
| Wave | Plans | What it builds |
|
|
108
|
+
|------|-------|----------------|
|
|
109
|
+
| 1 | 01, 02 | [objectives] |
|
|
110
|
+
| 2 | 03 | [objective] |
|
|
111
|
+
|
|
112
|
+
Research: {Completed | Used existing | Skipped}
|
|
113
|
+
Verification: {Passed | Skipped}
|
|
114
|
+
|
|
115
|
+
Next: /forge:execute {phase}
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
**Plan frontmatter reference:**
|
|
119
|
+
```yaml
|
|
120
|
+
---
|
|
121
|
+
phase: M2-planning-engine # Phase identifier
|
|
122
|
+
plan: 01 # Sequential plan number
|
|
123
|
+
wave: 1 # Execution wave (parallel within wave)
|
|
124
|
+
depends_on: [] # Plan numbers this depends on
|
|
125
|
+
files_modified: [src/foo.ts] # Files this plan touches
|
|
126
|
+
autonomous: true # false if has checkpoints needing user input
|
|
127
|
+
gap_closure: false # true for gap remediation plans
|
|
128
|
+
---
|
|
129
|
+
```
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: forge:quick
|
|
3
|
+
description: Execute a quick task with FORGE guarantees (atomic commits, state tracking)
|
|
4
|
+
argument-hint: <task-description>
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Write
|
|
8
|
+
- Edit
|
|
9
|
+
- Glob
|
|
10
|
+
- Grep
|
|
11
|
+
- Bash
|
|
12
|
+
- Task
|
|
13
|
+
- TaskCreate
|
|
14
|
+
- TeamCreate
|
|
15
|
+
- AskUserQuestion
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
Execute quick ad-hoc task "$ARGUMENTS" with atomic commits and state tracking. Skips research/verification.
|
|
19
|
+
|
|
20
|
+
**Read:** state/STATE.json
|
|
21
|
+
|
|
22
|
+
**Steps:**
|
|
23
|
+
|
|
24
|
+
1. Generate task ID `quick-{timestamp}`, create `.planning/quick/{taskId}/PLAN.md` with description, steps (1-3), and acceptance criteria
|
|
25
|
+
|
|
26
|
+
2. **Ensure FORGE team AND teammates are running:**
|
|
27
|
+
- Check `~/.claude/teams/forge/config.json` exists. If not, create team with TeamCreate.
|
|
28
|
+
- Read `.planning/AgentTeam.md` to get the list of teammates that should be active.
|
|
29
|
+
- Read `~/.claude/teams/forge/config.json` members list to see who is registered.
|
|
30
|
+
- For each teammate defined in AgentTeam.md that is NOT in the team config (or if team was just created), spawn them using the Task tool with `team_name: "forge"` and `name: "{teammate-name}"` and their full prompt from AgentTeam.md.
|
|
31
|
+
- This ensures teammates are always running when any FORGE command executes, even after session restarts.
|
|
32
|
+
|
|
33
|
+
3. Validate quick mode fit (well-understood, small, 1-3 steps). If too big, suggest `/forge:plan`.
|
|
34
|
+
|
|
35
|
+
4. Execute steps: make changes → atomic commit `feat({taskId}): {desc}` → update PLAN.md checklist after each
|
|
36
|
+
|
|
37
|
+
5. Optionally delegate to teammates via TaskCreate + Task if complex enough
|
|
38
|
+
|
|
39
|
+
6. Finalize PLAN.md (mark completed, list commits), update STATE.json `quickTasksCompleted` table, submit QUICK_TASK_COMPLETED event to state/events/
|
|
40
|
+
|
|
41
|
+
7. Show completion summary with commits and PLAN.md location
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: forge:remove-phase
|
|
3
|
+
description: Remove a future phase from roadmap and renumber subsequent phases
|
|
4
|
+
argument-hint: <phase-number>
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Write
|
|
8
|
+
- Bash
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
<objective>
|
|
12
|
+
Remove a future phase from the roadmap and renumber all subsequent phases.
|
|
13
|
+
|
|
14
|
+
Use when: Phase is no longer needed, duplicate, or superseded by another phase.
|
|
15
|
+
|
|
16
|
+
**Safety:** Cannot remove in-progress or completed phases.
|
|
17
|
+
</objective>
|
|
18
|
+
|
|
19
|
+
<execution_context>
|
|
20
|
+
@state/STATE.json
|
|
21
|
+
@ROADMAP.md
|
|
22
|
+
@CLAUDE.md
|
|
23
|
+
</execution_context>
|
|
24
|
+
|
|
25
|
+
<context>
|
|
26
|
+
**Phase to Remove:** $ARGUMENTS
|
|
27
|
+
|
|
28
|
+
**Phase Removal Validation:**
|
|
29
|
+
1. Check phase status (must be "pending")
|
|
30
|
+
2. Verify phase is in the future
|
|
31
|
+
3. Check for dependents
|
|
32
|
+
4. Warn if other phases depend on this one
|
|
33
|
+
</context>
|
|
34
|
+
|
|
35
|
+
<process>
|
|
36
|
+
**Execute remove-phase workflow:**
|
|
37
|
+
|
|
38
|
+
1. **Parse Arguments**
|
|
39
|
+
- Extract phase number to remove
|
|
40
|
+
|
|
41
|
+
2. **Load State**
|
|
42
|
+
- Read state/STATE.json
|
|
43
|
+
- Read ROADMAP.md
|
|
44
|
+
- Check phase status
|
|
45
|
+
|
|
46
|
+
3. **Validate Removal**
|
|
47
|
+
- If phase is "in_progress" or "completed" → ERROR
|
|
48
|
+
- If phase is "pending" → continue
|
|
49
|
+
- Check for phases that depend on this one
|
|
50
|
+
- If dependents exist → warn and require confirmation
|
|
51
|
+
|
|
52
|
+
4. **Renumber Subsequent Phases**
|
|
53
|
+
- Find all phases with higher numbers in the same milestone
|
|
54
|
+
- Decrement each phase number by 1
|
|
55
|
+
- Update phase directory names if needed
|
|
56
|
+
- Update phase IDs in ROADMAP.md
|
|
57
|
+
- Update dependencies in other phases
|
|
58
|
+
|
|
59
|
+
5. **Remove from ROADMAP.md**
|
|
60
|
+
- Delete phase entry from ROADMAP.md
|
|
61
|
+
- Renumber subsequent phases
|
|
62
|
+
- Update all cross-references
|
|
63
|
+
|
|
64
|
+
6. **Remove Directory** (optional)
|
|
65
|
+
- Ask user if they want to remove the phase directory
|
|
66
|
+
- If yes: `rm -rf .planning/phases/<phase-slug>/`
|
|
67
|
+
- If no: Keep for reference
|
|
68
|
+
|
|
69
|
+
7. **Submit Event**
|
|
70
|
+
- Event type: PHASE_REMOVED
|
|
71
|
+
- Include: removedPhaseId, renumberedPhases
|
|
72
|
+
- Write to state/events/
|
|
73
|
+
|
|
74
|
+
8. **Confirm**
|
|
75
|
+
- Show removed phase info
|
|
76
|
+
- List renumbered phases
|
|
77
|
+
- Notify of any dependency updates
|
|
78
|
+
</process>
|
|
79
|
+
|
|
80
|
+
<deliverables>
|
|
81
|
+
- ROADMAP.md updated (phase removed, subsequent phases renumbered)
|
|
82
|
+
- Phase directory removed (if user confirmed)
|
|
83
|
+
- Event: PHASE_REMOVED in state/events/
|
|
84
|
+
- STATE.json updated
|
|
85
|
+
</deliverables>
|
|
86
|
+
|
|
87
|
+
<next_steps>
|
|
88
|
+
- Review updated roadmap with `/forge:status`
|
|
89
|
+
- Update any dependent phases manually if needed
|
|
90
|
+
- Continue work with `/forge:execute <phase-number>`
|
|
91
|
+
- Tip: Use `/clear` to start from a fresh context
|
|
92
|
+
</next_steps>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: forge:resume
|
|
3
|
+
description: Resume work from previous session with full context restoration
|
|
4
|
+
argument-hint: ""
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Write
|
|
8
|
+
- Bash
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
Resume work by loading `.continue-here.md` handoff file.
|
|
12
|
+
|
|
13
|
+
**Read:** .continue-here.md, state/STATE.json
|
|
14
|
+
|
|
15
|
+
**Steps:**
|
|
16
|
+
|
|
17
|
+
1. Check for `.continue-here.md`. If missing, check STATE.json for last phase.
|
|
18
|
+
2. Parse and display: phase, status, position, completed work, remaining work, decisions, blockers
|
|
19
|
+
3. Ask "Ready to continue?"
|
|
20
|
+
4. Submit WORK_RESUMED event to state/events/
|
|
21
|
+
5. Route to next action: `/forge:execute`, manual work, or `/forge:discuss`
|
|
22
|
+
6. After completing work, remove .continue-here.md and submit WORK_COMPLETED event
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: forge:status
|
|
3
|
+
description: Show FORGE project status including current milestone, tasks, events, and progress. Use when user asks "forge status" or wants to see project progress.
|
|
4
|
+
argument-hint: [-v|--verbose]
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Bash
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
<objective>
|
|
11
|
+
Display current FORGE project status including milestone progress, task states, event count, and team activity.
|
|
12
|
+
|
|
13
|
+
Purpose: Provide visibility into project state and progress.
|
|
14
|
+
Output: Formatted status table with milestone, tasks, events, and counts.
|
|
15
|
+
</objective>
|
|
16
|
+
|
|
17
|
+
<execution_context>
|
|
18
|
+
**Load these files NOW:**
|
|
19
|
+
|
|
20
|
+
- @state/STATE.json (current project state)
|
|
21
|
+
- @src/commands/status.ts (status command implementation)
|
|
22
|
+
</execution_context>
|
|
23
|
+
|
|
24
|
+
<context>
|
|
25
|
+
**Verbosity:** Standard (summary) or -v (verbose with full details)
|
|
26
|
+
**State File:** state/STATE.json
|
|
27
|
+
**Events Directory:** state/events/
|
|
28
|
+
|
|
29
|
+
**Status Information:**
|
|
30
|
+
- Project name and version
|
|
31
|
+
- Current milestone and phase
|
|
32
|
+
- Task counts by status (pending, in_progress, completed)
|
|
33
|
+
- Total events processed
|
|
34
|
+
- Team member activity
|
|
35
|
+
- Recent commits
|
|
36
|
+
</context>
|
|
37
|
+
|
|
38
|
+
<process>
|
|
39
|
+
**Execute the status command:**
|
|
40
|
+
|
|
41
|
+
1. **Load State**
|
|
42
|
+
```bash
|
|
43
|
+
forge status
|
|
44
|
+
# or
|
|
45
|
+
forge status -v # verbose mode
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
2. **Parse STATE.json**
|
|
49
|
+
- Extract project metadata
|
|
50
|
+
- Count tasks by status
|
|
51
|
+
- Count events from state/events/
|
|
52
|
+
- Get current milestone/phase
|
|
53
|
+
|
|
54
|
+
3. **Format Output**
|
|
55
|
+
```
|
|
56
|
+
PROJECT: FORGE v1.0-M1
|
|
57
|
+
STATUS: in_progress
|
|
58
|
+
|
|
59
|
+
MILESTONE: v1.0-M1 (Foundation)
|
|
60
|
+
PHASE: Complete
|
|
61
|
+
|
|
62
|
+
TASKS:
|
|
63
|
+
✅ Completed: 27/27
|
|
64
|
+
🔄 In Progress: 0
|
|
65
|
+
⏳ Pending: 0
|
|
66
|
+
|
|
67
|
+
EVENTS: 47 events processed
|
|
68
|
+
|
|
69
|
+
TEAM ACTIVITY:
|
|
70
|
+
ARCHITECT: 6/6 tasks complete
|
|
71
|
+
STATE-ENGINE: 4/4 tasks complete
|
|
72
|
+
CLI-ENGINE: 5/5 tasks complete
|
|
73
|
+
TEMPLATES: 6/6 tasks complete
|
|
74
|
+
GIT-OPS: 6/6 tasks complete
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
4. **Verbose Mode** (-v flag)
|
|
78
|
+
- Show all tasks with IDs and owners
|
|
79
|
+
- List recent events
|
|
80
|
+
- Show contract status
|
|
81
|
+
- Display worktree activity
|
|
82
|
+
</process>
|
|
83
|
+
|
|
84
|
+
<output_formats>
|
|
85
|
+
**Standard:** Summary with counts and milestone
|
|
86
|
+
**Verbose (-v):** Full task list, recent events, team details
|
|
87
|
+
</output_formats>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: forge:team-add
|
|
3
|
+
description: Add a new member to the FORGE agent team.
|
|
4
|
+
argument-hint: <name> <role> <agent-type>
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Write
|
|
8
|
+
- Edit
|
|
9
|
+
- Bash
|
|
10
|
+
- TeamCreate
|
|
11
|
+
- Task
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
Add a new specialist to FORGE team by updating AgentTeam.md and recreating team.
|
|
15
|
+
|
|
16
|
+
**Read:** .planning/AgentTeam.md, ~/.claude/teams/forge/config.json
|
|
17
|
+
|
|
18
|
+
**Steps:**
|
|
19
|
+
|
|
20
|
+
1. Validate AgentTeam.md exists
|
|
21
|
+
2. Prompt for details if not in args: name (kebab-case), role, agent type, model, owned paths
|
|
22
|
+
3. Add member section to AgentTeam.md, increment version
|
|
23
|
+
4. Confirm with user, shutdown old team via SendMessage, recreate with TeamCreate, spawn all teammates
|
|
24
|
+
5. Verify with `/forge:team-view`
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: forge:team-create
|
|
3
|
+
description: Create a FORGE agent team from AgentTeam.md specification.
|
|
4
|
+
argument-hint: [--team-name <name>]
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Write
|
|
8
|
+
- Bash
|
|
9
|
+
- TeamCreate
|
|
10
|
+
- Task
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
Create FORGE agent team from `.planning/AgentTeam.md`.
|
|
14
|
+
|
|
15
|
+
**Read:** .planning/AgentTeam.md (or .planning/AgentTeam.template.md as reference)
|
|
16
|
+
|
|
17
|
+
**Steps:**
|
|
18
|
+
|
|
19
|
+
1. If AgentTeam.md missing, spawn Explore subagent to analyze codebase and generate it
|
|
20
|
+
2. Show team config to user, confirm creation
|
|
21
|
+
3. Create team with TeamCreate, spawn all specialist teammates via Task tool
|
|
22
|
+
4. Verify at `~/.claude/teams/forge/config.json`
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: forge:team-remove
|
|
3
|
+
description: Remove a member from the FORGE agent team.
|
|
4
|
+
argument-hint: <member-name>
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Write
|
|
8
|
+
- Edit
|
|
9
|
+
- Bash
|
|
10
|
+
- TeamCreate
|
|
11
|
+
- Task
|
|
12
|
+
- SendMessage
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
Remove specialist $ARGUMENTS from FORGE team by updating AgentTeam.md and recreating team.
|
|
16
|
+
|
|
17
|
+
**Read:** .planning/AgentTeam.md, ~/.claude/teams/forge/config.json
|
|
18
|
+
|
|
19
|
+
**Steps:**
|
|
20
|
+
|
|
21
|
+
1. Show current members, confirm which to remove
|
|
22
|
+
2. Remove member section from AgentTeam.md, renumber remaining, increment version
|
|
23
|
+
3. Shutdown old team, recreate with TeamCreate, spawn remaining teammates
|
|
24
|
+
4. Verify with `/forge:team-view`
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: forge:team-start
|
|
3
|
+
description: Start the FORGE agent team by spawning all teammates.
|
|
4
|
+
argument-hint: [--team-name <name>]
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Bash
|
|
8
|
+
- TeamCreate
|
|
9
|
+
- Task
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
Spawn all specialist teammates defined in AgentTeam.md.
|
|
13
|
+
|
|
14
|
+
**Read:** .planning/AgentTeam.md, ~/.claude/teams/forge/config.json
|
|
15
|
+
|
|
16
|
+
**Steps:**
|
|
17
|
+
|
|
18
|
+
1. Validate AgentTeam.md exists
|
|
19
|
+
2. Parse all specialist roles (name, agent type, model, prompt)
|
|
20
|
+
3. Check existing team for inactive members
|
|
21
|
+
4. Spawn team-lead first, then all specialists via Task tool
|
|
22
|
+
5. Verify team is active, show member summary
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: forge:team-view
|
|
3
|
+
description: View FORGE agent team members and configuration.
|
|
4
|
+
argument-hint: [--team-name <name>]
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Bash
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
Display current FORGE team configuration.
|
|
11
|
+
|
|
12
|
+
**Read:** ~/.claude/teams/forge/config.json, .planning/AgentTeam.md
|
|
13
|
+
|
|
14
|
+
**Steps:**
|
|
15
|
+
|
|
16
|
+
1. Read team config, extract: name, description, members
|
|
17
|
+
2. Display formatted table: name, type, model, role, owned paths, active/idle status
|
|
18
|
+
3. Compare with AgentTeam.md, flag differences
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: forge:verify
|
|
3
|
+
description: Verify all phase plans against requirements and generate gap closure plans.
|
|
4
|
+
argument-hint: <phase-name>
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Write
|
|
8
|
+
- Glob
|
|
9
|
+
- Grep
|
|
10
|
+
- Bash
|
|
11
|
+
- Task
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
Verify phase $ARGUMENTS plans cover all requirements via goal-backward analysis. If gaps are found, generate numbered gap closure plan files (same format as regular plans) that can be executed with `/forge:execute {phase} --gaps`.
|
|
15
|
+
|
|
16
|
+
**Read:** All `.planning/phases/{phase}/*-PLAN.md` files, all `*-SUMMARY.md` files (if execution happened), REQUIREMENTS.md, ROADMAP.md, state/STATE.json
|
|
17
|
+
|
|
18
|
+
**Steps:**
|
|
19
|
+
|
|
20
|
+
1. **Discover all plan and summary files:**
|
|
21
|
+
- Glob `.planning/phases/{phase}/*-PLAN.md` → parse each plan's frontmatter and tasks
|
|
22
|
+
- Glob `.planning/phases/{phase}/*-SUMMARY.md` → check execution results
|
|
23
|
+
- Build complete picture: what was planned, what was executed, what succeeded
|
|
24
|
+
|
|
25
|
+
2. **Requirements coverage** — Map each requirement from REQUIREMENTS.md → plans/tasks that cover it. Mark each as:
|
|
26
|
+
- **Covered** — task exists and (if executed) summary confirms completion
|
|
27
|
+
- **Planned** — task exists but not yet executed
|
|
28
|
+
- **Gap** — no task addresses this requirement
|
|
29
|
+
|
|
30
|
+
3. **Goal-backward analysis** — For each milestone goal from ROADMAP.md:
|
|
31
|
+
- Trace: goal → plans → tasks → acceptance criteria
|
|
32
|
+
- Flag missing links in the chain
|
|
33
|
+
|
|
34
|
+
4. **Integration completeness** — Check cross-plan contracts defined, integration points covered, no conflicting file modifications across plans in the same wave.
|
|
35
|
+
|
|
36
|
+
5. **Dependency validation** — Verify plan dependency graph is acyclic, all depends_on references are valid plan numbers, wave assignments are correct.
|
|
37
|
+
|
|
38
|
+
6. **Scope validation** — Cross-reference with CONTEXT.md:
|
|
39
|
+
- Deferred ideas should NOT appear in any plan
|
|
40
|
+
- Locked decisions should be implemented as specified
|
|
41
|
+
- Claude's discretion areas should have reasonable choices
|
|
42
|
+
|
|
43
|
+
7. **Write VERIFICATION.md** — `.planning/phases/{phase}/VERIFICATION.md` with:
|
|
44
|
+
```markdown
|
|
45
|
+
# {Phase} Verification
|
|
46
|
+
**Verified:** [timestamp]
|
|
47
|
+
**Result:** {PASS | GAPS FOUND}
|
|
48
|
+
|
|
49
|
+
## Requirements Coverage
|
|
50
|
+
| Requirement | Status | Covered By |
|
|
51
|
+
|-------------|--------|------------|
|
|
52
|
+
| REQ-001 | Covered | Plan 01, Task 1 |
|
|
53
|
+
| REQ-003 | GAP | — |
|
|
54
|
+
|
|
55
|
+
## Goal-Backward Analysis
|
|
56
|
+
[Results per goal]
|
|
57
|
+
|
|
58
|
+
## Integration Check
|
|
59
|
+
[Results]
|
|
60
|
+
|
|
61
|
+
## Dependency Validation
|
|
62
|
+
[Results]
|
|
63
|
+
|
|
64
|
+
## Scope Validation
|
|
65
|
+
[Results]
|
|
66
|
+
|
|
67
|
+
## Gaps Summary
|
|
68
|
+
{count} gaps identified requiring remediation.
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
8. **If gaps found — generate gap closure plan files:**
|
|
72
|
+
- Determine next plan number (highest existing + 1)
|
|
73
|
+
- Create `.planning/phases/{phase}/{phase}-{next}-PLAN.md` for each gap cluster
|
|
74
|
+
- Each gap closure plan uses the same format as regular plans with frontmatter:
|
|
75
|
+
```yaml
|
|
76
|
+
---
|
|
77
|
+
phase: {phase-name}
|
|
78
|
+
plan: {next-number}
|
|
79
|
+
wave: 1
|
|
80
|
+
depends_on: []
|
|
81
|
+
files_modified: [...]
|
|
82
|
+
autonomous: true
|
|
83
|
+
gap_closure: true
|
|
84
|
+
---
|
|
85
|
+
```
|
|
86
|
+
- Gap closure plans contain 2-3 remediation tasks each (same XML task format)
|
|
87
|
+
- Number sequentially after existing plans
|
|
88
|
+
- Gap plan limit: max 3 gap closure plans. If more gaps exist, recommend breaking into sub-phases.
|
|
89
|
+
|
|
90
|
+
9. **Routing:**
|
|
91
|
+
- If **no gaps:** "All requirements covered. Ready to execute." → Offer `/forge:execute {phase}`
|
|
92
|
+
- If **gaps found:** Show gap summary, list generated gap closure plans → Offer `/forge:execute {phase} --gaps` to run only gap closure plans
|
|
93
|
+
- If **already executed and gaps in results:** Generate plans targeting execution failures
|
|
94
|
+
|
|
95
|
+
**Pass criteria:** All requirements covered, goals achievable, deps valid, scope aligned with CONTEXT.md.
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// FORGE Hook: Context Cleanup (SessionStart)
|
|
3
|
+
// Archives old events, cleans temp files, reports context health
|
|
4
|
+
|
|
5
|
+
const fs = require('fs');
|
|
6
|
+
const path = require('path');
|
|
7
|
+
|
|
8
|
+
const cwd = process.cwd();
|
|
9
|
+
const eventsDir = path.join(cwd, 'state', 'events');
|
|
10
|
+
const archiveDir = path.join(cwd, 'state', 'events', 'archive');
|
|
11
|
+
const planningDir = path.join(cwd, '.planning');
|
|
12
|
+
|
|
13
|
+
// Only run if this looks like a FORGE project
|
|
14
|
+
if (!fs.existsSync(path.join(cwd, 'state', 'STATE.json'))) {
|
|
15
|
+
process.exit(0);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
let archived = 0;
|
|
19
|
+
let cleaned = 0;
|
|
20
|
+
|
|
21
|
+
// 1. Archive events older than 7 days
|
|
22
|
+
if (fs.existsSync(eventsDir)) {
|
|
23
|
+
const cutoff = Date.now() - (7 * 24 * 60 * 60 * 1000);
|
|
24
|
+
const files = fs.readdirSync(eventsDir)
|
|
25
|
+
.filter(f => f.endsWith('.json') && f !== 'archive');
|
|
26
|
+
|
|
27
|
+
for (const file of files) {
|
|
28
|
+
const fp = path.join(eventsDir, file);
|
|
29
|
+
try {
|
|
30
|
+
const stat = fs.statSync(fp);
|
|
31
|
+
if (stat.mtime.getTime() < cutoff) {
|
|
32
|
+
if (!fs.existsSync(archiveDir)) {
|
|
33
|
+
fs.mkdirSync(archiveDir, { recursive: true });
|
|
34
|
+
}
|
|
35
|
+
fs.renameSync(fp, path.join(archiveDir, file));
|
|
36
|
+
archived++;
|
|
37
|
+
}
|
|
38
|
+
} catch (e) {}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// 2. Clean up orphaned .continue-here.md if older than 3 days
|
|
43
|
+
const continueFile = path.join(cwd, '.continue-here.md');
|
|
44
|
+
if (fs.existsSync(continueFile)) {
|
|
45
|
+
try {
|
|
46
|
+
const stat = fs.statSync(continueFile);
|
|
47
|
+
const age = Date.now() - stat.mtime.getTime();
|
|
48
|
+
if (age > 3 * 24 * 60 * 60 * 1000) {
|
|
49
|
+
fs.unlinkSync(continueFile);
|
|
50
|
+
cleaned++;
|
|
51
|
+
}
|
|
52
|
+
} catch (e) {}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// 3. Clean up empty quick task dirs
|
|
56
|
+
const quickDir = path.join(planningDir, 'quick');
|
|
57
|
+
if (fs.existsSync(quickDir)) {
|
|
58
|
+
const dirs = fs.readdirSync(quickDir);
|
|
59
|
+
for (const dir of dirs) {
|
|
60
|
+
const dp = path.join(quickDir, dir);
|
|
61
|
+
try {
|
|
62
|
+
if (fs.statSync(dp).isDirectory()) {
|
|
63
|
+
const contents = fs.readdirSync(dp);
|
|
64
|
+
if (contents.length === 0) {
|
|
65
|
+
fs.rmdirSync(dp);
|
|
66
|
+
cleaned++;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
} catch (e) {}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// Report if anything happened
|
|
74
|
+
if (archived > 0 || cleaned > 0) {
|
|
75
|
+
const parts = [];
|
|
76
|
+
if (archived > 0) parts.push(`archived ${archived} old event(s)`);
|
|
77
|
+
if (cleaned > 0) parts.push(`cleaned ${cleaned} temp file(s)`);
|
|
78
|
+
process.stderr.write(`\x1b[34m→ FORGE cleanup: ${parts.join(', ')}\x1b[0m\n`);
|
|
79
|
+
}
|