forge-orkes 0.6.1 → 0.8.0

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.6.1",
3
+ "version": "0.8.0",
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"
@@ -250,6 +250,34 @@ Re-plan? Route to `planning` with summary.
250
250
 
251
251
  After convergence:
252
252
 
253
+ ### Step A: Milestone Gate (Advisory → Tier Escalation)
254
+
255
+ If no milestone exists (advisory discussion — forge routed here without tier/milestone):
256
+
257
+ 1. **Assess decisions.** Do locked decisions require code changes?
258
+ - Schema changes, field renames, new files, API changes, multi-file edits, refactoring → **yes, changes needed**
259
+ - Documentation only, config tweaks, "no changes needed" → **no** → end. *"No code changes needed. Discussion complete."*
260
+ 2. **Detect tier from decisions scope.**
261
+ - Single file, <50 lines, trivial → **Quick**
262
+ - Multi-file, refactor, feature, service changes → **Standard**
263
+ - Major architectural, multi-subsystem, multi-phase → **Full**
264
+ 3. **Create milestone.**
265
+ - Read `.forge/state/index.yml` (create from `.forge/templates/state/index.yml` if missing)
266
+ - Next ID = max existing ID + 1 (or 1 if none)
267
+ - Create `milestone-{id}.yml` from `.forge/templates/state/milestone.yml`:
268
+ - `milestone.id` = {id}, `milestone.name` = brief summary of discussion topic
269
+ - `current.tier` = detected tier
270
+ - `current.status` = `planning` (Standard) / `architecting` (Full) / `not_started` (Quick)
271
+ - `decisions[]` = locked decisions from `context.md`
272
+ - Add entry to `index.yml`: `id`, `name`, `status: active`, `last_updated: now`
273
+ 4. **Update `context.md`** — scope decisions under `### M{id} — {name} (locked {date})`
274
+ 5. **Quick tier?** → *"Scope is Quick. `/clear` then `/forge {id}` for quick-tasking."* End.
275
+ 6. Proceed to Step B with new milestone.
276
+
277
+ If milestone exists → skip to Step B.
278
+
279
+ ### Step B: Standard Handoff
280
+
253
281
  1. **Promote decisions in `context.md`** -- Rename milestone heading from `(drafting)` → `(locked {date})`. Decisions already written progressively — just finalize:
254
282
  - Verify all confirmed decisions present under `## Locked Decisions`
255
283
  - Verify deferred items under `## Deferred Ideas`
@@ -22,9 +22,9 @@ Check state files:
22
22
  - Match IDs (exact) or names (case-insensitive substring)
23
23
  - Found → auto-select: *"Resuming {id}: [{name}] -- {current.status}, {overall_percent}%"*
24
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?"*
25
+ 3. **Multiple (no arg):** Show active + not_started milestones with status + `last_updated`. Default most recent. After main list, show **Deferred:** section (id, name, frozen status `was: {current.status}`, defer date, reason). *"{N} active. Most recent: [{name}] ({current.status}, {date}). This one, or switch?"*
26
26
  4. **One:** Auto-select. *"Resuming: [{name}] -- {current.status}, {overall_percent}%"*
27
- 5. **None:** Init or create.
27
+ 5. **None active:** If deferred exist, mention them: *"No active milestones. {N} deferred — 'resume milestone {id}' to reactivate."* Else → init or create.
28
28
  6. Load `milestone-{id}.yml`
29
29
  7. **Route on `current.status`, NOT `overall_percent`.** Complete only at `complete`. 100% tasks ≠ done -- verifying + reviewing must run.
30
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.
@@ -43,6 +43,60 @@ Check `desire_paths` 3+ occurrences:
43
43
 
44
44
  No `project.yml` + Standard/Full → **Step 2A**. State exists → **Step 2B**.
45
45
 
46
+ ## Step 1.5: Lifecycle Operations
47
+
48
+ Before tier detection, check if user request matches lifecycle patterns:
49
+ - "defer milestone {id}" / "defer {id}" / "pause milestone {id}" → **Defer**
50
+ - "resume milestone {id}" / "undefer {id}" / "reactivate milestone {id}" → **Resume**
51
+ - "delete milestone {id}" / "archive milestone {id}" / "remove milestone {id}" → **Delete** (see below)
52
+
53
+ No match → fall through to Step 2B (tier detection).
54
+
55
+ ### Defer Operation
56
+
57
+ 1. Validate: milestone in `index.yml`, status not `deferred`
58
+ 2. Extract reason (text after "—"/"-" or second sentence). None → ask: *"Reason for deferring?"*
59
+ 3. Update `index.yml`: `status: deferred`, `last_updated`
60
+ 4. Update `milestone-{id}.yml`:
61
+ - `lifecycle.deferred_at` = ISO 8601 now
62
+ - `lifecycle.deferred_reason` = reason
63
+ - `lifecycle.status_before_defer` = copy of `current.status`
64
+ 5. Update `roadmap.yml`: all phases belonging to this milestone → `status: deferred`
65
+ 6. Confirm: *"Deferred milestone {id}: {name}. Was {status}, frozen at {current.status}. Reason: {reason}."*
66
+
67
+ ### Resume Operation
68
+
69
+ 1. Validate: milestone in `index.yml`, status is `deferred`
70
+ 2. Update `index.yml`: `status: active`, `last_updated`
71
+ 3. Update `milestone-{id}.yml`: `lifecycle.resumed_at` = ISO 8601 now
72
+ 4. Confirm + route: *"Resumed milestone {id}: {name}. Picking up at {current.status}."*
73
+ 5. Fall through to normal routing (Step 3) — `current.status` already frozen at correct position
74
+
75
+ ### Delete (Archive) Operation
76
+
77
+ 1. Validate: milestone in `index.yml` (any status — active, deferred, complete, not_started)
78
+ 2. Build manifest — scan for associated files:
79
+ - `.forge/state/milestone-{id}.yml`
80
+ - `.forge/phases/m{id}-*/` (glob all phase dirs)
81
+ - `.forge/research/milestone-{id}.md` (if exists)
82
+ - `.forge/audits/milestone-{id}-*` (if exists)
83
+ - Note: `.forge/context.md` is shared — do NOT archive or modify. M{id} decisions stay as history.
84
+ 3. Show manifest + confirm:
85
+ *"Archiving milestone {id}: {name}\n - {list files}\n → .forge/archive/milestone-{id}/\n\nProceed?"*
86
+ 4. On confirm:
87
+ a. Create `.forge/archive/milestone-{id}/`
88
+ b. Copy `milestone-{id}.yml` → archive as `state.yml`
89
+ c. Copy phase dirs → archive `phases/`
90
+ d. Copy research file → archive `research.md` (if exists)
91
+ e. Copy audit files → archive `audits/` (if exists)
92
+ f. Remove originals after successful copy
93
+ g. Remove milestone entry from `index.yml`
94
+ h. Remove milestone + its phases from `roadmap.yml`
95
+ i. Update `index.yml` `last_updated`
96
+ 5. Confirm: *"Archived milestone {id}: {name} → .forge/archive/milestone-{id}/. Removed from active state."*
97
+
98
+ **Safety:** Copy-then-delete, not move. If copy fails, originals intact.
99
+
46
100
  ### Parent Session Model Advisory
47
101
 
48
102
  Check `models.parent_session` from `project.yml`. **Always display:** *"Session model: {current}. Project recommends: {parent_session}."*
@@ -71,6 +125,12 @@ ANY: new project, major arch change, multi-phase, multi-subsystem, days of work,
71
125
  ### Direct Utility
72
126
  "upgrade"/"update forge"/"sync forge" → `upgrading` (bypasses tiers)
73
127
 
128
+ ### Advisory (Tier Deferred)
129
+ ANY: "review"/"advise"/"assess"/"evaluate" + specific system/component/feature, scope unclear, "what do you think about"
130
+ → No `project.yml` → init first. Then `discussing` (no milestone — tier detected post-discussion).
131
+
132
+ Can't know upfront if "review X" → "it's fine" or "restructure 6 files." Discussion determines scope. Discussing skill detects tier at convergence, creates milestone if code changes needed.
133
+
74
134
  ### User Override
75
135
  "Use Quick/Standard/Full tier" → honor.
76
136
 
@@ -132,6 +192,7 @@ Subagents via `Agent` tool → same precedence, enforced via `model` param.
132
192
  | `verifying` | Agent-dispatched → reviewing | **Agent** |
133
193
  | `reviewing` | `Skill(reviewing)` → complete | Skill |
134
194
  | `complete` | Done. Ask what's next. | — |
195
+ | `deferred` | Milestone frozen. *"Resume milestone {id}" to reactivate.* | — |
135
196
  | `quick-tasking` | Agent-dispatched (Quick tier / refactor-backlog) | **Agent** |
136
197
 
137
198
  **Phases marked Agent MUST use `Agent()` with `model` param. Never `Skill()` — model enforcement only works through `Agent()`.**
@@ -266,8 +327,9 @@ After clear, skills load from disk via "Read Context"/"Pre-Execution Checklist".
266
327
  ## State Transitions
267
328
 
268
329
  ```
269
- Standard: not_started → [init?] → researching → discussing → planning → executing → verifying → reviewing → complete
270
- Full: not_started → [init?] → researching → discussing → architecting → planning → executing → verifying → reviewing → complete
330
+ Standard: not_started → [init?] → researching → discussing → planning → executing → verifying → reviewing → complete
331
+ Full: not_started → [init?] → researching → discussing → architecting → planning → executing → verifying → reviewing → complete
332
+ Advisory: [init?] → discussing → [tier gate] → planning → executing → verifying → reviewing → complete
271
333
 
272
334
  Branches (any tier, on-demand): debugging (stuck) · designing (UI) · securing (auth/data/API) · testing (e2e/integration/flake)
273
335
  Phase boundaries: `[clear]` recommended between phases to reset context.
@@ -312,7 +312,7 @@ User selects per stack.
312
312
  milestones:
313
313
  - id: 1
314
314
  name: "{project name}"
315
- status: active
315
+ status: active # not_started | active | deferred | complete
316
316
  last_updated: "{date}"
317
317
  ```
318
318
  - `.forge/state/milestone-1.yml`:
@@ -4,13 +4,16 @@
4
4
 
5
5
  roadmap:
6
6
  # Milestones group phases into concurrent work streams.
7
- # Phases keep global IDs. Milestones reference them.
7
+ # Each milestone contains its own phases numbered sequentially (1, 2, 3...).
8
8
  # Different milestones can be worked on in parallel across sessions.
9
9
  milestones:
10
10
  - id: 1
11
11
  name: "" # e.g., "MVP", "Admin Dashboard"
12
- phases: [] # List of phase IDs belonging to this milestone
12
+ phases: [] # List of phase numbers belonging to this milestone
13
13
 
14
+ # Phases are scoped within milestones. Each phase has a local number (1, 2, 3...)
15
+ # within its milestone. Directory naming: .forge/phases/m{milestone_id}-{phase_num}-{name}/
16
+ # Example: m1-1-foundation/, m1-2-auth/, m2-1-dashboard/
14
17
  phases:
15
18
  - id: 1
16
19
  name: "" # e.g., "Foundation & Architecture"
@@ -21,7 +24,7 @@ roadmap:
21
24
  - "" # e.g., "User can see the landing page"
22
25
  - "" # e.g., "API returns valid JSON for /users"
23
26
  estimated_hours: null
24
- status: pending # pending | researching | planning | executing | verifying | complete
27
+ status: pending # pending | researching | planning | executing | verifying | deferred | complete
25
28
 
26
29
  - id: 2
27
30
  name: ""
@@ -5,7 +5,7 @@
5
5
  milestones: # Active milestones and their high-level status
6
6
  - id: 1
7
7
  name: "" # Human-readable milestone name from roadmap
8
- status: not_started # not_started | active | complete
8
+ status: not_started # not_started | active | deferred | complete
9
9
  last_updated: null # ISO 8601 timestamp — used for resume default selection
10
10
 
11
11
  metrics:
@@ -46,3 +46,11 @@ deviations: # Tracked deviations during execution
46
46
  plan: null
47
47
  task: null
48
48
  resolution: ""
49
+
50
+ # Lifecycle — events separate from workflow position (current:).
51
+ # current.status stays frozen when deferred — it IS the resume point.
52
+ lifecycle:
53
+ deferred_at: null # ISO 8601 — when milestone was deferred
54
+ deferred_reason: "" # User-provided reason for deferring
55
+ status_before_defer: null # Workflow status when deferred (mirrors frozen current.status)
56
+ resumed_at: null # ISO 8601 — when milestone was resumed
@@ -36,6 +36,10 @@ Auto-detects complexity. Override: "Use Quick/Standard/Full tier."
36
36
  **Flow:** `researching` → `discussing` → `architecting` → `planning` → `executing` → `verifying` → `reviewing` → done
37
37
  **Optional:** `designing` (UI), `securing` (auth/data/API), `debugging` (stuck), `testing` (e2e/integration/flake)
38
38
 
39
+ ### Advisory (tier deferred)
40
+ **Triggers:** "review"/"advise"/"assess"/"evaluate" + specific system/component, scope unclear upfront
41
+ **Flow:** `discussing` → [tier gate detects scope] → `planning` → `executing` → `verifying` → `reviewing` → done
42
+
39
43
  ## Skill Routing
40
44
 
41
45
  | Need to... | Skill | Tier |
@@ -130,8 +134,10 @@ State lives in `.forge/`:
130
134
  - `research/milestone-{id}.md` — Research findings snapshot (dated, immutable)
131
135
  - `phases/m{M}-{N}-{name}/plan-{NN}.md` — Task plans with must_haves frontmatter
132
136
  - `refactor-backlog.yml` — Refactoring catalog, worked via quick-tasking
137
+ - `archive/milestone-{id}/` — Archived milestone artifacts (archive-delete)
133
138
 
134
- **Milestones** group phases into concurrent streams. Own state file — no conflicts across sessions.
139
+ **Milestones** group phases into concurrent streams. Own state file — no conflicts across sessions. Can be deferred (frozen in place) or archive-deleted.
140
+ `index.yml status` gates routing: `not_started | active | deferred | complete`.
135
141
  **Format**: YAML for machine state, Markdown for human content.
136
142
  **`current.status` is authoritative.** Complete only at `current.status == complete`. 100% tasks ≠ done — still needs verifying + reviewing.
137
143