@howlil/ez-agents 3.5.0 → 4.0.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 (382) hide show
  1. package/README.md +735 -537
  2. package/agents/ez-architect-agent.md +267 -0
  3. package/agents/ez-backend-agent.md +303 -0
  4. package/agents/ez-chief-strategist.md +271 -0
  5. package/agents/ez-codebase-mapper.md +770 -770
  6. package/agents/ez-context-manager.md +319 -0
  7. package/agents/ez-debugger.md +1255 -1255
  8. package/agents/ez-design-expert.md +347 -0
  9. package/agents/ez-devops-agent.md +331 -0
  10. package/agents/ez-executor.md +487 -487
  11. package/agents/ez-frontend-agent.md +322 -0
  12. package/agents/ez-phase-researcher.md +553 -553
  13. package/agents/ez-planner.md +1307 -1307
  14. package/agents/ez-product-engineer.md +435 -0
  15. package/agents/ez-project-researcher.md +629 -629
  16. package/agents/ez-qa-agent.md +320 -0
  17. package/agents/ez-release-agent.md +333 -333
  18. package/agents/ez-requirements-agent.md +377 -377
  19. package/agents/ez-roadmapper.md +650 -650
  20. package/agents/ez-technical-writer.md +551 -0
  21. package/agents/ez-ux-expert.md +393 -0
  22. package/agents/ez-verifier.md +579 -579
  23. package/bin/guards/autonomy-guard.cjs +346 -0
  24. package/bin/guards/context-budget-guard.cjs +278 -0
  25. package/bin/guards/hallucination-guard.cjs +380 -0
  26. package/bin/guards/hidden-state-guard.cjs +182 -0
  27. package/bin/guards/team-overhead-guard.cjs +266 -0
  28. package/bin/guards/tool-sprawl-guard.cjs +271 -0
  29. package/bin/lib/analytics/analytics-collector.cjs +86 -0
  30. package/bin/lib/analytics/analytics-reporter.cjs +130 -0
  31. package/bin/lib/analytics/cohort-analyzer.cjs +138 -0
  32. package/bin/lib/analytics/funnel-analyzer.cjs +147 -0
  33. package/bin/lib/analytics/nps-tracker.cjs +147 -0
  34. package/bin/lib/archetype-detector.cjs +289 -0
  35. package/bin/lib/assistant-adapter.cjs +361 -0
  36. package/bin/lib/audit-exec.cjs +175 -0
  37. package/bin/lib/auth.cjs +176 -0
  38. package/bin/lib/backup-service.cjs +422 -0
  39. package/bin/lib/bdd-validator.cjs +622 -0
  40. package/bin/lib/business-flow-mapper.cjs +429 -0
  41. package/bin/lib/circuit-breaker.cjs +276 -0
  42. package/bin/lib/code-complexity-analyzer.cjs +360 -0
  43. package/bin/lib/codebase-analyzer.cjs +241 -0
  44. package/bin/lib/commands.cjs +691 -0
  45. package/bin/lib/config.cjs +236 -0
  46. package/bin/lib/constraint-extractor.cjs +526 -0
  47. package/bin/lib/content-scanner.cjs +238 -0
  48. package/bin/lib/context-cache.cjs +154 -0
  49. package/bin/lib/context-compressor.cjs +102 -0
  50. package/bin/lib/context-deduplicator.cjs +105 -0
  51. package/bin/lib/context-errors.cjs +78 -0
  52. package/bin/lib/context-manager.cjs +338 -0
  53. package/bin/lib/context-metadata-tracker.cjs +140 -0
  54. package/bin/lib/context-relevance-scorer.cjs +99 -0
  55. package/bin/lib/core.cjs +507 -0
  56. package/bin/lib/cost-alerts.cjs +174 -0
  57. package/bin/lib/cost-tracker.cjs +275 -0
  58. package/bin/lib/crash-recovery.cjs +220 -0
  59. package/bin/lib/dependency-graph.cjs +319 -0
  60. package/bin/lib/deploy/deploy-audit-log.cjs +76 -0
  61. package/bin/lib/deploy/deploy-detector.cjs +69 -0
  62. package/bin/lib/deploy/deploy-env-manager.cjs +109 -0
  63. package/bin/lib/deploy/deploy-health-check.cjs +88 -0
  64. package/bin/lib/deploy/deploy-pre-flight.cjs +57 -0
  65. package/bin/lib/deploy/deploy-rollback.cjs +72 -0
  66. package/bin/lib/deploy/deploy-runner.cjs +97 -0
  67. package/bin/lib/deploy/deploy-status.cjs +74 -0
  68. package/bin/lib/discussion-synthesizer.cjs +439 -0
  69. package/bin/lib/error-cache.cjs +114 -0
  70. package/bin/lib/error-registry.cjs +177 -0
  71. package/bin/lib/file-access.cjs +207 -0
  72. package/bin/lib/file-lock.cjs +236 -0
  73. package/bin/lib/finops/budget-enforcer.cjs +126 -0
  74. package/bin/lib/finops/cost-reporter.cjs +132 -0
  75. package/bin/lib/finops/finops-analyzer.cjs +112 -0
  76. package/bin/lib/finops/spot-manager.cjs +118 -0
  77. package/bin/lib/framework-detector.cjs +396 -0
  78. package/bin/lib/frontmatter.cjs +313 -0
  79. package/bin/lib/fs-utils.cjs +153 -0
  80. package/bin/lib/gate-executor.cjs +272 -0
  81. package/bin/lib/gates/README.md +374 -0
  82. package/bin/lib/gates/gate-01-requirement.cjs +303 -0
  83. package/bin/lib/gates/gate-02-architecture.cjs +555 -0
  84. package/bin/lib/gates/gate-03-code.cjs +635 -0
  85. package/bin/lib/gates/gate-04-security.cjs +829 -0
  86. package/bin/lib/git-errors.cjs +83 -0
  87. package/bin/lib/git-utils.cjs +321 -0
  88. package/bin/lib/git-workflow-engine.cjs +1157 -0
  89. package/bin/lib/health-check.cjs +227 -0
  90. package/bin/lib/index.cjs +279 -0
  91. package/bin/lib/init.cjs +725 -0
  92. package/bin/lib/lock-logger.cjs +194 -0
  93. package/bin/lib/lock-state.cjs +263 -0
  94. package/bin/lib/lockfile-validator.cjs +227 -0
  95. package/bin/lib/log-rotation.cjs +71 -0
  96. package/bin/lib/logger.cjs +125 -0
  97. package/bin/lib/memory-compression.cjs +256 -0
  98. package/bin/lib/milestone.cjs +247 -0
  99. package/bin/lib/model-provider.cjs +241 -0
  100. package/bin/lib/package-manager-detector.cjs +203 -0
  101. package/bin/lib/package-manager-executor.cjs +385 -0
  102. package/bin/lib/package-manager-service.cjs +216 -0
  103. package/bin/lib/perf/api-monitor.cjs +88 -0
  104. package/bin/lib/perf/db-optimizer.cjs +78 -0
  105. package/bin/lib/perf/frontend-performance.cjs +56 -0
  106. package/bin/lib/perf/perf-analyzer.cjs +77 -0
  107. package/bin/lib/perf/perf-baseline.cjs +102 -0
  108. package/bin/lib/perf/perf-reporter.cjs +117 -0
  109. package/bin/lib/perf/regression-detector.cjs +92 -0
  110. package/bin/lib/phase.cjs +963 -0
  111. package/bin/lib/planning-write.cjs +123 -0
  112. package/bin/lib/project-reporter.cjs +565 -0
  113. package/bin/lib/quality-gate.cjs +332 -0
  114. package/bin/lib/quality-metrics.cjs +324 -0
  115. package/bin/lib/recovery-manager.cjs +98 -0
  116. package/bin/lib/release-validator.cjs +617 -0
  117. package/bin/lib/retry.cjs +119 -0
  118. package/bin/lib/roadmap.cjs +309 -0
  119. package/bin/lib/safe-exec.cjs +173 -0
  120. package/bin/lib/safe-path.cjs +130 -0
  121. package/bin/lib/security-errors.cjs +62 -0
  122. package/bin/lib/session-chain.cjs +304 -0
  123. package/bin/lib/session-errors.cjs +81 -0
  124. package/bin/lib/session-export.cjs +251 -0
  125. package/bin/lib/session-import.cjs +262 -0
  126. package/bin/lib/session-manager.cjs +280 -0
  127. package/bin/lib/skill-context.cjs +148 -0
  128. package/bin/lib/skill-matcher.cjs +236 -0
  129. package/bin/lib/skill-registry.cjs +360 -0
  130. package/bin/lib/skill-resolver.cjs +449 -0
  131. package/bin/lib/skill-triggers.cjs +90 -0
  132. package/bin/lib/skill-validator.cjs +270 -0
  133. package/bin/lib/skill-versioning.cjs +355 -0
  134. package/bin/lib/stack-detector.cjs +399 -0
  135. package/bin/lib/state.cjs +736 -0
  136. package/bin/lib/tech-debt-analyzer.cjs +309 -0
  137. package/bin/lib/temp-file.cjs +239 -0
  138. package/bin/lib/template.cjs +223 -0
  139. package/bin/lib/test-file-lock.cjs +112 -0
  140. package/bin/lib/test-graceful.cjs +93 -0
  141. package/bin/lib/test-logger.cjs +60 -0
  142. package/bin/lib/test-safe-exec.cjs +38 -0
  143. package/bin/lib/test-safe-path.cjs +33 -0
  144. package/bin/lib/test-temp-file.cjs +125 -0
  145. package/bin/lib/tier-manager.cjs +428 -0
  146. package/bin/lib/timeout-exec.cjs +63 -0
  147. package/bin/lib/tradeoff-analyzer.cjs +284 -0
  148. package/bin/lib/url-fetch.cjs +170 -0
  149. package/bin/lib/verify.cjs +863 -0
  150. package/bin/update.js +217 -214
  151. package/commands/deploy.cjs +53 -0
  152. package/commands/ez/add-tests.md +41 -41
  153. package/commands/ez/audit-milestone.md +36 -36
  154. package/commands/ez/complete-milestone.md +136 -136
  155. package/commands/ez/discuss-phase.md +90 -90
  156. package/commands/ez/execute-phase.md +52 -52
  157. package/commands/ez/help.md +22 -22
  158. package/commands/ez/map-codebase.md +71 -71
  159. package/commands/ez/new-milestone.md +44 -44
  160. package/commands/ez/new-project.md +51 -42
  161. package/commands/ez/plan-phase.md +53 -53
  162. package/commands/ez/progress.md +36 -36
  163. package/commands/ez/quick.md +45 -45
  164. package/commands/ez/resume-work.md +40 -40
  165. package/commands/ez/run-phase.md +580 -0
  166. package/commands/ez/settings.md +36 -36
  167. package/commands/ez/update.md +37 -37
  168. package/commands/ez/verify-work.md +402 -38
  169. package/commands/health-check.cjs +44 -0
  170. package/commands/rollback.cjs +47 -0
  171. package/ez-agents/bin/ez-tools.cjs +599 -2
  172. package/ez-agents/bin/guards/autonomy-guard.cjs +346 -0
  173. package/ez-agents/bin/guards/context-budget-guard.cjs +247 -0
  174. package/ez-agents/bin/guards/hallucination-guard.cjs +271 -0
  175. package/ez-agents/bin/guards/hidden-state-guard.cjs +182 -0
  176. package/ez-agents/bin/guards/team-overhead-guard.cjs +266 -0
  177. package/ez-agents/bin/guards/tool-sprawl-guard.cjs +271 -0
  178. package/ez-agents/bin/lib/analytics/analytics-collector.cjs +86 -0
  179. package/ez-agents/bin/lib/analytics/analytics-reporter.cjs +130 -0
  180. package/ez-agents/bin/lib/analytics/cohort-analyzer.cjs +138 -0
  181. package/ez-agents/bin/lib/analytics/funnel-analyzer.cjs +147 -0
  182. package/ez-agents/bin/lib/analytics/nps-tracker.cjs +147 -0
  183. package/ez-agents/bin/lib/archetype-detector.cjs +289 -0
  184. package/ez-agents/bin/lib/audit-exec.cjs +166 -167
  185. package/ez-agents/bin/lib/auth.cjs +176 -176
  186. package/ez-agents/bin/lib/backup-service.cjs +422 -0
  187. package/ez-agents/bin/lib/bdd-validator.cjs +622 -622
  188. package/ez-agents/bin/lib/business-flow-mapper.cjs +429 -0
  189. package/ez-agents/bin/lib/code-complexity-analyzer.cjs +360 -0
  190. package/ez-agents/bin/lib/codebase-analyzer.cjs +241 -0
  191. package/ez-agents/bin/lib/commands.cjs +685 -685
  192. package/ez-agents/bin/lib/config.cjs +41 -1
  193. package/ez-agents/bin/lib/constraint-extractor.cjs +526 -0
  194. package/ez-agents/bin/lib/content-scanner.cjs +238 -238
  195. package/ez-agents/bin/lib/context-cache.cjs +154 -154
  196. package/ez-agents/bin/lib/context-errors.cjs +71 -71
  197. package/ez-agents/bin/lib/context-manager.cjs +220 -220
  198. package/ez-agents/bin/lib/core.cjs +507 -512
  199. package/ez-agents/bin/lib/cost-tracker.cjs +243 -0
  200. package/ez-agents/bin/lib/crash-recovery.cjs +172 -0
  201. package/ez-agents/bin/lib/dependency-graph.cjs +319 -0
  202. package/ez-agents/bin/lib/deploy/deploy-audit-log.cjs +76 -0
  203. package/ez-agents/bin/lib/deploy/deploy-detector.cjs +69 -0
  204. package/ez-agents/bin/lib/deploy/deploy-env-manager.cjs +109 -0
  205. package/ez-agents/bin/lib/deploy/deploy-health-check.cjs +88 -0
  206. package/ez-agents/bin/lib/deploy/deploy-pre-flight.cjs +57 -0
  207. package/ez-agents/bin/lib/deploy/deploy-rollback.cjs +72 -0
  208. package/ez-agents/bin/lib/deploy/deploy-runner.cjs +97 -0
  209. package/ez-agents/bin/lib/deploy/deploy-status.cjs +74 -0
  210. package/ez-agents/bin/lib/file-access.cjs +207 -207
  211. package/ez-agents/bin/lib/finops/budget-enforcer.cjs +126 -0
  212. package/ez-agents/bin/lib/finops/cost-reporter.cjs +132 -0
  213. package/ez-agents/bin/lib/finops/finops-analyzer.cjs +112 -0
  214. package/ez-agents/bin/lib/finops/spot-manager.cjs +118 -0
  215. package/ez-agents/bin/lib/framework-detector.cjs +396 -0
  216. package/ez-agents/bin/lib/frontmatter.cjs +3 -1
  217. package/ez-agents/bin/lib/gates/README.md +374 -0
  218. package/ez-agents/bin/lib/gates/gate-01-requirement.cjs +303 -0
  219. package/ez-agents/bin/lib/gates/gate-02-architecture.cjs +555 -0
  220. package/ez-agents/bin/lib/gates/gate-03-code.cjs +635 -0
  221. package/ez-agents/bin/lib/gates/gate-04-security.cjs +829 -0
  222. package/ez-agents/bin/lib/git-errors.cjs +83 -83
  223. package/ez-agents/bin/lib/git-utils.cjs +321 -321
  224. package/ez-agents/bin/lib/git-workflow-engine.cjs +1157 -1157
  225. package/ez-agents/bin/lib/health-check.cjs +162 -162
  226. package/ez-agents/bin/lib/index.cjs +2 -8
  227. package/ez-agents/bin/lib/init.cjs +0 -2
  228. package/ez-agents/bin/lib/lockfile-validator.cjs +227 -227
  229. package/ez-agents/bin/lib/log-rotation.cjs +71 -0
  230. package/ez-agents/bin/lib/logger.cjs +22 -47
  231. package/ez-agents/bin/lib/memory-compression.cjs +256 -256
  232. package/ez-agents/bin/lib/package-manager-detector.cjs +203 -203
  233. package/ez-agents/bin/lib/package-manager-executor.cjs +385 -385
  234. package/ez-agents/bin/lib/package-manager-service.cjs +216 -216
  235. package/ez-agents/bin/lib/perf/api-monitor.cjs +88 -0
  236. package/ez-agents/bin/lib/perf/db-optimizer.cjs +78 -0
  237. package/ez-agents/bin/lib/perf/frontend-performance.cjs +56 -0
  238. package/ez-agents/bin/lib/perf/perf-analyzer.cjs +77 -0
  239. package/ez-agents/bin/lib/perf/perf-baseline.cjs +102 -0
  240. package/ez-agents/bin/lib/perf/perf-reporter.cjs +117 -0
  241. package/ez-agents/bin/lib/perf/regression-detector.cjs +92 -0
  242. package/ez-agents/bin/lib/project-reporter.cjs +502 -0
  243. package/ez-agents/bin/lib/quality-gate.cjs +332 -0
  244. package/ez-agents/bin/lib/recovery-manager.cjs +98 -0
  245. package/ez-agents/bin/lib/release-validator.cjs +617 -614
  246. package/ez-agents/bin/lib/security-errors.cjs +62 -0
  247. package/ez-agents/bin/lib/session-chain.cjs +304 -304
  248. package/ez-agents/bin/lib/session-errors.cjs +81 -81
  249. package/ez-agents/bin/lib/session-export.cjs +251 -251
  250. package/ez-agents/bin/lib/session-import.cjs +262 -262
  251. package/ez-agents/bin/lib/session-manager.cjs +280 -280
  252. package/ez-agents/bin/lib/skill-context.cjs +148 -0
  253. package/ez-agents/bin/lib/skill-matcher.cjs +236 -0
  254. package/ez-agents/bin/lib/skill-registry.cjs +341 -0
  255. package/ez-agents/bin/lib/skill-resolver.cjs +449 -0
  256. package/ez-agents/bin/lib/skill-triggers.cjs +90 -0
  257. package/ez-agents/bin/lib/skill-validator.cjs +270 -0
  258. package/ez-agents/bin/lib/skill-versioning.cjs +355 -0
  259. package/ez-agents/bin/lib/stack-detector.cjs +399 -0
  260. package/ez-agents/bin/lib/tech-debt-analyzer.cjs +309 -0
  261. package/ez-agents/bin/lib/tier-manager.cjs +428 -428
  262. package/ez-agents/bin/lib/tradeoff-analyzer.cjs +284 -0
  263. package/ez-agents/bin/lib/url-fetch.cjs +170 -170
  264. package/ez-agents/bin/lib/verify.cjs +863 -863
  265. package/ez-agents/references/decimal-phase-calculation.md +65 -65
  266. package/ez-agents/references/git-integration.md +248 -248
  267. package/ez-agents/references/git-planning-commit.md +38 -38
  268. package/ez-agents/references/metrics-schema.md +118 -118
  269. package/ez-agents/references/model-profile-resolution.md +34 -34
  270. package/ez-agents/references/model-profiles.md +93 -93
  271. package/ez-agents/references/phase-argument-parsing.md +61 -61
  272. package/ez-agents/references/planning-config.md +340 -340
  273. package/ez-agents/references/tier-strategy.md +103 -103
  274. package/ez-agents/references/ui-brand.md +160 -160
  275. package/ez-agents/references/verification-patterns.md +612 -612
  276. package/ez-agents/templates/DEBUG.md +164 -164
  277. package/ez-agents/templates/UAT.md +247 -247
  278. package/ez-agents/templates/agent-output-format.md +404 -0
  279. package/ez-agents/templates/bdd-feature.md +173 -173
  280. package/ez-agents/templates/codebase/architecture.md +255 -255
  281. package/ez-agents/templates/codebase/structure.md +285 -285
  282. package/ez-agents/templates/copilot-instructions.md +7 -7
  283. package/ez-agents/templates/debug-subagent-prompt.md +91 -91
  284. package/ez-agents/templates/discovery.md +146 -146
  285. package/ez-agents/templates/discussion.md +68 -68
  286. package/ez-agents/templates/handoff-protocol.md +294 -0
  287. package/ez-agents/templates/incident-runbook.md +205 -205
  288. package/ez-agents/templates/mode-workflow-templates.md +301 -0
  289. package/ez-agents/templates/phase-prompt.md +610 -610
  290. package/ez-agents/templates/planner-subagent-prompt.md +117 -117
  291. package/ez-agents/templates/project.md +184 -184
  292. package/ez-agents/templates/release-checklist.md +136 -133
  293. package/ez-agents/templates/research.md +552 -552
  294. package/ez-agents/templates/rollback-plan.md +201 -201
  295. package/ez-agents/templates/security-user-setup.md +244 -0
  296. package/ez-agents/templates/skill-validation-rules.md +476 -0
  297. package/ez-agents/templates/state.md +180 -176
  298. package/ez-agents/templates/summary-complex.md +59 -59
  299. package/ez-agents/tests/gates/gate-01-02.test.cjs +812 -0
  300. package/ez-agents/tests/gates/gate-03-04.test.cjs +762 -0
  301. package/ez-agents/tests/gates/gate-05-validator.test.cjs +145 -0
  302. package/ez-agents/tests/gates/gate-06-docs-validator.test.cjs +244 -0
  303. package/ez-agents/tests/gates/gate-07-release-validator.test.cjs +219 -0
  304. package/ez-agents/tests/guards/context-budget-guard.test.cjs +145 -0
  305. package/ez-agents/tests/guards/edge-case-guards.test.cjs +238 -0
  306. package/ez-agents/tests/guards/hallucination-guard.test.cjs +124 -0
  307. package/ez-agents/workflows/audit-milestone.md +1 -1
  308. package/ez-agents/workflows/autonomous.md +844 -844
  309. package/ez-agents/workflows/complete-milestone.md +1 -1
  310. package/ez-agents/workflows/discuss-phase.md +1 -1
  311. package/ez-agents/workflows/execute-phase.md +124 -3
  312. package/ez-agents/workflows/help.md +42 -181
  313. package/ez-agents/workflows/hotfix.md +291 -291
  314. package/ez-agents/workflows/new-milestone.md +713 -713
  315. package/ez-agents/workflows/new-project.md +1089 -1107
  316. package/ez-agents/workflows/plan-phase.md +0 -40
  317. package/ez-agents/workflows/release.md +253 -253
  318. package/ez-agents/workflows/resume-session.md +215 -215
  319. package/ez-agents/workflows/run-phase.md +531 -0
  320. package/ez-agents/workflows/settings.md +2 -35
  321. package/hooks/dist/ez-check-update.js +81 -81
  322. package/hooks/dist/ez-context-monitor.js +148 -141
  323. package/hooks/dist/ez-statusline.js +115 -115
  324. package/package.json +78 -71
  325. package/scripts/fix-qwen-installation.js +144 -144
  326. package/agents/ez-integration-checker.md +0 -443
  327. package/agents/ez-nyquist-auditor.md +0 -176
  328. package/agents/ez-observer-agent.md +0 -260
  329. package/agents/ez-plan-checker.md +0 -706
  330. package/agents/ez-research-synthesizer.md +0 -247
  331. package/agents/ez-scrum-master-agent.md +0 -242
  332. package/agents/ez-tech-lead-agent.md +0 -267
  333. package/agents/ez-ui-auditor.md +0 -439
  334. package/agents/ez-ui-checker.md +0 -300
  335. package/agents/ez-ui-researcher.md +0 -353
  336. package/commands/ez/add-phase.md +0 -43
  337. package/commands/ez/add-todo.md +0 -47
  338. package/commands/ez/arch-review.md +0 -102
  339. package/commands/ez/auth.md +0 -87
  340. package/commands/ez/autonomous.md +0 -41
  341. package/commands/ez/check-todos.md +0 -45
  342. package/commands/ez/cleanup.md +0 -18
  343. package/commands/ez/debug.md +0 -168
  344. package/commands/ez/export-session.md +0 -79
  345. package/commands/ez/gather-requirements.md +0 -117
  346. package/commands/ez/git-workflow.md +0 -72
  347. package/commands/ez/health.md +0 -22
  348. package/commands/ez/hotfix.md +0 -120
  349. package/commands/ez/import-session.md +0 -82
  350. package/commands/ez/insert-phase.md +0 -32
  351. package/commands/ez/join-discord.md +0 -18
  352. package/commands/ez/list-phase-assumptions.md +0 -46
  353. package/commands/ez/list-sessions.md +0 -96
  354. package/commands/ez/package-manager.md +0 -316
  355. package/commands/ez/pause-work.md +0 -38
  356. package/commands/ez/plan-milestone-gaps.md +0 -34
  357. package/commands/ez/preflight.md +0 -79
  358. package/commands/ez/reapply-patches.md +0 -124
  359. package/commands/ez/release.md +0 -153
  360. package/commands/ez/remove-phase.md +0 -31
  361. package/commands/ez/research-phase.md +0 -190
  362. package/commands/ez/resume.md +0 -107
  363. package/commands/ez/set-profile.md +0 -34
  364. package/commands/ez/standup.md +0 -85
  365. package/commands/ez/stats.md +0 -18
  366. package/commands/ez/ui-phase.md +0 -34
  367. package/commands/ez/ui-review.md +0 -32
  368. package/commands/ez/validate-phase.md +0 -35
  369. package/ez-agents/bin/lib/metrics-tracker.cjs +0 -406
  370. package/ez-agents/templates/UI-SPEC.md +0 -100
  371. package/ez-agents/templates/VALIDATION.md +0 -76
  372. package/ez-agents/templates/context.md +0 -352
  373. package/ez-agents/templates/verification-report.md +0 -322
  374. package/ez-agents/workflows/arch-review.md +0 -54
  375. package/ez-agents/workflows/export-session.md +0 -255
  376. package/ez-agents/workflows/gather-requirements.md +0 -206
  377. package/ez-agents/workflows/import-session.md +0 -303
  378. package/ez-agents/workflows/research-phase.md +0 -74
  379. package/ez-agents/workflows/standup.md +0 -64
  380. package/ez-agents/workflows/ui-phase.md +0 -290
  381. package/ez-agents/workflows/ui-review.md +0 -157
  382. package/ez-agents/workflows/validate-phase.md +0 -167
@@ -1,1107 +1,1089 @@
1
- <purpose>
2
- Initialize a new project through unified flow: questioning, research (optional), requirements, roadmap. This is the most leveraged moment in any project — deep questioning here means better plans, better execution, better outcomes. One workflow takes you from idea to ready-for-planning.
3
-
4
- **GSD-2 Enhanced:** Includes health check, cost tracking, crash recovery, fresh context, and stuck detection for production-grade reliability.
5
- </purpose>
6
-
7
- <required_reading>
8
- Read all files referenced by the invoking prompt's execution_context before starting.
9
- </required_reading>
10
-
11
- <auto_mode>
12
- ## Auto Mode Detection
13
-
14
- Check if `--auto` flag is present in $ARGUMENTS.
15
-
16
- **If auto mode:**
17
- - Skip brownfield mapping offer (assume greenfield)
18
- - Skip deep questioning (extract context from provided document)
19
- - Config: YOLO mode is implicit (skip that question), but ask granularity/git/agents FIRST (Step 2a)
20
- - After config: run Steps 6-9 automatically with smart defaults:
21
- - Research: Always yes
22
- - Requirements: Include all table stakes + features from provided document
23
- - Requirements approval: Auto-approve
24
- - Roadmap approval: Auto-approve
25
-
26
- **Document requirement:**
27
- Auto mode requires an idea document — either:
28
- - File reference: `/ez:new-project --auto @prd.md`
29
- - Pasted/written text in the prompt
30
-
31
- If no document content provided, error:
32
-
33
- ```
34
- Error: --auto requires an idea document.
35
-
36
- Usage:
37
- /ez:new-project --auto @your-idea.md
38
- /ez:new-project --auto [paste or write your idea here]
39
-
40
- The document should describe what you want to build.
41
- ```
42
- </auto_mode>
43
-
44
- <process>
45
-
46
- ## 0. Pre-Flight Health Check (GSD-2 Pattern)
47
-
48
- **MANDATORY FIRST STEP — Validate environment before ANY operation:**
49
-
50
- ```bash
51
- # Run health check
52
- HEALTH=$(node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" doctor --json)
53
- ```
54
-
55
- **Check:**
56
- - ✅ Node.js version >= 16.7.0
57
- - ✅ AI tools available (Claude, OpenCode, etc.)
58
- - ✅ Config valid (`.planning/config.json` or create default)
59
- - ✅ Git repo initialized (or auto-init)
60
- - ✅ API keys configured
61
-
62
- **If any check fails:**
63
- ```
64
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
65
- EZ ► HEALTH CHECK FAILED
66
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
67
-
68
- ❌ [Failed check description]
69
-
70
- Fix:
71
- [suggested command]
72
-
73
- Example:
74
- $ [example command]
75
-
76
- Resolve before continuing with project initialization.
77
- ```
78
-
79
- **Abort project init until resolved.**
80
-
81
- ---
82
-
83
- ## 0a. Gather Initial Context (CONTEXT-01, CONTEXT-02)
84
-
85
- **Initialize ContextManager for context gathering:**
86
-
87
- ```javascript
88
- const ContextManager = require('../bin/lib/context-manager.cjs');
89
- const contextManager = new ContextManager(process.cwd());
90
- ```
91
-
92
- **Request initial project context:**
93
-
94
- ```javascript
95
- const context = await contextManager.requestContext({
96
- files: ['README.md', 'package.json'],
97
- urls: []
98
- });
99
- ```
100
-
101
- **Agent can request additional context using:**
102
- - `ez-tools context read <pattern>` — Read local files
103
- - `ez-tools context fetch <url>` — Fetch URL content (requires user confirmation)
104
-
105
- **Update STATE.md with context sources:**
106
-
107
- ```javascript
108
- await contextManager.updateStateMd();
109
- ```
110
-
111
- **Continue to Setup (Step 1) with gathered context.**
112
-
113
- ---
114
-
115
- ## 1. Setup with Lock File (GSD-2 Pattern)
116
-
117
- **Execute initialization with crash recovery:**
118
-
119
- ```bash
120
- INIT=$(node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" init new-project)
121
- if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
122
- ```
123
-
124
- Parse JSON for: `researcher_model`, `synthesizer_model`, `roadmapper_model`, `commit_docs`, `project_exists`, `has_codebase_map`, `planning_exists`, `has_existing_code`, `has_package_file`, `is_brownfield`, `needs_codebase_map`, `has_git`, `project_path`.
125
-
126
- **If `project_exists` is true:** Error — project already initialized. Use `/ez:progress`.
127
-
128
- **Create lock file for crash recovery:**
129
-
130
- ```bash
131
- # Create auto.lock
132
- node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" lock-create \
133
- --operation="new-project" \
134
- --project-path="$project_path"
135
- ```
136
-
137
- **Create `.planning/auto.lock`:**
138
- ```json
139
- {
140
- "pid": 12345,
141
- "operation": "new-project",
142
- "project_path": "/path/to/project",
143
- "started_at": "2026-03-18T12:00:00.000Z",
144
- "last_heartbeat": "2026-03-18T12:00:00.000Z",
145
- "state": "setup"
146
- }
147
- ```
148
-
149
- **If `has_git` is false:** Initialize git:
150
- ```bash
151
- git init
152
- node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" lock-update --state="git_initialized"
153
- ```
154
-
155
- ---
156
-
157
- ## 2. Brownfield Offer
158
-
159
- **If auto mode:** Skip to Step 4 (assume greenfield, synthesize PROJECT.md from provided document).
160
-
161
- **If `needs_codebase_map` is true** (from init — existing code detected but no codebase map):
162
-
163
- Use AskUserQuestion:
164
- - header: "Codebase"
165
- - question: "I detected existing code in this directory. Would you like to map the codebase first?"
166
- - options:
167
- - "Map codebase first" — Run /ez:map-codebase to understand existing architecture (Recommended)
168
- - "Skip mapping" — Proceed with project initialization
169
-
170
- **If "Map codebase first":**
171
- ```
172
- Run `/ez:map-codebase` first, then return to `/ez:new-project`
173
- ```
174
- Exit command.
175
-
176
- **If "Skip mapping" OR `needs_codebase_map` is false:** Continue to Step 3.
177
-
178
- **Update lock file state:**
179
- ```bash
180
- node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" lock-update --state="brownfield_check_complete"
181
- ```
182
-
183
- ---
184
-
185
- ## 2a. Auto Mode Config (auto mode only)
186
-
187
- **If auto mode:** Collect config settings upfront before processing the idea document.
188
-
189
- YOLO mode is implicit (auto = YOLO). Ask remaining config questions:
190
-
191
- **Round 1 — Core settings (3 questions, no Mode question):**
192
-
193
- ```
194
- AskUserQuestion([
195
- {
196
- header: "Granularity",
197
- question: "How finely should scope be sliced into phases?",
198
- multiSelect: false,
199
- options: [
200
- { label: "Coarse (Recommended)", description: "Fewer, broader phases (3-5 phases, 1-3 plans each)" },
201
- { label: "Standard", description: "Balanced phase size (5-8 phases, 3-5 plans each)" },
202
- { label: "Fine", description: "Many focused phases (8-12 phases, 5-10 plans each)" }
203
- ]
204
- },
205
- {
206
- header: "Execution",
207
- question: "Run plans in parallel?",
208
- multiSelect: false,
209
- options: [
210
- { label: "Parallel (Recommended)", description: "Independent plans run simultaneously" },
211
- { label: "Sequential", description: "One plan at a time" }
212
- ]
213
- },
214
- {
215
- header: "Git Tracking",
216
- question: "Commit planning docs to git?",
217
- multiSelect: false,
218
- options: [
219
- { label: "Yes (Recommended)", description: "Planning docs tracked in version control" },
220
- { label: "No", description: "Keep .planning/ local-only (add to .gitignore)" }
221
- ]
222
- }
223
- ])
224
- ```
225
-
226
- **Round 2 — Workflow agents (same as Step 5):**
227
-
228
- ```
229
- AskUserQuestion([
230
- {
231
- header: "Research",
232
- question: "Research before planning each phase? (adds tokens/time)",
233
- multiSelect: false,
234
- options: [
235
- { label: "Yes (Recommended)", description: "Investigate domain, find patterns, surface gotchas" },
236
- { label: "No", description: "Plan directly from requirements" }
237
- ]
238
- },
239
- {
240
- header: "Plan Check",
241
- question: "Verify plans will achieve their goals? (adds tokens/time)",
242
- multiSelect: false,
243
- options: [
244
- { label: "Yes (Recommended)", description: "Catch gaps before execution starts" },
245
- { label: "No", description: "Execute plans without verification" }
246
- ]
247
- },
248
- {
249
- header: "Verifier",
250
- question: "Verify work satisfies requirements after each phase? (adds tokens/time)",
251
- multiSelect: false,
252
- options: [
253
- { label: "Yes (Recommended)", description: "Confirm deliverables match phase goals" },
254
- { label: "No", description: "Trust execution, skip verification" }
255
- ]
256
- },
257
- {
258
- header: "AI Models",
259
- question: "Which AI models for planning agents?",
260
- multiSelect: false,
261
- options: [
262
- { label: "Balanced (Recommended)", description: "Sonnet for most agents — good quality/cost ratio" },
263
- { label: "Quality", description: "Opus for research/roadmap — higher cost, deeper analysis" },
264
- { label: "Budget", description: "Haiku where possible — fastest, lowest cost" }
265
- ]
266
- }
267
- ])
268
- ```
269
-
270
- Create `.planning/config.json` with mode set to "yolo":
271
-
272
- ```json
273
- {
274
- "mode": "yolo",
275
- "granularity": "[selected]",
276
- "parallelization": true|false,
277
- "commit_docs": true|false,
278
- "model_profile": "quality|balanced|budget",
279
- "workflow": {
280
- "research": true|false,
281
- "plan_check": true|false,
282
- "verifier": true|false,
283
- "nyquist_validation": depth !== "quick",
284
- "auto_advance": true
285
- }
286
- }
287
- ```
288
-
289
- **If commit_docs = No:** Add `.planning/` to `.gitignore`.
290
-
291
- **Commit config.json:**
292
-
293
- ```bash
294
- mkdir -p .planning
295
- node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" commit "chore: add project config" --files .planning/config.json
296
- ```
297
-
298
- **Persist auto-advance chain flag to config (survives context compaction):**
299
-
300
- ```bash
301
- node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" config-set workflow._auto_chain_active true
302
- ```
303
-
304
- **Update lock file state:**
305
- ```bash
306
- node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" lock-update --state="config_complete"
307
- ```
308
-
309
- Proceed to Step 4 (skip Steps 3 and 5).
310
-
311
- ---
312
-
313
- ## 3. Deep Questioning
314
-
315
- **If auto mode:** Skip (already handled in Step 2a). Extract project context from provided document instead and proceed to Step 4.
316
-
317
- **Display stage banner:**
318
-
319
- ```
320
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
321
- EZ ► QUESTIONING
322
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
323
- ```
324
-
325
- **Open the conversation:**
326
-
327
- Ask inline (freeform, NOT AskUserQuestion):
328
-
329
- "What do you want to build?"
330
-
331
- Wait for their response. This gives you the context needed to ask intelligent follow-up questions.
332
-
333
- **Follow the thread:**
334
-
335
- Based on what they said, ask follow-up questions that dig into their response. Use AskUserQuestion with options that probe what they mentioned — interpretations, clarifications, concrete examples.
336
-
337
- Keep following threads. Each answer opens new threads to explore. Ask about:
338
- - What excited them
339
- - What problem sparked this
340
- - What they mean by vague terms
341
- - What it would actually look like
342
- - What's already decided
343
-
344
- Consult `questioning.md` for techniques:
345
- - Challenge vagueness
346
- - Make abstract concrete
347
- - Surface assumptions
348
- - Find edges
349
- - Reveal motivation
350
-
351
- **Check context (background, not out loud):**
352
-
353
- As you go, mentally check the context checklist from `questioning.md`. If gaps remain, weave questions naturally. Don't suddenly switch to checklist mode.
354
-
355
- **Decision gate:**
356
-
357
- When you could write a clear PROJECT.md, use AskUserQuestion:
358
-
359
- - header: "Ready?"
360
- - question: "I think I understand what you're after. Ready to create PROJECT.md?"
361
- - options:
362
- - "Create PROJECT.md" Let's move forward
363
- - "Keep exploring" — I want to share more / ask me more
364
-
365
- If "Keep exploring" — ask what they want to add, or identify gaps and probe naturally.
366
-
367
- Loop until "Create PROJECT.md" selected.
368
-
369
- **Update lock file state:**
370
- ```bash
371
- node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" lock-update --state="questioning_complete"
372
- ```
373
-
374
- ---
375
-
376
- ## 4. Write PROJECT.md
377
-
378
- **If auto mode:** Synthesize from provided document. No "Ready?" gate was shown — proceed directly to commit.
379
-
380
- Synthesize all context into `.planning/PROJECT.md` using the template from `templates/project.md`.
381
-
382
- **For greenfield projects:**
383
-
384
- Initialize requirements as hypotheses:
385
-
386
- ```markdown
387
- ## Requirements
388
-
389
- ### Validated
390
-
391
- (None yet — ship to validate)
392
-
393
- ### Active
394
-
395
- - [ ] [Requirement 1]
396
- - [ ] [Requirement 2]
397
- - [ ] [Requirement 3]
398
-
399
- ### Out of Scope
400
-
401
- - [Exclusion 1] — [why]
402
- - [Exclusion 2] [why]
403
- ```
404
-
405
- All Active requirements are hypotheses until shipped and validated.
406
-
407
- **For brownfield projects (codebase map exists):**
408
-
409
- Infer Validated requirements from existing code:
410
-
411
- 1. Read `.planning/codebase/ARCHITECTURE.md` and `STACK.md`
412
- 2. Identify what the codebase already does
413
- 3. These become the initial Validated set
414
-
415
- ```markdown
416
- ## Requirements
417
-
418
- ### Validated
419
-
420
- - [Existing capability 1] — existing
421
- - ✓ [Existing capability 2] — existing
422
- - [Existing capability 3] — existing
423
-
424
- ### Active
425
-
426
- - [ ] [New requirement 1]
427
- - [ ] [New requirement 2]
428
-
429
- ### Out of Scope
430
-
431
- - [Exclusion 1] — [why]
432
- ```
433
-
434
- **Key Decisions:**
435
-
436
- Initialize with any decisions made during questioning:
437
-
438
- ```markdown
439
- ## Key Decisions
440
-
441
- | Decision | Rationale | Outcome |
442
- |----------|-----------|---------|
443
- | [Choice from questioning] | [Why] | — Pending |
444
- ```
445
-
446
- **Last updated footer:**
447
-
448
- ```markdown
449
- ---
450
- *Last updated: [date] after initialization*
451
- ```
452
-
453
- Do not compress. Capture everything gathered.
454
-
455
- **Commit PROJECT.md:**
456
-
457
- ```bash
458
- mkdir -p .planning
459
- node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" commit "docs: initialize project" --files .planning/PROJECT.md
460
- ```
461
-
462
- **Update lock file state:**
463
- ```bash
464
- node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" lock-update --state="project_defined"
465
- ```
466
-
467
- ---
468
-
469
- ## 5. Workflow Preferences
470
-
471
- **If auto mode:** Skip config was collected in Step 2a. Proceed to Step 5.5.
472
-
473
- **Check for global defaults** at `~/.ez/defaults.json` using direct path existence checks only.
474
- Do **not** glob or recursively search home directories for this file.
475
- If it exists, offer to use saved defaults:
476
-
477
- ```
478
- AskUserQuestion([
479
- {
480
- question: "Use your saved default settings? (from ~/.ez/defaults.json)",
481
- header: "Defaults",
482
- multiSelect: false,
483
- options: [
484
- { label: "Yes (Recommended)", description: "Use saved defaults, skip settings questions" },
485
- { label: "No", description: "Configure settings manually" }
486
- ]
487
- }
488
- ])
489
- ```
490
-
491
- If "Yes": read `~/.ez/defaults.json`, use those values for config.json, and skip directly to **Commit config.json** below.
492
-
493
- If "No" or it doesn't exist: proceed with the questions below.
494
-
495
- **Round 1 Core workflow settings (4 questions):**
496
-
497
- ```
498
- questions: [
499
- {
500
- header: "Mode",
501
- question: "How do you want to work?",
502
- multiSelect: false,
503
- options: [
504
- { label: "YOLO (Recommended)", description: "Auto-approve, just execute" },
505
- { label: "Interactive", description: "Confirm at each step" }
506
- ]
507
- },
508
- {
509
- header: "Granularity",
510
- question: "How finely should scope be sliced into phases?",
511
- multiSelect: false,
512
- options: [
513
- { label: "Coarse", description: "Fewer, broader phases (3-5 phases, 1-3 plans each)" },
514
- { label: "Standard", description: "Balanced phase size (5-8 phases, 3-5 plans each)" },
515
- { label: "Fine", description: "Many focused phases (8-12 phases, 5-10 plans each)" }
516
- ]
517
- },
518
- {
519
- header: "Execution",
520
- question: "Run plans in parallel?",
521
- multiSelect: false,
522
- options: [
523
- { label: "Parallel (Recommended)", description: "Independent plans run simultaneously" },
524
- { label: "Sequential", description: "One plan at a time" }
525
- ]
526
- },
527
- {
528
- header: "Git Tracking",
529
- question: "Commit planning docs to git?",
530
- multiSelect: false,
531
- options: [
532
- { label: "Yes (Recommended)", description: "Planning docs tracked in version control" },
533
- { label: "No", description: "Keep .planning/ local-only (add to .gitignore)" }
534
- ]
535
- }
536
- ]
537
- ```
538
-
539
- **Round 2 — Workflow agents:**
540
-
541
- These spawn additional agents during planning/execution. They add tokens and time but improve quality. They add tokens and time but improve quality.
542
-
543
- All recommended for important projects. Skip for quick experiments.
544
-
545
- ```
546
- questions: [
547
- {
548
- header: "Research",
549
- question: "Research before planning each phase? (adds tokens/time)",
550
- multiSelect: false,
551
- options: [
552
- { label: "Yes (Recommended)", description: "Investigate domain, find patterns, surface gotchas" },
553
- { label: "No", description: "Plan directly from requirements" }
554
- ]
555
- },
556
- {
557
- header: "Plan Check",
558
- question: "Verify plans will achieve their goals? (adds tokens/time)",
559
- multiSelect: false,
560
- options: [
561
- { label: "Yes (Recommended)", description: "Catch gaps before execution starts" },
562
- { label: "No", description: "Execute plans without verification" }
563
- ]
564
- },
565
- {
566
- header: "Verifier",
567
- question: "Verify work satisfies requirements after each phase? (adds tokens/time)",
568
- multiSelect: false,
569
- options: [
570
- { label: "Yes (Recommended)", description: "Confirm deliverables match phase goals" },
571
- { label: "No", description: "Trust execution, skip verification" }
572
- ]
573
- },
574
- {
575
- header: "AI Models",
576
- question: "Which AI models for planning agents?",
577
- multiSelect: false,
578
- options: [
579
- { label: "Balanced (Recommended)", description: "Sonnet for most agents — good quality/cost ratio" },
580
- { label: "Quality", description: "Opus for research/roadmap — higher cost, deeper analysis" },
581
- { label: "Budget", description: "Haiku where possible — fastest, lowest cost" }
582
- ]
583
- }
584
- ]
585
- ```
586
-
587
- Create `.planning/config.json` with all settings:
588
-
589
- ```json
590
- {
591
- "mode": "yolo|interactive",
592
- "granularity": "coarse|standard|fine",
593
- "parallelization": true|false,
594
- "commit_docs": true|false,
595
- "model_profile": "quality|balanced|budget",
596
- "workflow": {
597
- "research": true|false,
598
- "plan_check": true|false,
599
- "verifier": true|false,
600
- "nyquist_validation": depth !== "quick"
601
- }
602
- }
603
- ```
604
-
605
- **If commit_docs = No:**
606
- - Set `commit_docs: false` in config.json
607
- - Add `.planning/` to `.gitignore` (create if needed)
608
-
609
- **If commit_docs = Yes:**
610
- - No additional gitignore entries needed
611
-
612
- **Commit config.json:**
613
-
614
- ```bash
615
- node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" commit "chore: add project config" --files .planning/config.json
616
- ```
617
-
618
- **Note:** Run `/ez:settings` anytime to update these preferences.
619
-
620
- **Update lock file state:**
621
- ```bash
622
- node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" lock-update --state="config_complete"
623
- ```
624
-
625
- ## 5.5. Resolve Model Profile
626
-
627
- Use models from init: `researcher_model`, `synthesizer_model`, `roadmapper_model`.
628
-
629
- ---
630
-
631
- ## 6. Research Decision (with Fresh Context - GSD-2 Pattern)
632
-
633
- **If auto mode:** Default to "Research first" without asking.
634
-
635
- Use AskUserQuestion:
636
- - header: "Research"
637
- - question: "Research the domain ecosystem before defining requirements?"
638
- - options:
639
- - "Research first (Recommended)" — Discover standard stack, expected features, architecture patterns
640
- - "Skip research" — I know this domain well, go straight to requirements
641
-
642
- **If "Research first":**
643
-
644
- Display stage banner:
645
- ```
646
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
647
- EZ ► RESEARCHING
648
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
649
-
650
- Researching [domain] ecosystem...
651
- ```
652
-
653
- Create research directory:
654
- ```bash
655
- mkdir -p .planning/research
656
- ```
657
-
658
- **Determine milestone context:**
659
-
660
- Check if this is greenfield or subsequent milestone:
661
- - If no "Validated" requirements in PROJECT.md → Greenfield (building from scratch)
662
- - If "Validated" requirements exist → Subsequent milestone (adding to existing app)
663
-
664
- Display spawning indicator:
665
- ```
666
- Spawning 4 researchers in parallel...
667
- → Stack research
668
- → Features research
669
- → Architecture research
670
- Pitfalls research
671
- ```
672
-
673
- **Spawn 4 parallel ez-project-researcher agents with FRESH CONTEXT (GSD-2 Pattern):**
674
-
675
- Each uses this template with dimension-specific fields:
676
-
677
- ```
678
- Task(prompt="
679
- <research_type>Project Research — {DIMENSION} for [domain].</research_type>
680
-
681
- <fresh_context>
682
- CONTEXT RESET: This is a fresh 200K session.
683
- No accumulated garbage from prior tasks.
684
- Only relevant context pre-loaded below.
685
- </fresh_context>
686
-
687
- <pre_loaded_context>
688
- - .planning/PROJECT.md excerpt (core value, goals)
689
- - .planning/config.json (workflow settings)
690
- </pre_loaded_context>
691
-
692
- <milestone_context>
693
- {greenfield_or_subsequent}
694
-
695
- Greenfield: Research the standard stack for building [domain] from scratch.
696
- Subsequent: Research what's needed to add [target features] to an existing [domain] app. Don't re-research the existing system.
697
- </milestone_context>
698
-
699
- <question>
700
- {QUESTION}
701
- </question>
702
-
703
- <files_to_read>
704
- - {project_path} (Project context and goals)
705
- </files_to_read>
706
-
707
- <downstream_consumer>
708
- {CONSUMER}
709
- </downstream_consumer>
710
-
711
- <quality_gate>
712
- {GATES}
713
- </quality_gate>
714
-
715
- <output>
716
- Write to: .planning/research/{FILE}
717
- Use template: ~/.claude/ez-agents/templates/research-project/{FILE}
718
- </output>
719
- ", subagent_type="ez-project-researcher", model="{researcher_model}", description="{DIMENSION} research")
720
- ```
721
-
722
- **Dimension-specific fields:**
723
-
724
- | Field | Stack | Features | Architecture | Pitfalls |
725
- |-------|-------|----------|-------------|----------|
726
- | QUESTION | What's the standard 2025 stack for [domain]? | What features do [domain] products have? | How are [domain] systems typically structured? | What do [domain] projects commonly get wrong? |
727
- | CONSUMER | Specific libraries with versions, clear rationale, what NOT to use | Table stakes vs differentiators vs anti-features | Component boundaries, data flow, build order | Warning signs, prevention strategy, phase mapping |
728
- | GATES | Versions current (verify with Context7), rationale explains WHY | Categories clear, complexity noted, dependencies identified | Components clearly defined, data flow explicit | Pitfalls specific to domain, prevention actionable |
729
- | FILE | STACK.md | FEATURES.md | ARCHITECTURE.md | PITFALLS.md |
730
-
731
- After all 4 complete, spawn synthesizer to create SUMMARY.md:
732
-
733
- ```
734
- Task(prompt="
735
- Synthesize research outputs into SUMMARY.md.
736
-
737
- <files_to_read>
738
- - .planning/research/STACK.md
739
- - .planning/research/FEATURES.md
740
- - .planning/research/ARCHITECTURE.md
741
- - .planning/research/PITFALLS.md
742
- </files_to_read>
743
-
744
- Write to: .planning/research/SUMMARY.md
745
- Use template: ~/.claude/ez-agents/templates/research-project/SUMMARY.md
746
- Commit after writing.
747
- ", subagent_type="ez-research-synthesizer", model="{synthesizer_model}", description="Synthesize research")
748
- ```
749
-
750
- Display research complete banner and key findings:
751
- ```
752
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
753
- EZ ► RESEARCH COMPLETE ✓
754
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
755
-
756
- ## Key Findings
757
-
758
- **Stack:** [from SUMMARY.md]
759
- **Table Stakes:** [from SUMMARY.md]
760
- **Watch Out For:** [from SUMMARY.md]
761
-
762
- Files: `.planning/research/`
763
- ```
764
-
765
- **Update lock file state:**
766
- ```bash
767
- node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" lock-update --state="research_complete"
768
- ```
769
-
770
- **If "Skip research":** Continue to Step 7.
771
-
772
- ---
773
-
774
- ## 7. Define Requirements
775
-
776
- Display stage banner:
777
- ```
778
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
779
- EZ DEFINING REQUIREMENTS
780
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
781
- ```
782
-
783
- **Load context:**
784
-
785
- Read PROJECT.md and extract:
786
- - Core value (the ONE thing that must work)
787
- - Stated constraints (budget, timeline, tech limitations)
788
- - Any explicit scope boundaries
789
-
790
- **If research exists:** Read research/FEATURES.md and extract feature categories.
791
-
792
- **If auto mode:**
793
- - Auto-include all table stakes features (users expect these)
794
- - Include features explicitly mentioned in provided document
795
- - Auto-defer differentiators not mentioned in document
796
- - Skip per-category AskUserQuestion loops
797
- - Skip "Any additions?" question
798
- - Skip requirements approval gate
799
- - Generate REQUIREMENTS.md and commit directly
800
-
801
- **Present features by category (interactive mode only):**
802
-
803
- ```
804
- Here are the features for [domain]:
805
-
806
- ## Authentication
807
- **Table stakes:**
808
- - Sign up with email/password
809
- - Email verification
810
- - Password reset
811
- - Session management
812
-
813
- **Differentiators:**
814
- - Magic link login
815
- - OAuth (Google, GitHub)
816
- - 2FA
817
-
818
- **Research notes:** [any relevant notes]
819
-
820
- ---
821
-
822
- ## [Next Category]
823
- ...
824
- ```
825
-
826
- **If no research:** Gather requirements through conversation instead.
827
-
828
- Ask: "What are the main things users need to be able to do?"
829
-
830
- For each capability mentioned:
831
- - Ask clarifying questions to make it specific
832
- - Probe for related capabilities
833
- - Group into categories
834
-
835
- **Scope each category:**
836
-
837
- For each category, use AskUserQuestion:
838
-
839
- - header: "[Category]" (max 12 chars)
840
- - question: "Which [category] features are in v1?"
841
- - multiSelect: true
842
- - options:
843
- - "[Feature 1]" — [brief description]
844
- - "[Feature 2]" — [brief description]
845
- - "[Feature 3]" — [brief description]
846
- - "None for v1" Defer entire category
847
-
848
- Track responses:
849
- - Selected features → v1 requirements
850
- - Unselected table stakes → v2 (users expect these)
851
- - Unselected differentiators out of scope
852
-
853
- **Identify gaps:**
854
-
855
- Use AskUserQuestion:
856
- - header: "Additions"
857
- - question: "Any requirements research missed? (Features specific to your vision)"
858
- - options:
859
- - "No, research covered it" — Proceed
860
- - "Yes, let me add some" — Capture additions
861
-
862
- **Validate core value:**
863
-
864
- Cross-check requirements against Core Value from PROJECT.md. If gaps detected, surface them.
865
-
866
- **Generate REQUIREMENTS.md:**
867
-
868
- Create `.planning/REQUIREMENTS.md` with:
869
- - v1 Requirements grouped by category (checkboxes, REQ-IDs)
870
- - v2 Requirements (deferred)
871
- - Out of Scope (explicit exclusions with reasoning)
872
- - Traceability section (empty, filled by roadmap)
873
-
874
- **REQ-ID format:** `[CATEGORY]-[NUMBER]` (AUTH-01, CONTENT-02)
875
-
876
- **Requirement quality criteria:**
877
-
878
- Good requirements are:
879
- - **Specific and testable:** "User can reset password via email link" (not "Handle password reset")
880
- - **User-centric:** "User can X" (not "System does Y")
881
- - **Atomic:** One capability per requirement (not "User can login and manage profile")
882
- - **Independent:** Minimal dependencies on other requirements
883
-
884
- Reject vague requirements. Push for specificity.
885
-
886
- Present FULL requirements list for confirmation:
887
-
888
- ```
889
- ## Project Requirements
890
-
891
- ### [Category 1]
892
- - [ ] **CAT1-01**: User can do X
893
- - [ ] **CAT1-02**: User can do Y
894
-
895
- ### [Category 2]
896
- - [ ] **CAT2-01**: User can do Z
897
-
898
- Does this capture what you're building? (yes / adjust)
899
- ```
900
-
901
- If "adjust": Return to scoping.
902
-
903
- **Commit requirements:**
904
- ```bash
905
- node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" commit "docs: define project requirements" --files .planning/REQUIREMENTS.md
906
- ```
907
-
908
- **Update lock file state:**
909
- ```bash
910
- node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" lock-update --state="requirements_defined"
911
- ```
912
-
913
- ---
914
-
915
- ## 8. Create Roadmap (with Stuck Detection - GSD-2 Pattern)
916
-
917
- Display stage banner:
918
- ```
919
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
920
- EZ ► CREATING ROADMAP
921
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
922
-
923
- Spawning roadmapper...
924
- ```
925
-
926
- **Initialize stuck detection:**
927
-
928
- ```bash
929
- # Start stuck watcher
930
- node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" stuck-watch start \
931
- --operation="roadmap-creation" \
932
- --max-retries=1 \
933
- --timeout=300
934
- ```
935
-
936
- ```
937
- Task(prompt="
938
- <planning_context>
939
- <files_to_read>
940
- - .planning/PROJECT.md
941
- - .planning/REQUIREMENTS.md
942
- - .planning/research/SUMMARY.md (if exists)
943
- - .planning/config.json
944
- </files_to_read>
945
- </planning_context>
946
-
947
- <instructions>
948
- Create roadmap for new project:
949
- 1. Start phase numbering from 1
950
- 2. Derive phases from requirements
951
- 3. Map every requirement to exactly one phase
952
- 4. Derive 2-5 success criteria per phase (observable user behaviors)
953
- 5. Validate 100% coverage
954
- 6. Write files immediately (ROADMAP.md, STATE.md, update REQUIREMENTS.md traceability)
955
- 7. Return ROADMAP CREATED with summary
956
-
957
- Write files first, then return.
958
- </instructions>
959
- ", subagent_type="ez-roadmapper", model="{roadmapper_model}", description="Create roadmap")
960
- ```
961
-
962
- **Handle return:**
963
-
964
- **If `## ROADMAP BLOCKED`:**
965
- 1. Log error type and location
966
- 2. Retry ONCE with diagnostic context:
967
- ```
968
- Task(prompt="
969
- <retry_context>
970
- PREVIOUS ATTEMPT FAILED
971
- Error Type: [error_type]
972
- Error Location: [location]
973
- Suggested Fix: [fix]
974
-
975
- CONTEXT SNAPSHOT FOR DEBUGGING:
976
- [snapshot of files read]
977
-
978
- Please try again with this diagnostic information.
979
- </retry_context>
980
- ", subagent_type="ez-roadmapper", model="{roadmapper_model}", description="Create roadmap (retry)")
981
- ```
982
- 3. If fails again STOP with exact failure report:
983
- ```
984
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
985
- EZ ► ROADMAP CREATION FAILED
986
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
987
-
988
- Error Type: [type]
989
- Error Location: [file:line]
990
- Suggested Fix: [action]
991
-
992
- Context Snapshot: .planning/logs/stuck-snapshot-[timestamp].json
993
-
994
- Next Steps:
995
- 1. Review context snapshot
996
- 2. Fix [specific issue]
997
- 3. Run: /ez:new-project --retry
998
- ```
999
-
1000
- **If `## ROADMAP CREATED`:** Read ROADMAP.md, present inline:
1001
-
1002
- ```
1003
- ## Proposed Roadmap
1004
-
1005
- **[N] phases** | **[X] requirements mapped** | All covered ✓
1006
-
1007
- | # | Phase | Goal | Requirements | Success Criteria |
1008
- |---|-------|------|--------------|------------------|
1009
- | 1 | [Name] | [Goal] | [REQ-IDs] | [count] |
1010
-
1011
- ### Phase Details
1012
-
1013
- **Phase 1: [Name]**
1014
- Goal: [goal]
1015
- Requirements: [REQ-IDs]
1016
- Success criteria:
1017
- 1. [criterion]
1018
- 2. [criterion]
1019
- ```
1020
-
1021
- **Ask for approval** via AskUserQuestion:
1022
- - "Approve" — Commit and continue
1023
- - "Adjust phases" Tell me what to change
1024
- - "Review full file" — Show raw ROADMAP.md
1025
-
1026
- **If "Adjust":** Get notes, re-spawn roadmapper with revision context, loop until approved.
1027
- **If "Review":** Display raw ROADMAP.md, re-ask.
1028
-
1029
- **Commit roadmap** (after approval):
1030
- ```bash
1031
- node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" commit "docs: create project roadmap ([N] phases)" --files .planning/ROADMAP.md .planning/STATE.md .planning/REQUIREMENTS.md
1032
- ```
1033
-
1034
- **Update lock file state:**
1035
- ```bash
1036
- node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" lock-update --state="roadmap_created"
1037
- ```
1038
-
1039
- ---
1040
-
1041
- ## 9. Release Lock File
1042
-
1043
- **Project initialization complete:**
1044
-
1045
- ```bash
1046
- node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" lock-release
1047
- ```
1048
-
1049
- ---
1050
-
1051
- ## 10. Done
1052
-
1053
- ```
1054
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1055
- EZ ► PROJECT INITIALIZED ✓
1056
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1057
-
1058
- **Project: [Project Name]**
1059
-
1060
- | Artifact | Location |
1061
- |----------------|-----------------------------|
1062
- | Project | `.planning/PROJECT.md` |
1063
- | Research | `.planning/research/` |
1064
- | Requirements | `.planning/REQUIREMENTS.md` |
1065
- | Roadmap | `.planning/ROADMAP.md` |
1066
- | Config | `.planning/config.json` |
1067
-
1068
- **[N] phases** | **[X] requirements** | Ready to build
1069
-
1070
- ## Next Up
1071
-
1072
- **Phase 1: [Phase Name]** [Goal]
1073
-
1074
- `/ez:discuss-phase 1` gather context and clarify approach
1075
-
1076
- <sub>`/clear` first fresh context window</sub>
1077
-
1078
- Also: `/ez:plan-phase 1` skip discussion, plan directly
1079
- ```
1080
-
1081
- </process>
1082
-
1083
- <success_criteria>
1084
- - [ ] Pre-flight health check passed (all systems go)
1085
- - [ ] Lock file created and maintained throughout
1086
- - [ ] PROJECT.md created with clear core value
1087
- - [ ] REQUIREMENTS.md created with REQ-IDs
1088
- - [ ] ROADMAP.md created with phased execution plan
1089
- - [ ] STATE.md initialized
1090
- - [ ] Config.json created with workflow preferences
1091
- - [ ] Research completed (if selected) — 4 parallel agents with fresh context
1092
- - [ ] Requirements gathered and scoped per category
1093
- - [ ] ez-roadmapper spawned with stuck detection
1094
- - [ ] Roadmap files written immediately (not draft)
1095
- - [ ] User feedback incorporated (if any)
1096
- - [ ] All commits made (if planning docs committed)
1097
- - [ ] Lock file released on completion
1098
- - [ ] User knows next step: `/ez:discuss-phase 1`
1099
-
1100
- **Atomic commits:** Each artifact committed immediately after creation.
1101
-
1102
- **GSD-2 Reliability:**
1103
- - ✅ Health check pre-flight validation
1104
- - ✅ Crash recovery via lock files
1105
- - ✅ Fresh context per researcher/agent
1106
- - ✅ Stuck detection with diagnostics during roadmap creation
1107
- </success_criteria>
1
+ <purpose>
2
+ Initialize a new project through unified flow: questioning, research (optional), requirements, roadmap. This is the most leveraged moment in any project — deep questioning here means better plans, better execution, better outcomes. One workflow takes you from idea to ready-for-planning.
3
+
4
+ **GSD-2 Enhanced:** Includes health check, cost tracking, crash recovery, fresh context, and stuck detection for production-grade reliability.
5
+ </purpose>
6
+
7
+ <required_reading>
8
+ Read all files referenced by the invoking prompt's execution_context before starting.
9
+ </required_reading>
10
+
11
+ <auto_mode>
12
+ ## Auto Mode Detection
13
+
14
+ Check if `--auto` flag is present in $ARGUMENTS.
15
+
16
+ **If auto mode:**
17
+ - Skip brownfield mapping offer (assume greenfield)
18
+ - Skip deep questioning (extract context from provided document)
19
+ - Config: YOLO mode is implicit (skip that question), but ask granularity/git/agents FIRST (Step 2a)
20
+ - After config: run Steps 6-9 automatically with smart defaults:
21
+ - Research: Always yes
22
+ - Requirements: Include all table stakes + features from provided document
23
+ - Requirements approval: Auto-approve
24
+ - Roadmap approval: Auto-approve
25
+
26
+ **Document requirement:**
27
+ Auto mode requires an idea document — either:
28
+ - File reference: `/ez:new-project --auto @prd.md`
29
+ - Pasted/written text in the prompt
30
+
31
+ If no document content provided, error:
32
+
33
+ ```
34
+ Error: --auto requires an idea document.
35
+
36
+ Usage:
37
+ /ez:new-project --auto @your-idea.md
38
+ /ez:new-project --auto [paste or write your idea here]
39
+
40
+ The document should describe what you want to build.
41
+ ```
42
+ </auto_mode>
43
+
44
+ <process>
45
+
46
+ ## 0. Pre-Flight Health Check (GSD-2 Pattern)
47
+
48
+ **MANDATORY FIRST STEP — Validate environment before ANY operation:**
49
+
50
+ ```bash
51
+ # Run health check
52
+ HEALTH=$(node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" doctor --json)
53
+ ```
54
+
55
+ **Check:**
56
+ - ✅ Node.js version >= 16.7.0
57
+ - ✅ AI tools available (Claude, OpenCode, etc.)
58
+ - ✅ Config valid (`.planning/config.json` or create default)
59
+ - ✅ Git repo initialized (or auto-init)
60
+ - ✅ API keys configured
61
+
62
+ **If any check fails:**
63
+ ```
64
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
65
+ EZ ► HEALTH CHECK FAILED
66
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
67
+
68
+ ❌ [Failed check description]
69
+
70
+ Fix:
71
+ [suggested command]
72
+
73
+ Example:
74
+ $ [example command]
75
+
76
+ Resolve before continuing with project initialization.
77
+ ```
78
+
79
+ **Abort project init until resolved.**
80
+
81
+ ---
82
+
83
+ ## 0a. Gather Initial Context (CONTEXT-01, CONTEXT-02)
84
+
85
+ **Initialize ContextManager for context gathering:**
86
+
87
+ ```javascript
88
+ const ContextManager = require('../bin/lib/context-manager.cjs');
89
+ const contextManager = new ContextManager(process.cwd());
90
+ ```
91
+
92
+ **Request initial project context:**
93
+
94
+ ```javascript
95
+ const context = await contextManager.requestContext({
96
+ files: ['README.md', 'package.json'],
97
+ urls: []
98
+ });
99
+ ```
100
+
101
+ **Agent can request additional context using:**
102
+ - `ez-tools context read <pattern>` — Read local files
103
+ - `ez-tools context fetch <url>` — Fetch URL content (requires user confirmation)
104
+
105
+ **Update STATE.md with context sources:**
106
+
107
+ ```javascript
108
+ await contextManager.updateStateMd();
109
+ ```
110
+
111
+ **Continue to Setup (Step 1) with gathered context.**
112
+
113
+ ---
114
+
115
+ ## 1. Setup with Lock File (GSD-2 Pattern)
116
+
117
+ **Execute initialization with crash recovery:**
118
+
119
+ ```bash
120
+ INIT=$(node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" init new-project)
121
+ if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
122
+ ```
123
+
124
+ Parse JSON for: `researcher_model`, `synthesizer_model`, `roadmapper_model`, `commit_docs`, `project_exists`, `has_codebase_map`, `planning_exists`, `has_existing_code`, `has_package_file`, `is_brownfield`, `needs_codebase_map`, `has_git`, `project_path`.
125
+
126
+ **If `project_exists` is true:** Error — project already initialized. Use `/ez:progress`.
127
+
128
+ **Create lock file for crash recovery:**
129
+
130
+ ```bash
131
+ # Create auto.lock
132
+ node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" lock-create \
133
+ --operation="new-project" \
134
+ --project-path="$project_path"
135
+ ```
136
+
137
+ **Create `.planning/auto.lock`:**
138
+ ```json
139
+ {
140
+ "pid": 12345,
141
+ "operation": "new-project",
142
+ "project_path": "/path/to/project",
143
+ "started_at": "2026-03-18T12:00:00.000Z",
144
+ "last_heartbeat": "2026-03-18T12:00:00.000Z",
145
+ "state": "setup"
146
+ }
147
+ ```
148
+
149
+ **If `has_git` is false:** Initialize git:
150
+ ```bash
151
+ git init
152
+ node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" lock-update --state="git_initialized"
153
+ ```
154
+
155
+ ---
156
+
157
+ ## 2. Brownfield Offer
158
+
159
+ **If auto mode:** Skip to Step 4 (assume greenfield, synthesize PROJECT.md from provided document).
160
+
161
+ **If `needs_codebase_map` is true** (from init — existing code detected but no codebase map):
162
+
163
+ Use AskUserQuestion:
164
+ - header: "Codebase"
165
+ - question: "I detected existing code in this directory. Would you like to map the codebase first?"
166
+ - options:
167
+ - "Map codebase first" — Run /ez:map-codebase to understand existing architecture (Recommended)
168
+ - "Skip mapping" — Proceed with project initialization
169
+
170
+ **If "Map codebase first":**
171
+ ```
172
+ Run `/ez:map-codebase` first, then return to `/ez:new-project`
173
+ ```
174
+ Exit command.
175
+
176
+ **If "Skip mapping" OR `needs_codebase_map` is false:** Continue to Step 3.
177
+
178
+ **Update lock file state:**
179
+ ```bash
180
+ node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" lock-update --state="brownfield_check_complete"
181
+ ```
182
+
183
+ ---
184
+
185
+ ## 2a. Auto Mode Config (auto mode only)
186
+
187
+ **If auto mode:** Collect config settings upfront before processing the idea document.
188
+
189
+ YOLO mode is implicit (auto = YOLO). Ask remaining config questions:
190
+
191
+ **Round 1 — Core settings (3 questions, no Mode question):**
192
+
193
+ ```
194
+ AskUserQuestion([
195
+ {
196
+ header: "Granularity",
197
+ question: "How finely should scope be sliced into phases?",
198
+ multiSelect: false,
199
+ options: [
200
+ { label: "Coarse (Recommended)", description: "Fewer, broader phases (3-5 phases, 1-3 plans each)" },
201
+ { label: "Standard", description: "Balanced phase size (5-8 phases, 3-5 plans each)" },
202
+ { label: "Fine", description: "Many focused phases (8-12 phases, 5-10 plans each)" }
203
+ ]
204
+ },
205
+ {
206
+ header: "Execution",
207
+ question: "Run plans in parallel?",
208
+ multiSelect: false,
209
+ options: [
210
+ { label: "Parallel (Recommended)", description: "Independent plans run simultaneously" },
211
+ { label: "Sequential", description: "One plan at a time" }
212
+ ]
213
+ },
214
+ {
215
+ header: "Git Tracking",
216
+ question: "Commit planning docs to git?",
217
+ multiSelect: false,
218
+ options: [
219
+ { label: "Yes (Recommended)", description: "Planning docs tracked in version control" },
220
+ { label: "No", description: "Keep .planning/ local-only (add to .gitignore)" }
221
+ ]
222
+ }
223
+ ])
224
+ ```
225
+
226
+ **Round 2 — Workflow agents (same as Step 5):**
227
+
228
+ ```
229
+ AskUserQuestion([
230
+ {
231
+ header: "Plan Check",
232
+ question: "Verify plans will achieve their goals? (adds tokens/time)",
233
+ multiSelect: false,
234
+ options: [
235
+ { label: "Yes (Recommended)", description: "Catch gaps before execution starts" },
236
+ { label: "No", description: "Execute plans without verification" }
237
+ ]
238
+ },
239
+ {
240
+ header: "Verifier",
241
+ question: "Verify work satisfies requirements after each phase? (adds tokens/time)",
242
+ multiSelect: false,
243
+ options: [
244
+ { label: "Yes (Recommended)", description: "Confirm deliverables match phase goals" },
245
+ { label: "No", description: "Trust execution, skip verification" }
246
+ ]
247
+ },
248
+ {
249
+ header: "AI Models",
250
+ question: "Which AI models for planning agents?",
251
+ multiSelect: false,
252
+ options: [
253
+ { label: "Balanced (Recommended)", description: "Sonnet for most agents — good quality/cost ratio" },
254
+ { label: "Quality", description: "Opus for research/roadmap — higher cost, deeper analysis" },
255
+ { label: "Budget", description: "Haiku where possible — fastest, lowest cost" }
256
+ ]
257
+ }
258
+ ])
259
+ ```
260
+
261
+ Create `.planning/config.json` with mode set to "yolo":
262
+
263
+ ```json
264
+ {
265
+ "mode": "yolo",
266
+ "granularity": "[selected]",
267
+ "parallelization": true|false,
268
+ "commit_docs": true|false,
269
+ "model_profile": "quality|balanced|budget",
270
+ "workflow": {
271
+ "research": true|false,
272
+ "plan_check": true|false,
273
+ "verifier": true|false,
274
+ "nyquist_validation": depth !== "quick",
275
+ "auto_advance": true
276
+ }
277
+ }
278
+ ```
279
+
280
+ **If commit_docs = No:** Add `.planning/` to `.gitignore`.
281
+
282
+ **Commit config.json:**
283
+
284
+ ```bash
285
+ mkdir -p .planning
286
+ node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" commit "chore: add project config" --files .planning/config.json
287
+ ```
288
+
289
+ **Persist auto-advance chain flag to config (survives context compaction):**
290
+
291
+ ```bash
292
+ node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" config-set workflow._auto_chain_active true
293
+ ```
294
+
295
+ **Update lock file state:**
296
+ ```bash
297
+ node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" lock-update --state="config_complete"
298
+ ```
299
+
300
+ Proceed to Step 4 (skip Steps 3 and 5).
301
+
302
+ ---
303
+
304
+ ## 3. Deep Questioning
305
+
306
+ **If auto mode:** Skip (already handled in Step 2a). Extract project context from provided document instead and proceed to Step 4.
307
+
308
+ **Display stage banner:**
309
+
310
+ ```
311
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
312
+ EZ ► QUESTIONING
313
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
314
+ ```
315
+
316
+ **Open the conversation:**
317
+
318
+ Ask inline (freeform, NOT AskUserQuestion):
319
+
320
+ "What do you want to build?"
321
+
322
+ Wait for their response. This gives you the context needed to ask intelligent follow-up questions.
323
+
324
+ **Follow the thread:**
325
+
326
+ Based on what they said, ask follow-up questions that dig into their response. Use AskUserQuestion with options that probe what they mentioned — interpretations, clarifications, concrete examples.
327
+
328
+ Keep following threads. Each answer opens new threads to explore. Ask about:
329
+ - What excited them
330
+ - What problem sparked this
331
+ - What they mean by vague terms
332
+ - What it would actually look like
333
+ - What's already decided
334
+
335
+ Consult `questioning.md` for techniques:
336
+ - Challenge vagueness
337
+ - Make abstract concrete
338
+ - Surface assumptions
339
+ - Find edges
340
+ - Reveal motivation
341
+
342
+ **Check context (background, not out loud):**
343
+
344
+ As you go, mentally check the context checklist from `questioning.md`. If gaps remain, weave questions naturally. Don't suddenly switch to checklist mode.
345
+
346
+ **Decision gate:**
347
+
348
+ When you could write a clear PROJECT.md, use AskUserQuestion:
349
+
350
+ - header: "Ready?"
351
+ - question: "I think I understand what you're after. Ready to create PROJECT.md?"
352
+ - options:
353
+ - "Create PROJECT.md" Let's move forward
354
+ - "Keep exploring" — I want to share more / ask me more
355
+
356
+ If "Keep exploring" — ask what they want to add, or identify gaps and probe naturally.
357
+
358
+ Loop until "Create PROJECT.md" selected.
359
+
360
+ **Update lock file state:**
361
+ ```bash
362
+ node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" lock-update --state="questioning_complete"
363
+ ```
364
+
365
+ ---
366
+
367
+ ## 4. Write PROJECT.md
368
+
369
+ **If auto mode:** Synthesize from provided document. No "Ready?" gate was shown — proceed directly to commit.
370
+
371
+ Synthesize all context into `.planning/PROJECT.md` using the template from `templates/project.md`.
372
+
373
+ **For greenfield projects:**
374
+
375
+ Initialize requirements as hypotheses:
376
+
377
+ ```markdown
378
+ ## Requirements
379
+
380
+ ### Validated
381
+
382
+ (None yet — ship to validate)
383
+
384
+ ### Active
385
+
386
+ - [ ] [Requirement 1]
387
+ - [ ] [Requirement 2]
388
+ - [ ] [Requirement 3]
389
+
390
+ ### Out of Scope
391
+
392
+ - [Exclusion 1] — [why]
393
+ - [Exclusion 2] — [why]
394
+ ```
395
+
396
+ All Active requirements are hypotheses until shipped and validated.
397
+
398
+ **For brownfield projects (codebase map exists):**
399
+
400
+ Infer Validated requirements from existing code:
401
+
402
+ 1. Read `.planning/codebase/ARCHITECTURE.md` and `STACK.md`
403
+ 2. Identify what the codebase already does
404
+ 3. These become the initial Validated set
405
+
406
+ ```markdown
407
+ ## Requirements
408
+
409
+ ### Validated
410
+
411
+ - [Existing capability 1] — existing
412
+ - [Existing capability 2] existing
413
+ - [Existing capability 3] existing
414
+
415
+ ### Active
416
+
417
+ - [ ] [New requirement 1]
418
+ - [ ] [New requirement 2]
419
+
420
+ ### Out of Scope
421
+
422
+ - [Exclusion 1] — [why]
423
+ ```
424
+
425
+ **Key Decisions:**
426
+
427
+ Initialize with any decisions made during questioning:
428
+
429
+ ```markdown
430
+ ## Key Decisions
431
+
432
+ | Decision | Rationale | Outcome |
433
+ |----------|-----------|---------|
434
+ | [Choice from questioning] | [Why] | — Pending |
435
+ ```
436
+
437
+ **Last updated footer:**
438
+
439
+ ```markdown
440
+ ---
441
+ *Last updated: [date] after initialization*
442
+ ```
443
+
444
+ Do not compress. Capture everything gathered.
445
+
446
+ **Commit PROJECT.md:**
447
+
448
+ ```bash
449
+ mkdir -p .planning
450
+ node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" commit "docs: initialize project" --files .planning/PROJECT.md
451
+ ```
452
+
453
+ **Update lock file state:**
454
+ ```bash
455
+ node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" lock-update --state="project_defined"
456
+ ```
457
+
458
+ ---
459
+
460
+ ## 5. Workflow Preferences
461
+
462
+ **If auto mode:** Skip — config was collected in Step 2a. Proceed to Step 5.5.
463
+
464
+ **Check for global defaults** at `~/.ez/defaults.json` using direct path existence checks only.
465
+ Do **not** glob or recursively search home directories for this file.
466
+ If it exists, offer to use saved defaults:
467
+
468
+ ```
469
+ AskUserQuestion([
470
+ {
471
+ question: "Use your saved default settings? (from ~/.ez/defaults.json)",
472
+ header: "Defaults",
473
+ multiSelect: false,
474
+ options: [
475
+ { label: "Yes (Recommended)", description: "Use saved defaults, skip settings questions" },
476
+ { label: "No", description: "Configure settings manually" }
477
+ ]
478
+ }
479
+ ])
480
+ ```
481
+
482
+ If "Yes": read `~/.ez/defaults.json`, use those values for config.json, and skip directly to **Commit config.json** below.
483
+
484
+ If "No" or it doesn't exist: proceed with the questions below.
485
+
486
+ **Round 1 — Core workflow settings (4 questions):**
487
+
488
+ ```
489
+ questions: [
490
+ {
491
+ header: "Mode",
492
+ question: "How do you want to work?",
493
+ multiSelect: false,
494
+ options: [
495
+ { label: "YOLO (Recommended)", description: "Auto-approve, just execute" },
496
+ { label: "Interactive", description: "Confirm at each step" }
497
+ ]
498
+ },
499
+ {
500
+ header: "Granularity",
501
+ question: "How finely should scope be sliced into phases?",
502
+ multiSelect: false,
503
+ options: [
504
+ { label: "Coarse", description: "Fewer, broader phases (3-5 phases, 1-3 plans each)" },
505
+ { label: "Standard", description: "Balanced phase size (5-8 phases, 3-5 plans each)" },
506
+ { label: "Fine", description: "Many focused phases (8-12 phases, 5-10 plans each)" }
507
+ ]
508
+ },
509
+ {
510
+ header: "Execution",
511
+ question: "Run plans in parallel?",
512
+ multiSelect: false,
513
+ options: [
514
+ { label: "Parallel (Recommended)", description: "Independent plans run simultaneously" },
515
+ { label: "Sequential", description: "One plan at a time" }
516
+ ]
517
+ },
518
+ {
519
+ header: "Git Tracking",
520
+ question: "Commit planning docs to git?",
521
+ multiSelect: false,
522
+ options: [
523
+ { label: "Yes (Recommended)", description: "Planning docs tracked in version control" },
524
+ { label: "No", description: "Keep .planning/ local-only (add to .gitignore)" }
525
+ ]
526
+ }
527
+ ]
528
+ ```
529
+
530
+ **Round 2 — Workflow agents:**
531
+
532
+ These spawn additional agents during planning/execution. They add tokens and time but improve quality. They add tokens and time but improve quality.
533
+
534
+ All recommended for important projects. Skip for quick experiments.
535
+
536
+ ```
537
+ questions: [
538
+ {
539
+ header: "Plan Check",
540
+ question: "Verify plans will achieve their goals? (adds tokens/time)",
541
+ multiSelect: false,
542
+ options: [
543
+ { label: "Yes (Recommended)", description: "Catch gaps before execution starts" },
544
+ { label: "No", description: "Execute plans without verification" }
545
+ ]
546
+ },
547
+ {
548
+ header: "Verifier",
549
+ question: "Verify work satisfies requirements after each phase? (adds tokens/time)",
550
+ multiSelect: false,
551
+ options: [
552
+ { label: "Yes (Recommended)", description: "Confirm deliverables match phase goals" },
553
+ { label: "No", description: "Trust execution, skip verification" }
554
+ ]
555
+ },
556
+ {
557
+ header: "AI Models",
558
+ question: "Which AI models for planning agents?",
559
+ multiSelect: false,
560
+ options: [
561
+ { label: "Balanced (Recommended)", description: "Sonnet for most agents — good quality/cost ratio" },
562
+ { label: "Quality", description: "Opus for research/roadmap — higher cost, deeper analysis" },
563
+ { label: "Budget", description: "Haiku where possible — fastest, lowest cost" }
564
+ ]
565
+ }
566
+ ]
567
+ ```
568
+
569
+ Create `.planning/config.json` with all settings:
570
+
571
+ ```json
572
+ {
573
+ "mode": "yolo|interactive",
574
+ "granularity": "coarse|standard|fine",
575
+ "parallelization": true|false,
576
+ "commit_docs": true|false,
577
+ "model_profile": "quality|balanced|budget",
578
+ "workflow": {
579
+ "research": true|false,
580
+ "plan_check": true|false,
581
+ "verifier": true|false,
582
+ "nyquist_validation": depth !== "quick"
583
+ }
584
+ }
585
+ ```
586
+
587
+ **If commit_docs = No:**
588
+ - Set `commit_docs: false` in config.json
589
+ - Add `.planning/` to `.gitignore` (create if needed)
590
+
591
+ **If commit_docs = Yes:**
592
+ - No additional gitignore entries needed
593
+
594
+ **Commit config.json:**
595
+
596
+ ```bash
597
+ node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" commit "chore: add project config" --files .planning/config.json
598
+ ```
599
+
600
+ **Note:** Run `/ez:settings` anytime to update these preferences.
601
+
602
+ **Update lock file state:**
603
+ ```bash
604
+ node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" lock-update --state="config_complete"
605
+ ```
606
+
607
+ ## 5.5. Resolve Model Profile
608
+
609
+ Use models from init: `researcher_model`, `synthesizer_model`, `roadmapper_model`.
610
+
611
+ ---
612
+
613
+ ## 6. Research Decision (with Fresh Context - GSD-2 Pattern)
614
+
615
+ **If auto mode:** Default to "Research first" without asking.
616
+
617
+ Use AskUserQuestion:
618
+ - header: "Research"
619
+ - question: "Research the domain ecosystem before defining requirements?"
620
+ - options:
621
+ - "Research first (Recommended)" — Discover standard stack, expected features, architecture patterns
622
+ - "Skip research" I know this domain well, go straight to requirements
623
+
624
+ **If "Research first":**
625
+
626
+ Display stage banner:
627
+ ```
628
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
629
+ EZ ► RESEARCHING
630
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
631
+
632
+ Researching [domain] ecosystem...
633
+ ```
634
+
635
+ Create research directory:
636
+ ```bash
637
+ mkdir -p .planning/research
638
+ ```
639
+
640
+ **Determine milestone context:**
641
+
642
+ Check if this is greenfield or subsequent milestone:
643
+ - If no "Validated" requirements in PROJECT.md → Greenfield (building from scratch)
644
+ - If "Validated" requirements exist → Subsequent milestone (adding to existing app)
645
+
646
+ Display spawning indicator:
647
+ ```
648
+ ◆ Spawning 4 researchers in parallel...
649
+ → Stack research
650
+ Features research
651
+ → Architecture research
652
+ → Pitfalls research
653
+ ```
654
+
655
+ **Spawn 4 parallel ez-project-researcher agents with FRESH CONTEXT (GSD-2 Pattern):**
656
+
657
+ Each uses this template with dimension-specific fields:
658
+
659
+ ```
660
+ Task(prompt="
661
+ <research_type>Project Research {DIMENSION} for [domain].</research_type>
662
+
663
+ <fresh_context>
664
+ CONTEXT RESET: This is a fresh 200K session.
665
+ No accumulated garbage from prior tasks.
666
+ Only relevant context pre-loaded below.
667
+ </fresh_context>
668
+
669
+ <pre_loaded_context>
670
+ - .planning/PROJECT.md excerpt (core value, goals)
671
+ - .planning/config.json (workflow settings)
672
+ </pre_loaded_context>
673
+
674
+ <milestone_context>
675
+ {greenfield_or_subsequent}
676
+
677
+ Greenfield: Research the standard stack for building [domain] from scratch.
678
+ Subsequent: Research what's needed to add [target features] to an existing [domain] app. Don't re-research the existing system.
679
+ </milestone_context>
680
+
681
+ <question>
682
+ {QUESTION}
683
+ </question>
684
+
685
+ <files_to_read>
686
+ - {project_path} (Project context and goals)
687
+ </files_to_read>
688
+
689
+ <downstream_consumer>
690
+ {CONSUMER}
691
+ </downstream_consumer>
692
+
693
+ <quality_gate>
694
+ {GATES}
695
+ </quality_gate>
696
+
697
+ <output>
698
+ Write to: .planning/research/{FILE}
699
+ Use template: ~/.claude/ez-agents/templates/research-project/{FILE}
700
+ </output>
701
+ ", subagent_type="ez-project-researcher", model="{researcher_model}", description="{DIMENSION} research")
702
+ ```
703
+
704
+ **Dimension-specific fields:**
705
+
706
+ | Field | Stack | Features | Architecture | Pitfalls |
707
+ |-------|-------|----------|-------------|----------|
708
+ | QUESTION | What's the standard 2025 stack for [domain]? | What features do [domain] products have? | How are [domain] systems typically structured? | What do [domain] projects commonly get wrong? |
709
+ | CONSUMER | Specific libraries with versions, clear rationale, what NOT to use | Table stakes vs differentiators vs anti-features | Component boundaries, data flow, build order | Warning signs, prevention strategy, phase mapping |
710
+ | GATES | Versions current (verify with Context7), rationale explains WHY | Categories clear, complexity noted, dependencies identified | Components clearly defined, data flow explicit | Pitfalls specific to domain, prevention actionable |
711
+ | FILE | STACK.md | FEATURES.md | ARCHITECTURE.md | PITFALLS.md |
712
+
713
+ After all 4 complete, spawn synthesizer to create SUMMARY.md:
714
+
715
+ ```
716
+ Task(prompt="
717
+ Synthesize research outputs into SUMMARY.md.
718
+
719
+ <files_to_read>
720
+ - .planning/research/STACK.md
721
+ - .planning/research/FEATURES.md
722
+ - .planning/research/ARCHITECTURE.md
723
+ - .planning/research/PITFALLS.md
724
+ </files_to_read>
725
+
726
+ Write to: .planning/research/SUMMARY.md
727
+ Use template: ~/.claude/ez-agents/templates/research-project/SUMMARY.md
728
+ Commit after writing.
729
+ ", subagent_type="ez-phase-researcher", model="{synthesizer_model}", description="Synthesize research")
730
+ ```
731
+
732
+ Display research complete banner and key findings:
733
+ ```
734
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
735
+ EZ RESEARCH COMPLETE ✓
736
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
737
+
738
+ ## Key Findings
739
+
740
+ **Stack:** [from SUMMARY.md]
741
+ **Table Stakes:** [from SUMMARY.md]
742
+ **Watch Out For:** [from SUMMARY.md]
743
+
744
+ Files: `.planning/research/`
745
+ ```
746
+
747
+ **Update lock file state:**
748
+ ```bash
749
+ node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" lock-update --state="research_complete"
750
+ ```
751
+
752
+ **If "Skip research":** Continue to Step 7.
753
+
754
+ ---
755
+
756
+ ## 7. Define Requirements
757
+
758
+ Display stage banner:
759
+ ```
760
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
761
+ EZ ► DEFINING REQUIREMENTS
762
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
763
+ ```
764
+
765
+ **Load context:**
766
+
767
+ Read PROJECT.md and extract:
768
+ - Core value (the ONE thing that must work)
769
+ - Stated constraints (budget, timeline, tech limitations)
770
+ - Any explicit scope boundaries
771
+
772
+ **If research exists:** Read research/FEATURES.md and extract feature categories.
773
+
774
+ **If auto mode:**
775
+ - Auto-include all table stakes features (users expect these)
776
+ - Include features explicitly mentioned in provided document
777
+ - Auto-defer differentiators not mentioned in document
778
+ - Skip per-category AskUserQuestion loops
779
+ - Skip "Any additions?" question
780
+ - Skip requirements approval gate
781
+ - Generate REQUIREMENTS.md and commit directly
782
+
783
+ **Present features by category (interactive mode only):**
784
+
785
+ ```
786
+ Here are the features for [domain]:
787
+
788
+ ## Authentication
789
+ **Table stakes:**
790
+ - Sign up with email/password
791
+ - Email verification
792
+ - Password reset
793
+ - Session management
794
+
795
+ **Differentiators:**
796
+ - Magic link login
797
+ - OAuth (Google, GitHub)
798
+ - 2FA
799
+
800
+ **Research notes:** [any relevant notes]
801
+
802
+ ---
803
+
804
+ ## [Next Category]
805
+ ...
806
+ ```
807
+
808
+ **If no research:** Gather requirements through conversation instead.
809
+
810
+ Ask: "What are the main things users need to be able to do?"
811
+
812
+ For each capability mentioned:
813
+ - Ask clarifying questions to make it specific
814
+ - Probe for related capabilities
815
+ - Group into categories
816
+
817
+ **Scope each category:**
818
+
819
+ For each category, use AskUserQuestion:
820
+
821
+ - header: "[Category]" (max 12 chars)
822
+ - question: "Which [category] features are in v1?"
823
+ - multiSelect: true
824
+ - options:
825
+ - "[Feature 1]" — [brief description]
826
+ - "[Feature 2]" [brief description]
827
+ - "[Feature 3]" — [brief description]
828
+ - "None for v1" Defer entire category
829
+
830
+ Track responses:
831
+ - Selected features v1 requirements
832
+ - Unselected table stakes → v2 (users expect these)
833
+ - Unselected differentiators → out of scope
834
+
835
+ **Identify gaps:**
836
+
837
+ Use AskUserQuestion:
838
+ - header: "Additions"
839
+ - question: "Any requirements research missed? (Features specific to your vision)"
840
+ - options:
841
+ - "No, research covered it" — Proceed
842
+ - "Yes, let me add some" — Capture additions
843
+
844
+ **Validate core value:**
845
+
846
+ Cross-check requirements against Core Value from PROJECT.md. If gaps detected, surface them.
847
+
848
+ **Generate REQUIREMENTS.md:**
849
+
850
+ Create `.planning/REQUIREMENTS.md` with:
851
+ - v1 Requirements grouped by category (checkboxes, REQ-IDs)
852
+ - v2 Requirements (deferred)
853
+ - Out of Scope (explicit exclusions with reasoning)
854
+ - Traceability section (empty, filled by roadmap)
855
+
856
+ **REQ-ID format:** `[CATEGORY]-[NUMBER]` (AUTH-01, CONTENT-02)
857
+
858
+ **Requirement quality criteria:**
859
+
860
+ Good requirements are:
861
+ - **Specific and testable:** "User can reset password via email link" (not "Handle password reset")
862
+ - **User-centric:** "User can X" (not "System does Y")
863
+ - **Atomic:** One capability per requirement (not "User can login and manage profile")
864
+ - **Independent:** Minimal dependencies on other requirements
865
+
866
+ Reject vague requirements. Push for specificity.
867
+
868
+ Present FULL requirements list for confirmation:
869
+
870
+ ```
871
+ ## Project Requirements
872
+
873
+ ### [Category 1]
874
+ - [ ] **CAT1-01**: User can do X
875
+ - [ ] **CAT1-02**: User can do Y
876
+
877
+ ### [Category 2]
878
+ - [ ] **CAT2-01**: User can do Z
879
+
880
+ Does this capture what you're building? (yes / adjust)
881
+ ```
882
+
883
+ If "adjust": Return to scoping.
884
+
885
+ **Commit requirements:**
886
+ ```bash
887
+ node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" commit "docs: define project requirements" --files .planning/REQUIREMENTS.md
888
+ ```
889
+
890
+ **Update lock file state:**
891
+ ```bash
892
+ node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" lock-update --state="requirements_defined"
893
+ ```
894
+
895
+ ---
896
+
897
+ ## 8. Create Roadmap (with Stuck Detection - GSD-2 Pattern)
898
+
899
+ Display stage banner:
900
+ ```
901
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
902
+ EZ ► CREATING ROADMAP
903
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
904
+
905
+ Spawning roadmapper...
906
+ ```
907
+
908
+ **Initialize stuck detection:**
909
+
910
+ ```bash
911
+ # Start stuck watcher
912
+ node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" stuck-watch start \
913
+ --operation="roadmap-creation" \
914
+ --max-retries=1 \
915
+ --timeout=300
916
+ ```
917
+
918
+ ```
919
+ Task(prompt="
920
+ <planning_context>
921
+ <files_to_read>
922
+ - .planning/PROJECT.md
923
+ - .planning/REQUIREMENTS.md
924
+ - .planning/research/SUMMARY.md (if exists)
925
+ - .planning/config.json
926
+ </files_to_read>
927
+ </planning_context>
928
+
929
+ <instructions>
930
+ Create roadmap for new project:
931
+ 1. Start phase numbering from 1
932
+ 2. Derive phases from requirements
933
+ 3. Map every requirement to exactly one phase
934
+ 4. Derive 2-5 success criteria per phase (observable user behaviors)
935
+ 5. Validate 100% coverage
936
+ 6. Write files immediately (ROADMAP.md, STATE.md, update REQUIREMENTS.md traceability)
937
+ 7. Return ROADMAP CREATED with summary
938
+
939
+ Write files first, then return.
940
+ </instructions>
941
+ ", subagent_type="ez-roadmapper", model="{roadmapper_model}", description="Create roadmap")
942
+ ```
943
+
944
+ **Handle return:**
945
+
946
+ **If `## ROADMAP BLOCKED`:**
947
+ 1. Log error type and location
948
+ 2. Retry ONCE with diagnostic context:
949
+ ```
950
+ Task(prompt="
951
+ <retry_context>
952
+ PREVIOUS ATTEMPT FAILED
953
+ Error Type: [error_type]
954
+ Error Location: [location]
955
+ Suggested Fix: [fix]
956
+
957
+ CONTEXT SNAPSHOT FOR DEBUGGING:
958
+ [snapshot of files read]
959
+
960
+ Please try again with this diagnostic information.
961
+ </retry_context>
962
+ ", subagent_type="ez-roadmapper", model="{roadmapper_model}", description="Create roadmap (retry)")
963
+ ```
964
+ 3. If fails again → STOP with exact failure report:
965
+ ```
966
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
967
+ EZ ► ROADMAP CREATION FAILED
968
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
969
+
970
+ Error Type: [type]
971
+ Error Location: [file:line]
972
+ Suggested Fix: [action]
973
+
974
+ Debug: Run `/ez:debug` to see current session state
975
+
976
+ Next Steps:
977
+ 1. Review error details
978
+ 2. Fix [specific issue]
979
+ 3. Run: /ez:new-project --retry
980
+ ```
981
+
982
+ **If `## ROADMAP CREATED`:** Read ROADMAP.md, present inline:
983
+
984
+ ```
985
+ ## Proposed Roadmap
986
+
987
+ **[N] phases** | **[X] requirements mapped** | All covered ✓
988
+
989
+ | # | Phase | Goal | Requirements | Success Criteria |
990
+ |---|-------|------|--------------|------------------|
991
+ | 1 | [Name] | [Goal] | [REQ-IDs] | [count] |
992
+
993
+ ### Phase Details
994
+
995
+ **Phase 1: [Name]**
996
+ Goal: [goal]
997
+ Requirements: [REQ-IDs]
998
+ Success criteria:
999
+ 1. [criterion]
1000
+ 2. [criterion]
1001
+ ```
1002
+
1003
+ **Ask for approval** via AskUserQuestion:
1004
+ - "Approve" — Commit and continue
1005
+ - "Adjust phases" Tell me what to change
1006
+ - "Review full file" — Show raw ROADMAP.md
1007
+
1008
+ **If "Adjust":** Get notes, re-spawn roadmapper with revision context, loop until approved.
1009
+ **If "Review":** Display raw ROADMAP.md, re-ask.
1010
+
1011
+ **Commit roadmap** (after approval):
1012
+ ```bash
1013
+ node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" commit "docs: create project roadmap ([N] phases)" --files .planning/ROADMAP.md .planning/STATE.md .planning/REQUIREMENTS.md
1014
+ ```
1015
+
1016
+ **Update lock file state:**
1017
+ ```bash
1018
+ node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" lock-update --state="roadmap_created"
1019
+ ```
1020
+
1021
+ ---
1022
+
1023
+ ## 9. Release Lock File
1024
+
1025
+ **Project initialization complete:**
1026
+
1027
+ ```bash
1028
+ node "$HOME/.claude/ez-agents/bin/ez-tools.cjs" lock-release
1029
+ ```
1030
+
1031
+ ---
1032
+
1033
+ ## 10. Done
1034
+
1035
+ ```
1036
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1037
+ EZ ► PROJECT INITIALIZED ✓
1038
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1039
+
1040
+ **Project: [Project Name]**
1041
+
1042
+ | Artifact | Location |
1043
+ |----------------|-----------------------------|
1044
+ | Project | `.planning/PROJECT.md` |
1045
+ | Research | `.planning/research/` |
1046
+ | Requirements | `.planning/REQUIREMENTS.md` |
1047
+ | Roadmap | `.planning/ROADMAP.md` |
1048
+ | Config | `.planning/config.json` |
1049
+
1050
+ **[N] phases** | **[X] requirements** | Ready to build ✓
1051
+
1052
+ ## ▶ Next Up
1053
+
1054
+ **Phase 1: [Phase Name]** — [Goal]
1055
+
1056
+ `/ez:discuss-phase 1` — gather context and clarify approach
1057
+
1058
+ <sub>`/clear` first → fresh context window</sub>
1059
+
1060
+ Also: `/ez:plan-phase 1` — skip discussion, plan directly
1061
+ ```
1062
+
1063
+ </process>
1064
+
1065
+ <success_criteria>
1066
+ - [ ] Pre-flight health check passed (all systems go)
1067
+ - [ ] Lock file created and maintained throughout
1068
+ - [ ] PROJECT.md created with clear core value
1069
+ - [ ] REQUIREMENTS.md created with REQ-IDs
1070
+ - [ ] ROADMAP.md created with phased execution plan
1071
+ - [ ] STATE.md initialized
1072
+ - [ ] Config.json created with workflow preferences
1073
+ - [ ] Research completed (if selected) — 4 parallel agents with fresh context
1074
+ - [ ] Requirements gathered and scoped per category
1075
+ - [ ] ez-roadmapper spawned with stuck detection
1076
+ - [ ] Roadmap files written immediately (not draft)
1077
+ - [ ] User feedback incorporated (if any)
1078
+ - [ ] All commits made (if planning docs committed)
1079
+ - [ ] Lock file released on completion
1080
+ - [ ] User knows next step: `/ez:discuss-phase 1`
1081
+
1082
+ **Atomic commits:** Each artifact committed immediately after creation.
1083
+
1084
+ **GSD-2 Reliability:**
1085
+ - Health check pre-flight validation
1086
+ - Crash recovery via lock files
1087
+ - Fresh context per researcher/agent
1088
+ - Stuck detection with diagnostics during roadmap creation
1089
+ </success_criteria>