forge-dev-framework 1.0.1 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,314 @@
1
+ # FORGE Command Reference
2
+
3
+ FORGE commands are now available as slash commands in Claude Code, similar to how GSD works.
4
+
5
+ ## Available Commands
6
+
7
+ ### Core Commands (Milestone 1 ✅)
8
+
9
+ | Command | Description | Usage |
10
+ |---------|-------------|-------|
11
+ | `/forge:new-project` | Initialize a new FORGE project | `/forge:new-project [project-name]` |
12
+ | `/forge:init` | Initialize FORGE in current directory | `/forge:init [--quick]` |
13
+ | `/forge:status` | Show project progress | `/forge:status [-v]` |
14
+ | `/forge:config` | View/edit configuration | `/forge:config [key] [value]` |
15
+ | `/forge:generate` | Generate artifact from template | `/forge:generate <artifact> [-f]` |
16
+ | `/forge:help` | Show command reference | `/forge:help [command]` |
17
+
18
+ ### Planning Commands (Milestone 2 🚧)
19
+
20
+ | Command | Description | Usage |
21
+ |---------|-------------|-------|
22
+ | `/forge:discuss` | Capture phase context | `/forge:discuss <phase-name>` |
23
+ | `/forge:plan` | Generate task breakdown | `/forge:plan <phase-name>` |
24
+ | `/forge:verify` | Verify plan against requirements | `/forge:verify <phase-name>` |
25
+
26
+ ### Execution Commands (Milestone 3 📋)
27
+
28
+ | Command | Description | Usage |
29
+ |---------|-------------|-------|
30
+ | `/forge:execute` | Execute phase with agent teams | `/forge:execute <phase-name>` |
31
+
32
+ ### Phase Management Commands
33
+
34
+ | Command | Description | Usage |
35
+ |---------|-------------|-------|
36
+ | `/forge:add-phase` | Add phase to end of current milestone | `/forge:add-phase <description>` |
37
+ | `/forge:insert-phase` | Insert urgent work as decimal phase | `/forge:insert-phase <after-phase> <description>` |
38
+ | `/forge:remove-phase` | Remove future phase and renumber | `/forge:remove-phase <phase-number>` |
39
+
40
+ ### Milestone Commands
41
+
42
+ | Command | Description | Usage |
43
+ |---------|-------------|-------|
44
+ | `/forge:new-milestone` | Start new milestone cycle | `/forge:new-milestone` |
45
+ | `/forge:complete-milestone` | Archive completed milestone | `/forge:complete-milestone` |
46
+
47
+ ### Workflow Commands
48
+
49
+ | Command | Description | Usage |
50
+ |---------|-------------|-------|
51
+ | `/forge:pause-work` | Create context handoff | `/forge:pause-work` |
52
+ | `/forge:resume-work` | Resume from previous session | `/forge:resume-work` |
53
+ | `/forge:quick` | Execute quick task with guarantees | `/forge:quick <task-description>` |
54
+ | `/forge:debug` | Systematic debugging | `/forge:debug [issue description]` |
55
+
56
+ ## Quick Start
57
+
58
+ ### 1. Initialize a New FORGE Project
59
+
60
+ ```bash
61
+ /forge:new-project my-app
62
+ ```
63
+
64
+ This creates a complete FORGE project structure with:
65
+ - CLAUDE.md (project constitution)
66
+ - state/STATE.json (event-sourced state)
67
+ - .planning/forge.config.json (configuration)
68
+ - Templates and generators
69
+ - Git integration with hooks
70
+
71
+ ### 2. Plan a Phase
72
+
73
+ First, capture context:
74
+
75
+ ```bash
76
+ /forge:discuss M2-planning-engine
77
+ ```
78
+
79
+ Then generate tasks:
80
+
81
+ ```bash
82
+ /forge:plan M2-planning-engine
83
+ ```
84
+
85
+ This creates a PLAN.md with:
86
+ - 5-6 atomic tasks (FORGE hard rule)
87
+ - Mermaid dependency graph
88
+ - Requirements coverage matrix
89
+ - Acceptance criteria
90
+
91
+ ### 3. Verify the Plan
92
+
93
+ ```bash
94
+ /forge:verify M2-planning-engine
95
+ ```
96
+
97
+ This validates:
98
+ - Requirements coverage
99
+ - Goal-backward verification
100
+ - Integration completeness
101
+ - Task atomicity
102
+
103
+ ### 4. Execute the Phase
104
+
105
+ ```bash
106
+ /forge:execute M2-planning-engine
107
+ ```
108
+
109
+ This spawns agent teams to execute tasks with:
110
+ - Wave-based parallelization
111
+ - Wipe Protocol (fresh context per task)
112
+ - Atomic commits (one task = one commit)
113
+ - Contract-first coordination
114
+
115
+ ## Artifact Generation
116
+
117
+ Generate specific artifacts using `/forge:generate`:
118
+
119
+ ```bash
120
+ /forge:generate claude # CLAUDE.md
121
+ /forge:generate requirements # REQUIREMENTS.md
122
+ /forge:generate roadmap # ROADMAP.md
123
+ /forge:generate plan # PLAN.md
124
+ /forge:generate config # forge.config.json
125
+ /forge:generate rules # .claude/rules/*.md
126
+ ```
127
+
128
+ ## Configuration
129
+
130
+ View configuration:
131
+
132
+ ```bash
133
+ /forge:config
134
+ ```
135
+
136
+ Edit a setting:
137
+
138
+ ```bash
139
+ /forge:config maxTeammates 6
140
+ /forge:config taskLimit 5
141
+ ```
142
+
143
+ Available settings:
144
+
145
+ | Key | Type | Default | Description |
146
+ |-----|------|---------|-------------|
147
+ | mode | enum | interactive | yolo, interactive, standard |
148
+ | depth | enum | standard | quick, standard, comprehensive |
149
+ | maxTeammates | int | 5 | Max agents per phase (2-10) |
150
+ | taskLimit | int | 6 | Max tasks per phase (5-6 recommended) |
151
+ | conventionalCommits | bool | true | Enforce commit format |
152
+ | worktreeIsolation | bool | true | Use worktrees for tasks |
153
+
154
+ ## Status Tracking
155
+
156
+ Check project progress:
157
+
158
+ ```bash
159
+ /forge:status
160
+ ```
161
+
162
+ Verbose mode (shows all tasks):
163
+
164
+ ```bash
165
+ /forge:status -v
166
+ ```
167
+
168
+ ## Command Lifecycle
169
+
170
+ ```
171
+ ┌─────────────────┐
172
+ │ forge:new-project │ ← Create new FORGE project
173
+ └────────┬────────┘
174
+
175
+ ┌─────────────────┐
176
+ │ forge:new-milestone │ ← Start new milestone
177
+ └────────┬────────┘
178
+
179
+ ┌─────────────────┐
180
+ │ forge:discuss │ ← Capture phase context
181
+ └────────┬────────┘
182
+
183
+ ┌─────────────────┐
184
+ │ forge:plan │ ← Generate 5-6 atomic tasks
185
+ └────────┬────────┘
186
+
187
+ ┌─────────────────┐
188
+ │ forge:verify │ ← Validate against requirements
189
+ └────────┬────────┘
190
+
191
+ ┌─────────────────┐
192
+ │ forge:execute │ ← Execute with agent teams
193
+ └────────┬────────┘
194
+
195
+ ┌─────────────────────┐
196
+ │ forge:pause-work │ ← Pause mid-phase (optional)
197
+ └────────┬────────────┘
198
+
199
+ ┌─────────────────────┐
200
+ │ forge:resume-work │ ← Resume with full context
201
+ └────────┬────────────┘
202
+
203
+ ┌─────────────────────┐
204
+ │forge:complete-milestone│ ← Archive milestone
205
+ └─────────────────────┘
206
+ ```
207
+
208
+ ## Quick Tasks & Debugging
209
+
210
+ For ad-hoc work outside the planned phases:
211
+
212
+ ```bash
213
+ /forge:quick "Fix login bug" # Execute small task with atomic commits
214
+ /forge:debug "API not responding" # Systematic debugging workflow
215
+ ```
216
+
217
+ **Quick tasks** live in `.planning/quick/` separate from planned phases and update the quick tasks table in STATE.json.
218
+
219
+ **Debug sessions** create `.planning/debug/*.md` files with investigation state that persists across context resets.
220
+
221
+ ## FORGE Architecture
222
+
223
+ FORGE uses an event-sourced state engine with single-writer merge:
224
+
225
+ ```
226
+ All Agents → state/events/*.json (append-only)
227
+
228
+ State Steward (single writer)
229
+
230
+ state/STATE.json (canonical)
231
+ ```
232
+
233
+ ### Key Principles
234
+
235
+ - **Event-Sourced State**: Append-only event log
236
+ - **Single-Writer**: Only State Steward writes STATE.json
237
+ - **Contract-First**: API contracts negotiated before cross-domain work
238
+ - **File Ownership**: Each agent writes only within owned paths
239
+ - **Wipe Protocol**: Fresh agent context per task
240
+ - **5-6 Task Limit**: Maximum tasks per phase
241
+ - **Atomic Commits**: One task = one commit
242
+
243
+ ## Milestone Status
244
+
245
+ | Milestone | Name | Status |
246
+ |-----------|------|--------|
247
+ | M1 | Foundation | ✅ Complete |
248
+ | M2 | Planning Engine | 🚧 In Progress |
249
+ | M3 | Parallel Execution | 📋 Planned |
250
+ | M4 | Adversarial Review | 📋 Planned |
251
+ | M5 | CLI & TUI | 📋 Planned |
252
+
253
+ ## Getting Help
254
+
255
+ ```bash
256
+ /forge:help # Show all commands
257
+ /forge:help plan # Detailed help for specific command
258
+ ```
259
+
260
+ ## File Structure
261
+
262
+ ```
263
+ .forge-project/
264
+ ├── CLAUDE.md # Project constitution
265
+ ├── REQUIREMENTS.md # Functional requirements
266
+ ├── ROADMAP.md # Milestone breakdown
267
+ ├── PLAN.md # Task breakdown
268
+ ├── state/
269
+ │ ├── STATE.json # Canonical state (single-writer)
270
+ │ ├── STATE.schema.json # State validation schema
271
+ │ └── events/ # Append-only event log
272
+ ├── contracts/ # API contracts
273
+ ├── .planning/
274
+ │ ├── forge.config.json # Configuration
275
+ │ └── phases/ # Phase artifacts
276
+ ├── .claude/
277
+ │ └── rules/ # Scoped rules
278
+ ├── src/
279
+ │ ├── cli/ # CLI commands
280
+ │ ├── commands/ # Command implementations
281
+ │ ├── generators/ # Template engine
282
+ │ ├── git/ # Git operations
283
+ │ └── utils/ # Utilities
284
+ └── .worktrees/ # Git worktrees for isolation
285
+ ```
286
+
287
+ ## Integration with Claude Code
288
+
289
+ FORGE commands integrate seamlessly with Claude Code's agent teams:
290
+
291
+ 1. **State Engine**: Manages project state deterministically
292
+ 2. **Contract-First**: Agents negotiate interfaces before implementation
293
+ 3. **File Ownership**: Clear boundaries prevent merge conflicts
294
+ 4. **Wipe Protocol**: Fresh context prevents hallucination carry-over
295
+ 5. **Atomic Commits**: One task = one git commit (enforced)
296
+
297
+ ## Next Steps
298
+
299
+ 1. Run `/forge:new-project` to create a new FORGE project
300
+ 2. Run `/forge:discuss` to capture phase context
301
+ 3. Run `/forge:plan` to generate task breakdown
302
+ 4. Run `/forge:execute` to execute with agent teams
303
+ 5. Run `/forge:status` to track progress
304
+
305
+ ## Documentation
306
+
307
+ - **CLAUDE.md**: Architecture, patterns, rules
308
+ - **REQUIREMENTS.md**: Functional requirements
309
+ - **ROADMAP.md**: 5-milestone implementation plan
310
+ - **PLAN.md**: Detailed task breakdowns
311
+
312
+ ## Version
313
+
314
+ FORGE v1.0-M1 — Milestone 1: Foundation (COMPLETE ✅)
@@ -0,0 +1,89 @@
1
+ ---
2
+ name: forge:add-phase
3
+ description: Add phase to end of current milestone in roadmap
4
+ argument-hint: <description>
5
+ allowed-tools:
6
+ - Read
7
+ - Write
8
+ - Bash
9
+ ---
10
+
11
+ <objective>
12
+ Add a new integer phase to the end of the current milestone in the roadmap.
13
+
14
+ Routes to the add-phase workflow which handles:
15
+ - Phase number calculation (next sequential integer)
16
+ - Directory creation with slug generation
17
+ - Roadmap structure updates
18
+ - State evolution tracking
19
+ </objective>
20
+
21
+ <execution_context>
22
+ @state/STATE.json
23
+ @ROADMAP.md
24
+ @CLAUDE.md
25
+ </execution_context>
26
+
27
+ <context>
28
+ **Phase Description:** $ARGUMENTS
29
+
30
+ **Phase Assignment:**
31
+ 1. Read ROADMAP.md to find current milestone
32
+ 2. Calculate next integer phase (ignoring decimals)
33
+ 3. Generate slug from description
34
+ 4. Create phase directory structure
35
+ 5. Add to ROADMAP.md
36
+ </context>
37
+
38
+ <process>
39
+ **Execute add-phase workflow:**
40
+
41
+ 1. **Load State**
42
+ - Read state/STATE.json
43
+ - Read ROADMAP.md
44
+ - Identify current milestone
45
+
46
+ 2. **Calculate Phase Number**
47
+ - Find highest integer phase in current milestone
48
+ - Next phase = highest + 1
49
+ - Example: If phases are 70, 71, 71.1, 72 → next is 73
50
+
51
+ 3. **Generate Slug**
52
+ - Create URL-safe slug from description
53
+ - Format: `<phase-number>-<slug>`
54
+ - Example: "Implement auth" → "73-implement-auth"
55
+
56
+ 4. **Create Directory Structure**
57
+ ```bash
58
+ mkdir -p .planning/phases/<phase-slug>/
59
+ touch .planning/phases/<phase-slug>/CONTEXT.md
60
+ touch .planning/phases/<phase-slug>/PLAN.md
61
+ ```
62
+
63
+ 5. **Update ROADMAP.md**
64
+ - Add new phase entry to current milestone
65
+ - Use standard phase format
66
+ - Maintain proper heading hierarchy
67
+
68
+ 6. **Submit Event**
69
+ - Event type: PHASE_ADDED
70
+ - Include: phaseId, milestoneId, description
71
+ - Write to state/events/
72
+
73
+ 7. **Confirm**
74
+ - Show new phase info
75
+ - Suggest next: `forge discuss <phase>` or `forge plan <phase>`
76
+ </process>
77
+
78
+ <deliverables>
79
+ - .planning/phases/<phase-slug>/CONTEXT.md (empty template)
80
+ - .planning/phases/<phase-slug>/PLAN.md (empty template)
81
+ - ROADMAP.md updated with new phase
82
+ - Event: PHASE_ADDED in state/events/
83
+ - STATE.json updated
84
+ </deliverables>
85
+
86
+ <next_steps>
87
+ - Run `forge discuss <phase>` to capture phase context
88
+ - Run `forge plan <phase>` to generate task breakdown
89
+ </next_steps>
@@ -0,0 +1,130 @@
1
+ ---
2
+ name: forge:complete-milestone
3
+ description: Archive completed milestone and prepare for next version
4
+ argument-hint: ""
5
+ allowed-tools:
6
+ - Read
7
+ - Write
8
+ - Bash
9
+ ---
10
+
11
+ <objective>
12
+ Archive the completed milestone and prepare the project for the next version.
13
+
14
+ Routes to audit-milestone workflow which validates completion before archiving.
15
+ </objective>
16
+
17
+ <execution_context>
18
+ @state/STATE.json
19
+ @ROADMAP.md
20
+ @CLAUDE.md
21
+ </execution_context>
22
+
23
+ <context>
24
+ **Milestone Completion Workflow:**
25
+ 1. Validate all phases in milestone are complete
26
+ 2. Generate milestone summary
27
+ 3. Archive milestone artifacts
28
+ 4. Update ROADMAP.md
29
+ 5. Prepare next milestone
30
+ 6. Tag and release (optional)
31
+ </context>
32
+
33
+ <process>
34
+ **Execute complete-milestone workflow:**
35
+
36
+ 1. **Load State**
37
+ - Read state/STATE.json
38
+ - Read ROADMAP.md
39
+ - Identify current milestone
40
+
41
+ 2. **Validate Completion**
42
+ Check all phases in current milestone:
43
+ - Status is "completed"
44
+ - All tasks complete
45
+ - All tests passing
46
+ - No pending blockers
47
+
48
+ If validation fails:
49
+ - Show incomplete phases
50
+ - Ask: "Continue anyway?" or "Fix issues first?"
51
+
52
+ 3. **Generate Milestone Summary**
53
+ ```markdown
54
+ # Milestone {name} Summary
55
+
56
+ **Completed:** {date}
57
+ **Duration:** {start-date} to {end-date}
58
+
59
+ ## Phases Delivered
60
+ - {phase-1}: {description}
61
+ - {phase-2}: {description}
62
+
63
+ ## Key Metrics
64
+ - Total Phases: {count}
65
+ - Total Tasks: {count}
66
+ - Completion Rate: {percentage}
67
+ - Test Coverage: {percentage}
68
+
69
+ ## Technical Highlights
70
+ - {highlight-1}
71
+ - {highlight-2}
72
+
73
+ ## Challenges Overcome
74
+ - {challenge-1}
75
+ - {challenge-2}
76
+
77
+ ## Next Steps
78
+ - {next-milestone-goals}
79
+ ```
80
+
81
+ 4. **Archive Artifacts**
82
+ ```bash
83
+ mkdir -p .planning/archive/milestone-{name}/
84
+ cp ROADMAP.md .planning/archive/milestone-{name}/
85
+ cp PLAN.md .planning/archive/milestone-{name}/ || true
86
+ cp -r .planning/phases/* .planning/archive/milestone-{name}/phases/ || true
87
+ ```
88
+
89
+ 5. **Update ROADMAP.md**
90
+ - Move completed milestone to "Completed" section
91
+ - Mark as ✅ COMPLETE
92
+ - Add milestone summary
93
+
94
+ 6. **Update STATE.json**
95
+ - Set `project.status` = "completed"
96
+ - Archive milestone data
97
+ - Prepare for next milestone
98
+
99
+ 7. **Submit Events**
100
+ - Event type: MILESTONE_COMPLETED
101
+ - Include: milestoneId, summary, metrics
102
+ - Write to state/events/
103
+
104
+ 8. **Git Tag** (optional)
105
+ - Ask: "Create git tag for this milestone?"
106
+ - If yes: `git tag -a milestone-{name} -m "Milestone {name} complete"`
107
+
108
+ 9. **Confirm**
109
+ - Show milestone summary
110
+ - List archived artifacts
111
+ - Suggest next: `forge new-milestone` or manual planning
112
+
113
+ 10. **Cleanup**
114
+ - Offer to remove completed phase directories
115
+ - Ask: "Clean up .planning/phases/?"
116
+ </process>
117
+
118
+ <deliverables>
119
+ - .planning/archive/milestone-{name}/ (archived artifacts)
120
+ - ROADMAP.md updated (milestone moved to completed)
121
+ - STATE.json updated (milestone archived)
122
+ - Event: MILESTONE_COMPLETED in state/events/
123
+ - Optional: Git tag milestone-{name}
124
+ </deliverables>
125
+
126
+ <next_steps>
127
+ - Run `forge new-milestone` to start next milestone
128
+ - Or manually plan next work
129
+ - Celebrate! 🎉
130
+ </next_steps>
@@ -0,0 +1,115 @@
1
+ ---
2
+ name: forge:config
3
+ description: View or edit FORGE configuration settings. Use when user says "forge config" or wants to change settings.
4
+ argument-hint: [key] [value]
5
+ allowed-tools:
6
+ - Read
7
+ - Write
8
+ - Bash
9
+ ---
10
+
11
+ <objective>
12
+ View current FORGE configuration or modify specific settings.
13
+
14
+ Purpose: Configure FORGE behavior for the project.
15
+ Output: Current settings or updated configuration.
16
+ </objective>
17
+
18
+ <execution_context>
19
+ **Load these files NOW:**
20
+
21
+ - @.planning/forge.config.json (Current configuration)
22
+ - @state/STATE.json (Project state)
23
+ </execution_context>
24
+
25
+ <context>
26
+ **Configuration File:** .planning/forge.config.json
27
+ **Operation:** View (no args) or Edit (key + value)
28
+ </context>
29
+
30
+ <process>
31
+ **Execute config command:**
32
+
33
+ 1. **View Configuration** (no arguments)
34
+ ```bash
35
+ forge config
36
+ ```
37
+
38
+ Output:
39
+ ```
40
+ FORGE Configuration:
41
+ ───────────────────────────────────────
42
+ mode: interactive # Interaction mode
43
+ depth: standard # Planning depth
44
+ maxTeammates: 5 # Max agents per phase
45
+ taskLimit: 6 # Max tasks per phase
46
+ conventionalCommits: true # Enforce commit format
47
+ worktreeIsolation: true # Use worktrees for tasks
48
+ ```
49
+
50
+ 2. **View Specific Key**
51
+ ```bash
52
+ forge config taskLimit
53
+ # Output: taskLimit = 6
54
+ ```
55
+
56
+ 3. **Edit Setting**
57
+ ```bash
58
+ forge config maxTeammates 6
59
+ # Updates: .planning/forge.config.json
60
+ ```
61
+
62
+ 4. **Validate Changes**
63
+ - Check value type
64
+ - Validate ranges (e.g., maxTeammates: 2-10)
65
+ - Verify schema compliance
66
+ - Update STATE.json if needed
67
+
68
+ 5. **Available Settings**
69
+
70
+ | Key | Type | Default | Description |
71
+ |-----|------|---------|-------------|
72
+ | mode | enum | interactive | yolo, interactive, standard |
73
+ | depth | enum | standard | quick, standard, comprehensive |
74
+ | maxTeammates | int | 5 | Max agents per phase (2-10) |
75
+ | taskLimit | int | 6 | Max tasks per phase (5-6 recommended) |
76
+ | conventionalCommits | bool | true | Enforce commit format |
77
+ | worktreeIsolation | bool | true | Use worktrees for tasks |
78
+ | autoMerge | bool | false | Auto-merge completed tasks |
79
+
80
+ 6. **Config Schema**
81
+ ```json
82
+ {
83
+ "$schema": "./config.schema.json",
84
+ "mode": "interactive",
85
+ "depth": "standard",
86
+ "maxTeammates": 5,
87
+ "taskLimit": 6,
88
+ "conventionalCommits": true,
89
+ "worktreeIsolation": true,
90
+ "autoMerge": false
91
+ }
92
+ ```
93
+ </process>
94
+
95
+ <validation>
96
+ - Type checking (int, bool, enum)
97
+ - Range validation (e.g., maxTeammates: 2-10)
98
+ - Schema compliance
99
+ </validation>
100
+
101
+ <examples>
102
+ ```bash
103
+ # View all config
104
+ forge config
105
+
106
+ # View specific setting
107
+ forge config taskLimit
108
+
109
+ # Change setting
110
+ forge config maxTeammates 6
111
+
112
+ # Reset to defaults
113
+ forge config --reset
114
+ ```
115
+ </examples>