forge-dev-framework 1.1.0 → 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.
Files changed (107) hide show
  1. package/.claude/commands/forge/README.md +156 -189
  2. package/.claude/commands/forge/add-phase.md +4 -3
  3. package/.claude/commands/forge/complete-milestone.md +1 -1
  4. package/.claude/commands/forge/convert.md +31 -0
  5. package/.claude/commands/forge/debug.md +12 -154
  6. package/.claude/commands/forge/discuss.md +60 -107
  7. package/.claude/commands/forge/execute.md +67 -142
  8. package/.claude/commands/forge/generate.md +8 -107
  9. package/.claude/commands/forge/help.md +9 -114
  10. package/.claude/commands/forge/init.md +10 -74
  11. package/.claude/commands/forge/insert-phase.md +4 -3
  12. package/.claude/commands/forge/new-milestone.md +1 -1
  13. package/.claude/commands/forge/new-project.md +12 -91
  14. package/.claude/commands/forge/pause-work.md +2 -2
  15. package/.claude/commands/forge/plan.md +114 -129
  16. package/.claude/commands/forge/quick.md +17 -106
  17. package/.claude/commands/forge/remove-phase.md +3 -2
  18. package/.claude/commands/forge/resume.md +22 -0
  19. package/.claude/commands/forge/team-add.md +24 -0
  20. package/.claude/commands/forge/team-create.md +22 -0
  21. package/.claude/commands/forge/team-remove.md +24 -0
  22. package/.claude/commands/forge/team-start.md +22 -0
  23. package/.claude/commands/forge/team-view.md +18 -0
  24. package/.claude/commands/forge/verify.md +68 -147
  25. package/.claude/hooks/forge-context-cleanup.cjs +79 -0
  26. package/.claude/hooks/forge-event-guard.cjs +36 -0
  27. package/.claude/hooks/forge-size-guard.cjs +55 -0
  28. package/.claude/rules/api-patterns.md +13 -98
  29. package/.claude/rules/context-efficiency.md +10 -0
  30. package/.claude/rules/security-baseline.md +18 -204
  31. package/.claude/rules/testing-standards.md +16 -177
  32. package/.claude/rules/ui-conventions.md +17 -142
  33. package/bin/forge.js +5 -3
  34. package/dist/bin/forge.js +5 -3
  35. package/dist/cli/index.d.ts.map +1 -1
  36. package/dist/cli/index.js +15 -1
  37. package/dist/cli/index.js.map +1 -1
  38. package/dist/commands/convert.d.ts +6 -0
  39. package/dist/commands/convert.d.ts.map +1 -0
  40. package/dist/commands/convert.js +132 -0
  41. package/dist/commands/convert.js.map +1 -0
  42. package/dist/commands/generate.d.ts.map +1 -1
  43. package/dist/commands/generate.js +3 -2
  44. package/dist/commands/generate.js.map +1 -1
  45. package/dist/commands/index.d.ts +4 -4
  46. package/dist/commands/index.d.ts.map +1 -1
  47. package/dist/commands/index.js +4 -4
  48. package/dist/commands/index.js.map +1 -1
  49. package/dist/generators/gsd-converter.d.ts +100 -0
  50. package/dist/generators/gsd-converter.d.ts.map +1 -0
  51. package/dist/generators/gsd-converter.js +335 -0
  52. package/dist/generators/gsd-converter.js.map +1 -0
  53. package/dist/templates/.claude/rules/api-patterns.md.template +212 -0
  54. package/dist/templates/.claude/rules/security-baseline.md.template +322 -0
  55. package/dist/templates/.claude/rules/testing-standards.md.template +280 -0
  56. package/dist/templates/.claude/rules/ui-conventions.md.template +264 -0
  57. package/dist/templates/.planning/forge.config.json.template +75 -0
  58. package/dist/templates/CLAUDE.md.template +161 -0
  59. package/dist/templates/PLAN.md.template +177 -0
  60. package/dist/templates/PROJECT.md.template +156 -0
  61. package/dist/templates/REQUIREMENTS.md.template +221 -0
  62. package/dist/templates/ROADMAP.md.template +130 -0
  63. package/dist/types/index.d.ts +2 -2
  64. package/dist/types/index.d.ts.map +1 -1
  65. package/dist/types/index.js +2 -2
  66. package/dist/types/index.js.map +1 -1
  67. package/dist/utils/index.d.ts +5 -5
  68. package/dist/utils/index.d.ts.map +1 -1
  69. package/dist/utils/index.js +5 -5
  70. package/dist/utils/index.js.map +1 -1
  71. package/dist/utils/template-client.d.ts.map +1 -1
  72. package/dist/utils/template-client.js +3 -2
  73. package/dist/utils/template-client.js.map +1 -1
  74. package/package.json +6 -4
  75. package/.claude/commands/forge/resume-work.md +0 -122
  76. package/dist/git/__tests__/worktree.test.d.ts +0 -5
  77. package/dist/git/__tests__/worktree.test.d.ts.map +0 -1
  78. package/dist/git/__tests__/worktree.test.js +0 -121
  79. package/dist/git/__tests__/worktree.test.js.map +0 -1
  80. package/dist/git/codeowners.d.ts +0 -101
  81. package/dist/git/codeowners.d.ts.map +0 -1
  82. package/dist/git/codeowners.js +0 -216
  83. package/dist/git/codeowners.js.map +0 -1
  84. package/dist/git/commit.d.ts +0 -135
  85. package/dist/git/commit.d.ts.map +0 -1
  86. package/dist/git/commit.js +0 -223
  87. package/dist/git/commit.js.map +0 -1
  88. package/dist/git/hooks/commit-msg.d.ts +0 -8
  89. package/dist/git/hooks/commit-msg.d.ts.map +0 -1
  90. package/dist/git/hooks/commit-msg.js +0 -34
  91. package/dist/git/hooks/commit-msg.js.map +0 -1
  92. package/dist/git/hooks/pre-commit.d.ts +0 -8
  93. package/dist/git/hooks/pre-commit.d.ts.map +0 -1
  94. package/dist/git/hooks/pre-commit.js +0 -34
  95. package/dist/git/hooks/pre-commit.js.map +0 -1
  96. package/dist/git/pre-commit-hooks.d.ts +0 -117
  97. package/dist/git/pre-commit-hooks.d.ts.map +0 -1
  98. package/dist/git/pre-commit-hooks.js +0 -270
  99. package/dist/git/pre-commit-hooks.js.map +0 -1
  100. package/dist/git/wipe-protocol.d.ts +0 -281
  101. package/dist/git/wipe-protocol.d.ts.map +0 -1
  102. package/dist/git/wipe-protocol.js +0 -237
  103. package/dist/git/wipe-protocol.js.map +0 -1
  104. package/dist/git/worktree.d.ts +0 -69
  105. package/dist/git/worktree.d.ts.map +0 -1
  106. package/dist/git/worktree.js +0 -202
  107. package/dist/git/worktree.js.map +0 -1
@@ -1,125 +1,78 @@
1
1
  ---
2
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.
3
+ description: Capture project context and identify gray areas for a phase.
4
4
  argument-hint: <phase-name>
5
5
  allowed-tools:
6
6
  - Read
7
7
  - Write
8
+ - Glob
9
+ - Grep
10
+ - Bash
8
11
  - AskUserQuestion
9
12
  ---
10
13
 
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
- ```
14
+ Extract implementation decisions for phase $ARGUMENTS that downstream agents (researcher, planner) need. The user is the visionary — you are the builder asking clarifying questions.
48
15
 
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
16
+ **Read first:** ROADMAP.md, REQUIREMENTS.md, state/STATE.json
17
+
18
+ **Steps:**
81
19
 
82
- ## Overview
83
- [Purpose and goals]
20
+ 1. **Initialize** — Read ROADMAP.md, REQUIREMENTS.md, STATE.json. Validate the phase exists in the roadmap. Extract the phase goal and scope statement.
84
21
 
85
- ## Requirements
86
- - Functional requirements
87
- - Non-functional requirements
22
+ 2. **Check existing** — If `.planning/phases/{phase}/CONTEXT.md` exists, use AskUserQuestion:
23
+ - "Update existing context" — re-run discussion, merge new answers
24
+ - "View current context" — display CONTEXT.md and stop
25
+ - "Skip (use existing)" — proceed to offering next command
88
26
 
89
- ## Constraints
90
- - Technical constraints
91
- - Time/resource constraints
27
+ 3. **Analyze phase for gray areas** — Based on the phase goal from ROADMAP.md, identify 3-4 **concrete** gray areas specific to THIS phase. Do NOT use generic categories (UI, UX, Behavior). Instead, identify real decisions:
28
+ - For a visual feature → presentation choices, interaction patterns, layout decisions
29
+ - For a CLI tool → flag design, output format, error messaging style
30
+ - For an API → contract shape, auth strategy, error handling patterns
31
+ - For infrastructure → deployment strategy, monitoring approach, scaling model
32
+ - Each gray area should be a specific decision point, e.g. "Layout style", "Loading behavior", "Error recovery strategy"
92
33
 
93
- ## Dependencies
94
- - Internal dependencies
95
- - External services
34
+ 4. **Present gray areas** — Use AskUserQuestion (multiSelect: true) with the 3-4 phase-specific gray areas. User picks which ones to discuss.
96
35
 
97
- ## Gray Areas
98
- - Items requiring research
99
- - Unknowns to investigate
36
+ 5. **Discuss selected areas** — For each selected area:
37
+ - Ask up to 4 questions via AskUserQuestion with concrete options (not abstract)
38
+ - Always include a "You decide (Claude's discretion)" option where reasonable — this captures areas where the planner has flexibility
39
+ - After 4 questions, ask: "More questions about [area], or move to next?"
40
+ - If user introduces scope creep (new capability beyond this phase), redirect: "That sounds like a new capability — I'll note it under Deferred Ideas for a future phase."
100
41
 
101
- ## Acceptance Criteria
102
- - Success metrics
103
- - Definition of done
42
+ 6. **Write CONTEXT.md** — Create `.planning/phases/{phase}/CONTEXT.md` with this structure:
43
+
44
+ ```markdown
45
+ # Phase [X]: [Name] - Context
46
+ **Gathered:** [date]
47
+ **Status:** Ready for planning
48
+
49
+ ## Phase Boundary
50
+ [Clear scope statement from ROADMAP.md — fixed, not negotiable]
51
+
52
+ ## Implementation Decisions
53
+ ### [Area 1 discussed]
54
+ - [Specific decision made]
55
+ - [Another decision]
56
+ ### [Area 2 discussed]
57
+ - [Specific decision made]
58
+
59
+ ## Claude's Discretion
60
+ [Areas where user said "you decide" — flexibility for planner/researcher]
61
+ - [Area]: [What Claude can choose freely]
62
+
63
+ ## Specific Ideas
64
+ [Any references, inspirations, or "I want it like X" moments from discussion]
65
+
66
+ ## Deferred Ideas
67
+ [Scope creep captured here — explicitly out of scope for this phase]
68
+ - [Idea]: [Why it was deferred]
104
69
  ```
105
70
 
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>
71
+ 7. **Commit and offer next step** — Offer `/forge:plan {phase}` to proceed.
72
+
73
+ **Downstream contract — who reads CONTEXT.md and how:**
74
+ - **Researcher** reads CONTEXT.md to know WHAT to research:
75
+ - Locked decisions → research deeply, don't explore alternatives
76
+ - Claude's discretion research options and recommend best approach
77
+ - Deferred ideas ignore completely
78
+ - **Planner** reads CONTEXT.md to know WHAT choices are locked (implement exactly), flexible (can choose), and out of scope (must not include)
@@ -1,160 +1,85 @@
1
1
  ---
2
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>
3
+ description: Execute all plans in a phase with wave-based parallelization.
4
+ argument-hint: <phase-name> [--gaps]
5
5
  allowed-tools:
6
6
  - Read
7
7
  - Write
8
8
  - Bash
9
- - Task
9
+ - TaskList
10
+ - TaskCreate
11
+ - TaskUpdate
12
+ - TaskGet
10
13
  - SendMessage
14
+ - Task
11
15
  ---
12
16
 
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:**
17
+ Execute phase $ARGUMENTS by discovering all plan files, grouping by wave, and executing waves sequentially with plans within each wave in parallel.
22
18
 
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>
19
+ **Flag support:** If `$ARGUMENTS` contains `--gaps`, only execute plans with `gap_closure: true` in their frontmatter. Parse the phase name by stripping `--gaps` from arguments.
29
20
 
30
- <context>
31
- **Phase:** $ARGUMENTS
32
- **Execution Mode:** Wave-based parallelization
33
- **Protocol:** Wipe Protocol (fresh agent context per task)
21
+ **Read first:** All `.planning/phases/{phase}/*-PLAN.md` files, `.planning/phases/{phase}/CONTEXT.md`, state/STATE.json
34
22
 
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>
23
+ **Steps:**
41
24
 
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
- ```
25
+ 1. **Parse arguments and discover plans:**
26
+ - Extract phase name, check for `--gaps` flag
27
+ - Glob `.planning/phases/{phase}/*-PLAN.md` → parse YAML frontmatter of each
28
+ - Extract from each: plan number, wave, depends_on, autonomous, files_modified, gap_closure
29
+ - Skip plans that have a matching `*-SUMMARY.md` (already executed)
30
+ - If `--gaps`: only include plans where `gap_closure: true`
31
+ - If no plans found, error: suggest running `/forge:plan {phase}` first
32
+ - Report: "Found {N} plans in {M} waves ({K} incomplete)"
71
33
 
72
- **Wave 3+:** Continue until all tasks complete
34
+ 2. **Ensure FORGE team AND teammates are running:**
35
+ - Check `~/.claude/teams/forge/config.json` exists. If not, create team with TeamCreate.
36
+ - Read `.planning/AgentTeam.md` to get the list of teammates that should be active.
37
+ - Read `~/.claude/teams/forge/config.json` members list to see who is registered.
38
+ - 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.
39
+ - This ensures teammates are always running when any FORGE command executes, even after session restarts.
73
40
 
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
- ```
41
+ 3. **Create EXECUTION.md** `.planning/phases/{phase}/EXECUTION.md` with wave/plan status table:
42
+ ```markdown
43
+ # {Phase} Execution Log
44
+ **Started:** [timestamp]
83
45
 
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
46
+ | Wave | Plan | Objective | Status | Commit |
47
+ |------|------|-----------|--------|--------|
48
+ | 1 | 01 | [from plan] | pending | — |
49
+ | 1 | 02 | [from plan] | pending | — |
50
+ | 2 | 03 | [from plan] | pending | — |
91
51
  ```
92
52
 
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>
53
+ 4. **Wave execution loop** (sequential between waves, parallel within):
54
+ For each wave in order:
55
+ - Describe what this wave builds (from plan objectives — substantive, not just plan numbers)
56
+ - Spawn one executor agent per plan via Task tool (subagent_type: "general-purpose"). Each executor:
57
+ - Reads their specific `{phase}-{NN}-PLAN.md`
58
+ - Reads CONTEXT.md for locked decisions and RESEARCH.md for technical guidance
59
+ - Executes tasks following the plan exactly
60
+ - Atomic commit per task: `type(phase-plan): description`
61
+ - Creates `{phase}-{NN}-SUMMARY.md` on completion with:
62
+ ```markdown
63
+ # Plan {NN} Summary
64
+ **Completed:** [timestamp]
65
+ ## What was built
66
+ ## Files changed
67
+ ## Commits
68
+ ## Issues encountered (if any)
69
+ ```
70
+ - Wait for all wave agents to complete
71
+ - Spot-check: verify SUMMARY.md exists for each plan, git commits present
72
+ - Update EXECUTION.md after each plan completes
73
+ - Report wave completion with what was built
74
+ - Proceed to next wave automatically (do NOT ask user between waves)
75
+
76
+ 5. **Cross-domain work:** If a plan touches another teammate's files, use REQUEST_CONTRACT event → provider publishes to contracts/ both work against contract
77
+
78
+ 6. **State:** Agents write events to state/events/, State Steward merges → STATE.json
79
+
80
+ 7. **On completion:**
81
+ - Aggregate all SUMMARY.md files into final EXECUTION.md status
82
+ - Submit phase completion events
83
+ - Offer `/forge:verify {phase}` to validate results
84
+
85
+ **Prefer existing teammates** over spawning new ones. Only spawn if the task domain is truly uncovered by current team members.
@@ -1,6 +1,6 @@
1
1
  ---
2
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.
3
+ description: Generate a FORGE artifact from templates.
4
4
  argument-hint: <artifact-name> [-f]
5
5
  allowed-tools:
6
6
  - Read
@@ -8,113 +8,14 @@ allowed-tools:
8
8
  - Bash
9
9
  ---
10
10
 
11
- <objective>
12
- Generate specific FORGE artifacts from templates, including CLAUDE.md, REQUIREMENTS.md, ROADMAP.md, PLAN.md, config files, and rule files.
11
+ Generate artifact $ARGUMENTS (claude, project, requirements, roadmap, plan, config, rules).
13
12
 
14
- Purpose: Create or update FORGE artifacts with project-specific content.
15
- Output: Generated artifact file with validated content.
16
- </objective>
13
+ **Read:** state/STATE.json, src/templates/
17
14
 
18
- <execution_context>
19
- **Load these files NOW:**
15
+ **Artifact mapping:** claude→CLAUDE.md | requirements→REQUIREMENTS.md | roadmap→ROADMAP.md | plan→PLAN.md | config→.planning/forge.config.json | rules→.claude/rules/*.md
20
16
 
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>
17
+ **Steps:**
26
18
 
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>
19
+ 1. Load context from STATE.json (projectName, version, tasks, milestones). Error if required fields missing.
20
+ 2. Render template. Check token limits: CLAUDE.md ~2000, REQUIREMENTS.md ~4000, PLAN.md ~6000, rules ~1000 each.
21
+ 3. Backup existing file (unless `-f` flag), write artifact, verify format.
@@ -1,123 +1,18 @@
1
1
  ---
2
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.
3
+ description: Show FORGE command reference.
4
4
  argument-hint: [command-name]
5
5
  allowed-tools:
6
6
  - Read
7
7
  ---
8
8
 
9
- <objective>
10
- Display comprehensive FORGE command reference with descriptions, usage examples, and links to detailed documentation.
9
+ Show FORGE command reference. Read `.claude/commands/forge/README.md` for full details.
11
10
 
12
- Purpose: Help users discover and understand FORGE capabilities.
13
- Output: Formatted command reference with examples.
14
- </objective>
11
+ **Core:** `init`, `status`, `config`, `help`, `generate`
12
+ **Planning:** `discuss`, `plan`, `verify`
13
+ **Execution:** `execute`, `quick`, `debug`, `resume`, `pause-work`
14
+ **Team:** `team-create`, `team-start`, `team-view`, `team-add`, `team-remove`
15
+ **Roadmap:** `new-milestone`, `complete-milestone`, `add-phase`, `remove-phase`, `insert-phase`
16
+ **Migration:** `convert`, `new-project`
15
17
 
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>
18
+ For specific command help, read the command's md file in `.claude/commands/forge/`.