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.
- package/.claude/commands/forge/README.md +314 -0
- package/.claude/commands/forge/add-phase.md +89 -0
- package/.claude/commands/forge/complete-milestone.md +130 -0
- package/.claude/commands/forge/config.md +115 -0
- package/.claude/commands/forge/debug.md +173 -0
- package/.claude/commands/forge/discuss.md +125 -0
- package/.claude/commands/forge/execute.md +160 -0
- package/.claude/commands/forge/generate.md +120 -0
- package/.claude/commands/forge/help.md +123 -0
- package/.claude/commands/forge/init.md +85 -0
- package/.claude/commands/forge/insert-phase.md +98 -0
- package/.claude/commands/forge/new-milestone.md +114 -0
- package/.claude/commands/forge/new-project.md +103 -0
- package/.claude/commands/forge/pause-work.md +111 -0
- package/.claude/commands/forge/plan.md +144 -0
- package/.claude/commands/forge/quick.md +130 -0
- package/.claude/commands/forge/remove-phase.md +91 -0
- package/.claude/commands/forge/resume-work.md +122 -0
- package/.claude/commands/forge/status.md +87 -0
- package/.claude/commands/forge/verify.md +174 -0
- package/README.md +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: forge:debug
|
|
3
|
+
description: Systematic debugging with persistent state across context resets
|
|
4
|
+
argument-hint: [issue description]
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Bash
|
|
8
|
+
- Task
|
|
9
|
+
- AskUserQuestion
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
<objective>
|
|
13
|
+
Debug issues using scientific method with subagent isolation.
|
|
14
|
+
|
|
15
|
+
**Orchestrator role:** Gather symptoms, spawn debugger agent, handle checkpoints, spawn continuations.
|
|
16
|
+
|
|
17
|
+
**Why subagent:** Investigation burns context fast (reading files, forming hypotheses, testing). Fresh 200k context per investigation. Main context stays lean for user interaction.
|
|
18
|
+
</objective>
|
|
19
|
+
|
|
20
|
+
<execution_context>
|
|
21
|
+
@state/STATE.json
|
|
22
|
+
@CLAUDE.md
|
|
23
|
+
</execution_context>
|
|
24
|
+
|
|
25
|
+
<context>
|
|
26
|
+
**User's Issue:** $ARGUMENTS
|
|
27
|
+
|
|
28
|
+
**Debug Workflow:**
|
|
29
|
+
1. Check for active debug sessions
|
|
30
|
+
2. Gather symptoms (expected, actual, errors, timeline, reproduction)
|
|
31
|
+
3. Spawn debugger agent
|
|
32
|
+
4. Handle checkpoints and continuations
|
|
33
|
+
5. Confirm root cause before fixing
|
|
34
|
+
</context>
|
|
35
|
+
|
|
36
|
+
<process>
|
|
37
|
+
**Execute debug workflow:**
|
|
38
|
+
|
|
39
|
+
1. **Check Active Sessions**
|
|
40
|
+
```bash
|
|
41
|
+
find .planning/debug -name "*.md" -type f 2>/dev/null | grep -v resolved | head -5
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
If active sessions exist AND no $ARGUMENTS:
|
|
45
|
+
- List sessions with status, hypothesis, next action
|
|
46
|
+
- User picks number to resume OR describes new issue
|
|
47
|
+
|
|
48
|
+
If $ARGUMENTS provided OR user describes new issue:
|
|
49
|
+
- Continue to symptom gathering
|
|
50
|
+
|
|
51
|
+
2. **Gather Symptoms** (if new issue)
|
|
52
|
+
Use AskUserQuestion for each:
|
|
53
|
+
- **Expected behavior:** What should happen?
|
|
54
|
+
- **Actual behavior:** What happens instead?
|
|
55
|
+
- **Error messages:** Any errors? (paste or describe)
|
|
56
|
+
- **Timeline:** When did this start? Ever worked?
|
|
57
|
+
- **Reproduction:** How do you trigger it?
|
|
58
|
+
|
|
59
|
+
After gathering, confirm ready to investigate.
|
|
60
|
+
|
|
61
|
+
3. **Create Debug Session**
|
|
62
|
+
- Generate slug from issue description
|
|
63
|
+
- Create debug file: `.planning/debug/{slug}.md`
|
|
64
|
+
- Initialize with symptom data
|
|
65
|
+
|
|
66
|
+
4. **Spawn Debugger Agent**
|
|
67
|
+
Fill prompt and spawn:
|
|
68
|
+
```markdown
|
|
69
|
+
<objective>
|
|
70
|
+
Investigate issue: {slug}
|
|
71
|
+
|
|
72
|
+
**Summary:** {trigger}
|
|
73
|
+
</objective>
|
|
74
|
+
|
|
75
|
+
<symptoms>
|
|
76
|
+
expected: {expected}
|
|
77
|
+
actual: {actual}
|
|
78
|
+
errors: {errors}
|
|
79
|
+
reproduction: {reproduction}
|
|
80
|
+
timeline: {timeline}
|
|
81
|
+
</symptoms>
|
|
82
|
+
|
|
83
|
+
<mode>
|
|
84
|
+
symptoms_prefilled: true
|
|
85
|
+
goal: find_and_fix
|
|
86
|
+
</mode>
|
|
87
|
+
|
|
88
|
+
<debug_file>
|
|
89
|
+
Create: .planning/debug/{slug}.md
|
|
90
|
+
</debug_file>
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Spawn with Task tool:
|
|
94
|
+
```
|
|
95
|
+
Task(
|
|
96
|
+
prompt=filled_prompt,
|
|
97
|
+
subagent_type="general-purpose",
|
|
98
|
+
description="Debug {slug}"
|
|
99
|
+
)
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
5. **Handle Agent Return**
|
|
103
|
+
|
|
104
|
+
**If `## ROOT CAUSE FOUND`:**
|
|
105
|
+
- Display root cause and evidence summary
|
|
106
|
+
- Offer options:
|
|
107
|
+
- "Fix now" - spawn fix subagent or fix directly
|
|
108
|
+
- "Plan fix" - suggest `forge plan <phase>`
|
|
109
|
+
- "Manual fix" - done
|
|
110
|
+
|
|
111
|
+
**If `## CHECKPOINT REACHED`:**
|
|
112
|
+
- Present checkpoint details to user
|
|
113
|
+
- Get user response
|
|
114
|
+
- Spawn continuation agent
|
|
115
|
+
|
|
116
|
+
**If `## INVESTIGATION INCONCLUSIVE`:**
|
|
117
|
+
- Show what was checked and eliminated
|
|
118
|
+
- Offer options:
|
|
119
|
+
- "Continue investigating" - spawn new agent
|
|
120
|
+
- "Manual investigation" - done
|
|
121
|
+
- "Add more context" - gather more symptoms
|
|
122
|
+
|
|
123
|
+
6. **Spawn Continuation Agent** (after checkpoint)
|
|
124
|
+
When user responds to checkpoint, spawn fresh agent:
|
|
125
|
+
```markdown
|
|
126
|
+
<objective>
|
|
127
|
+
Continue debugging {slug}. Evidence is in the debug file.
|
|
128
|
+
</objective>
|
|
129
|
+
|
|
130
|
+
<prior_state>
|
|
131
|
+
Debug file: @.planning/debug/{slug}.md
|
|
132
|
+
</prior_state>
|
|
133
|
+
|
|
134
|
+
<checkpoint_response>
|
|
135
|
+
**Type:** {checkpoint_type}
|
|
136
|
+
**Response:** {user_response}
|
|
137
|
+
</checkpoint_response>
|
|
138
|
+
|
|
139
|
+
<mode>
|
|
140
|
+
goal: find_and_fix
|
|
141
|
+
</mode>
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
7. **Submit Event**
|
|
145
|
+
- Event type: DEBUG_SESSION_CREATED or DEBUG_RESOLVED
|
|
146
|
+
- Include: issueSlug, status, rootCause (if found)
|
|
147
|
+
- Write to state/events/
|
|
148
|
+
|
|
149
|
+
8. **Update Debug File**
|
|
150
|
+
- Mark as resolved if root cause found
|
|
151
|
+
- Rename to `{slug}.resolved.md`
|
|
152
|
+
</process>
|
|
153
|
+
|
|
154
|
+
<deliverables>
|
|
155
|
+
- .planning/debug/{slug}.md (debug session file)
|
|
156
|
+
- Root cause identified (or investigation results)
|
|
157
|
+
- Event: DEBUG_SESSION_CREATED/RESOLVED in state/events/
|
|
158
|
+
- Optional: Fix applied with atomic commit
|
|
159
|
+
</deliverables>
|
|
160
|
+
|
|
161
|
+
<success_criteria>
|
|
162
|
+
- [ ] Active sessions checked
|
|
163
|
+
- [ ] Symptoms gathered (if new)
|
|
164
|
+
- [ ] Debugger spawned with context
|
|
165
|
+
- [ ] Checkpoints handled correctly
|
|
166
|
+
- [ ] Root cause confirmed before fixing
|
|
167
|
+
</success_criteria>
|
|
168
|
+
|
|
169
|
+
<next_steps>
|
|
170
|
+
- If root cause found: Fix now or plan fix
|
|
171
|
+
- If inconclusive: Continue investigating or manual investigation
|
|
172
|
+
- Check progress: `forge status`
|
|
173
|
+
</next_steps>
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: forge:discuss
|
|
3
|
+
description: Capture project context and identify gray areas for a specific phase. Use when user says "forge discuss <phase>" or wants to gather context before planning.
|
|
4
|
+
argument-hint: <phase-name>
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Write
|
|
8
|
+
- AskUserQuestion
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
<objective>
|
|
12
|
+
Gather project context through adaptive questioning for a specific phase, identifying gray areas and knowledge gaps before planning.
|
|
13
|
+
|
|
14
|
+
Purpose: Capture domain knowledge, requirements, constraints, and acceptance criteria.
|
|
15
|
+
Output: Context document (.planning/phases/<phase>/CONTEXT.md) with captured information.
|
|
16
|
+
</objective>
|
|
17
|
+
|
|
18
|
+
<execution_context>
|
|
19
|
+
**Load these files NOW:**
|
|
20
|
+
|
|
21
|
+
- @CLAUDE.md (FORGE patterns and conventions)
|
|
22
|
+
- @ROADMAP.md (Milestone and phase breakdown)
|
|
23
|
+
- @REQUIREMENTS.md (Project requirements)
|
|
24
|
+
- @state/STATE.json (Current project state)
|
|
25
|
+
</execution_context>
|
|
26
|
+
|
|
27
|
+
<context>
|
|
28
|
+
**Phase:** $ARGUMENTS (e.g., "M2-planning-engine", "api-integration", "frontend-auth")
|
|
29
|
+
**Target:** Context capture before planning
|
|
30
|
+
|
|
31
|
+
**Context Areas to Explore:**
|
|
32
|
+
- Domain knowledge and constraints
|
|
33
|
+
- Technical requirements and NFRs
|
|
34
|
+
- Dependencies and integrations
|
|
35
|
+
- Acceptance criteria and success metrics
|
|
36
|
+
- Risks and unknowns
|
|
37
|
+
- File ownership boundaries
|
|
38
|
+
</context>
|
|
39
|
+
|
|
40
|
+
<process>
|
|
41
|
+
**Execute context capture workflow:**
|
|
42
|
+
|
|
43
|
+
1. **Initialize Context Session**
|
|
44
|
+
```bash
|
|
45
|
+
mkdir -p .planning/phases/<phase-name>
|
|
46
|
+
touch .planning/phases/<phase-name>/CONTEXT.md
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
2. **Adaptive Questioning**
|
|
50
|
+
- Ask targeted questions based on phase type
|
|
51
|
+
- Explore dependencies and integration points
|
|
52
|
+
- Identify gray areas requiring research
|
|
53
|
+
- Capture constraints and preferences
|
|
54
|
+
|
|
55
|
+
3. **Question Categories:**
|
|
56
|
+
|
|
57
|
+
**For Backend/API Phases:**
|
|
58
|
+
- API contracts and endpoints
|
|
59
|
+
- Data models and schemas
|
|
60
|
+
- Authentication/authorization
|
|
61
|
+
- Performance requirements
|
|
62
|
+
- External dependencies
|
|
63
|
+
|
|
64
|
+
**For Frontend/UI Phases:**
|
|
65
|
+
- Component hierarchy
|
|
66
|
+
- State management approach
|
|
67
|
+
- Design system and patterns
|
|
68
|
+
- User interaction flows
|
|
69
|
+
- Accessibility requirements
|
|
70
|
+
|
|
71
|
+
**For Infrastructure Phases:**
|
|
72
|
+
- Deployment architecture
|
|
73
|
+
- CI/CD requirements
|
|
74
|
+
- Monitoring and observability
|
|
75
|
+
- Security and compliance
|
|
76
|
+
- Scalability constraints
|
|
77
|
+
|
|
78
|
+
4. **Document Context**
|
|
79
|
+
```markdown
|
|
80
|
+
# <Phase Name> Context
|
|
81
|
+
|
|
82
|
+
## Overview
|
|
83
|
+
[Purpose and goals]
|
|
84
|
+
|
|
85
|
+
## Requirements
|
|
86
|
+
- Functional requirements
|
|
87
|
+
- Non-functional requirements
|
|
88
|
+
|
|
89
|
+
## Constraints
|
|
90
|
+
- Technical constraints
|
|
91
|
+
- Time/resource constraints
|
|
92
|
+
|
|
93
|
+
## Dependencies
|
|
94
|
+
- Internal dependencies
|
|
95
|
+
- External services
|
|
96
|
+
|
|
97
|
+
## Gray Areas
|
|
98
|
+
- Items requiring research
|
|
99
|
+
- Unknowns to investigate
|
|
100
|
+
|
|
101
|
+
## Acceptance Criteria
|
|
102
|
+
- Success metrics
|
|
103
|
+
- Definition of done
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
5. **State Update**
|
|
107
|
+
- Submit PHASE_CONTEXT_CAPTURED event
|
|
108
|
+
- Update STATE.json with phase context
|
|
109
|
+
|
|
110
|
+
6. **Handoff to Planning**
|
|
111
|
+
- Offer `forge plan <phase>` to generate tasks
|
|
112
|
+
- Identify research needs (use research agents)
|
|
113
|
+
</process>
|
|
114
|
+
|
|
115
|
+
<deliverables>
|
|
116
|
+
- .planning/phases/<phase>/CONTEXT.md (captured context)
|
|
117
|
+
- Event: PHASE_CONTEXT_CAPTURED in state/events/
|
|
118
|
+
- STATE.json updated with phase status
|
|
119
|
+
</deliverables>
|
|
120
|
+
|
|
121
|
+
<next_steps>
|
|
122
|
+
- Run `forge plan <phase>` to generate atomic task breakdown
|
|
123
|
+
- Use research agents for gray areas
|
|
124
|
+
- Proceed to task execution with agent teams
|
|
125
|
+
</next_steps>
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: forge:execute
|
|
3
|
+
description: Execute all tasks in a phase with agent team coordination and parallel execution. Use when user says "forge execute <phase>" or wants to run a planned phase.
|
|
4
|
+
argument-hint: <phase-name>
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Write
|
|
8
|
+
- Bash
|
|
9
|
+
- Task
|
|
10
|
+
- SendMessage
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
<objective>
|
|
14
|
+
Execute all tasks in a phase using agent teams with wave-based parallelization, contract-first protocol, and atomic commits.
|
|
15
|
+
|
|
16
|
+
Purpose: Execute planned tasks with multi-agent coordination.
|
|
17
|
+
Output: All tasks complete, verified, integrated, and committed.
|
|
18
|
+
</objective>
|
|
19
|
+
|
|
20
|
+
<execution_context>
|
|
21
|
+
**Load these files NOW:**
|
|
22
|
+
|
|
23
|
+
- @CLAUDE.md (Wipe protocol, atomic commits, file ownership)
|
|
24
|
+
- @.planning/phases/<phase>/PLAN.md (Task list and dependencies)
|
|
25
|
+
- @.planning/phases/<phase>/CONTEXT.md (Phase context)
|
|
26
|
+
- @state/STATE.json (Current state)
|
|
27
|
+
- @contracts/ (API contracts)
|
|
28
|
+
</execution_context>
|
|
29
|
+
|
|
30
|
+
<context>
|
|
31
|
+
**Phase:** $ARGUMENTS
|
|
32
|
+
**Execution Mode:** Wave-based parallelization
|
|
33
|
+
**Protocol:** Wipe Protocol (fresh agent context per task)
|
|
34
|
+
|
|
35
|
+
**Execution Constraints:**
|
|
36
|
+
- One task = one git commit (atomic)
|
|
37
|
+
- Agents write only within owned paths
|
|
38
|
+
- Contracts required before cross-domain work
|
|
39
|
+
- Worktree isolation for parallel tasks
|
|
40
|
+
</context>
|
|
41
|
+
|
|
42
|
+
<process>
|
|
43
|
+
**Execute phase with agent teams:**
|
|
44
|
+
|
|
45
|
+
1. **Load Plan**
|
|
46
|
+
- Read PLAN.md for task list
|
|
47
|
+
- Build dependency graph
|
|
48
|
+
- Identify parallel execution waves
|
|
49
|
+
|
|
50
|
+
2. **Create Agent Team**
|
|
51
|
+
```bash
|
|
52
|
+
forge deploy <phase>
|
|
53
|
+
# Spawns team with specialists based on plan
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
3. **Wave-Based Execution**
|
|
57
|
+
|
|
58
|
+
**Wave 1:** Tasks with no dependencies (parallel)
|
|
59
|
+
```
|
|
60
|
+
Spawn agents for:
|
|
61
|
+
- api-001 → backend-agent
|
|
62
|
+
- core-001 → core-engine
|
|
63
|
+
- ui-001 → frontend-agent
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
**Wave 2:** Tasks after Wave 1 complete
|
|
67
|
+
```
|
|
68
|
+
- api-002 → backend-agent (depends on api-001)
|
|
69
|
+
- ui-002 → frontend-agent (depends on ui-001)
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
**Wave 3+:** Continue until all tasks complete
|
|
73
|
+
|
|
74
|
+
4. **Per-Task Execution** (Wipe Protocol)
|
|
75
|
+
```
|
|
76
|
+
For each task:
|
|
77
|
+
a. Hydrate: Agent reads CLAUDE.md + STATE.json + task + contracts
|
|
78
|
+
b. Execute: Agent writes code, runs tests
|
|
79
|
+
c. Commit: Atomic git commit (one task = one commit)
|
|
80
|
+
d. Verify: Run acceptance tests
|
|
81
|
+
e. Terminate: Agent context wiped
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
5. **Contract-First Coordination**
|
|
85
|
+
```
|
|
86
|
+
If agent needs interface from another domain:
|
|
87
|
+
- Write REQUEST_CONTRACT event
|
|
88
|
+
- Provider publishes contract to contracts/
|
|
89
|
+
- Both work against agreed contract
|
|
90
|
+
- Integration at merge time
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
6. **State Updates**
|
|
94
|
+
- Each agent submits events to state/events/
|
|
95
|
+
- State Steward merges events → STATE.json
|
|
96
|
+
- Progress tracked in real-time
|
|
97
|
+
|
|
98
|
+
7. **Integration & Verification**
|
|
99
|
+
- Run integration tests
|
|
100
|
+
- Verify end-to-end flows
|
|
101
|
+
- Check requirements coverage
|
|
102
|
+
- Create VERIFICATION.md
|
|
103
|
+
|
|
104
|
+
8. **Completion**
|
|
105
|
+
- All tasks marked complete in STATE.json
|
|
106
|
+
- Phase marked done
|
|
107
|
+
- Git tag created: forge/<phase>-complete
|
|
108
|
+
- Summary generated
|
|
109
|
+
</process>
|
|
110
|
+
|
|
111
|
+
<deliverables>
|
|
112
|
+
- All tasks complete and verified
|
|
113
|
+
- Git commits (one per task) with conventional format
|
|
114
|
+
- .planning/phases/<phase>/VERIFICATION.md
|
|
115
|
+
- Updated state/STATE.json
|
|
116
|
+
- state/events/ with all task events
|
|
117
|
+
- Integration tests passing
|
|
118
|
+
</deliverables>
|
|
119
|
+
|
|
120
|
+
<atomic_commit_format>
|
|
121
|
+
Each commit follows conventional format:
|
|
122
|
+
```
|
|
123
|
+
type(scope): description
|
|
124
|
+
|
|
125
|
+
Examples:
|
|
126
|
+
feat(api-003): implement session authentication
|
|
127
|
+
fix(ui-002): resolve login form validation bug
|
|
128
|
+
test(core-001): add database integration tests
|
|
129
|
+
```
|
|
130
|
+
</atomic_commit_format>
|
|
131
|
+
|
|
132
|
+
<wipe_protocol>
|
|
133
|
+
**Per-Task Context Lifecycle:**
|
|
134
|
+
1. Hydrate → Load CLAUDE.md + STATE.json + task + contracts
|
|
135
|
+
2. Execute → Write code, run tests
|
|
136
|
+
3. Commit → Atomic git commit
|
|
137
|
+
4. Terminate → Session ends, context wiped
|
|
138
|
+
5. Reincarnate → Next task starts fresh
|
|
139
|
+
|
|
140
|
+
This prevents hallucination carry-over and context rot.
|
|
141
|
+
</wipe_protocol>
|
|
142
|
+
|
|
143
|
+
<verification>
|
|
144
|
+
After execution completes:
|
|
145
|
+
- ✅ All tasks marked complete
|
|
146
|
+
- ✅ All tests passing
|
|
147
|
+
- ✅ Integration tests pass
|
|
148
|
+
- ✅ Requirements verified
|
|
149
|
+
- ✅ One commit per task
|
|
150
|
+
- ✅ Conventional commit format
|
|
151
|
+
- ✅ No merge conflicts
|
|
152
|
+
- ✅ Files within ownership boundaries
|
|
153
|
+
</verification>
|
|
154
|
+
|
|
155
|
+
<next_steps>
|
|
156
|
+
- Run `forge status` to confirm completion
|
|
157
|
+
- Review VERIFICATION.md for details
|
|
158
|
+
- Proceed to next phase or milestone
|
|
159
|
+
- Archive phase with `forge archive <phase>`
|
|
160
|
+
</next_steps>
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: forge:generate
|
|
3
|
+
description: Generate a specific FORGE artifact from templates. Use when user says "forge generate <artifact>" to create CLAUDE.md, REQUIREMENTS.md, etc.
|
|
4
|
+
argument-hint: <artifact-name> [-f]
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Write
|
|
8
|
+
- Bash
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
<objective>
|
|
12
|
+
Generate specific FORGE artifacts from templates, including CLAUDE.md, REQUIREMENTS.md, ROADMAP.md, PLAN.md, config files, and rule files.
|
|
13
|
+
|
|
14
|
+
Purpose: Create or update FORGE artifacts with project-specific content.
|
|
15
|
+
Output: Generated artifact file with validated content.
|
|
16
|
+
</objective>
|
|
17
|
+
|
|
18
|
+
<execution_context>
|
|
19
|
+
**Load these files NOW:**
|
|
20
|
+
|
|
21
|
+
- @src/commands/generate.ts (Generate command implementation)
|
|
22
|
+
- @src/generators/index.ts (Template engine)
|
|
23
|
+
- @src/templates/ (Template files)
|
|
24
|
+
- @state/STATE.json (Project context)
|
|
25
|
+
</execution_context>
|
|
26
|
+
|
|
27
|
+
<context>
|
|
28
|
+
**Artifact:** $ARGUMENTS (claude, project, requirements, roadmap, plan, config, rules)
|
|
29
|
+
**Force Mode:** -f flag overwrites without backup
|
|
30
|
+
**Context:** Loaded from STATE.json or user input
|
|
31
|
+
</context>
|
|
32
|
+
|
|
33
|
+
<process>
|
|
34
|
+
**Execute generate command:**
|
|
35
|
+
|
|
36
|
+
1. **Map Artifact to Template**
|
|
37
|
+
|
|
38
|
+
| Artifact | Template | Output | Required Fields |
|
|
39
|
+
|----------|----------|--------|-----------------|
|
|
40
|
+
| claude | CLAUDE.md.template | CLAUDE.md | projectName, vision, techStack |
|
|
41
|
+
| project | PROJECT.md.template | PROJECT.md | projectName, vision, techStack |
|
|
42
|
+
| requirements | REQUIREMENTS.md.template | REQUIREMENTS.md | projectName, vision, features, nfrs |
|
|
43
|
+
| roadmap | ROADMAP.md.template | ROADMAP.md | projectName, milestones, phases |
|
|
44
|
+
| plan | PLAN.md.template | PLAN.md | tasks, dependencyGraph |
|
|
45
|
+
| config | forge.config.json.template | .planning/forge.config.json | mode, depth, maxTeammates, taskLimit |
|
|
46
|
+
| rules | .claude/rules/*.md.template | .claude/rules/ | patterns, rules |
|
|
47
|
+
|
|
48
|
+
2. **Load Context**
|
|
49
|
+
- Read state/STATE.json for project data
|
|
50
|
+
- Extract: projectName, version, status, tasks, milestones
|
|
51
|
+
- If missing fields, prompt user or error
|
|
52
|
+
|
|
53
|
+
3. **Validate Required Fields**
|
|
54
|
+
- Check all required fields present
|
|
55
|
+
- Error if missing (suggest `forge init`)
|
|
56
|
+
- Show missing fields list
|
|
57
|
+
|
|
58
|
+
4. **Render Template**
|
|
59
|
+
```typescript
|
|
60
|
+
const result = await templateEngine.render(templateName, context);
|
|
61
|
+
// Returns: { content, tokenCount, withinLimit, warnings }
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
5. **Token Limit Check**
|
|
65
|
+
- CLAUDE.md: ~2000 tokens max
|
|
66
|
+
- REQUIREMENTS.md: ~4000 tokens max
|
|
67
|
+
- PLAN.md: ~6000 tokens max
|
|
68
|
+
- Rules: ~1000 tokens each
|
|
69
|
+
|
|
70
|
+
If over limit:
|
|
71
|
+
- Show warning with suggestions
|
|
72
|
+
- Offer to proceed or reduce
|
|
73
|
+
|
|
74
|
+
6. **Backup Existing** (unless -f flag)
|
|
75
|
+
- Copy existing file to .backup
|
|
76
|
+
- Inform user of backup location
|
|
77
|
+
|
|
78
|
+
7. **Write Artifact**
|
|
79
|
+
- Write rendered content to output path
|
|
80
|
+
- Log success with token count
|
|
81
|
+
- Show output location
|
|
82
|
+
|
|
83
|
+
8. **Verify**
|
|
84
|
+
- Check file exists
|
|
85
|
+
- Validate format (JSON for config, MD for others)
|
|
86
|
+
- Run `forge status` to confirm
|
|
87
|
+
</process>
|
|
88
|
+
|
|
89
|
+
<examples>
|
|
90
|
+
```bash
|
|
91
|
+
# Generate CLAUDE.md
|
|
92
|
+
forge generate claude
|
|
93
|
+
|
|
94
|
+
# Generate REQUIREMENTS.md
|
|
95
|
+
forge generate requirements
|
|
96
|
+
|
|
97
|
+
# Generate ROADMAP.md
|
|
98
|
+
forge generate roadmap
|
|
99
|
+
|
|
100
|
+
# Generate with force (no backup)
|
|
101
|
+
forge generate plan -f
|
|
102
|
+
|
|
103
|
+
# Generate config file
|
|
104
|
+
forge generate config
|
|
105
|
+
```
|
|
106
|
+
</examples>
|
|
107
|
+
|
|
108
|
+
<deliverables>
|
|
109
|
+
- Generated artifact file
|
|
110
|
+
- Backup of existing file (if not -f)
|
|
111
|
+
- Token count and limit status
|
|
112
|
+
</deliverables>
|
|
113
|
+
|
|
114
|
+
<validation>
|
|
115
|
+
- ✅ Required fields present
|
|
116
|
+
- ✅ Template exists
|
|
117
|
+
- ✅ Token limit within bounds
|
|
118
|
+
- ✅ Output path writable
|
|
119
|
+
- ✅ Format valid (JSON/MD)
|
|
120
|
+
</validation>
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: forge:help
|
|
3
|
+
description: Show comprehensive FORGE command reference and usage guide. Use when user asks "forge help" or wants to see available commands.
|
|
4
|
+
argument-hint: [command-name]
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Read
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
<objective>
|
|
10
|
+
Display comprehensive FORGE command reference with descriptions, usage examples, and links to detailed documentation.
|
|
11
|
+
|
|
12
|
+
Purpose: Help users discover and understand FORGE capabilities.
|
|
13
|
+
Output: Formatted command reference with examples.
|
|
14
|
+
</objective>
|
|
15
|
+
|
|
16
|
+
<execution_context>
|
|
17
|
+
**Load these files NOW:**
|
|
18
|
+
|
|
19
|
+
- @ROADMAP.md (Implementation status)
|
|
20
|
+
- @CLAUDE.md (Architecture overview)
|
|
21
|
+
</execution_context>
|
|
22
|
+
|
|
23
|
+
<context>
|
|
24
|
+
**Command Scope:** All FORGE commands (implemented and stubs)
|
|
25
|
+
**Detail Level:** Summary (all commands) or detailed (specific command)
|
|
26
|
+
</context>
|
|
27
|
+
|
|
28
|
+
<process>
|
|
29
|
+
**Display command reference:**
|
|
30
|
+
|
|
31
|
+
## FORGE Commands
|
|
32
|
+
|
|
33
|
+
### Core Commands (Implemented)
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
forge init [--quick] # Initialize FORGE project
|
|
37
|
+
forge status [-v] # Show project status
|
|
38
|
+
forge config [key] [value] # View/edit configuration
|
|
39
|
+
forge help [command] # Show this help
|
|
40
|
+
forge generate <artifact> # Generate specific artifact
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Planning Commands (Milestone 2 - In Progress)
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
forge discuss <phase> # Capture phase context
|
|
47
|
+
forge plan <phase> # Generate task breakdown
|
|
48
|
+
forge verify <phase> # Verify plan against requirements
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Execution Commands (Milestone 3 - Planned)
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
forge deploy <phase> # Deploy agent team for phase
|
|
55
|
+
forge assign <task-id> <agent> # Assign task to specialist
|
|
56
|
+
forge commit <task-id> # Create atomic commit for task
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Review Commands (Milestone 4 - Planned)
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
forge tribunal <phase> # Adversarial review
|
|
63
|
+
forge critique <file> # Security/quality review
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Utility Commands
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
forge generate <artifact> # Generate artifact
|
|
70
|
+
Artifacts: claude, project, requirements, roadmap, plan, config, rules
|
|
71
|
+
|
|
72
|
+
forge worktree <task-id> # Create git worktree for task
|
|
73
|
+
forge merge <task-id> # Merge worktree back to main
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Examples
|
|
77
|
+
|
|
78
|
+
### Start a New Project
|
|
79
|
+
```bash
|
|
80
|
+
forge new-project my-app
|
|
81
|
+
forge discuss M2-planning-engine
|
|
82
|
+
forge plan M2-planning-engine
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Check Progress
|
|
86
|
+
```bash
|
|
87
|
+
forge status
|
|
88
|
+
forge status -v # verbose with all tasks
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Generate Artifacts
|
|
92
|
+
```bash
|
|
93
|
+
forge generate requirements
|
|
94
|
+
forge generate roadmap
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Quick Reference
|
|
98
|
+
|
|
99
|
+
| Command | Purpose | Milestone |
|
|
100
|
+
|---------|---------|-----------|
|
|
101
|
+
| init | Initialize project | M1 ✅ |
|
|
102
|
+
| status | Show progress | M1 ✅ |
|
|
103
|
+
| config | Configure settings | M1 ✅ |
|
|
104
|
+
| discuss | Capture context | M2 🚧 |
|
|
105
|
+
| plan | Generate tasks | M2 🚧 |
|
|
106
|
+
| deploy | Execute phase | M3 📋 |
|
|
107
|
+
| tribunal | Review phase | M4 📋 |
|
|
108
|
+
|
|
109
|
+
Legend: ✅ Complete | 🚧 In Progress | 📋 Planned
|
|
110
|
+
|
|
111
|
+
## Documentation
|
|
112
|
+
|
|
113
|
+
- CLAUDE.md - Architecture and patterns
|
|
114
|
+
- REQUIREMENTS.md - Functional requirements
|
|
115
|
+
- ROADMAP.md - Implementation roadmap
|
|
116
|
+
- PLAN.md - Detailed task plans
|
|
117
|
+
</process>
|
|
118
|
+
|
|
119
|
+
<output_format>
|
|
120
|
+
**Summary:** All commands in table format
|
|
121
|
+
**Detailed:** Full documentation for specific command
|
|
122
|
+
**With Examples:** Usage examples for common workflows
|
|
123
|
+
</output_format>
|