forge-orkes 0.3.11 → 0.3.14
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/package.json +1 -1
- package/template/.claude/agents/executor.md +44 -95
- package/template/.claude/agents/planner.md +46 -75
- package/template/.claude/agents/researcher.md +34 -70
- package/template/.claude/agents/reviewer.md +54 -117
- package/template/.claude/agents/verifier.md +51 -102
- package/template/.claude/skills/discussing/SKILL.md +69 -121
- package/template/.claude/skills/executing/SKILL.md +20 -3
- package/template/.claude/skills/forge/SKILL.md +129 -129
- package/template/.claude/skills/initializing/SKILL.md +72 -174
- package/template/.claude/skills/planning/SKILL.md +92 -118
- package/template/.claude/skills/reviewing/SKILL.md +88 -175
- package/template/.forge/templates/constitution.md +10 -0
- package/template/.forge/templates/project.yml +17 -0
- package/template/CLAUDE.md +105 -115
|
@@ -5,193 +5,193 @@ description: "START HERE for any task. Forge orchestrates Quick fixes, Standard
|
|
|
5
5
|
|
|
6
6
|
# Forging: Workflow Orchestration
|
|
7
7
|
|
|
8
|
-
Entry point. Detect tier, route
|
|
8
|
+
Entry point. Detect tier, route skills, manage transitions. New projects → init first.
|
|
9
9
|
|
|
10
10
|
## Step 1: Read State
|
|
11
11
|
|
|
12
12
|
### Milestone Selection
|
|
13
13
|
|
|
14
|
-
Check state files
|
|
15
|
-
1. `.forge/state/index.yml`
|
|
16
|
-
2. `.forge/state.yml`
|
|
17
|
-
3. Neither
|
|
18
|
-
|
|
19
|
-
**When milestone-aware state exists (`state/index.yml`):**
|
|
20
|
-
1. Read `.forge/state/index.yml` for active milestones
|
|
21
|
-
2. **Check for milestone argument first.** If the user invoked `/forge` with an argument (e.g., `/forge 2`, `/forge "Auth system"`):
|
|
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**.
|
|
14
|
+
Check state files:
|
|
15
|
+
1. `.forge/state/index.yml` → milestone-aware
|
|
16
|
+
2. `.forge/state.yml` (legacy) → *"Migrate?"* Yes → split into `state/index.yml` + `milestone-1.yml`, delete old.
|
|
17
|
+
3. Neither → init/tier detection.
|
|
56
18
|
|
|
57
|
-
|
|
19
|
+
**With `state/index.yml`:**
|
|
20
|
+
1. Read for active milestones
|
|
21
|
+
2. **Check arg first.** `/forge 2` or `/forge "Auth system"`:
|
|
22
|
+
- Match IDs (exact) or names (case-insensitive substring)
|
|
23
|
+
- Found → auto-select: *"Resuming {id}: [{name}] -- {current.status}, {overall_percent}%"*
|
|
24
|
+
- No match → *"No match for '{arg}'. Active:"*
|
|
25
|
+
3. **Multiple (no arg):** Show all + status + `last_updated`. Default recent. *"{N} active. Most recent: [{name}] ({current.status}, {date}). This one, or switch?"*
|
|
26
|
+
4. **One:** Auto-select. *"Resuming: [{name}] -- {current.status}, {overall_percent}%"*
|
|
27
|
+
5. **None:** Init or create.
|
|
28
|
+
6. Load `milestone-{id}.yml`
|
|
29
|
+
7. **Route on `current.status`, NOT `overall_percent`.** Complete only at `complete`. 100% tasks ≠ done -- verifying + reviewing must run.
|
|
30
|
+
8. Report + **immediately route** (Step 3). Show: `current.status`, phase labels (Executed/Verified/Pending/In progress -- **never "Complete" for unverified**), `overall_percent`. **No menus.** Position → action → invoke.
|
|
58
31
|
|
|
59
|
-
|
|
32
|
+
Beads enabled (`forge.beads_integration: true`) → `bd prime`. Optional.
|
|
60
33
|
|
|
61
|
-
|
|
34
|
+
Read `.forge/context.md`. **Needs Resolution** unchecked → warn: *"{N} unresolved discrepancies."* Quick proceeds; Standard/Full blocked at planning.
|
|
62
35
|
|
|
63
|
-
|
|
64
|
-
|
|
36
|
+
Check `.forge/refactor-backlog.yml`:
|
|
37
|
+
- *"{N} refactors ({Q} quick, {S} standard). Tackle first?"*
|
|
38
|
+
- Pick → `quick-tasking`/Standard, set `in_progress`. Decline → proceed.
|
|
65
39
|
|
|
66
|
-
|
|
40
|
+
Check `desire_paths` 3+ occurrences:
|
|
41
|
+
- *"Recurring: [{description}] ({N}x). Fix via [suggestion]?"*
|
|
42
|
+
- Agree → apply, reset. Decline → note, don't nag.
|
|
67
43
|
|
|
68
|
-
|
|
69
|
-
Match ANY: new feature/component, bug fix requiring investigation, multi-file refactor, external service integration, 1-8 hours estimated
|
|
44
|
+
No `project.yml` + Standard/Full → **Step 2A**. State exists → **Step 2B**.
|
|
70
45
|
|
|
71
|
-
|
|
46
|
+
### Parent Session Model Advisory
|
|
47
|
+
|
|
48
|
+
Check `models.parent_session` from `project.yml`. Mismatch → *"Recommends {parent_session}, running {current}. `/model` to switch."*
|
|
49
|
+
- Advisory only -- no block. Reviewer enforces at review gate.
|
|
50
|
+
|
|
51
|
+
## Step 2A: Project Init
|
|
72
52
|
|
|
73
|
-
|
|
74
|
-
|
|
53
|
+
No `project.yml` → `Skill(initializing)`. Brownfield/greenfield, absorption, stack scan, design system, constitution. Return after.
|
|
54
|
+
|
|
55
|
+
## Step 2B: Detect Tier
|
|
56
|
+
|
|
57
|
+
### Quick
|
|
58
|
+
ANY: single file, typo/formatting, config/env, dep bump, <50 lines, "quick"/"small"/"minor"
|
|
59
|
+
→ `quick-tasking`
|
|
60
|
+
|
|
61
|
+
### Standard
|
|
62
|
+
ANY: new feature/component, bug needing investigation, multi-file refactor, service integration, 1-8h
|
|
63
|
+
→ `researching` → `discussing` → `planning` → `executing` → `verifying` → `reviewing`
|
|
75
64
|
|
|
65
|
+
### Full
|
|
66
|
+
ANY: new project, major arch change, multi-phase, multi-subsystem, days of work, "full"/"complex"/"project"/"milestone"
|
|
76
67
|
→ `researching` → `discussing` → `architecting` → `planning` → `executing` → `verifying` → `reviewing`
|
|
77
|
-
→
|
|
78
|
-
→ Add `securing` if auth/data/API touched
|
|
68
|
+
→ +`designing` if UI; +`securing` if auth/data/API
|
|
79
69
|
|
|
80
|
-
### Direct Utility
|
|
81
|
-
|
|
70
|
+
### Direct Utility
|
|
71
|
+
"upgrade"/"update forge"/"sync forge" → `upgrading` (bypasses tiers)
|
|
82
72
|
|
|
83
73
|
### User Override
|
|
84
|
-
|
|
74
|
+
"Use Quick/Standard/Full tier" → honor.
|
|
85
75
|
|
|
86
76
|
## Step 3: Route to Next Skill
|
|
87
77
|
|
|
88
|
-
|
|
78
|
+
Tier + state → invoke via `Skill` tool.
|
|
89
79
|
|
|
90
|
-
**CRITICAL: NEVER
|
|
80
|
+
**CRITICAL: NEVER `EnterPlanMode`.** "Planning" = `Skill(planning)`. Native plan mode writes wrong format, bypasses gates + state.
|
|
91
81
|
|
|
92
82
|
### Mandatory Auto-Routing on Resume
|
|
93
83
|
|
|
94
|
-
**
|
|
95
|
-
|
|
96
|
-
Resume steps:
|
|
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:
|
|
101
|
-
|
|
102
|
-
*"Resuming Milestone {id}: {name}*
|
|
103
|
-
*Workflow: {current.status} — next: {next skill}*
|
|
104
|
-
*Phases: {compact list with Executed/Verified/Pending/In progress}*
|
|
105
|
-
*Progress: {overall_percent}% of tasks executed*
|
|
106
|
-
*Routing to {skill}..."*
|
|
107
|
-
|
|
108
|
-
This is a **briefing, not a prompt** — the user can interrupt, but the default is forward motion.
|
|
109
|
-
|
|
110
|
-
| `current.status` | Next Action (invoke via `Skill` tool) |
|
|
111
|
-
|-------------------|-------------|
|
|
112
|
-
| `not_started` | Detect tier, start workflow |
|
|
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`)
|
|
123
|
-
- Resume from current phase
|
|
84
|
+
**No menus.** Deterministic. Brief → route. Choices only at `complete` or corrupted.
|
|
124
85
|
|
|
125
|
-
|
|
86
|
+
1. Read `milestone-{id}.yml` → 2. Check advancement → 3. `current.status` → skill → 4. Brief + route:
|
|
87
|
+
|
|
88
|
+
*"Milestone {id}: {name} | {current.status} → {next} | {overall_percent}% | Routing..."*
|
|
89
|
+
|
|
90
|
+
Briefing, not prompt -- default = forward.
|
|
91
|
+
|
|
92
|
+
### Model Routing
|
|
93
|
+
|
|
94
|
+
Read `models` from `project.yml`:
|
|
95
|
+
1. `models.skills.{skill_name}` → use if set
|
|
96
|
+
2. `models.default` → fallback
|
|
97
|
+
3. Inherit parent session
|
|
98
|
+
|
|
99
|
+
Subagents via `Task` → same precedence.
|
|
126
100
|
|
|
127
|
-
|
|
101
|
+
| Skill | Model | Why |
|
|
102
|
+
|-------|-------|-----|
|
|
103
|
+
| architecting | opus | Structural reasoning |
|
|
104
|
+
| planning | opus | Task decomposition |
|
|
105
|
+
| researching | sonnet | Analysis |
|
|
106
|
+
| executing | sonnet | Code gen |
|
|
107
|
+
| verifying | haiku | Mechanical checks |
|
|
108
|
+
| reviewing | sonnet | Audit judgment |
|
|
109
|
+
| quick-tasking | haiku | Speed |
|
|
110
|
+
| discussing | sonnet | Conversation |
|
|
128
111
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
112
|
+
| `current.status` | Route To |
|
|
113
|
+
|-------------------|----------|
|
|
114
|
+
| `not_started` | Detect tier, start |
|
|
115
|
+
| `researching` | `Skill(researching)` → discussing |
|
|
116
|
+
| `discussing` | `Skill(discussing)` → planning (or architecting if Full) |
|
|
117
|
+
| `architecting` | `Skill(architecting)` → planning |
|
|
118
|
+
| `planning` | `Skill(planning)` → executing |
|
|
119
|
+
| `executing` | `Skill(executing)` → verifying |
|
|
120
|
+
| `verifying` | `Skill(verifying)` → reviewing |
|
|
121
|
+
| `reviewing` | `Skill(reviewing)` → complete |
|
|
122
|
+
| `complete` | Done. Ask what's next. |
|
|
123
|
+
|
|
124
|
+
- 100% tasks != complete -- verification + reviewing must run.
|
|
125
|
+
- Skip before `current.status`; resume current.
|
|
126
|
+
|
|
127
|
+
### Status Advancement Check
|
|
128
|
+
|
|
129
|
+
Sessions end before advancement. On resume detect + fix:
|
|
130
|
+
- `executing`: all committed? → `verifying`. Else → executing.
|
|
131
|
+
- `verifying`: report passed? → `reviewing`. Else → verifying.
|
|
132
|
+
- General: work done, status stale → advance + route.
|
|
132
133
|
|
|
133
134
|
### Phase Status Wording
|
|
134
135
|
|
|
135
|
-
|
|
|
136
|
-
|
|
137
|
-
|
|
|
138
|
-
| Passed verifying
|
|
139
|
-
| Not started | **"Pending"** | No work
|
|
140
|
-
|
|
|
136
|
+
| State | Display | Meaning |
|
|
137
|
+
|-------|---------|---------|
|
|
138
|
+
| Committed, not verified | **"Executed"** | Code done, NOT verified |
|
|
139
|
+
| Passed verifying | **"Verified"** | Goal-backward verified |
|
|
140
|
+
| Not started | **"Pending"** | No work |
|
|
141
|
+
| Partial | **"In progress"** | Partial execution |
|
|
141
142
|
|
|
142
|
-
**Never
|
|
143
|
+
**Never "Complete" unless passed full workflow** (executed + verified + reviewed).
|
|
143
144
|
|
|
144
145
|
### On-Demand Discussion
|
|
145
146
|
|
|
146
|
-
`discussing`
|
|
147
|
+
`discussing` anytime. "discuss Phase 2"/"talk through plan"/"rethink this" → route immediately. After, return or re-plan if direction changed.
|
|
147
148
|
|
|
148
149
|
## Deviation Rules (All Tiers)
|
|
149
150
|
|
|
150
151
|
| Situation | Action | Rule |
|
|
151
152
|
|-----------|--------|------|
|
|
152
|
-
| Bug blocking
|
|
153
|
-
| Missing validation/error handling/null checks | Auto-add, document |
|
|
154
|
-
| Broken import/dep/config
|
|
155
|
-
|
|
|
156
|
-
| After verifying passes |
|
|
153
|
+
| Bug blocking task | Auto-fix, document | 1 |
|
|
154
|
+
| Missing validation/error handling/null checks | Auto-add, document | 2 |
|
|
155
|
+
| Broken import/dep/config | Auto-fix, document | 3 |
|
|
156
|
+
| New DB table, service layer, library swap | **STOP. Ask user.** | 4 |
|
|
157
|
+
| After verifying passes | Health + refactoring audit | `reviewing` |
|
|
158
|
+
| Model routing mismatch | Flag expensive models for mechanical tasks | `reviewing` |
|
|
157
159
|
|
|
158
|
-
Uncertain →
|
|
160
|
+
Uncertain → 4. Never silently make arch decisions.
|
|
159
161
|
|
|
160
162
|
## Context Handoff Protocol
|
|
161
163
|
|
|
162
|
-
Phase transitions
|
|
163
|
-
|
|
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.
|
|
164
|
+
Phase transitions = clear boundaries. **Recommend `/clear`** after writing state. Next phase reads disk artifacts, not working memory.
|
|
165
165
|
|
|
166
|
-
|
|
166
|
+
Standard/Full:
|
|
167
167
|
|
|
168
168
|
```
|
|
169
169
|
researching → [clear] → discussing → [clear] → architecting → [clear] → planning → [clear] → executing → [clear] → verifying → [clear] → reviewing
|
|
170
170
|
```
|
|
171
171
|
|
|
172
|
-
**Skip
|
|
172
|
+
**Skip:** Quick, short phase + context <40%, user opted out.
|
|
173
173
|
|
|
174
174
|
### Handoff Pattern
|
|
175
175
|
|
|
176
|
-
1. Confirm state
|
|
177
|
-
2.
|
|
178
|
-
3. *"State written. `/clear` then `/forge`
|
|
179
|
-
4.
|
|
176
|
+
1. Confirm state written
|
|
177
|
+
2. List artifacts for next phase
|
|
178
|
+
3. *"State written. `/clear` then `/forge` for {next phase}."*
|
|
179
|
+
4. Decline → proceed. Advisory.
|
|
180
180
|
|
|
181
181
|
### Handoff Artifacts
|
|
182
182
|
|
|
183
|
-
| Phase | Writes |
|
|
184
|
-
|
|
185
|
-
| researching | Research summary | discussing
|
|
186
|
-
| discussing |
|
|
187
|
-
| architecting | ADRs
|
|
188
|
-
| planning |
|
|
189
|
-
| executing | Committed code, execution summary,
|
|
190
|
-
| verifying | Verification report, desire paths | reviewing
|
|
183
|
+
| Phase | Writes | Read By |
|
|
184
|
+
|-------|--------|---------|
|
|
185
|
+
| researching | Research summary | discussing |
|
|
186
|
+
| discussing | Decisions → context.md | planning |
|
|
187
|
+
| architecting | ADRs, data models, API contracts | planning |
|
|
188
|
+
| planning | `.forge/phases/m{M}-{N}-{name}/`, requirements.yml, roadmap.yml | executing |
|
|
189
|
+
| executing | Committed code, execution summary, state | verifying |
|
|
190
|
+
| verifying | Verification report, desire paths | reviewing |
|
|
191
191
|
|
|
192
192
|
### Context Loading on Resume
|
|
193
193
|
|
|
194
|
-
After
|
|
194
|
+
After clear, skills load from disk via "Read Context"/"Pre-Execution Checklist". Orchestrator reads `milestone-{id}.yml`; skills load own deps.
|
|
195
195
|
|
|
196
196
|
## State Transitions
|
|
197
197
|
|
|
@@ -202,4 +202,4 @@ not_started → [init if new] → researching → [clear] → discussing → [cl
|
|
|
202
202
|
↗ securing (if auth/data)
|
|
203
203
|
```
|
|
204
204
|
|
|
205
|
-
Update
|
|
205
|
+
Update `milestone-{id}.yml` + `index.yml` `last_updated` at each transition.
|