@howlil/ez-agents 3.4.2 → 3.5.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.
Files changed (74) hide show
  1. package/README.md +77 -2
  2. package/agents/ez-observer-agent.md +260 -0
  3. package/agents/ez-release-agent.md +333 -0
  4. package/agents/ez-requirements-agent.md +377 -0
  5. package/agents/ez-scrum-master-agent.md +242 -0
  6. package/agents/ez-tech-lead-agent.md +267 -0
  7. package/bin/install.js +3221 -3272
  8. package/commands/ez/arch-review.md +102 -0
  9. package/commands/ez/execute-phase.md +11 -0
  10. package/commands/ez/export-session.md +79 -0
  11. package/commands/ez/gather-requirements.md +117 -0
  12. package/commands/ez/git-workflow.md +72 -0
  13. package/commands/ez/hotfix.md +120 -0
  14. package/commands/ez/import-session.md +82 -0
  15. package/commands/ez/list-sessions.md +96 -0
  16. package/commands/ez/package-manager.md +316 -0
  17. package/commands/ez/plan-phase.md +9 -1
  18. package/commands/ez/preflight.md +79 -0
  19. package/commands/ez/progress.md +13 -1
  20. package/commands/ez/release.md +153 -0
  21. package/commands/ez/resume.md +107 -0
  22. package/commands/ez/standup.md +85 -0
  23. package/ez-agents/bin/ez-tools.cjs +1095 -716
  24. package/ez-agents/bin/lib/bdd-validator.cjs +622 -0
  25. package/ez-agents/bin/lib/content-scanner.cjs +238 -0
  26. package/ez-agents/bin/lib/context-cache.cjs +154 -0
  27. package/ez-agents/bin/lib/context-errors.cjs +71 -0
  28. package/ez-agents/bin/lib/context-manager.cjs +220 -0
  29. package/ez-agents/bin/lib/discussion-synthesizer.cjs +458 -0
  30. package/ez-agents/bin/lib/file-access.cjs +207 -0
  31. package/ez-agents/bin/lib/git-errors.cjs +83 -0
  32. package/ez-agents/bin/lib/git-utils.cjs +321 -203
  33. package/ez-agents/bin/lib/git-workflow-engine.cjs +1157 -0
  34. package/ez-agents/bin/lib/index.cjs +46 -2
  35. package/ez-agents/bin/lib/lockfile-validator.cjs +227 -0
  36. package/ez-agents/bin/lib/logger.cjs +124 -154
  37. package/ez-agents/bin/lib/memory-compression.cjs +256 -0
  38. package/ez-agents/bin/lib/metrics-tracker.cjs +406 -0
  39. package/ez-agents/bin/lib/package-manager-detector.cjs +203 -0
  40. package/ez-agents/bin/lib/package-manager-executor.cjs +385 -0
  41. package/ez-agents/bin/lib/package-manager-service.cjs +216 -0
  42. package/ez-agents/bin/lib/release-validator.cjs +614 -0
  43. package/ez-agents/bin/lib/safe-exec.cjs +128 -214
  44. package/ez-agents/bin/lib/session-chain.cjs +304 -0
  45. package/ez-agents/bin/lib/session-errors.cjs +81 -0
  46. package/ez-agents/bin/lib/session-export.cjs +251 -0
  47. package/ez-agents/bin/lib/session-import.cjs +262 -0
  48. package/ez-agents/bin/lib/session-manager.cjs +280 -0
  49. package/ez-agents/bin/lib/tier-manager.cjs +428 -0
  50. package/ez-agents/bin/lib/url-fetch.cjs +170 -0
  51. package/ez-agents/references/metrics-schema.md +118 -0
  52. package/ez-agents/references/planning-config.md +140 -0
  53. package/ez-agents/references/tier-strategy.md +103 -0
  54. package/ez-agents/templates/bdd-feature.md +173 -0
  55. package/ez-agents/templates/discussion.md +68 -0
  56. package/ez-agents/templates/incident-runbook.md +205 -0
  57. package/ez-agents/templates/release-checklist.md +133 -0
  58. package/ez-agents/templates/rollback-plan.md +201 -0
  59. package/ez-agents/workflows/arch-review.md +54 -0
  60. package/ez-agents/workflows/autonomous.md +844 -743
  61. package/ez-agents/workflows/execute-phase.md +45 -0
  62. package/ez-agents/workflows/export-session.md +255 -0
  63. package/ez-agents/workflows/gather-requirements.md +206 -0
  64. package/ez-agents/workflows/help.md +92 -0
  65. package/ez-agents/workflows/hotfix.md +291 -0
  66. package/ez-agents/workflows/import-session.md +303 -0
  67. package/ez-agents/workflows/new-milestone.md +713 -384
  68. package/ez-agents/workflows/new-project.md +1107 -1113
  69. package/ez-agents/workflows/plan-phase.md +22 -0
  70. package/ez-agents/workflows/progress.md +15 -25
  71. package/ez-agents/workflows/release.md +253 -0
  72. package/ez-agents/workflows/resume-session.md +215 -0
  73. package/ez-agents/workflows/standup.md +64 -0
  74. package/package.json +9 -2
@@ -1,384 +1,713 @@
1
- <purpose>
2
-
3
- Start a new milestone cycle for an existing project. Loads project context, gathers milestone goals (from MILESTONE-CONTEXT.md or conversation), updates PROJECT.md and STATE.md, optionally runs parallel research, defines scoped requirements with REQ-IDs, spawns the roadmapper to create phased execution plan, and commits all artifacts. Brownfield equivalent of new-project.
4
-
5
- </purpose>
6
-
7
- <required_reading>
8
-
9
- Read all files referenced by the invoking prompt's execution_context before starting.
10
-
11
- </required_reading>
12
-
13
- <process>
14
-
15
- ## 1. Load Context
16
-
17
- - Read PROJECT.md (existing project, validated requirements, decisions)
18
- - Read MILESTONES.md (what shipped previously)
19
- - Read STATE.md (pending todos, blockers)
20
- - Check for MILESTONE-CONTEXT.md (from /ez:discuss-milestone)
21
-
22
- ## 2. Gather Milestone Goals
23
-
24
- **If MILESTONE-CONTEXT.md exists:**
25
- - Use features and scope from discuss-milestone
26
- - Present summary for confirmation
27
-
28
- **If no context file:**
29
- - Present what shipped in last milestone
30
- - Ask inline (freeform, NOT AskUserQuestion): "What do you want to build next?"
31
- - Wait for their response, then use AskUserQuestion to probe specifics
32
- - If user selects "Other" at any point to provide freeform input, ask follow-up as plain text — not another AskUserQuestion
33
-
34
- ## 3. Determine Milestone Version
35
-
36
- - Parse last version from MILESTONES.md
37
- - Suggest next version (v1.0 → v1.1, or v2.0 for major)
38
- - Confirm with user
39
-
40
- ## 4. Update PROJECT.md
41
-
42
- Add/update:
43
-
44
- ```markdown
45
- ## Current Milestone: v[X.Y] [Name]
46
-
47
- **Goal:** [One sentence describing milestone focus]
48
-
49
- **Target features:**
50
- - [Feature 1]
51
- - [Feature 2]
52
- - [Feature 3]
53
- ```
54
-
55
- Update Active requirements section and "Last updated" footer.
56
-
57
- ## 5. Update STATE.md
58
-
59
- ```markdown
60
- ## Current Position
61
-
62
- Phase: Not started (defining requirements)
63
- Plan:
64
- Status: Defining requirements
65
- Last activity: [today] — Milestone v[X.Y] started
66
- ```
67
-
68
- Keep Accumulated Context section from previous milestone.
69
-
70
- ## 6. Cleanup and Commit
71
-
72
- Delete MILESTONE-CONTEXT.md if exists (consumed).
73
-
74
- ```bash
75
- node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" commit "docs: start milestone v[X.Y] [Name]" --files .planning/PROJECT.md .planning/STATE.md
76
- ```
77
-
78
- ## 7. Load Context and Resolve Models
79
-
80
- ```bash
81
- INIT=$(node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" init new-milestone)
82
- if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
83
- ```
84
-
85
- Extract from init JSON: `researcher_model`, `synthesizer_model`, `roadmapper_model`, `commit_docs`, `research_enabled`, `current_milestone`, `project_exists`, `roadmap_exists`.
86
-
87
- ## 8. Research Decision
88
-
89
- AskUserQuestion: "Research the domain ecosystem for new features before defining requirements?"
90
- - "Research first (Recommended)" — Discover patterns, features, architecture for NEW capabilities
91
- - "Skip research" Go straight to requirements
92
-
93
- **Persist choice to config** (so future `/ez:plan-phase` honors it):
94
-
95
- ```bash
96
- # If "Research first": persist true
97
- node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" config-set workflow.research true
98
-
99
- # If "Skip research": persist false
100
- node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" config-set workflow.research false
101
- ```
102
-
103
- **If "Research first":**
104
-
105
- ```
106
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
107
- EZ ► RESEARCHING
108
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
109
-
110
- Spawning 4 researchers in parallel...
111
- Stack, Features, Architecture, Pitfalls
112
- ```
113
-
114
- ```bash
115
- mkdir -p .planning/research
116
- ```
117
-
118
- Spawn 4 parallel ez-project-researcher agents. Each uses this template with dimension-specific fields:
119
-
120
- **Common structure for all 4 researchers:**
121
- ```
122
- Task(prompt="
123
- <research_type>Project Research — {DIMENSION} for [new features].</research_type>
124
-
125
- <milestone_context>
126
- SUBSEQUENT MILESTONE — Adding [target features] to existing app.
127
- {EXISTING_CONTEXT}
128
- Focus ONLY on what's needed for the NEW features.
129
- </milestone_context>
130
-
131
- <question>{QUESTION}</question>
132
-
133
- <files_to_read>
134
- - .planning/PROJECT.md (Project context)
135
- </files_to_read>
136
-
137
- <downstream_consumer>{CONSUMER}</downstream_consumer>
138
-
139
- <quality_gate>{GATES}</quality_gate>
140
-
141
- <output>
142
- Write to: .planning/research/{FILE}
143
- Use template: ~/.claude/ez-agents/templates/research-project/{FILE}
144
- </output>
145
- ", subagent_type="ez-project-researcher", model="{researcher_model}", description="{DIMENSION} research")
146
- ```
147
-
148
- **Dimension-specific fields:**
149
-
150
- | Field | Stack | Features | Architecture | Pitfalls |
151
- |-------|-------|----------|-------------|----------|
152
- | EXISTING_CONTEXT | Existing validated capabilities (DO NOT re-research): [from PROJECT.md] | Existing features (already built): [from PROJECT.md] | Existing architecture: [from PROJECT.md or codebase map] | Focus on common mistakes when ADDING these features to existing system |
153
- | QUESTION | What stack additions/changes are needed for [new features]? | How do [target features] typically work? Expected behavior? | How do [target features] integrate with existing architecture? | Common mistakes when adding [target features] to [domain]? |
154
- | CONSUMER | Specific libraries with versions for NEW capabilities, integration points, what NOT to add | Table stakes vs differentiators vs anti-features, complexity noted, dependencies on existing | Integration points, new components, data flow changes, suggested build order | Warning signs, prevention strategy, which phase should address it |
155
- | GATES | Versions current (verify with Context7), rationale explains WHY, integration considered | Categories clear, complexity noted, dependencies identified | Integration points identified, new vs modified explicit, build order considers deps | Pitfalls specific to adding these features, integration pitfalls covered, prevention actionable |
156
- | FILE | STACK.md | FEATURES.md | ARCHITECTURE.md | PITFALLS.md |
157
-
158
- After all 4 complete, spawn synthesizer:
159
-
160
- ```
161
- Task(prompt="
162
- Synthesize research outputs into SUMMARY.md.
163
-
164
- <files_to_read>
165
- - .planning/research/STACK.md
166
- - .planning/research/FEATURES.md
167
- - .planning/research/ARCHITECTURE.md
168
- - .planning/research/PITFALLS.md
169
- </files_to_read>
170
-
171
- Write to: .planning/research/SUMMARY.md
172
- Use template: ~/.claude/ez-agents/templates/research-project/SUMMARY.md
173
- Commit after writing.
174
- ", subagent_type="ez-research-synthesizer", model="{synthesizer_model}", description="Synthesize research")
175
- ```
176
-
177
- Display key findings from SUMMARY.md:
178
- ```
179
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
180
- EZ ► RESEARCH COMPLETE ✓
181
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
182
-
183
- **Stack additions:** [from SUMMARY.md]
184
- **Feature table stakes:** [from SUMMARY.md]
185
- **Watch Out For:** [from SUMMARY.md]
186
- ```
187
-
188
- **If "Skip research":** Continue to Step 9.
189
-
190
- ## 9. Define Requirements
191
-
192
- ```
193
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
194
- EZ ► DEFINING REQUIREMENTS
195
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
196
- ```
197
-
198
- Read PROJECT.md: core value, current milestone goals, validated requirements (what exists).
199
-
200
- **If research exists:** Read FEATURES.md, extract feature categories.
201
-
202
- Present features by category:
203
- ```
204
- ## [Category 1]
205
- **Table stakes:** Feature A, Feature B
206
- **Differentiators:** Feature C, Feature D
207
- **Research notes:** [any relevant notes]
208
- ```
209
-
210
- **If no research:** Gather requirements through conversation. Ask: "What are the main things users need to do with [new features]?" Clarify, probe for related capabilities, group into categories.
211
-
212
- **Scope each category** via AskUserQuestion (multiSelect: true, header max 12 chars):
213
- - "[Feature 1]" — [brief description]
214
- - "[Feature 2]" — [brief description]
215
- - "None for this milestone" — Defer entire category
216
-
217
- Track: Selected this milestone. Unselected table stakes → future. Unselected differentiators → out of scope.
218
-
219
- **Identify gaps** via AskUserQuestion:
220
- - "No, research covered it" — Proceed
221
- - "Yes, let me add some" — Capture additions
222
-
223
- **Generate REQUIREMENTS.md:**
224
- - v1 Requirements grouped by category (checkboxes, REQ-IDs)
225
- - Future Requirements (deferred)
226
- - Out of Scope (explicit exclusions with reasoning)
227
- - Traceability section (empty, filled by roadmap)
228
-
229
- **REQ-ID format:** `[CATEGORY]-[NUMBER]` (AUTH-01, NOTIF-02). Continue numbering from existing.
230
-
231
- **Requirement quality criteria:**
232
-
233
- Good requirements are:
234
- - **Specific and testable:** "User can reset password via email link" (not "Handle password reset")
235
- - **User-centric:** "User can X" (not "System does Y")
236
- - **Atomic:** One capability per requirement (not "User can login and manage profile")
237
- - **Independent:** Minimal dependencies on other requirements
238
-
239
- Present FULL requirements list for confirmation:
240
-
241
- ```
242
- ## Milestone v[X.Y] Requirements
243
-
244
- ### [Category 1]
245
- - [ ] **CAT1-01**: User can do X
246
- - [ ] **CAT1-02**: User can do Y
247
-
248
- ### [Category 2]
249
- - [ ] **CAT2-01**: User can do Z
250
-
251
- Does this capture what you're building? (yes / adjust)
252
- ```
253
-
254
- If "adjust": Return to scoping.
255
-
256
- **Commit requirements:**
257
- ```bash
258
- node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" commit "docs: define milestone v[X.Y] requirements" --files .planning/REQUIREMENTS.md
259
- ```
260
-
261
- ## 10. Create Roadmap
262
-
263
- ```
264
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
265
- EZ CREATING ROADMAP
266
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
267
-
268
- Spawning roadmapper...
269
- ```
270
-
271
- **Starting phase number:** Read MILESTONES.md for last phase number. Continue from there (v1.0 ended at phase 5 → v1.1 starts at phase 6).
272
-
273
- ```
274
- Task(prompt="
275
- <planning_context>
276
- <files_to_read>
277
- - .planning/PROJECT.md
278
- - .planning/REQUIREMENTS.md
279
- - .planning/research/SUMMARY.md (if exists)
280
- - .planning/config.json
281
- - .planning/MILESTONES.md
282
- </files_to_read>
283
- </planning_context>
284
-
285
- <instructions>
286
- Create roadmap for milestone v[X.Y]:
287
- 1. Start phase numbering from [N]
288
- 2. Derive phases from THIS MILESTONE's requirements only
289
- 3. Map every requirement to exactly one phase
290
- 4. Derive 2-5 success criteria per phase (observable user behaviors)
291
- 5. Validate 100% coverage
292
- 6. Write files immediately (ROADMAP.md, STATE.md, update REQUIREMENTS.md traceability)
293
- 7. Return ROADMAP CREATED with summary
294
-
295
- Write files first, then return.
296
- </instructions>
297
- ", subagent_type="ez-roadmapper", model="{roadmapper_model}", description="Create roadmap")
298
- ```
299
-
300
- **Handle return:**
301
-
302
- **If `## ROADMAP BLOCKED`:** Present blocker, work with user, re-spawn.
303
-
304
- **If `## ROADMAP CREATED`:** Read ROADMAP.md, present inline:
305
-
306
- ```
307
- ## Proposed Roadmap
308
-
309
- **[N] phases** | **[X] requirements mapped** | All covered ✓
310
-
311
- | # | Phase | Goal | Requirements | Success Criteria |
312
- |---|-------|------|--------------|------------------|
313
- | [N] | [Name] | [Goal] | [REQ-IDs] | [count] |
314
-
315
- ### Phase Details
316
-
317
- **Phase [N]: [Name]**
318
- Goal: [goal]
319
- Requirements: [REQ-IDs]
320
- Success criteria:
321
- 1. [criterion]
322
- 2. [criterion]
323
- ```
324
-
325
- **Ask for approval** via AskUserQuestion:
326
- - "Approve" Commit and continue
327
- - "Adjust phases" — Tell me what to change
328
- - "Review full file" — Show raw ROADMAP.md
329
-
330
- **If "Adjust":** Get notes, re-spawn roadmapper with revision context, loop until approved.
331
- **If "Review":** Display raw ROADMAP.md, re-ask.
332
-
333
- **Commit roadmap** (after approval):
334
- ```bash
335
- node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" commit "docs: create milestone v[X.Y] roadmap ([N] phases)" --files .planning/ROADMAP.md .planning/STATE.md .planning/REQUIREMENTS.md
336
- ```
337
-
338
- ## 11. Done
339
-
340
- ```
341
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
342
- EZ ► MILESTONE INITIALIZED ✓
343
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
344
-
345
- **Milestone v[X.Y]: [Name]**
346
-
347
- | Artifact | Location |
348
- |----------------|-----------------------------|
349
- | Project | `.planning/PROJECT.md` |
350
- | Research | `.planning/research/` |
351
- | Requirements | `.planning/REQUIREMENTS.md` |
352
- | Roadmap | `.planning/ROADMAP.md` |
353
-
354
- **[N] phases** | **[X] requirements** | Ready to build
355
-
356
- ## Next Up
357
-
358
- **Phase [N]: [Phase Name]** [Goal]
359
-
360
- `/ez:discuss-phase [N]` gather context and clarify approach
361
-
362
- <sub>`/clear` first fresh context window</sub>
363
-
364
- Also: `/ez:plan-phase [N]` — skip discussion, plan directly
365
- ```
366
-
367
- </process>
368
-
369
- <success_criteria>
370
- - [ ] PROJECT.md updated with Current Milestone section
371
- - [ ] STATE.md reset for new milestone
372
- - [ ] MILESTONE-CONTEXT.md consumed and deleted (if existed)
373
- - [ ] Research completed (if selected) — 4 parallel agents, milestone-aware
374
- - [ ] Requirements gathered and scoped per category
375
- - [ ] REQUIREMENTS.md created with REQ-IDs
376
- - [ ] ez-roadmapper spawned with phase numbering context
377
- - [ ] Roadmap files written immediately (not draft)
378
- - [ ] User feedback incorporated (if any)
379
- - [ ] ROADMAP.md phases continue from previous milestone
380
- - [ ] All commits made (if planning docs committed)
381
- - [ ] User knows next step: `/ez:discuss-phase [N]`
382
-
383
- **Atomic commits:** Each phase commits its artifacts immediately.
384
- </success_criteria>
1
+ <purpose>
2
+
3
+ Start a new milestone cycle for an existing project. Loads project context, gathers milestone goals (from MILESTONE-CONTEXT.md or conversation), updates PROJECT.md and STATE.md, optionally runs parallel research, defines scoped requirements with REQ-IDs, spawns the roadmapper to create phased execution plan, and commits all artifacts. Brownfield equivalent of new-project.
4
+
5
+ **GSD-2 Enhanced:** Includes crash recovery, cost tracking, fresh context, and stuck detection for production-grade reliability.
6
+
7
+ </purpose>
8
+
9
+ <required_reading>
10
+
11
+ Read all files referenced by the invoking prompt's execution_context before starting.
12
+
13
+ </required_reading>
14
+
15
+ <process>
16
+
17
+ ## 0. Pre-Flight Health Check (GSD-2 Pattern)
18
+
19
+ **MANDATORY FIRST STEP Validate environment before ANY operation:**
20
+
21
+ ```bash
22
+ # Run health check
23
+ HEALTH=$(node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" doctor --json)
24
+ ```
25
+
26
+ **Check:**
27
+ - ✅ Node.js version >= 16.7.0
28
+ - AI tools available (Claude, OpenCode, etc.)
29
+ - Config valid (`.planning/config.json`)
30
+ - Git repo initialized
31
+ - API keys configured
32
+
33
+ **If any check fails:**
34
+ ```
35
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
36
+ EZ HEALTH CHECK FAILED
37
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
38
+
39
+ ❌ [Failed check description]
40
+
41
+ Fix:
42
+ [suggested command]
43
+
44
+ Example:
45
+ $ [example command]
46
+
47
+ Resolve before continuing with milestone initialization.
48
+ ```
49
+
50
+ **Abort milestone init until resolved.**
51
+
52
+ ---
53
+
54
+ ## 0a. Gather Initial Context (CONTEXT-01, CONTEXT-02)
55
+
56
+ **Initialize ContextManager for context gathering:**
57
+
58
+ ```javascript
59
+ const ContextManager = require('../bin/lib/context-manager.cjs');
60
+ const contextManager = new ContextManager(process.cwd());
61
+ ```
62
+
63
+ **Request milestone-specific context:**
64
+
65
+ ```javascript
66
+ const context = await contextManager.requestContext({
67
+ files: ['.planning/PROJECT.md', '.planning/STATE.md', '.planning/ROADMAP.md'],
68
+ urls: []
69
+ });
70
+ ```
71
+
72
+ **Agent can request additional context using:**
73
+ - `ez-tools context read <pattern>` — Read local files
74
+ - `ez-tools context fetch <url>` — Fetch URL content (requires user confirmation)
75
+
76
+ **Update STATE.md with context sources:**
77
+
78
+ ```javascript
79
+ await contextManager.updateStateMd();
80
+ ```
81
+
82
+ **Continue to Load Context (Step 1) with gathered context.**
83
+
84
+ ---
85
+
86
+ ## 1. Load Context
87
+
88
+ Read PROJECT.md (existing project, validated requirements, decisions)
89
+ Read MILESTONES.md (what shipped previously)
90
+ Read STATE.md (pending todos, blockers)
91
+ Check for MILESTONE-CONTEXT.md (from /ez:discuss-milestone)
92
+
93
+ ---
94
+
95
+ ## 1a. Initialize Milestone Cost Tracking (GSD-2 Pattern)
96
+
97
+ **Create/Update metrics.json:**
98
+
99
+ ```bash
100
+ # Initialize milestone budget
101
+ node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" cost-init \
102
+ --milestone="v[X.Y]" \
103
+ --budget-ceiling=50.00 \
104
+ --alert-threshold=0.8
105
+ ```
106
+
107
+ **Create `.planning/metrics.json`:**
108
+ ```json
109
+ {
110
+ "milestone": "v[X.Y]",
111
+ "started_at": "2026-03-18T12:00:00.000Z",
112
+ "budget": {
113
+ "ceiling": 50.00,
114
+ "alert_threshold": 0.8,
115
+ "projected": 0.00,
116
+ "spent": 0.00
117
+ },
118
+ "phases": {},
119
+ "cumulative": {
120
+ "total_tokens": 0,
121
+ "total_cost_usd": 0.00,
122
+ "by_provider": {}
123
+ }
124
+ }
125
+ ```
126
+
127
+ **Display budget info:**
128
+ ```
129
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
130
+ EZ ► MILESTONE BUDGET
131
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
132
+
133
+ Milestone: v[X.Y]
134
+ Budget Ceiling: $50.00
135
+ Alert Threshold: 80% ($40.00)
136
+
137
+ You will be warned when spending reaches 80% of budget.
138
+ Auto-pause at $50.00.
139
+
140
+ View anytime: /ez:cost
141
+ ```
142
+
143
+ **Commit metrics.json:**
144
+ ```bash
145
+ node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" commit "chore: initialize milestone budget" --files .planning/metrics.json
146
+ ```
147
+
148
+ ---
149
+
150
+ ## 2. Gather Milestone Goals
151
+
152
+ **If MILESTONE-CONTEXT.md exists:**
153
+ - Use features and scope from discuss-milestone
154
+ - Present summary for confirmation
155
+
156
+ **If no context file:**
157
+ - Present what shipped in last milestone
158
+ - Ask inline (freeform, NOT AskUserQuestion): "What do you want to build next?"
159
+ - Wait for their response, then use AskUserQuestion to probe specifics
160
+ - If user selects "Other" at any point to provide freeform input, ask follow-up as plain text — not another AskUserQuestion
161
+
162
+ ---
163
+
164
+ ## 2a. Create Lock File (GSD-2 Pattern)
165
+
166
+ **Before any major operation:**
167
+
168
+ ```bash
169
+ # Create auto.lock
170
+ node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" lock-create \
171
+ --operation="new-milestone" \
172
+ --milestone="v[X.Y]"
173
+ ```
174
+
175
+ **Create `.planning/auto.lock`:**
176
+ ```json
177
+ {
178
+ "pid": 12345,
179
+ "operation": "new-milestone",
180
+ "milestone": "v[X.Y]",
181
+ "started_at": "2026-03-18T12:00:00.000Z",
182
+ "last_heartbeat": "2026-03-18T12:00:00.000Z",
183
+ "state": "gathering_goals"
184
+ }
185
+ ```
186
+
187
+ **Update heartbeat every 5 minutes:**
188
+ ```bash
189
+ node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" lock-heartbeat
190
+ ```
191
+
192
+ **On completion:**
193
+ ```bash
194
+ node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" lock-release
195
+ ```
196
+
197
+ **On crash/restart:**
198
+ - Detect orphaned lock (PID dead)
199
+ - Synthesize recovery briefing
200
+ - Resume from last known state
201
+
202
+ ---
203
+
204
+ ## 3. Determine Milestone Version
205
+
206
+ - Parse last version from MILESTONES.md
207
+ - Suggest next version (v1.0 → v1.1, or v2.0 for major)
208
+ - Confirm with user
209
+
210
+ ---
211
+
212
+ ## 4. Update PROJECT.md
213
+
214
+ Add/update:
215
+
216
+ ```markdown
217
+ ## Current Milestone: v[X.Y] [Name]
218
+
219
+ **Goal:** [One sentence describing milestone focus]
220
+
221
+ **Target features:**
222
+ - [Feature 1]
223
+ - [Feature 2]
224
+ - [Feature 3]
225
+ ```
226
+
227
+ Update Active requirements section and "Last updated" footer.
228
+
229
+ ---
230
+
231
+ ## 5. Update STATE.md
232
+
233
+ ```markdown
234
+ ## Current Position
235
+
236
+ Phase: Not started (defining requirements)
237
+ Plan:
238
+ Status: Defining requirements
239
+ Last activity: [today] Milestone v[X.Y] started
240
+ ```
241
+
242
+ Keep Accumulated Context section from previous milestone.
243
+
244
+ ---
245
+
246
+ ## 6. Cleanup and Commit
247
+
248
+ Delete MILESTONE-CONTEXT.md if exists (consumed).
249
+
250
+ ```bash
251
+ node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" commit "docs: start milestone v[X.Y] [Name]" --files .planning/PROJECT.md .planning/STATE.md .planning/metrics.json
252
+ ```
253
+
254
+ **Update lock file state:**
255
+ ```bash
256
+ node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" lock-update --state="context_loaded"
257
+ ```
258
+
259
+ ---
260
+
261
+ ## 7. Load Context and Resolve Models
262
+
263
+ ```bash
264
+ INIT=$(node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" init new-milestone)
265
+ if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
266
+ ```
267
+
268
+ Extract from init JSON: `researcher_model`, `synthesizer_model`, `roadmapper_model`, `commit_docs`, `research_enabled`, `current_milestone`, `project_exists`, `roadmap_exists`.
269
+
270
+ ---
271
+
272
+ ## 8. Research Decision
273
+
274
+ AskUserQuestion: "Research the domain ecosystem for new features before defining requirements?"
275
+ - "Research first (Recommended)" — Discover patterns, features, architecture for NEW capabilities
276
+ - "Skip research" — Go straight to requirements
277
+
278
+ **Persist choice to config** (so future `/ez:plan-phase` honors it):
279
+
280
+ ```bash
281
+ # If "Research first": persist true
282
+ node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" config-set workflow.research true
283
+
284
+ # If "Skip research": persist false
285
+ node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" config-set workflow.research false
286
+ ```
287
+
288
+ **Update lock file state:**
289
+ ```bash
290
+ node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" lock-update --state="research_decision"
291
+ ```
292
+
293
+ **If "Research first":**
294
+
295
+ ```
296
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
297
+ EZ RESEARCHING
298
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
299
+
300
+ Spawning 4 researchers in parallel...
301
+ → Stack, Features, Architecture, Pitfalls
302
+ ```
303
+
304
+ ```bash
305
+ mkdir -p .planning/research
306
+ ```
307
+
308
+ **Spawn 4 parallel ez-project-researcher agents with FRESH CONTEXT (GSD-2 Pattern):**
309
+
310
+ Each uses this template with dimension-specific fields:
311
+
312
+ **Common structure for all 4 researchers:**
313
+ ```
314
+ Task(prompt="
315
+ <research_type>Project Research — {DIMENSION} for [new features].</research_type>
316
+
317
+ <fresh_context>
318
+ CONTEXT RESET: This is a fresh 200K session.
319
+ No accumulated garbage from prior tasks.
320
+ Only relevant context pre-loaded below.
321
+ </fresh_context>
322
+
323
+ <pre_loaded_context>
324
+ - .planning/PROJECT.md excerpt (core value, milestone goals)
325
+ - .planning/REQUIREMENTS.md excerpt (active requirements)
326
+ - .planning/ROADMAP.md excerpt (phase structure)
327
+ </pre_loaded_context>
328
+
329
+ <milestone_context>
330
+ SUBSEQUENT MILESTONE Adding [target features] to existing app.
331
+ {EXISTING_CONTEXT}
332
+ Focus ONLY on what's needed for the NEW features.
333
+ </milestone_context>
334
+
335
+ <question>{QUESTION}</question>
336
+
337
+ <files_to_read>
338
+ - .planning/PROJECT.md (Project context)
339
+ </files_to_read>
340
+
341
+ <downstream_consumer>{CONSUMER}</downstream_consumer>
342
+
343
+ <quality_gate>{GATES}</quality_gate>
344
+
345
+ <output>
346
+ Write to: .planning/research/{FILE}
347
+ Use template: ~/.claude/ez-agents/templates/research-project/{FILE}
348
+ </output>
349
+ ", subagent_type="ez-project-researcher", model="{researcher_model}", description="{DIMENSION} research")
350
+ ```
351
+
352
+ **Dimension-specific fields:**
353
+
354
+ | Field | Stack | Features | Architecture | Pitfalls |
355
+ |-------|-------|----------|-------------|----------|
356
+ | EXISTING_CONTEXT | Existing validated capabilities (DO NOT re-research): [from PROJECT.md] | Existing features (already built): [from PROJECT.md] | Existing architecture: [from PROJECT.md or codebase map] | Focus on common mistakes when ADDING these features to existing system |
357
+ | QUESTION | What stack additions/changes are needed for [new features]? | How do [target features] typically work? Expected behavior? | How do [target features] integrate with existing architecture? | Common mistakes when adding [target features] to [domain]? |
358
+ | CONSUMER | Specific libraries with versions for NEW capabilities, integration points, what NOT to add | Table stakes vs differentiators vs anti-features, complexity noted, dependencies on existing | Integration points, new components, data flow changes, suggested build order | Warning signs, prevention strategy, which phase should address it |
359
+ | GATES | Versions current (verify with Context7), rationale explains WHY, integration considered | Categories clear, complexity noted, dependencies identified | Integration points identified, new vs modified explicit, build order considers deps | Pitfalls specific to adding these features, integration pitfalls covered, prevention actionable |
360
+ | FILE | STACK.md | FEATURES.md | ARCHITECTURE.md | PITFALLS.md |
361
+
362
+ After all 4 complete, spawn synthesizer:
363
+
364
+ ```
365
+ Task(prompt="
366
+ Synthesize research outputs into SUMMARY.md.
367
+
368
+ <files_to_read>
369
+ - .planning/research/STACK.md
370
+ - .planning/research/FEATURES.md
371
+ - .planning/research/ARCHITECTURE.md
372
+ - .planning/research/PITFALLS.md
373
+ </files_to_read>
374
+
375
+ Write to: .planning/research/SUMMARY.md
376
+ Use template: ~/.claude/ez-agents/templates/research-project/SUMMARY.md
377
+ Commit after writing.
378
+ ", subagent_type="ez-research-synthesizer", model="{synthesizer_model}", description="Synthesize research")
379
+ ```
380
+
381
+ Display key findings from SUMMARY.md:
382
+ ```
383
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
384
+ EZ ► RESEARCH COMPLETE ✓
385
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
386
+
387
+ **Stack additions:** [from SUMMARY.md]
388
+ **Feature table stakes:** [from SUMMARY.md]
389
+ **Watch Out For:** [from SUMMARY.md]
390
+ ```
391
+
392
+ **Update lock file state:**
393
+ ```bash
394
+ node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" lock-update --state="research_complete"
395
+ ```
396
+
397
+ **If "Skip research":** Continue to Step 9.
398
+
399
+ ---
400
+
401
+ ## 9. Define Requirements
402
+
403
+ ```
404
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
405
+ EZ ► DEFINING REQUIREMENTS
406
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
407
+ ```
408
+
409
+ Read PROJECT.md: core value, current milestone goals, validated requirements (what exists).
410
+
411
+ **If research exists:** Read FEATURES.md, extract feature categories.
412
+
413
+ Present features by category:
414
+ ```
415
+ ## [Category 1]
416
+ **Table stakes:** Feature A, Feature B
417
+ **Differentiators:** Feature C, Feature D
418
+ **Research notes:** [any relevant notes]
419
+ ```
420
+
421
+ **If no research:** Gather requirements through conversation. Ask: "What are the main things users need to do with [new features]?" Clarify, probe for related capabilities, group into categories.
422
+
423
+ **Scope each category** via AskUserQuestion (multiSelect: true, header max 12 chars):
424
+ - "[Feature 1]" — [brief description]
425
+ - "[Feature 2]" — [brief description]
426
+ - "None for this milestone" — Defer entire category
427
+
428
+ Track: Selected → this milestone. Unselected table stakes → future. Unselected differentiators → out of scope.
429
+
430
+ **Identify gaps** via AskUserQuestion:
431
+ - "No, research covered it" — Proceed
432
+ - "Yes, let me add some" — Capture additions
433
+
434
+ **Generate REQUIREMENTS.md:**
435
+ - v1 Requirements grouped by category (checkboxes, REQ-IDs)
436
+ - Future Requirements (deferred)
437
+ - Out of Scope (explicit exclusions with reasoning)
438
+ - Traceability section (empty, filled by roadmap)
439
+
440
+ **REQ-ID format:** `[CATEGORY]-[NUMBER]` (AUTH-01, NOTIF-02). Continue numbering from existing.
441
+
442
+ **Requirement quality criteria:**
443
+
444
+ Good requirements are:
445
+ - **Specific and testable:** "User can reset password via email link" (not "Handle password reset")
446
+ - **User-centric:** "User can X" (not "System does Y")
447
+ - **Atomic:** One capability per requirement (not "User can login and manage profile")
448
+ - **Independent:** Minimal dependencies on other requirements
449
+
450
+ Present FULL requirements list for confirmation:
451
+
452
+ ```
453
+ ## Milestone v[X.Y] Requirements
454
+
455
+ ### [Category 1]
456
+ - [ ] **CAT1-01**: User can do X
457
+ - [ ] **CAT1-02**: User can do Y
458
+
459
+ ### [Category 2]
460
+ - [ ] **CAT2-01**: User can do Z
461
+
462
+ Does this capture what you're building? (yes / adjust)
463
+ ```
464
+
465
+ If "adjust": Return to scoping.
466
+
467
+ **Commit requirements:**
468
+ ```bash
469
+ node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" commit "docs: define milestone v[X.Y] requirements" --files .planning/REQUIREMENTS.md
470
+ ```
471
+
472
+ **Update lock file state:**
473
+ ```bash
474
+ node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" lock-update --state="requirements_defined"
475
+ ```
476
+
477
+ ---
478
+
479
+ ## 10. Create Roadmap (with Stuck Detection - GSD-2 Pattern)
480
+
481
+ ```
482
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
483
+ EZ ► CREATING ROADMAP
484
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
485
+
486
+ ◆ Spawning roadmapper...
487
+ ```
488
+
489
+ **Initialize stuck detection:**
490
+
491
+ ```bash
492
+ # Start stuck watcher
493
+ node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" stuck-watch start \
494
+ --operation="roadmap-creation" \
495
+ --max-retries=1 \
496
+ --timeout=300
497
+ ```
498
+
499
+ **Starting phase number:** Read MILESTONES.md for last phase number. Continue from there (v1.0 ended at phase 5 → v1.1 starts at phase 6).
500
+
501
+ ```
502
+ Task(prompt="
503
+ <planning_context>
504
+ <files_to_read>
505
+ - .planning/PROJECT.md
506
+ - .planning/REQUIREMENTS.md
507
+ - .planning/research/SUMMARY.md (if exists)
508
+ - .planning/config.json
509
+ - .planning/MILESTONES.md
510
+ </files_to_read>
511
+ </planning_context>
512
+
513
+ <instructions>
514
+ Create roadmap for milestone v[X.Y]:
515
+ 1. Start phase numbering from [N]
516
+ 2. Derive phases from THIS MILESTONE's requirements only
517
+ 3. Map every requirement to exactly one phase
518
+ 4. Derive 2-5 success criteria per phase (observable user behaviors)
519
+ 5. Validate 100% coverage
520
+ 6. Write files immediately (ROADMAP.md, STATE.md, update REQUIREMENTS.md traceability)
521
+ 7. Return ROADMAP CREATED with summary
522
+
523
+ Write files first, then return.
524
+ </instructions>
525
+ ", subagent_type="ez-roadmapper", model="{roadmapper_model}", description="Create roadmap")
526
+ ```
527
+
528
+ **Handle return:**
529
+
530
+ **If `## ROADMAP BLOCKED`:**
531
+ 1. Log error type and location
532
+ 2. Retry ONCE with diagnostic context:
533
+ ```
534
+ Task(prompt="
535
+ <retry_context>
536
+ PREVIOUS ATTEMPT FAILED
537
+ Error Type: [error_type]
538
+ Error Location: [location]
539
+ Suggested Fix: [fix]
540
+
541
+ CONTEXT SNAPSHOT FOR DEBUGGING:
542
+ [snapshot of files read]
543
+
544
+ Please try again with this diagnostic information.
545
+ </retry_context>
546
+ ", subagent_type="ez-roadmapper", model="{roadmapper_model}", description="Create roadmap (retry)")
547
+ ```
548
+ 3. If fails again → STOP with exact failure report:
549
+ ```
550
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
551
+ EZ ► ROADMAP CREATION FAILED
552
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
553
+
554
+ Error Type: [type]
555
+ Error Location: [file:line]
556
+ Suggested Fix: [action]
557
+
558
+ Context Snapshot: .planning/logs/stuck-snapshot-[timestamp].json
559
+
560
+ Next Steps:
561
+ 1. Review context snapshot
562
+ 2. Fix [specific issue]
563
+ 3. Run: /ez:plan-milestone --retry
564
+ ```
565
+
566
+ **If `## ROADMAP CREATED`:** Read ROADMAP.md, present inline:
567
+
568
+ ```
569
+ ## Proposed Roadmap
570
+
571
+ **[N] phases** | **[X] requirements mapped** | All covered ✓
572
+
573
+ | # | Phase | Goal | Requirements | Success Criteria |
574
+ |---|-------|------|--------------|------------------|
575
+ | [N] | [Name] | [Goal] | [REQ-IDs] | [count] |
576
+
577
+ ### Phase Details
578
+
579
+ **Phase [N]: [Name]**
580
+ Goal: [goal]
581
+ Requirements: [REQ-IDs]
582
+ Success criteria:
583
+ 1. [criterion]
584
+ 2. [criterion]
585
+ ```
586
+
587
+ **Ask for approval** via AskUserQuestion:
588
+ - "Approve" — Commit and continue
589
+ - "Adjust phases" — Tell me what to change
590
+ - "Review full file" — Show raw ROADMAP.md
591
+
592
+ **If "Adjust":** Get notes, re-spawn roadmapper with revision context, loop until approved.
593
+ **If "Review":** Display raw ROADMAP.md, re-ask.
594
+
595
+ **Commit roadmap** (after approval):
596
+ ```bash
597
+ node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" commit "docs: create milestone v[X.Y] roadmap ([N] phases)" --files .planning/ROADMAP.md .planning/STATE.md .planning/REQUIREMENTS.md
598
+ ```
599
+
600
+ **Update lock file state:**
601
+ ```bash
602
+ node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" lock-update --state="roadmap_created"
603
+ ```
604
+
605
+ ---
606
+
607
+ ## 11. Release Lock File
608
+
609
+ **Milestone initialization complete:**
610
+
611
+ ```bash
612
+ node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" lock-release
613
+ ```
614
+
615
+ ---
616
+
617
+ ## 12. Post-Milestone Cost Report (GSD-2 Pattern)
618
+
619
+ **After all commits complete:**
620
+
621
+ ```bash
622
+ # Generate cost report
623
+ COST_REPORT=$(node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" cost-report \
624
+ --milestone="v[X.Y]" \
625
+ --format=summary)
626
+ ```
627
+
628
+ **Display:**
629
+ ```
630
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
631
+ EZ ► MILESTONE INITIALIZATION COST
632
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
633
+
634
+ Milestone: v[X.Y]
635
+ Phases: [N]
636
+ Requirements: [X]
637
+
638
+ Initialization Cost:
639
+ - Research: $[X.XX] ([N] tokens)
640
+ - Requirements: $[X.XX] ([N] tokens)
641
+ - Roadmap: $[X.XX] ([N] tokens)
642
+ - Total: $[X.XX] ([N] tokens)
643
+
644
+ Budget Remaining: $[XX.XX] of $[XX.XX]
645
+
646
+ Projected Total (based on similar milestones): $[XX.XX]
647
+
648
+ View detailed report: /ez:cost --milestone=v[X.Y]
649
+ ```
650
+
651
+ ---
652
+
653
+ ## 13. Done
654
+
655
+ ```
656
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
657
+ EZ ► MILESTONE INITIALIZED ✓
658
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
659
+
660
+ **Milestone v[X.Y]: [Name]**
661
+
662
+ | Artifact | Location |
663
+ |----------------|-----------------------------|
664
+ | Project | `.planning/PROJECT.md` |
665
+ | Research | `.planning/research/` |
666
+ | Requirements | `.planning/REQUIREMENTS.md` |
667
+ | Roadmap | `.planning/ROADMAP.md` |
668
+ | Metrics | `.planning/metrics.json` |
669
+
670
+ **[N] phases** | **[X] requirements** | Ready to build ✓
671
+
672
+ ## ▶ Next Up
673
+
674
+ **Phase [N]: [Phase Name]** — [Goal]
675
+
676
+ `/ez:discuss-phase [N]` — gather context and clarify approach
677
+
678
+ <sub>`/clear` first → fresh context window</sub>
679
+
680
+ Also: `/ez:plan-phase [N]` — skip discussion, plan directly
681
+ ```
682
+
683
+ </process>
684
+
685
+ <success_criteria>
686
+ - [ ] Pre-flight health check passed (all systems go)
687
+ - [ ] Cost tracking initialized (metrics.json created)
688
+ - [ ] Lock file created and maintained throughout
689
+ - [ ] PROJECT.md updated with Current Milestone section
690
+ - [ ] STATE.md reset for new milestone
691
+ - [ ] MILESTONE-CONTEXT.md consumed and deleted (if existed)
692
+ - [ ] Research completed (if selected) — 4 parallel agents, milestone-aware, fresh context
693
+ - [ ] Requirements gathered and scoped per category
694
+ - [ ] REQUIREMENTS.md created with REQ-IDs
695
+ - [ ] ez-roadmapper spawned with phase numbering context
696
+ - [ ] Stuck detection active during roadmap creation
697
+ - [ ] Roadmap files written immediately (not draft)
698
+ - [ ] User feedback incorporated (if any)
699
+ - [ ] ROADMAP.md phases continue from previous milestone
700
+ - [ ] All commits made (if planning docs committed)
701
+ - [ ] Lock file released on completion
702
+ - [ ] Cost report displayed
703
+ - [ ] User knows next step: `/ez:discuss-phase [N]`
704
+
705
+ **Atomic commits:** Each phase commits its artifacts immediately.
706
+
707
+ **GSD-2 Reliability:**
708
+ - ✅ Crash recovery via lock files
709
+ - ✅ Cost transparency via metrics.json
710
+ - ✅ Fresh context per researcher/agent
711
+ - ✅ Stuck detection with diagnostics
712
+ - ✅ Health check pre-flight validation
713
+ </success_criteria>