forge-orkes 0.3.11 → 0.3.13

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.
@@ -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 to skills, manage state transitions. For new projects, run init before work begins.
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 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
-
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
- ## Step 2A: Project Init
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
- 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.
32
+ Beads enabled (`forge.beads_integration: true`)`bd prime`. Optional.
60
33
 
61
- ## Step 2B: Detect Tier
34
+ Read `.forge/context.md`. **Needs Resolution** unchecked → warn: *"{N} unresolved discrepancies."* Quick proceeds; Standard/Full blocked at planning.
62
35
 
63
- ### Quick Tier
64
- Match ANY: single file change, typo/grammar/formatting fix, config/env update, dependency bump, <50 lines estimated, user says "quick"/"small"/"minor"
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
- Route to `quick-tasking`
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
- ### Standard Tier
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
- `researching` `discussing` → `planning` → `executing` → `verifying` → `reviewing`
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
- ### Full Tier
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"
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
- Add `designing` if UI work involved
78
- → Add `securing` if auth/data/API touched
68
+ +`designing` if UI; +`securing` if auth/data/API
79
69
 
80
- ### Direct Utility Skills
81
- User says "upgrade"/"update forge"/"sync forge" → route to `upgrading` (bypasses tier detection)
70
+ ### Direct Utility
71
+ "upgrade"/"update forge"/"sync forge" → `upgrading` (bypasses tiers)
82
72
 
83
73
  ### User Override
84
- User says "Use Quick/Standard/Full tier" → honor it.
74
+ "Use Quick/Standard/Full tier" → honor.
85
75
 
86
76
  ## Step 3: Route to Next Skill
87
77
 
88
- Based on tier and state, invoke the next skill via the `Skill` tool.
78
+ Tier + state invoke via `Skill` tool.
89
79
 
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.
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
- **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.
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
- ### Status Advancement Check
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
- Sessions can end before status advances. On resume, detect and fix:
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
- - **`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.
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
- | Phase State | Display As | Meaning |
136
- |------------|-----------|---------|
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 |
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 say "Complete" unless a phase passed the full workflow** (executed + verified + reviewed).
143
+ **Never "Complete" unless passed full workflow** (executed + verified + reviewed).
143
144
 
144
145
  ### On-Demand Discussion
145
146
 
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.
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 current task | Auto-fix, document | Rule 1 |
153
- | Missing validation/error handling/null checks | Auto-add, document | Rule 2 |
154
- | Broken import/dep/config blocking progress | Auto-fix, document | Rule 3 |
155
- | Need new DB table, service layer, library swap | **STOP. Ask user.** | Rule 4 |
156
- | After verifying passes | Run health audit + refactoring review | `reviewing` |
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 → Rule 4 (ask). Never silently make architectural decisions.
160
+ Uncertain → 4. Never silently make arch decisions.
159
161
 
160
162
  ## Context Handoff Protocol
161
163
 
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.
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
- Recommend at every Standard/Full phase boundary:
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 when:** Quick tier, phase was very short and context under 40%, or user opted out of clearing prompts.
172
+ **Skip:** Quick, short phase + context <40%, user opted out.
173
173
 
174
174
  ### Handoff Pattern
175
175
 
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.
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 | Next Phase Reads |
184
- |-------|--------|------------------|
185
- | researching | Research summary | discussing reads findings |
186
- | discussing | Decision summary → context.md | planning reads context.md |
187
- | architecting | ADRs in `.forge/decisions/`, data models, API contracts | planning reads decisions |
188
- | planning | Plans in `.forge/phases/m{M}-{N}-{name}/`, requirements.yml, roadmap.yml, context.md | executing reads plans |
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 |
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 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.
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 `.forge/state/milestone-{id}.yml` at each transition. Update `.forge/state/index.yml` milestone `last_updated` timestamp.
205
+ Update `milestone-{id}.yml` + `index.yml` `last_updated` at each transition.