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.
@@ -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
- You are the entry point. Detect the right tier, route to the right skills, manage state transitions. For new projects, run the interactive init before any work begins.
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 for state files in this order:
15
- 1. If `.forge/state/index.yml` exists → **new milestone-aware format**
16
- 2. If `.forge/state.yml` exists (legacy) → suggest migration: *"I found a legacy state.yml. Would you like me to migrate it to the new milestone-aware format?"* If yes, create `.forge/state/` directory, split into `index.yml` + `milestone-1.yml`, delete old file.
17
- 3. If neither exists → no state yet, proceed to init or tier detection.
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` to get the list of active milestones
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 the argument against milestone IDs (exact number match) or milestone names (case-insensitive substring match)
23
- - If a match is found → auto-select it immediately, skip the confirmation prompt: *"Resuming milestone {id}: [{name}] — status: {current.status}, tasks: {overall_percent}%"*
24
- - If no match → warn and fall through to the interactive prompt: *"No milestone matching '{arg}' found. Here are your active milestones:"*
25
- 3. **If multiple active milestones (and no argument provided):**
26
- - Present all milestones with their status and `last_updated` timestamp
27
- - Default to the most recently updated milestone
28
- - Ask user to confirm or switch: *"You have {N} active milestones. Most recent: [{name}] (status: {current.status}, last touched {date}). Work on this one, or switch?"*
29
- 4. **If one milestone:** Auto-select it. Inform user: *"Resuming milestone: [{name}] status: {current.status}, tasks: {overall_percent}%"*
30
- 5. **If no active milestones:** Proceed to init or ask user to create one.
31
- 6. Load the selected milestone's state file (`.forge/state/milestone-{id}.yml`)
32
- 7. **Route based on `current.status`, NOT on `overall_percent`.** The `current.status` field is the authoritative workflow position. A milestone is only complete when `current.status` equals `complete`. Even if `overall_percent` is 100%, the milestone still needs to go through remaining workflow steps (verifying, reviewing) before it is truly done.
33
- 8. Report position briefly, then **immediately route to the next skill** (see Step 3: Mandatory Auto-Routing):
34
- - **Workflow status** (`current.status`) this is the primary indicator of where you are
35
- - Phase progress using precise terminology: "Executed" (code done, not verified), "Verified", "Pending", "In progress" — **never say "Complete" for a phase that hasn't been verified**
36
- - Task progress percentage (`overall_percent`) this measures task completion, not workflow completion
37
- - **Do NOT present a menu of options.** State the position, state the next action, invoke the skill.
38
-
39
- If Beads is installed and enabled (`settings.json → forge.beads_integration: true`), also run `bd prime` for cross-session context. See `beads-integration` skill for details. This is optional — Forge works fully without it.
40
-
41
- Also read `.forge/context.md` if it exists. If the **Needs Resolution** section has unchecked items:
42
- - **Warn the user immediately**: *"There are {N} unresolved discrepancies from project init that need your input before planning can proceed: [list items briefly]."*
43
- - Quick tier tasks can proceed despite unresolved items (they don't go through planning)
44
- - Standard/Full tier tasks will be blocked at the planning gate until resolved
45
-
46
- Check `.forge/refactor-backlog.yml` for pending items. If found:
47
- - Count pending items by effort level
48
- - **Surface them early**: *"You have {N} pending refactoring items ({Q} quick, {S} standard). Want to tackle any before starting new work?"*
49
- - If the user picks one route to `quick-tasking` (for quick items) or Standard tier (for standard items). Update the item's `status` to `in_progress`.
50
- - If the user says not now proceed with normal workflow.
51
-
52
- Check `.forge/state/index.ymldesire_paths` for any patterns with 3+ occurrences that haven't been acted on:
53
- - **Surface them early**: *"I've noticed a recurring pattern: [{description}] ({N} times). Before we start, would you like to address this by [suggested framework change]?"*
54
- - If the user agreesapply the change (update skill, constitution, or template), reset the counter
55
- - If the user says not now note it and move on. Don't nag every session.
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.ymldesire_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
- If no `.forge/project.yml` exists, invoke the `initializing` skill via `Skill(initializing)`. It handles brownfield/greenfield detection, framework absorption, tech stack scanning, design system setup, and constitutional configuration. After init completes, return here for tier detection.
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` skill
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
- Route through: `researching` → `discussing` → `planning` → `executing` → `verifying` → `reviewing`
71
+ → `researching` → `discussing` → `planning` → `executing` → `verifying` → `reviewing`
89
72
 
90
73
  ### Full Tier
91
- Match ANY:
92
- - New project from scratch
93
- - Major architectural change
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
- Match ANY:
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
- If user explicitly says "Use Quick/Standard/Full tier" honor it. No arguments.
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 detected tier and current state, tell the user which skill comes next and **invoke it using the `Skill` tool**.
88
+ Based on tier and state, invoke the next skill via the `Skill` tool.
115
89
 
116
- **CRITICAL: NEVER use `EnterPlanMode` or Claude Code's native plan mode.** All Forge phases are handled by Forge skills invoked via the `Skill` tool. When the workflow says "planning", that means invoke `Skill(planning)` — not enter native plan mode. Native plan mode writes to a different file format and bypasses Forge's constitutional gates, state management, and structured plan output.
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
- **When resuming mid-workflow, DO NOT present a menu of options or ask "What would you like to do?".** Routing is deterministic. Give a brief status briefing, then route automatically. The only time to ask the user for a choice is when `current.status == complete` (milestone done) or when state is ambiguous/corrupted.
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 the selected milestone's state file (`.forge/state/milestone-{id}.yml`) for current position
124
- 2. **Check for status advancement** (see below)
125
- 3. **Use `current.status` to determine the next skill** — this is the authoritative workflow position
126
- 4. **Brief the user, then route.** Show a compact status summary so the user can orient, then immediately invoke the next skill. Format:
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 step: {next skill name}*
130
- *Phases: {compact phase list with statuses using correct wording — Executed/Verified/Pending/In progress}*
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 sees where they are and what's happening next. They can interrupt if they want to do something different, but the default is forward motion.
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` | Invoke `Skill(researching)`, then → `discussing` |
140
- | `discussing` | Invoke `Skill(discussing)`, then → `planning` (or `architecting` for Full) |
141
- | `planning` | Invoke `Skill(planning)`, then → `executing` |
142
- | `executing` | Invoke `Skill(executing)`, then → `verifying` |
143
- | `verifying` | Invoke `Skill(verifying)`, then → `reviewing` |
144
- | `reviewing` | Invoke `Skill(reviewing)`, then → `complete` |
145
- | `complete` | Milestone is done. Ask user what's next. |
146
-
147
- - **Never treat a milestone as complete just because `overall_percent` is 100%.** Task completion and workflow completion are different. All planned tasks being done (100%) means execution is finished — verification and reviewing still need to run.
148
- - Skip completed phases (phases before `current.status`)
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
- Sometimes a session ends before the executing skill advances `current.status`. On resume, detect and fix this:
127
+ Sessions can end before status advances. On resume, detect and fix:
154
128
 
155
- - **If `current.status == executing`**: Check if all phases in the roadmap have been executed (all plans completed, commits made). If YES → advance `current.status` to `verifying` in the state file, then route to verifying. If NO → route to executing for the next unexecuted phase.
156
- - **If `current.status == verifying`**: Check if verification report exists. If YES and it passed → advance to `reviewing`. If NO → route to verifying.
157
- - **General rule**: If the work for the current status is done but the status wasn't advanced (session ended mid-handoff), advance it now and route to the next skill.
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
- | All tasks executed, commits made | **"Executed"** | Code is written and committed, but NOT yet verified |
166
- | Verified by verifying skill | **"Verified"** | Passed goal-backward verification |
167
- | Not yet started | **"Pending"** | No work done yet |
168
- | Currently in progress | **"In progress"** | Partially executed |
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 a phase is "Complete" unless it has passed through the full workflow** (executed + verified + reviewed). Use "Executed" for phases where code is done but verification hasn't run. This prevents users from thinking a phase is fully done when it still needs verification.
142
+ **Never say "Complete" unless a phase passed the full workflow** (executed + verified + reviewed).
171
143
 
172
144
  ### On-Demand Discussion
173
145
 
174
- The `discussing` skill can be invoked at any time, regardless of current workflow position. If the user says "discuss Phase 2", "let's talk through the plan", "I want to rethink this", or similar — route to `discussing` immediately. After the discussion concludes, return to whatever skill was active (or re-plan if the discussion changed direction).
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
- When uncertain → Rule 4 (ask). Never silently make architectural decisions.
158
+ Uncertain → Rule 4 (ask). Never silently make architectural decisions.
189
159
 
190
160
  ## Context Handoff Protocol
191
161
 
192
- Phase transitions are natural context-clearing boundaries. After each phase completes and writes its state to disk, **recommend the user clear context** before the next phase begins. This prevents context rot — the #1 cause of quality degradation in long sessions.
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 (state files, plans, reports, backlogs) that the next phase reads from disk. The next phase does NOT need the previous phase's working memory — it needs the artifacts. Carrying forward stale context wastes tokens and degrades output quality.
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
- ### When to Recommend
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 the recommendation when:**
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
- *Ready to continue? Clear context and invoke `/forge` to resume."*
174
+ ### Handoff Pattern
222
175
 
223
- 4. **If user declines** — proceed normally. The recommendation is advisory, not blocking.
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
- ### What Each Phase Writes (Handoff Artifacts)
181
+ ### Handoff Artifacts
226
182
 
227
- | Phase | Writes to Disk | Next Phase Reads |
228
- |-------|---------------|------------------|
229
- | researching | Research summary (markdown in conversation or `.forge/` files) | discussing reads research findings |
230
- | discussing | Decision summary → carried into planning via context.md | planning reads context.md |
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 updated | verifying reads must_haves from plans |
234
- | verifying | Verification report, desire paths updated | reviewing reads project.yml + source files + git diff |
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
- When a skill starts after a context clear, it must load its required state from disk. Each skill's "Read Context" or "Pre-Execution Checklist" step handles this. The `forge` orchestrator reads `milestone-{id}.yml` to determine which skill to route to, then that skill loads its own dependencies.
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