forge-orkes 0.4.1 → 0.5.1

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "forge-orkes",
3
- "version": "0.4.1",
3
+ "version": "0.5.1",
4
4
  "description": "Set up the Forge meta-prompting framework for Claude Code in your project",
5
5
  "bin": {
6
6
  "create-forge": "./bin/create-forge.js"
@@ -18,9 +18,28 @@ Structured conversation: approach, trade-offs, decisions. Clarity, not artifacts
18
18
  ## Boundaries
19
19
 
20
20
  - No plans or code
21
- - Writes only `context.md` (at convergence, before handoff)
21
+ - Writes `context.md` progressively (after each confirmed decision, not just at handoff)
22
22
  - No phase/plan required
23
23
 
24
+ ## Progressive Persistence
25
+
26
+ **Decisions persist immediately.** After each user response that confirms a decision, write it to `.forge/context.md` right away. Don't accumulate in working memory.
27
+
28
+ ### Rules
29
+
30
+ 1. **Create `context.md` on first decision** if it doesn't exist (from template `.forge/templates/context.md`)
31
+ 2. **Scope by milestone.** Add decisions under `### M{id} — {name} (drafting)` inside `## Locked Decisions`
32
+ 3. **Append, don't rewrite.** Each confirmed decision → append one `- **[Topic]**: [Decision]. Reason: [Why]` line
33
+ 4. **Deferred ideas too.** User says "not now" / "later" / "skip" → append to `## Deferred Ideas` immediately
34
+ 5. **Discretion areas too.** Left to agent judgment → append to `## Discretion Areas` immediately
35
+ 6. **Phase Handoff promotes.** Rename `(drafting)` → `(locked {date})` at convergence. No content change needed — decisions are already written
36
+
37
+ ### Why
38
+
39
+ Sessions `/clear` or die mid-discussion. Previous behavior: decisions lived only in conversation memory until Step 5 convergence. If session ended before convergence, all Q&A answers vanished. Planning would start from scratch.
40
+
41
+ Now: any `/clear` preserves everything decided so far. Worst case on interruption = last answer lost, not all answers.
42
+
24
43
  ## Pre-Planning Discussion
25
44
 
26
45
  ### Step 0: Load Context
@@ -60,6 +79,8 @@ Brief context paragraph from research.
60
79
 
61
80
  Surface 3-5 decisions that matter.
62
81
 
82
+ **After each user response:** write confirmed decisions to `context.md` immediately (see Progressive Persistence).
83
+
63
84
  ### Step 2: Facilitate, Don't Dictate
64
85
 
65
86
  Help user think deeper, don't push preference. `AskUserQuestion` for decisions; prose for open-ended.
@@ -89,6 +110,8 @@ AskUserQuestion:
89
110
 
90
111
  Open-ended via prose: *"Tried before?" / "Must-haves or must-nots?"* 1-2 at a time.
91
112
 
113
+ **After each user response:** write confirmed decisions/constraints to `context.md` immediately.
114
+
92
115
  ### Step 4: Functionality Distillation
93
116
 
94
117
  Per feature, force behavioral clarity. Surface assumptions + edge cases.
@@ -103,6 +126,8 @@ Per feature, force behavioral clarity. Surface assumptions + edge cases.
103
126
 
104
127
  Not all 5 mechanically. 2-3 questions, deeper on uncertainty. `AskUserQuestion` for discrete; prose to explain.
105
128
 
129
+ **After each user response:** write confirmed behavioral decisions to `context.md` immediately.
130
+
106
131
  Example -- L3:
107
132
  ```
108
133
  question: "When the enrichment API is down, what should the system do?"
@@ -223,11 +248,11 @@ Re-plan? Route to `planning` with summary.
223
248
 
224
249
  After convergence:
225
250
 
226
- 1. **Write `context.md`** -- Create/update `.forge/context.md` from template (`.forge/templates/context.md`). Populate:
227
- - **Locked Decisions**: all confirmed decisions from Steps 1-5
228
- - **Deferred Ideas**: anything explicitly deferred
229
- - **Discretion Areas**: topics left to agent judgment
230
- - **Needs Resolution**: unresolved items (if any)
251
+ 1. **Promote decisions in `context.md`** -- Rename milestone heading from `(drafting)` → `(locked {date})`. Decisions already written progressively — just finalize:
252
+ - Verify all confirmed decisions present under `## Locked Decisions`
253
+ - Verify deferred items under `## Deferred Ideas`
254
+ - Verify discretion areas under `## Discretion Areas`
255
+ - Add any unresolved items to `## Needs Resolution`
231
256
  - If `context.md` already exists (post-planning discussion), update relevant sections + log amendments
232
257
  2. **Update state** -- `current.status` = `planning` (`architecting` for Full) in milestone yml
233
258
  3. **Recommend clear:**
@@ -168,7 +168,7 @@ Run all non-advisory verification commands once after commit. 1 retry max.
168
168
  | Context under 40% | Continue normally |
169
169
  | Switching unrelated subsystems | Spawn fresh agent |
170
170
 
171
- **Spawn via Task tool** with: relevant plan details, specific files, locked decisions from context.md, clear success criteria.
171
+ **Spawn via Agent tool** with: relevant plan details, specific files, locked decisions from context.md, clear success criteria. **Pass `model` param** from `project.yml` model routing (`models.skills.executing` → `models.default` → parent). Display: *"Spawning executor with model: {model} (from {source})"*
172
172
 
173
173
  ## Execution Summary
174
174
 
@@ -45,7 +45,8 @@ No `project.yml` + Standard/Full → **Step 2A**. State exists → **Step 2B**.
45
45
 
46
46
  ### Parent Session Model Advisory
47
47
 
48
- Check `models.parent_session` from `project.yml`. Mismatch *"Recommends {parent_session}, running {current}. `/model` to switch."*
48
+ Check `models.parent_session` from `project.yml`. **Always display:** *"Session model: {current}. Project recommends: {parent_session}."*
49
+ Mismatch → append: *"Use `/model` to switch."*
49
50
  - Advisory only -- no block. Reviewer enforces at review gate.
50
51
 
51
52
  ## Step 2A: Project Init
@@ -75,7 +76,7 @@ ANY: new project, major arch change, multi-phase, multi-subsystem, days of work,
75
76
 
76
77
  ## Step 3: Route to Next Skill
77
78
 
78
- Tier + state → invoke via `Skill` tool.
79
+ Tier + state → invoke via `Skill` tool or `Agent` tool (agent-dispatched phases).
79
80
 
80
81
  **CRITICAL: NEVER `EnterPlanMode`.** "Planning" = `Skill(planning)`. Native plan mode writes wrong format, bypasses gates + state.
81
82
 
@@ -85,7 +86,7 @@ Tier + state → invoke via `Skill` tool.
85
86
 
86
87
  1. Read `milestone-{id}.yml` → 2. Check advancement → 3. `current.status` → skill → 4. Brief + route:
87
88
 
88
- *"Milestone {id}: {name} | {current.status} → {next} | {overall_percent}% | Routing..."*
89
+ *"Milestone {id}: {name} | {current.status} → {next} ({model}) | {overall_percent}% | Routing..."*
89
90
 
90
91
  Briefing, not prompt -- default = forward.
91
92
 
@@ -96,7 +97,15 @@ Read `models` from `project.yml`:
96
97
  2. `models.default` → fallback
97
98
  3. Inherit parent session
98
99
 
99
- Subagents via `Task` same precedence.
100
+ Resolve `{model}` for `{next}` skill using precedence above. **Always display** the resolved model in the routing briefing and its source:
101
+
102
+ *"Skill {next} expects {model} (from {source}). Running {current_model}."*
103
+
104
+ Where `{source}` = `skills.{name}` | `models.default` | `parent session`. Show on every transition, not just mismatch. If mismatch, append: *"Use `/model` to switch."*
105
+
106
+ **Agent spawns MUST include `model` param.** Resolve model for the skill context, pass to `Agent(model: "{model}")`. This is the only enforcement point — `Skill` tool has no model param.
107
+
108
+ Subagents via `Agent` tool → same precedence, enforced via `model` param.
100
109
 
101
110
  | Skill | Model | Why |
102
111
  |-------|-------|-----|
@@ -110,17 +119,60 @@ Subagents via `Task` → same precedence.
110
119
  | discussing | sonnet | Conversation |
111
120
  | testing | sonnet | Code gen (author) + audit judgment (analyst) — matches executing/reviewing |
112
121
 
113
- | `current.status` | Route To |
114
- |-------------------|----------|
115
- | `not_started` | Detect tier, start |
116
- | `researching` | `Skill(researching)` → discussing |
117
- | `discussing` | `Skill(discussing)` → planning (or architecting if Full) |
118
- | `architecting` | `Skill(architecting)` → planning |
119
- | `planning` | `Skill(planning)` → executing |
120
- | `executing` | `Skill(executing)` → verifying |
121
- | `verifying` | `Skill(verifying)` → reviewing |
122
- | `reviewing` | `Skill(reviewing)` → complete |
123
- | `complete` | Done. Ask what's next. |
122
+ | `current.status` | Route To | Method |
123
+ |-------------------|----------|--------|
124
+ | `not_started` | Detect tier, start | — |
125
+ | `researching` | `Skill(researching)` → discussing | Skill |
126
+ | `discussing` | `Skill(discussing)` → planning (or architecting if Full) | Skill |
127
+ | `architecting` | `Skill(architecting)` → planning | Skill |
128
+ | `planning` | `Skill(planning)` → executing | Skill |
129
+ | `executing` | `Skill(executing)` → verifying | Skill |
130
+ | `verifying` | Agent-dispatched → reviewing | **Agent** |
131
+ | `reviewing` | `Skill(reviewing)` → complete | Skill |
132
+ | `complete` | Done. Ask what's next. | — |
133
+
134
+ ### Agent-Dispatched Phases
135
+
136
+ Some phases run as spawned agents instead of in-session skills. This **enforces model routing** — the `Agent` tool's `model` param guarantees the correct model runs.
137
+
138
+ #### Verifying (Agent-Dispatched)
139
+
140
+ When `current.status == verifying`, do NOT call `Skill(verifying)`. Instead:
141
+
142
+ 1. Read milestone state: `.forge/state/milestone-{id}.yml`
143
+ 2. Identify the plan path from state: `.forge/phases/m{M}-{N}-{name}/plan-{NN}.md`
144
+ 3. Resolve model: `models.skills.verifying` → `models.default` → parent
145
+ 4. Spawn agent:
146
+
147
+ ```
148
+ Agent(
149
+ model: "{resolved_model}",
150
+ description: "Verify milestone {id}: {name}",
151
+ prompt: "You are a verifier agent. Your job: prove completed work delivers what was promised.
152
+
153
+ FIRST: Run `touch .forge/.active-skill` to satisfy the pre-commit hook guard. Without this, all Write/Edit operations will be blocked.
154
+
155
+ Read these files for context:
156
+ - .claude/skills/verifying/SKILL.md — your full process instructions
157
+ - .claude/agents/verifier.md — your role, tools, output format
158
+ - .forge/state/milestone-{id}.yml — current state
159
+ - .forge/phases/{phase_path}/plan-{NN}.md — must_haves to verify
160
+ - .forge/project.yml — tech stack, verification commands
161
+ - .forge/context.md — locked decisions
162
+ - .forge/requirements.yml — requirement IDs for coverage
163
+
164
+ Follow the 3-level verification process in verifying/SKILL.md exactly.
165
+ Write verification results to the plan directory.
166
+ Update milestone state: set current.status to 'reviewing' if PASSED, keep 'verifying' if GAPS FOUND.
167
+ End with a verification summary for the parent session."
168
+ )
169
+ ```
170
+
171
+ 5. On agent return:
172
+ - Read updated `milestone-{id}.yml`
173
+ - Display result: *"Verification {PASSED|GAPS FOUND}. Model: {model} (enforced)."*
174
+ - PASSED → route to reviewing
175
+ - GAPS FOUND → route back to planning (gap-closure mode)
124
176
 
125
177
  - Skip before `current.status`; resume current.
126
178
 
@@ -54,7 +54,7 @@ File lists per subagent (paths, not globs).
54
54
 
55
55
  ## Step 3: Parallel Scans
56
56
 
57
- Fresh-context subagents with file list + tech stack.
57
+ Fresh-context subagents with file list + tech stack. **Pass `model` param** from `project.yml` model routing (`models.skills.reviewing` → `models.default` → parent). Display: *"Spawning reviewers with model: {model} (from {source})"*
58
58
 
59
59
  ### Part 1: Security Audit
60
60