forge-orkes 0.3.9 → 0.3.11
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/bin/create-forge.js +16 -5
- package/package.json +1 -1
- package/template/.claude/agents/executor.md +37 -50
- package/template/.claude/agents/planner.md +33 -41
- package/template/.claude/agents/researcher.md +24 -26
- package/template/.claude/agents/reviewer.md +45 -53
- package/template/.claude/agents/verifier.md +30 -50
- package/template/.claude/skills/architecting/SKILL.md +32 -46
- package/template/.claude/skills/beads-integration/SKILL.md +27 -43
- package/template/.claude/skills/debugging/SKILL.md +34 -35
- package/template/.claude/skills/designing/SKILL.md +33 -52
- package/template/.claude/skills/discussing/SKILL.md +139 -180
- package/template/.claude/skills/executing/SKILL.md +85 -157
- package/template/.claude/skills/forge/SKILL.md +98 -142
- package/template/.claude/skills/initializing/SKILL.md +104 -144
- package/template/.claude/skills/planning/SKILL.md +65 -67
- package/template/.claude/skills/quick-tasking/SKILL.md +25 -31
- package/template/.claude/skills/researching/SKILL.md +22 -32
- package/template/.claude/skills/reviewing/SKILL.md +133 -164
- package/template/.claude/skills/securing/SKILL.md +19 -19
- package/template/.claude/skills/upgrading/SKILL.md +19 -27
- package/template/.claude/skills/verifying/SKILL.md +52 -80
|
@@ -5,178 +5,148 @@ description: "START HERE for any task. Forge orchestrates Quick fixes, Standard
|
|
|
5
5
|
|
|
6
6
|
# Forging: Workflow Orchestration
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Entry point. Detect tier, route to skills, manage state transitions. For new projects, run init before work begins.
|
|
9
9
|
|
|
10
10
|
## Step 1: Read State
|
|
11
11
|
|
|
12
12
|
### Milestone Selection
|
|
13
13
|
|
|
14
|
-
Check
|
|
15
|
-
1.
|
|
16
|
-
2.
|
|
17
|
-
3.
|
|
14
|
+
Check state files in order:
|
|
15
|
+
1. `.forge/state/index.yml` exists → milestone-aware format
|
|
16
|
+
2. `.forge/state.yml` exists (legacy) → suggest migration: *"I found a legacy state.yml. Migrate to milestone-aware format?"* If yes, create `.forge/state/`, split into `index.yml` + `milestone-1.yml`, delete old file.
|
|
17
|
+
3. Neither exists → no state yet, proceed to init or tier detection.
|
|
18
18
|
|
|
19
19
|
**When milestone-aware state exists (`state/index.yml`):**
|
|
20
|
-
1. Read `.forge/state/index.yml`
|
|
20
|
+
1. Read `.forge/state/index.yml` for active milestones
|
|
21
21
|
2. **Check for milestone argument first.** If the user invoked `/forge` with an argument (e.g., `/forge 2`, `/forge "Auth system"`):
|
|
22
|
-
- Match
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
3. **
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
- **
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
-
|
|
44
|
-
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
If no `.forge/project.yml` exists AND the task is Standard or Full tier → go to **Step 2A: Project Init** before anything else.
|
|
58
|
-
|
|
59
|
-
If state exists → go to **Step 2B: Detect Tier**.
|
|
22
|
+
- Match against milestone IDs (exact number) or names (case-insensitive substring)
|
|
23
|
+
- Match found → auto-select, skip prompt: *"Resuming milestone {id}: [{name}] — status: {current.status}, tasks: {overall_percent}%"*
|
|
24
|
+
- No match → warn and show interactive prompt: *"No milestone matching '{arg}'. Active milestones:"*
|
|
25
|
+
3. **Multiple active milestones (no argument):** Present all with status and `last_updated`. Default to most recent. *"You have {N} active milestones. Most recent: [{name}] (status: {current.status}, last touched {date}). Work on this one, or switch?"*
|
|
26
|
+
4. **One milestone:** Auto-select. *"Resuming milestone: [{name}] — status: {current.status}, tasks: {overall_percent}%"*
|
|
27
|
+
5. **No active milestones:** Proceed to init or ask user to create one.
|
|
28
|
+
6. Load `.forge/state/milestone-{id}.yml`
|
|
29
|
+
7. **Route on `current.status`, NOT `overall_percent`.** Status is the authoritative workflow position. A milestone is complete only when `current.status == complete`. Even at 100% `overall_percent`, remaining workflow steps (verifying, reviewing) must run.
|
|
30
|
+
8. Report position, then **immediately route** (see Step 3):
|
|
31
|
+
- Workflow status (`current.status`) — primary position indicator
|
|
32
|
+
- Phase progress: "Executed" (code done, not verified), "Verified", "Pending", "In progress" — **never say "Complete" for unverified phases**
|
|
33
|
+
- Task progress (`overall_percent`) — measures task completion, not workflow completion
|
|
34
|
+
- **No menus.** State position, state next action, invoke skill.
|
|
35
|
+
|
|
36
|
+
If Beads is installed and enabled (`settings.json → forge.beads_integration: true`), run `bd prime` for cross-session context. See `beads-integration` skill. Optional — Forge works without it.
|
|
37
|
+
|
|
38
|
+
Read `.forge/context.md` if it exists. If **Needs Resolution** has unchecked items:
|
|
39
|
+
- Warn immediately: *"There are {N} unresolved discrepancies from init: [list items]."*
|
|
40
|
+
- Quick tier proceeds despite unresolved items
|
|
41
|
+
- Standard/Full blocked at planning gate until resolved
|
|
42
|
+
|
|
43
|
+
Check `.forge/refactor-backlog.yml` for pending items:
|
|
44
|
+
- Count by effort level
|
|
45
|
+
- *"You have {N} pending refactoring items ({Q} quick, {S} standard). Tackle any before new work?"*
|
|
46
|
+
- User picks one → route to `quick-tasking` (quick) or Standard tier (standard). Set `status: in_progress`.
|
|
47
|
+
- User declines → proceed normally.
|
|
48
|
+
|
|
49
|
+
Check `.forge/state/index.yml → desire_paths` for patterns with 3+ occurrences not yet acted on:
|
|
50
|
+
- *"Recurring pattern: [{description}] ({N} times). Address this by [suggested change]?"*
|
|
51
|
+
- User agrees → apply change, reset counter
|
|
52
|
+
- User declines → note it, move on. Don't nag every session.
|
|
53
|
+
|
|
54
|
+
No `.forge/project.yml` AND Standard/Full tier → **Step 2A: Project Init**.
|
|
55
|
+
State exists → **Step 2B: Detect Tier**.
|
|
60
56
|
|
|
61
57
|
## Step 2A: Project Init
|
|
62
58
|
|
|
63
|
-
|
|
59
|
+
No `.forge/project.yml` → invoke `Skill(initializing)`. It handles brownfield/greenfield detection, framework absorption, tech stack scanning, design system setup, and constitution config. After init, return here for tier detection.
|
|
64
60
|
|
|
65
61
|
## Step 2B: Detect Tier
|
|
66
62
|
|
|
67
|
-
Analyze the user's request against these patterns:
|
|
68
|
-
|
|
69
63
|
### Quick Tier
|
|
70
|
-
Match ANY:
|
|
71
|
-
- Single file change
|
|
72
|
-
- Typo, grammar, formatting fix
|
|
73
|
-
- Config/environment update
|
|
74
|
-
- Dependency version bump
|
|
75
|
-
- Under 50 lines of changes estimated
|
|
76
|
-
- User says "quick", "small", "minor", "just"
|
|
64
|
+
Match ANY: single file change, typo/grammar/formatting fix, config/env update, dependency bump, <50 lines estimated, user says "quick"/"small"/"minor"
|
|
77
65
|
|
|
78
|
-
→ Route to `quick-tasking`
|
|
66
|
+
→ Route to `quick-tasking`
|
|
79
67
|
|
|
80
68
|
### Standard Tier
|
|
81
|
-
Match ANY:
|
|
82
|
-
- New feature or component
|
|
83
|
-
- Bug fix requiring investigation
|
|
84
|
-
- Refactor touching multiple files
|
|
85
|
-
- Integration with external service
|
|
86
|
-
- Estimated 1-8 hours of work
|
|
69
|
+
Match ANY: new feature/component, bug fix requiring investigation, multi-file refactor, external service integration, 1-8 hours estimated
|
|
87
70
|
|
|
88
|
-
→
|
|
71
|
+
→ `researching` → `discussing` → `planning` → `executing` → `verifying` → `reviewing`
|
|
89
72
|
|
|
90
73
|
### Full Tier
|
|
91
|
-
Match ANY:
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
- Multi-phase milestone
|
|
95
|
-
- Complex system with multiple subsystems
|
|
96
|
-
- Estimated days of work
|
|
97
|
-
- User says "full", "complex", "project", "milestone"
|
|
98
|
-
|
|
99
|
-
→ Route through: `researching` → `discussing` → `architecting` → `planning` → `executing` → `verifying` → `reviewing`
|
|
74
|
+
Match ANY: new project, major architectural change, multi-phase milestone, complex multi-subsystem work, days of work estimated, user says "full"/"complex"/"project"/"milestone"
|
|
75
|
+
|
|
76
|
+
→ `researching` → `discussing` → `architecting` → `planning` → `executing` → `verifying` → `reviewing`
|
|
100
77
|
→ Add `designing` if UI work involved
|
|
101
78
|
→ Add `securing` if auth/data/API touched
|
|
102
79
|
|
|
103
80
|
### Direct Utility Skills
|
|
104
|
-
|
|
105
|
-
- User says "upgrade", "update forge", "sync forge"
|
|
106
|
-
|
|
107
|
-
→ Route to `upgrading` skill (bypasses tier detection)
|
|
81
|
+
User says "upgrade"/"update forge"/"sync forge" → route to `upgrading` (bypasses tier detection)
|
|
108
82
|
|
|
109
83
|
### User Override
|
|
110
|
-
|
|
84
|
+
User says "Use Quick/Standard/Full tier" → honor it.
|
|
111
85
|
|
|
112
86
|
## Step 3: Route to Next Skill
|
|
113
87
|
|
|
114
|
-
Based on
|
|
88
|
+
Based on tier and state, invoke the next skill via the `Skill` tool.
|
|
115
89
|
|
|
116
|
-
**CRITICAL: NEVER use `EnterPlanMode` or
|
|
90
|
+
**CRITICAL: NEVER use `EnterPlanMode` or native plan mode.** All Forge phases use Forge skills via `Skill` tool. "Planning" means `Skill(planning)` — not native plan mode. Native plan mode writes a different format and bypasses Forge's constitutional gates and state management.
|
|
117
91
|
|
|
118
92
|
### Mandatory Auto-Routing on Resume
|
|
119
93
|
|
|
120
|
-
**
|
|
94
|
+
**Never present menus or ask "What would you like to do?" on resume.** Routing is deterministic. Brief status, then route. Ask for choices only when `current.status == complete` or state is ambiguous/corrupted.
|
|
121
95
|
|
|
122
96
|
Resume steps:
|
|
123
|
-
1. Read
|
|
124
|
-
2.
|
|
125
|
-
3.
|
|
126
|
-
4.
|
|
97
|
+
1. Read `.forge/state/milestone-{id}.yml` for current position
|
|
98
|
+
2. Check for status advancement (see below)
|
|
99
|
+
3. Use `current.status` to determine next skill
|
|
100
|
+
4. Brief the user, then route:
|
|
127
101
|
|
|
128
102
|
*"Resuming Milestone {id}: {name}*
|
|
129
|
-
*Workflow: {current.status} — next
|
|
130
|
-
*Phases: {compact
|
|
103
|
+
*Workflow: {current.status} — next: {next skill}*
|
|
104
|
+
*Phases: {compact list with Executed/Verified/Pending/In progress}*
|
|
131
105
|
*Progress: {overall_percent}% of tasks executed*
|
|
132
106
|
*Routing to {skill}..."*
|
|
133
107
|
|
|
134
|
-
This is a **briefing, not a prompt** — the user
|
|
108
|
+
This is a **briefing, not a prompt** — the user can interrupt, but the default is forward motion.
|
|
135
109
|
|
|
136
110
|
| `current.status` | Next Action (invoke via `Skill` tool) |
|
|
137
111
|
|-------------------|-------------|
|
|
138
112
|
| `not_started` | Detect tier, start workflow |
|
|
139
|
-
| `researching` |
|
|
140
|
-
| `discussing` |
|
|
141
|
-
| `planning` |
|
|
142
|
-
| `executing` |
|
|
143
|
-
| `verifying` |
|
|
144
|
-
| `reviewing` |
|
|
145
|
-
| `complete` |
|
|
146
|
-
|
|
147
|
-
- **Never treat a milestone as complete
|
|
148
|
-
- Skip completed phases (
|
|
113
|
+
| `researching` | `Skill(researching)` → `discussing` |
|
|
114
|
+
| `discussing` | `Skill(discussing)` → `planning` (or `architecting` for Full) |
|
|
115
|
+
| `planning` | `Skill(planning)` → `executing` |
|
|
116
|
+
| `executing` | `Skill(executing)` → `verifying` |
|
|
117
|
+
| `verifying` | `Skill(verifying)` → `reviewing` |
|
|
118
|
+
| `reviewing` | `Skill(reviewing)` → `complete` |
|
|
119
|
+
| `complete` | Done. Ask user what's next. |
|
|
120
|
+
|
|
121
|
+
- **Never treat a milestone as complete at 100% `overall_percent`.** Task completion != workflow completion. 100% means execution is done — verification and reviewing still must run.
|
|
122
|
+
- Skip completed phases (before `current.status`)
|
|
149
123
|
- Resume from current phase
|
|
150
124
|
|
|
151
125
|
### Status Advancement Check
|
|
152
126
|
|
|
153
|
-
|
|
127
|
+
Sessions can end before status advances. On resume, detect and fix:
|
|
154
128
|
|
|
155
|
-
-
|
|
156
|
-
-
|
|
157
|
-
- **General
|
|
129
|
+
- **`executing`**: All plans completed and committed? YES → advance to `verifying`, route there. NO → route to executing.
|
|
130
|
+
- **`verifying`**: Verification report exists and passed? YES → advance to `reviewing`. NO → route to verifying.
|
|
131
|
+
- **General**: If work for current status is done but status wasn't advanced (session ended mid-handoff), advance now and route forward.
|
|
158
132
|
|
|
159
133
|
### Phase Status Wording
|
|
160
134
|
|
|
161
|
-
When reporting phase progress on resume, use precise terminology to avoid confusion:
|
|
162
|
-
|
|
163
135
|
| Phase State | Display As | Meaning |
|
|
164
136
|
|------------|-----------|---------|
|
|
165
|
-
|
|
|
166
|
-
|
|
|
167
|
-
| Not
|
|
168
|
-
|
|
|
137
|
+
| Tasks executed, commits made | **"Executed"** | Code written and committed, NOT verified |
|
|
138
|
+
| Passed verifying skill | **"Verified"** | Passed goal-backward verification |
|
|
139
|
+
| Not started | **"Pending"** | No work done |
|
|
140
|
+
| Partially done | **"In progress"** | Partially executed |
|
|
169
141
|
|
|
170
|
-
**Never say
|
|
142
|
+
**Never say "Complete" unless a phase passed the full workflow** (executed + verified + reviewed).
|
|
171
143
|
|
|
172
144
|
### On-Demand Discussion
|
|
173
145
|
|
|
174
|
-
|
|
146
|
+
`discussing` can be invoked anytime. If the user says "discuss Phase 2", "let's talk through the plan", "I want to rethink this" — route to `discussing` immediately. After, return to the active skill or re-plan if direction changed.
|
|
175
147
|
|
|
176
148
|
## Deviation Rules (All Tiers)
|
|
177
149
|
|
|
178
|
-
While working at any tier, if you encounter:
|
|
179
|
-
|
|
180
150
|
| Situation | Action | Rule |
|
|
181
151
|
|-----------|--------|------|
|
|
182
152
|
| Bug blocking current task | Auto-fix, document | Rule 1 |
|
|
@@ -185,57 +155,43 @@ While working at any tier, if you encounter:
|
|
|
185
155
|
| Need new DB table, service layer, library swap | **STOP. Ask user.** | Rule 4 |
|
|
186
156
|
| After verifying passes | Run health audit + refactoring review | `reviewing` |
|
|
187
157
|
|
|
188
|
-
|
|
158
|
+
Uncertain → Rule 4 (ask). Never silently make architectural decisions.
|
|
189
159
|
|
|
190
160
|
## Context Handoff Protocol
|
|
191
161
|
|
|
192
|
-
Phase transitions are
|
|
193
|
-
|
|
194
|
-
### Why Clear Between Phases
|
|
162
|
+
Phase transitions are context-clearing boundaries. After each phase writes state to disk, **recommend clearing context** before the next phase. This prevents context rot in long sessions.
|
|
195
163
|
|
|
196
|
-
Each phase produces persistent artifacts
|
|
164
|
+
Each phase produces persistent artifacts the next phase reads from disk. The next phase needs the artifacts, not the working memory. Stale context wastes tokens and degrades quality.
|
|
197
165
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
Recommend clearing context at every phase boundary in Standard and Full tiers:
|
|
166
|
+
Recommend at every Standard/Full phase boundary:
|
|
201
167
|
|
|
202
168
|
```
|
|
203
169
|
researching → [clear] → discussing → [clear] → architecting → [clear] → planning → [clear] → executing → [clear] → verifying → [clear] → reviewing
|
|
204
170
|
```
|
|
205
171
|
|
|
206
|
-
**Skip
|
|
207
|
-
- Quick tier (single phase, no boundary to clear)
|
|
208
|
-
- The phase was very short (under 5 minutes of work) and context is well under 40%
|
|
209
|
-
- The user has explicitly said they don't want context-clearing prompts
|
|
210
|
-
|
|
211
|
-
### The Handoff Prompt
|
|
212
|
-
|
|
213
|
-
Each skill ends with a standard handoff message. The pattern is:
|
|
214
|
-
|
|
215
|
-
1. **Confirm state is written** — skill verifies its outputs are persisted to `.forge/`
|
|
216
|
-
2. **Summarize what was produced** — brief list of artifacts the next phase will need
|
|
217
|
-
3. **Recommend clearing context** — present the prompt to the user:
|
|
218
|
-
|
|
219
|
-
*"Phase complete. All state has been written to disk. I recommend clearing context (`/clear`) before starting {next phase} — this gives the next phase a fresh context window to work with. The {next phase} skill will load everything it needs from `.forge/` state files.*
|
|
172
|
+
**Skip when:** Quick tier, phase was very short and context under 40%, or user opted out of clearing prompts.
|
|
220
173
|
|
|
221
|
-
|
|
174
|
+
### Handoff Pattern
|
|
222
175
|
|
|
223
|
-
|
|
176
|
+
1. Confirm state is written to `.forge/`
|
|
177
|
+
2. Summarize artifacts the next phase needs
|
|
178
|
+
3. *"State written. `/clear` then `/forge` to continue with {next phase}."*
|
|
179
|
+
4. User declines → proceed. Advisory, not blocking.
|
|
224
180
|
|
|
225
|
-
###
|
|
181
|
+
### Handoff Artifacts
|
|
226
182
|
|
|
227
|
-
| Phase | Writes
|
|
228
|
-
|
|
229
|
-
| researching | Research summary
|
|
230
|
-
| discussing | Decision summary →
|
|
183
|
+
| Phase | Writes | Next Phase Reads |
|
|
184
|
+
|-------|--------|------------------|
|
|
185
|
+
| researching | Research summary | discussing reads findings |
|
|
186
|
+
| discussing | Decision summary → context.md | planning reads context.md |
|
|
231
187
|
| architecting | ADRs in `.forge/decisions/`, data models, API contracts | planning reads decisions |
|
|
232
188
|
| planning | Plans in `.forge/phases/m{M}-{N}-{name}/`, requirements.yml, roadmap.yml, context.md | executing reads plans |
|
|
233
|
-
| executing | Committed code, execution summary, milestone state
|
|
234
|
-
| verifying | Verification report, desire paths
|
|
189
|
+
| executing | Committed code, execution summary, milestone state | verifying reads must_haves from plans |
|
|
190
|
+
| verifying | Verification report, desire paths | reviewing reads project.yml + source + git diff |
|
|
235
191
|
|
|
236
192
|
### Context Loading on Resume
|
|
237
193
|
|
|
238
|
-
|
|
194
|
+
After a context clear, each skill loads required state from disk via its "Read Context" or "Pre-Execution Checklist" step. The `forge` orchestrator reads `milestone-{id}.yml` for routing; the target skill loads its own dependencies.
|
|
239
195
|
|
|
240
196
|
## State Transitions
|
|
241
197
|
|