@howlil/ez-agents 3.4.2 → 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 (365) hide show
  1. package/README.md +735 -462
  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 -0
  18. package/agents/ez-requirements-agent.md +377 -0
  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/install.js +3221 -3272
  30. package/bin/lib/analytics/analytics-collector.cjs +86 -0
  31. package/bin/lib/analytics/analytics-reporter.cjs +130 -0
  32. package/bin/lib/analytics/cohort-analyzer.cjs +138 -0
  33. package/bin/lib/analytics/funnel-analyzer.cjs +147 -0
  34. package/bin/lib/analytics/nps-tracker.cjs +147 -0
  35. package/bin/lib/archetype-detector.cjs +289 -0
  36. package/bin/lib/assistant-adapter.cjs +361 -0
  37. package/bin/lib/audit-exec.cjs +175 -0
  38. package/bin/lib/auth.cjs +176 -0
  39. package/bin/lib/backup-service.cjs +422 -0
  40. package/bin/lib/bdd-validator.cjs +622 -0
  41. package/bin/lib/business-flow-mapper.cjs +429 -0
  42. package/bin/lib/circuit-breaker.cjs +276 -0
  43. package/bin/lib/code-complexity-analyzer.cjs +360 -0
  44. package/bin/lib/codebase-analyzer.cjs +241 -0
  45. package/bin/lib/commands.cjs +691 -0
  46. package/bin/lib/config.cjs +236 -0
  47. package/bin/lib/constraint-extractor.cjs +526 -0
  48. package/bin/lib/content-scanner.cjs +238 -0
  49. package/bin/lib/context-cache.cjs +154 -0
  50. package/bin/lib/context-compressor.cjs +102 -0
  51. package/bin/lib/context-deduplicator.cjs +105 -0
  52. package/bin/lib/context-errors.cjs +78 -0
  53. package/bin/lib/context-manager.cjs +338 -0
  54. package/bin/lib/context-metadata-tracker.cjs +140 -0
  55. package/bin/lib/context-relevance-scorer.cjs +99 -0
  56. package/bin/lib/core.cjs +507 -0
  57. package/bin/lib/cost-alerts.cjs +174 -0
  58. package/bin/lib/cost-tracker.cjs +275 -0
  59. package/bin/lib/crash-recovery.cjs +220 -0
  60. package/bin/lib/dependency-graph.cjs +319 -0
  61. package/bin/lib/deploy/deploy-audit-log.cjs +76 -0
  62. package/bin/lib/deploy/deploy-detector.cjs +69 -0
  63. package/bin/lib/deploy/deploy-env-manager.cjs +109 -0
  64. package/bin/lib/deploy/deploy-health-check.cjs +88 -0
  65. package/bin/lib/deploy/deploy-pre-flight.cjs +57 -0
  66. package/bin/lib/deploy/deploy-rollback.cjs +72 -0
  67. package/bin/lib/deploy/deploy-runner.cjs +97 -0
  68. package/bin/lib/deploy/deploy-status.cjs +74 -0
  69. package/bin/lib/discussion-synthesizer.cjs +439 -0
  70. package/bin/lib/error-cache.cjs +114 -0
  71. package/bin/lib/error-registry.cjs +177 -0
  72. package/bin/lib/file-access.cjs +207 -0
  73. package/bin/lib/file-lock.cjs +236 -0
  74. package/bin/lib/finops/budget-enforcer.cjs +126 -0
  75. package/bin/lib/finops/cost-reporter.cjs +132 -0
  76. package/bin/lib/finops/finops-analyzer.cjs +112 -0
  77. package/bin/lib/finops/spot-manager.cjs +118 -0
  78. package/bin/lib/framework-detector.cjs +396 -0
  79. package/bin/lib/frontmatter.cjs +313 -0
  80. package/bin/lib/fs-utils.cjs +153 -0
  81. package/bin/lib/gate-executor.cjs +272 -0
  82. package/bin/lib/gates/README.md +374 -0
  83. package/bin/lib/gates/gate-01-requirement.cjs +303 -0
  84. package/bin/lib/gates/gate-02-architecture.cjs +555 -0
  85. package/bin/lib/gates/gate-03-code.cjs +635 -0
  86. package/bin/lib/gates/gate-04-security.cjs +829 -0
  87. package/bin/lib/git-errors.cjs +83 -0
  88. package/bin/lib/git-utils.cjs +321 -0
  89. package/bin/lib/git-workflow-engine.cjs +1157 -0
  90. package/bin/lib/health-check.cjs +227 -0
  91. package/bin/lib/index.cjs +279 -0
  92. package/bin/lib/init.cjs +725 -0
  93. package/bin/lib/lock-logger.cjs +194 -0
  94. package/bin/lib/lock-state.cjs +263 -0
  95. package/bin/lib/lockfile-validator.cjs +227 -0
  96. package/bin/lib/log-rotation.cjs +71 -0
  97. package/bin/lib/logger.cjs +125 -0
  98. package/bin/lib/memory-compression.cjs +256 -0
  99. package/bin/lib/milestone.cjs +247 -0
  100. package/bin/lib/model-provider.cjs +241 -0
  101. package/bin/lib/package-manager-detector.cjs +203 -0
  102. package/bin/lib/package-manager-executor.cjs +385 -0
  103. package/bin/lib/package-manager-service.cjs +216 -0
  104. package/bin/lib/perf/api-monitor.cjs +88 -0
  105. package/bin/lib/perf/db-optimizer.cjs +78 -0
  106. package/bin/lib/perf/frontend-performance.cjs +56 -0
  107. package/bin/lib/perf/perf-analyzer.cjs +77 -0
  108. package/bin/lib/perf/perf-baseline.cjs +102 -0
  109. package/bin/lib/perf/perf-reporter.cjs +117 -0
  110. package/bin/lib/perf/regression-detector.cjs +92 -0
  111. package/bin/lib/phase.cjs +963 -0
  112. package/bin/lib/planning-write.cjs +123 -0
  113. package/bin/lib/project-reporter.cjs +565 -0
  114. package/bin/lib/quality-gate.cjs +332 -0
  115. package/bin/lib/quality-metrics.cjs +324 -0
  116. package/bin/lib/recovery-manager.cjs +98 -0
  117. package/bin/lib/release-validator.cjs +617 -0
  118. package/bin/lib/retry.cjs +119 -0
  119. package/bin/lib/roadmap.cjs +309 -0
  120. package/bin/lib/safe-exec.cjs +173 -0
  121. package/bin/lib/safe-path.cjs +130 -0
  122. package/bin/lib/security-errors.cjs +62 -0
  123. package/bin/lib/session-chain.cjs +304 -0
  124. package/bin/lib/session-errors.cjs +81 -0
  125. package/bin/lib/session-export.cjs +251 -0
  126. package/bin/lib/session-import.cjs +262 -0
  127. package/bin/lib/session-manager.cjs +280 -0
  128. package/bin/lib/skill-context.cjs +148 -0
  129. package/bin/lib/skill-matcher.cjs +236 -0
  130. package/bin/lib/skill-registry.cjs +360 -0
  131. package/bin/lib/skill-resolver.cjs +449 -0
  132. package/bin/lib/skill-triggers.cjs +90 -0
  133. package/bin/lib/skill-validator.cjs +270 -0
  134. package/bin/lib/skill-versioning.cjs +355 -0
  135. package/bin/lib/stack-detector.cjs +399 -0
  136. package/bin/lib/state.cjs +736 -0
  137. package/bin/lib/tech-debt-analyzer.cjs +309 -0
  138. package/bin/lib/temp-file.cjs +239 -0
  139. package/bin/lib/template.cjs +223 -0
  140. package/bin/lib/test-file-lock.cjs +112 -0
  141. package/bin/lib/test-graceful.cjs +93 -0
  142. package/bin/lib/test-logger.cjs +60 -0
  143. package/bin/lib/test-safe-exec.cjs +38 -0
  144. package/bin/lib/test-safe-path.cjs +33 -0
  145. package/bin/lib/test-temp-file.cjs +125 -0
  146. package/bin/lib/tier-manager.cjs +428 -0
  147. package/bin/lib/timeout-exec.cjs +63 -0
  148. package/bin/lib/tradeoff-analyzer.cjs +284 -0
  149. package/bin/lib/url-fetch.cjs +170 -0
  150. package/bin/lib/verify.cjs +863 -0
  151. package/bin/update.js +217 -214
  152. package/commands/deploy.cjs +53 -0
  153. package/commands/ez/add-tests.md +41 -41
  154. package/commands/ez/audit-milestone.md +36 -36
  155. package/commands/ez/complete-milestone.md +136 -136
  156. package/commands/ez/discuss-phase.md +90 -90
  157. package/commands/ez/execute-phase.md +52 -41
  158. package/commands/ez/help.md +22 -22
  159. package/commands/ez/map-codebase.md +71 -71
  160. package/commands/ez/new-milestone.md +44 -44
  161. package/commands/ez/new-project.md +51 -42
  162. package/commands/ez/plan-phase.md +53 -45
  163. package/commands/ez/progress.md +36 -24
  164. package/commands/ez/quick.md +45 -45
  165. package/commands/ez/resume-work.md +40 -40
  166. package/commands/ez/run-phase.md +580 -0
  167. package/commands/ez/settings.md +36 -36
  168. package/commands/ez/update.md +37 -37
  169. package/commands/ez/verify-work.md +402 -38
  170. package/commands/health-check.cjs +44 -0
  171. package/commands/rollback.cjs +47 -0
  172. package/ez-agents/bin/ez-tools.cjs +1692 -716
  173. package/ez-agents/bin/guards/autonomy-guard.cjs +346 -0
  174. package/ez-agents/bin/guards/context-budget-guard.cjs +247 -0
  175. package/ez-agents/bin/guards/hallucination-guard.cjs +271 -0
  176. package/ez-agents/bin/guards/hidden-state-guard.cjs +182 -0
  177. package/ez-agents/bin/guards/team-overhead-guard.cjs +266 -0
  178. package/ez-agents/bin/guards/tool-sprawl-guard.cjs +271 -0
  179. package/ez-agents/bin/lib/analytics/analytics-collector.cjs +86 -0
  180. package/ez-agents/bin/lib/analytics/analytics-reporter.cjs +130 -0
  181. package/ez-agents/bin/lib/analytics/cohort-analyzer.cjs +138 -0
  182. package/ez-agents/bin/lib/analytics/funnel-analyzer.cjs +147 -0
  183. package/ez-agents/bin/lib/analytics/nps-tracker.cjs +147 -0
  184. package/ez-agents/bin/lib/archetype-detector.cjs +289 -0
  185. package/ez-agents/bin/lib/audit-exec.cjs +166 -167
  186. package/ez-agents/bin/lib/auth.cjs +176 -176
  187. package/ez-agents/bin/lib/backup-service.cjs +422 -0
  188. package/ez-agents/bin/lib/bdd-validator.cjs +622 -0
  189. package/ez-agents/bin/lib/business-flow-mapper.cjs +429 -0
  190. package/ez-agents/bin/lib/code-complexity-analyzer.cjs +360 -0
  191. package/ez-agents/bin/lib/codebase-analyzer.cjs +241 -0
  192. package/ez-agents/bin/lib/commands.cjs +685 -685
  193. package/ez-agents/bin/lib/config.cjs +41 -1
  194. package/ez-agents/bin/lib/constraint-extractor.cjs +526 -0
  195. package/ez-agents/bin/lib/content-scanner.cjs +238 -0
  196. package/ez-agents/bin/lib/context-cache.cjs +154 -0
  197. package/ez-agents/bin/lib/context-errors.cjs +71 -0
  198. package/ez-agents/bin/lib/context-manager.cjs +220 -0
  199. package/ez-agents/bin/lib/core.cjs +507 -512
  200. package/ez-agents/bin/lib/cost-tracker.cjs +243 -0
  201. package/ez-agents/bin/lib/crash-recovery.cjs +172 -0
  202. package/ez-agents/bin/lib/dependency-graph.cjs +319 -0
  203. package/ez-agents/bin/lib/deploy/deploy-audit-log.cjs +76 -0
  204. package/ez-agents/bin/lib/deploy/deploy-detector.cjs +69 -0
  205. package/ez-agents/bin/lib/deploy/deploy-env-manager.cjs +109 -0
  206. package/ez-agents/bin/lib/deploy/deploy-health-check.cjs +88 -0
  207. package/ez-agents/bin/lib/deploy/deploy-pre-flight.cjs +57 -0
  208. package/ez-agents/bin/lib/deploy/deploy-rollback.cjs +72 -0
  209. package/ez-agents/bin/lib/deploy/deploy-runner.cjs +97 -0
  210. package/ez-agents/bin/lib/deploy/deploy-status.cjs +74 -0
  211. package/ez-agents/bin/lib/discussion-synthesizer.cjs +458 -0
  212. package/ez-agents/bin/lib/file-access.cjs +207 -0
  213. package/ez-agents/bin/lib/finops/budget-enforcer.cjs +126 -0
  214. package/ez-agents/bin/lib/finops/cost-reporter.cjs +132 -0
  215. package/ez-agents/bin/lib/finops/finops-analyzer.cjs +112 -0
  216. package/ez-agents/bin/lib/finops/spot-manager.cjs +118 -0
  217. package/ez-agents/bin/lib/framework-detector.cjs +396 -0
  218. package/ez-agents/bin/lib/frontmatter.cjs +3 -1
  219. package/ez-agents/bin/lib/gates/README.md +374 -0
  220. package/ez-agents/bin/lib/gates/gate-01-requirement.cjs +303 -0
  221. package/ez-agents/bin/lib/gates/gate-02-architecture.cjs +555 -0
  222. package/ez-agents/bin/lib/gates/gate-03-code.cjs +635 -0
  223. package/ez-agents/bin/lib/gates/gate-04-security.cjs +829 -0
  224. package/ez-agents/bin/lib/git-errors.cjs +83 -0
  225. package/ez-agents/bin/lib/git-utils.cjs +118 -0
  226. package/ez-agents/bin/lib/git-workflow-engine.cjs +1157 -0
  227. package/ez-agents/bin/lib/health-check.cjs +162 -162
  228. package/ez-agents/bin/lib/index.cjs +40 -2
  229. package/ez-agents/bin/lib/init.cjs +0 -2
  230. package/ez-agents/bin/lib/lockfile-validator.cjs +227 -0
  231. package/ez-agents/bin/lib/log-rotation.cjs +71 -0
  232. package/ez-agents/bin/lib/logger.cjs +99 -154
  233. package/ez-agents/bin/lib/memory-compression.cjs +256 -0
  234. package/ez-agents/bin/lib/package-manager-detector.cjs +203 -0
  235. package/ez-agents/bin/lib/package-manager-executor.cjs +385 -0
  236. package/ez-agents/bin/lib/package-manager-service.cjs +216 -0
  237. package/ez-agents/bin/lib/perf/api-monitor.cjs +88 -0
  238. package/ez-agents/bin/lib/perf/db-optimizer.cjs +78 -0
  239. package/ez-agents/bin/lib/perf/frontend-performance.cjs +56 -0
  240. package/ez-agents/bin/lib/perf/perf-analyzer.cjs +77 -0
  241. package/ez-agents/bin/lib/perf/perf-baseline.cjs +102 -0
  242. package/ez-agents/bin/lib/perf/perf-reporter.cjs +117 -0
  243. package/ez-agents/bin/lib/perf/regression-detector.cjs +92 -0
  244. package/ez-agents/bin/lib/project-reporter.cjs +502 -0
  245. package/ez-agents/bin/lib/quality-gate.cjs +332 -0
  246. package/ez-agents/bin/lib/recovery-manager.cjs +98 -0
  247. package/ez-agents/bin/lib/release-validator.cjs +617 -0
  248. package/ez-agents/bin/lib/safe-exec.cjs +128 -214
  249. package/ez-agents/bin/lib/security-errors.cjs +62 -0
  250. package/ez-agents/bin/lib/session-chain.cjs +304 -0
  251. package/ez-agents/bin/lib/session-errors.cjs +81 -0
  252. package/ez-agents/bin/lib/session-export.cjs +251 -0
  253. package/ez-agents/bin/lib/session-import.cjs +262 -0
  254. package/ez-agents/bin/lib/session-manager.cjs +280 -0
  255. package/ez-agents/bin/lib/skill-context.cjs +148 -0
  256. package/ez-agents/bin/lib/skill-matcher.cjs +236 -0
  257. package/ez-agents/bin/lib/skill-registry.cjs +341 -0
  258. package/ez-agents/bin/lib/skill-resolver.cjs +449 -0
  259. package/ez-agents/bin/lib/skill-triggers.cjs +90 -0
  260. package/ez-agents/bin/lib/skill-validator.cjs +270 -0
  261. package/ez-agents/bin/lib/skill-versioning.cjs +355 -0
  262. package/ez-agents/bin/lib/stack-detector.cjs +399 -0
  263. package/ez-agents/bin/lib/tech-debt-analyzer.cjs +309 -0
  264. package/ez-agents/bin/lib/tier-manager.cjs +428 -0
  265. package/ez-agents/bin/lib/tradeoff-analyzer.cjs +284 -0
  266. package/ez-agents/bin/lib/url-fetch.cjs +170 -0
  267. package/ez-agents/bin/lib/verify.cjs +863 -863
  268. package/ez-agents/references/decimal-phase-calculation.md +65 -65
  269. package/ez-agents/references/git-integration.md +248 -248
  270. package/ez-agents/references/git-planning-commit.md +38 -38
  271. package/ez-agents/references/metrics-schema.md +118 -0
  272. package/ez-agents/references/model-profile-resolution.md +34 -34
  273. package/ez-agents/references/model-profiles.md +93 -93
  274. package/ez-agents/references/phase-argument-parsing.md +61 -61
  275. package/ez-agents/references/planning-config.md +340 -200
  276. package/ez-agents/references/tier-strategy.md +103 -0
  277. package/ez-agents/references/ui-brand.md +160 -160
  278. package/ez-agents/references/verification-patterns.md +612 -612
  279. package/ez-agents/templates/DEBUG.md +164 -164
  280. package/ez-agents/templates/UAT.md +247 -247
  281. package/ez-agents/templates/agent-output-format.md +404 -0
  282. package/ez-agents/templates/bdd-feature.md +173 -0
  283. package/ez-agents/templates/codebase/architecture.md +255 -255
  284. package/ez-agents/templates/codebase/structure.md +285 -285
  285. package/ez-agents/templates/copilot-instructions.md +7 -7
  286. package/ez-agents/templates/debug-subagent-prompt.md +91 -91
  287. package/ez-agents/templates/discovery.md +146 -146
  288. package/ez-agents/templates/discussion.md +68 -0
  289. package/ez-agents/templates/handoff-protocol.md +294 -0
  290. package/ez-agents/templates/incident-runbook.md +205 -0
  291. package/ez-agents/templates/mode-workflow-templates.md +301 -0
  292. package/ez-agents/templates/phase-prompt.md +610 -610
  293. package/ez-agents/templates/planner-subagent-prompt.md +117 -117
  294. package/ez-agents/templates/project.md +184 -184
  295. package/ez-agents/templates/release-checklist.md +136 -0
  296. package/ez-agents/templates/research.md +552 -552
  297. package/ez-agents/templates/rollback-plan.md +201 -0
  298. package/ez-agents/templates/security-user-setup.md +244 -0
  299. package/ez-agents/templates/skill-validation-rules.md +476 -0
  300. package/ez-agents/templates/state.md +180 -176
  301. package/ez-agents/templates/summary-complex.md +59 -59
  302. package/ez-agents/tests/gates/gate-01-02.test.cjs +812 -0
  303. package/ez-agents/tests/gates/gate-03-04.test.cjs +762 -0
  304. package/ez-agents/tests/gates/gate-05-validator.test.cjs +145 -0
  305. package/ez-agents/tests/gates/gate-06-docs-validator.test.cjs +244 -0
  306. package/ez-agents/tests/gates/gate-07-release-validator.test.cjs +219 -0
  307. package/ez-agents/tests/guards/context-budget-guard.test.cjs +145 -0
  308. package/ez-agents/tests/guards/edge-case-guards.test.cjs +238 -0
  309. package/ez-agents/tests/guards/hallucination-guard.test.cjs +124 -0
  310. package/ez-agents/workflows/audit-milestone.md +1 -1
  311. package/ez-agents/workflows/autonomous.md +131 -30
  312. package/ez-agents/workflows/complete-milestone.md +1 -1
  313. package/ez-agents/workflows/discuss-phase.md +1 -1
  314. package/ez-agents/workflows/execute-phase.md +169 -3
  315. package/ez-agents/workflows/help.md +86 -133
  316. package/ez-agents/workflows/hotfix.md +291 -0
  317. package/ez-agents/workflows/new-milestone.md +340 -11
  318. package/ez-agents/workflows/new-project.md +294 -318
  319. package/ez-agents/workflows/plan-phase.md +22 -40
  320. package/ez-agents/workflows/progress.md +15 -25
  321. package/ez-agents/workflows/release.md +253 -0
  322. package/ez-agents/workflows/resume-session.md +215 -0
  323. package/ez-agents/workflows/run-phase.md +531 -0
  324. package/ez-agents/workflows/settings.md +2 -35
  325. package/hooks/dist/ez-check-update.js +81 -81
  326. package/hooks/dist/ez-context-monitor.js +148 -141
  327. package/hooks/dist/ez-statusline.js +115 -115
  328. package/package.json +78 -64
  329. package/scripts/fix-qwen-installation.js +144 -144
  330. package/agents/ez-integration-checker.md +0 -443
  331. package/agents/ez-nyquist-auditor.md +0 -176
  332. package/agents/ez-plan-checker.md +0 -706
  333. package/agents/ez-research-synthesizer.md +0 -247
  334. package/agents/ez-ui-auditor.md +0 -439
  335. package/agents/ez-ui-checker.md +0 -300
  336. package/agents/ez-ui-researcher.md +0 -353
  337. package/commands/ez/add-phase.md +0 -43
  338. package/commands/ez/add-todo.md +0 -47
  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/health.md +0 -22
  345. package/commands/ez/insert-phase.md +0 -32
  346. package/commands/ez/join-discord.md +0 -18
  347. package/commands/ez/list-phase-assumptions.md +0 -46
  348. package/commands/ez/pause-work.md +0 -38
  349. package/commands/ez/plan-milestone-gaps.md +0 -34
  350. package/commands/ez/reapply-patches.md +0 -124
  351. package/commands/ez/remove-phase.md +0 -31
  352. package/commands/ez/research-phase.md +0 -190
  353. package/commands/ez/set-profile.md +0 -34
  354. package/commands/ez/stats.md +0 -18
  355. package/commands/ez/ui-phase.md +0 -34
  356. package/commands/ez/ui-review.md +0 -32
  357. package/commands/ez/validate-phase.md +0 -35
  358. package/ez-agents/templates/UI-SPEC.md +0 -100
  359. package/ez-agents/templates/VALIDATION.md +0 -76
  360. package/ez-agents/templates/context.md +0 -352
  361. package/ez-agents/templates/verification-report.md +0 -322
  362. package/ez-agents/workflows/research-phase.md +0 -74
  363. package/ez-agents/workflows/ui-phase.md +0 -290
  364. package/ez-agents/workflows/ui-review.md +0 -157
  365. package/ez-agents/workflows/validate-phase.md +0 -167
@@ -12,9 +12,17 @@ const VALID_CONFIG_KEYS = new Set([
12
12
  'search_gitignored', 'brave_search',
13
13
  'workflow.research', 'workflow.plan_check', 'workflow.verifier',
14
14
  'workflow.nyquist_validation', 'workflow.ui_phase', 'workflow.ui_safety_gate',
15
- 'workflow._auto_chain_active',
15
+ 'workflow._auto_chain_active', 'workflow.auto_advance',
16
16
  'git.branching_strategy', 'git.phase_branch_template', 'git.milestone_branch_template',
17
17
  'planning.commit_docs', 'planning.search_gitignored',
18
+ 'security.provider', 'security.scan.default_mode', 'security.scan.block_on_critical',
19
+ 'security.headers_profile', 'security.audit_logs.enabled', 'security.audit_logs.format',
20
+ 'recovery.enabled', 'recovery.backup_scope', 'recovery.retention.local_backups',
21
+ 'recovery.retention.drill_reports', 'recovery.rto_minutes.planning_state',
22
+ 'recovery.rto_minutes.release_metadata', 'recovery.rpo_minutes.planning_state',
23
+ 'recovery.rpo_minutes.release_metadata',
24
+ 'infrastructure.enabled', 'infrastructure.provider', 'infrastructure.environments',
25
+ 'infrastructure.validation.checkov', 'infrastructure.validation.cdk_nag',
18
26
  ]);
19
27
 
20
28
  function cmdConfigEnsureSection(cwd, raw) {
@@ -82,6 +90,38 @@ function cmdConfigEnsureSection(cwd, raw) {
82
90
  },
83
91
  parallelization: true,
84
92
  brave_search: hasBraveSearch,
93
+ recovery: {
94
+ enabled: true,
95
+ backup_scope: [
96
+ '.planning',
97
+ '.github/workflows',
98
+ 'commands',
99
+ 'ez-agents/bin/lib',
100
+ 'package.json',
101
+ 'package-lock.json'
102
+ ],
103
+ retention: {
104
+ local_backups: 10,
105
+ drill_reports: 12
106
+ },
107
+ rto_minutes: {
108
+ planning_state: 30,
109
+ release_metadata: 60
110
+ },
111
+ rpo_minutes: {
112
+ planning_state: 1440,
113
+ release_metadata: 1440
114
+ }
115
+ },
116
+ infrastructure: {
117
+ enabled: true,
118
+ provider: 'aws',
119
+ environments: ['dev', 'staging', 'prod'],
120
+ validation: {
121
+ checkov: true,
122
+ cdk_nag: true
123
+ }
124
+ }
85
125
  };
86
126
  const defaults = {
87
127
  ...hardcoded,
@@ -0,0 +1,526 @@
1
+ /**
2
+ * Constraint Extractor — Analyzes project documentation and configuration for constraints
3
+ *
4
+ * Provides:
5
+ * - extract(rootPath): Orchestrates all constraint extraction methods
6
+ * - extractDeadlines(rootPath): Finds deadline mentions in docs
7
+ * - extractTeamSize(rootPath): Infers team size from various signals
8
+ * - extractBudgetTier(rootPath): Detects budget tier from tool/hosting choices
9
+ * - extractCompliance(rootPath): Finds compliance requirements
10
+ * - extractLegacyFactors(rootPath): Detects legacy system indicators
11
+ * - extractScalabilityNeeds(rootPath): Infers scalability from infrastructure
12
+ */
13
+
14
+ const fs = require('fs');
15
+ const path = require('path');
16
+ const { execSync } = require('child_process');
17
+
18
+ class ConstraintExtractor {
19
+ constructor(rootPath) {
20
+ this.rootPath = rootPath;
21
+ }
22
+
23
+ /**
24
+ * Extract all constraints from codebase
25
+ * @param {string} rootPath - Root directory to analyze
26
+ * @returns {object} Constraints object with deadlines, teamSize, budgetTier, compliance, legacyFactors, scalabilityNeeds
27
+ */
28
+ extract(rootPath = this.rootPath) {
29
+ return {
30
+ deadlines: this.extractDeadlines(rootPath),
31
+ teamSize: this.extractTeamSize(rootPath),
32
+ budgetTier: this.extractBudgetTier(rootPath),
33
+ compliance: this.extractCompliance(rootPath),
34
+ legacyFactors: this.extractLegacyFactors(rootPath),
35
+ scalabilityNeeds: this.extractScalabilityNeeds(rootPath)
36
+ };
37
+ }
38
+
39
+ /**
40
+ * Extract deadline constraints from documentation
41
+ * @param {string} rootPath - Root directory to analyze
42
+ * @returns {Array} Array of deadline objects with type, value, source, confidence, evidence
43
+ */
44
+ extractDeadlines(rootPath = this.rootPath) {
45
+ const deadlines = [];
46
+ const filesToSearch = [
47
+ 'README.md',
48
+ 'docs/ROADMAP.md',
49
+ 'docs/PLANNING.md',
50
+ '.planning/roadmap.md',
51
+ 'MILESTONES.md',
52
+ 'package.json'
53
+ ];
54
+
55
+ const patterns = [
56
+ { regex: /\b(Q[1-4]\s*\d{4})\b/i, type: 'quarter' },
57
+ { regex: /\b(202[6-9]|203[0-5])\b/g, type: 'year' },
58
+ { regex: /\b(deadline|due\s+date|launch|release|ship|target|ETA)\s*[:\-]?\s*(.+)/gi, type: 'explicit' },
59
+ { regex: /\b(\d+\s*(weeks?|months?))\b/i, type: 'duration' },
60
+ { regex: /\b(sprint\s*\d+)\b/i, type: 'sprint' }
61
+ ];
62
+
63
+ for (const filePattern of filesToSearch) {
64
+ const filePath = path.join(rootPath, filePattern);
65
+ if (!fs.existsSync(filePath)) continue;
66
+
67
+ try {
68
+ const content = fs.readFileSync(filePath, 'utf8');
69
+
70
+ for (const { regex, type } of patterns) {
71
+ let match;
72
+ // Reset regex lastIndex for global patterns
73
+ regex.lastIndex = 0;
74
+
75
+ while ((match = regex.exec(content)) !== null) {
76
+ const value = match[1] || match[0];
77
+ const evidence = content.substring(
78
+ Math.max(0, match.index - 50),
79
+ Math.min(content.length, match.index + 100)
80
+ ).replace(/\n/g, ' ').trim();
81
+
82
+ deadlines.push({
83
+ type: 'deadline',
84
+ value,
85
+ deadlineType: type,
86
+ source: filePath,
87
+ confidence: type === 'explicit' ? 'Explicit' : 'Implicit',
88
+ evidence
89
+ });
90
+ }
91
+ }
92
+ } catch (err) {
93
+ // Ignore read errors
94
+ }
95
+ }
96
+
97
+ // Check package.json for version-based timelines
98
+ const pkgPath = path.join(rootPath, 'package.json');
99
+ if (fs.existsSync(pkgPath)) {
100
+ try {
101
+ const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
102
+ if (pkg.version) {
103
+ deadlines.push({
104
+ type: 'deadline',
105
+ value: `v${pkg.version}`,
106
+ deadlineType: 'version',
107
+ source: pkgPath,
108
+ confidence: 'Implicit',
109
+ evidence: `Current version: ${pkg.version}`
110
+ });
111
+ }
112
+ } catch (err) {
113
+ // Ignore parse errors
114
+ }
115
+ }
116
+
117
+ return deadlines;
118
+ }
119
+
120
+ /**
121
+ * Extract team size from various signals
122
+ * @param {string} rootPath - Root directory to analyze
123
+ * @returns {object} Team size object with inferred count, confidence, sources
124
+ */
125
+ extractTeamSize(rootPath = this.rootPath) {
126
+ const result = {
127
+ inferred: 1,
128
+ confidence: 'Low',
129
+ sources: []
130
+ };
131
+
132
+ // Check package.json authors
133
+ const pkgPath = path.join(rootPath, 'package.json');
134
+ if (fs.existsSync(pkgPath)) {
135
+ try {
136
+ const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
137
+ if (pkg.author) {
138
+ result.sources.push({ type: 'author', value: pkg.author });
139
+ }
140
+ if (Array.isArray(pkg.authors) && pkg.authors.length > 0) {
141
+ result.inferred = pkg.authors.length;
142
+ result.sources.push({ type: 'authors', count: pkg.authors.length });
143
+ result.confidence = 'Medium';
144
+ }
145
+ if (Array.isArray(pkg.contributors) && pkg.contributors.length > 0) {
146
+ result.inferred = Math.max(result.inferred, pkg.contributors.length);
147
+ result.sources.push({ type: 'contributors', count: pkg.contributors.length });
148
+ result.confidence = 'Medium';
149
+ }
150
+ } catch (err) {
151
+ // Ignore parse errors
152
+ }
153
+ }
154
+
155
+ // Check git history for unique authors
156
+ try {
157
+ const gitOutput = execSync('git log --format="%aN" 2>nul | sort -u | wc -l', {
158
+ cwd: rootPath,
159
+ encoding: 'utf8',
160
+ stdio: ['pipe', 'pipe', 'ignore']
161
+ });
162
+ const gitAuthors = parseInt(gitOutput.trim(), 10);
163
+ if (gitAuthors > 0) {
164
+ result.inferred = Math.max(result.inferred, gitAuthors);
165
+ result.sources.push({ type: 'git_authors', count: gitAuthors });
166
+ if (gitAuthors > 2) {
167
+ result.confidence = 'Medium';
168
+ }
169
+ }
170
+ } catch (err) {
171
+ // Git not available or not a git repo
172
+ }
173
+
174
+ // Check CONTRIBUTING.md for team mentions
175
+ const contributingPath = path.join(rootPath, 'CONTRIBUTING.md');
176
+ if (fs.existsSync(contributingPath)) {
177
+ try {
178
+ const content = fs.readFileSync(contributingPath, 'utf8');
179
+ const teamMatches = content.match(/\b(team|developer|engineer|contributor|maintainer)\b/gi);
180
+ if (teamMatches && teamMatches.length > 0) {
181
+ result.sources.push({ type: 'contributing_mentions', count: teamMatches.length });
182
+ }
183
+ } catch (err) {
184
+ // Ignore read errors
185
+ }
186
+ }
187
+
188
+ // Check README.md for team section
189
+ const readmePath = path.join(rootPath, 'README.md');
190
+ if (fs.existsSync(readmePath)) {
191
+ try {
192
+ const content = fs.readFileSync(readmePath, 'utf8');
193
+ if (content.includes('## Team') || content.includes('## Contributors') || content.includes('## Maintainers')) {
194
+ result.sources.push({ type: 'readme_team_section', value: true });
195
+ }
196
+ } catch (err) {
197
+ // Ignore read errors
198
+ }
199
+ }
200
+
201
+ return result;
202
+ }
203
+
204
+ /**
205
+ * Extract budget tier from hosting and tool choices
206
+ * @param {string} rootPath - Root directory to analyze
207
+ * @returns {object} Budget tier object with tier, confidence, evidence
208
+ */
209
+ extractBudgetTier(rootPath = this.rootPath) {
210
+ const result = {
211
+ tier: 'startup',
212
+ confidence: 'Low',
213
+ evidence: []
214
+ };
215
+
216
+ // Check for hosting config files
217
+ const hostingPatterns = {
218
+ startup: ['vercel.json', 'netlify.toml', '.platform', 'railway.toml', 'render.yaml'],
219
+ enterprise: ['app.yaml', 'terraform/', 'kubernetes/', 'helm/', '.terraform/']
220
+ };
221
+
222
+ // Check for startup hosting
223
+ for (const file of hostingPatterns.startup) {
224
+ const filePath = path.join(rootPath, file);
225
+ if (fs.existsSync(filePath)) {
226
+ result.tier = 'startup';
227
+ result.confidence = 'Medium';
228
+ result.evidence.push({ type: 'hosting', file, tier: 'startup' });
229
+ break;
230
+ }
231
+ }
232
+
233
+ // Check for enterprise hosting (overrides startup)
234
+ for (const file of hostingPatterns.enterprise) {
235
+ const filePath = path.join(rootPath, file);
236
+ if (fs.existsSync(filePath)) {
237
+ result.tier = 'enterprise';
238
+ result.confidence = 'High';
239
+ result.evidence.push({ type: 'hosting', file, tier: 'enterprise' });
240
+ break;
241
+ }
242
+ }
243
+
244
+ // Check package.json for paid services
245
+ const pkgPath = path.join(rootPath, 'package.json');
246
+ if (fs.existsSync(pkgPath)) {
247
+ try {
248
+ const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
249
+ const allDeps = { ...pkg.dependencies, ...pkg.devDependencies };
250
+
251
+ // Enterprise indicators
252
+ const enterpriseDeps = ['@aws-sdk', 'aws-sdk', '@azure', '@google-cloud', 'newrelic', 'datadog-metrics', 'splunk'];
253
+ for (const dep of enterpriseDeps) {
254
+ if (Object.keys(allDeps).some(k => k.includes(dep))) {
255
+ result.tier = 'enterprise';
256
+ result.confidence = 'Medium';
257
+ result.evidence.push({ type: 'dependency', package: dep, tier: 'enterprise' });
258
+ }
259
+ }
260
+ } catch (err) {
261
+ // Ignore parse errors
262
+ }
263
+ }
264
+
265
+ // Check for CI/CD config
266
+ const ciPatterns = {
267
+ startup: ['.github/workflows/', '.gitlab-ci.yml'],
268
+ enterprise: ['.circleci/', 'bitbucket-pipelines.yml', 'azure-pipelines.yml']
269
+ };
270
+
271
+ for (const file of ciPatterns.enterprise) {
272
+ const filePath = path.join(rootPath, file);
273
+ if (fs.existsSync(filePath)) {
274
+ result.confidence = 'Medium';
275
+ result.evidence.push({ type: 'ci_cd', file, indicator: 'enterprise' });
276
+ }
277
+ }
278
+
279
+ return result;
280
+ }
281
+
282
+ /**
283
+ * Extract compliance requirements from documentation
284
+ * @param {string} rootPath - Root directory to analyze
285
+ * @returns {Array} Array of compliance objects with type, requirement, source, evidence
286
+ */
287
+ extractCompliance(rootPath = this.rootPath) {
288
+ const compliance = [];
289
+ const patterns = [
290
+ { regex: /\bGDPR\b/i, requirement: 'GDPR', type: 'data_privacy' },
291
+ { regex: /\bHIPAA\b/i, requirement: 'HIPAA', type: 'healthcare' },
292
+ { regex: /\bSOC2\b/i, requirement: 'SOC2', type: 'security' },
293
+ { regex: /\bPCI[- ]DSS\b/i, requirement: 'PCI-DSS', type: 'payment' },
294
+ { regex: /\b(a11y|accessibility|WCAG)\b/i, requirement: 'Accessibility (WCAG)', type: 'accessibility' },
295
+ { regex: /\bISO\s*27001\b/i, requirement: 'ISO 27001', type: 'security' },
296
+ { regex: /\bSOX\b/i, requirement: 'SOX', type: 'financial' },
297
+ { regex: /\bCCPA\b/i, requirement: 'CCPA', type: 'data_privacy' }
298
+ ];
299
+
300
+ const filesToSearch = [
301
+ 'README.md',
302
+ 'docs/COMPLIANCE.md',
303
+ 'docs/SECURITY.md',
304
+ 'SECURITY.md',
305
+ 'LICENSE',
306
+ 'TERMS.md',
307
+ 'PRIVACY.md'
308
+ ];
309
+
310
+ for (const filePattern of filesToSearch) {
311
+ const filePath = path.join(rootPath, filePattern);
312
+ if (!fs.existsSync(filePath)) continue;
313
+
314
+ try {
315
+ const content = fs.readFileSync(filePath, 'utf8');
316
+
317
+ for (const { regex, requirement, type } of patterns) {
318
+ if (regex.test(content)) {
319
+ const match = content.match(regex);
320
+ compliance.push({
321
+ type: 'compliance',
322
+ requirement,
323
+ complianceType: type,
324
+ source: filePath,
325
+ confidence: 'Explicit',
326
+ evidence: content.substring(
327
+ Math.max(0, match.index - 50),
328
+ Math.min(content.length, match.index + 100)
329
+ ).replace(/\n/g, ' ').trim()
330
+ });
331
+ }
332
+ }
333
+ } catch (err) {
334
+ // Ignore read errors
335
+ }
336
+ }
337
+
338
+ return compliance;
339
+ }
340
+
341
+ /**
342
+ * Extract legacy system factors
343
+ * @param {string} rootPath - Root directory to analyze
344
+ * @returns {Array} Array of legacy factor objects with type, factor, source, severity, evidence
345
+ */
346
+ extractLegacyFactors(rootPath = this.rootPath) {
347
+ const factors = [];
348
+ const patterns = [
349
+ { regex: /\b(deprecated|legacy|migration|upgrade|old\s+version|compatibility)\b/i, severity: 'Medium' },
350
+ { regex: /\b(backward\s*compat|BC\s*break)\b/i, severity: 'High' }
351
+ ];
352
+
353
+ const filesToSearch = [
354
+ 'README.md',
355
+ 'CHANGELOG.md',
356
+ 'docs/MIGRATION.md',
357
+ 'docs/UPGRADE.md',
358
+ 'package.json'
359
+ ];
360
+
361
+ for (const filePattern of filesToSearch) {
362
+ const filePath = path.join(rootPath, filePattern);
363
+ if (!fs.existsSync(filePath)) continue;
364
+
365
+ try {
366
+ const content = fs.readFileSync(filePath, 'utf8');
367
+
368
+ for (const { regex, severity } of patterns) {
369
+ const match = content.match(regex);
370
+ if (match) {
371
+ factors.push({
372
+ type: 'legacy',
373
+ factor: match[0],
374
+ source: filePath,
375
+ severity,
376
+ evidence: content.substring(
377
+ Math.max(0, match.index - 50),
378
+ Math.min(content.length, match.index + 100)
379
+ ).replace(/\n/g, ' ').trim()
380
+ });
381
+ }
382
+ }
383
+ } catch (err) {
384
+ // Ignore read errors
385
+ }
386
+ }
387
+
388
+ // Check for old dependency versions in package.json
389
+ const pkgPath = path.join(rootPath, 'package.json');
390
+ if (fs.existsSync(pkgPath)) {
391
+ try {
392
+ const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
393
+ const allDeps = { ...pkg.dependencies, ...pkg.devDependencies };
394
+
395
+ for (const [name, version] of Object.entries(allDeps)) {
396
+ // Check for very old version patterns (0.x or 1.x for major packages)
397
+ if (version.match(/^[\^~]?[01]\./)) {
398
+ factors.push({
399
+ type: 'legacy',
400
+ factor: `Outdated dependency: ${name}@${version}`,
401
+ source: pkgPath,
402
+ severity: 'Low',
403
+ evidence: `"${name}": "${version}"`
404
+ });
405
+ }
406
+ }
407
+ } catch (err) {
408
+ // Ignore parse errors
409
+ }
410
+ }
411
+
412
+ return factors;
413
+ }
414
+
415
+ /**
416
+ * Extract scalability needs from infrastructure
417
+ * @param {string} rootPath - Root directory to analyze
418
+ * @returns {Array} Array of scalability need objects with type, need, source, evidence
419
+ */
420
+ extractScalabilityNeeds(rootPath = this.rootPath) {
421
+ const needs = [];
422
+ const pkgPath = path.join(rootPath, 'package.json');
423
+
424
+ // Check package.json for scalability indicators
425
+ if (fs.existsSync(pkgPath)) {
426
+ try {
427
+ const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
428
+ const allDeps = { ...pkg.dependencies, ...pkg.devDependencies };
429
+
430
+ // Caching indicators
431
+ const cachingDeps = ['redis', 'ioredis', 'memcached', 'node-cache', 'lru-cache'];
432
+ for (const dep of cachingDeps) {
433
+ if (Object.keys(allDeps).some(k => k.includes(dep))) {
434
+ needs.push({
435
+ type: 'scalability',
436
+ need: 'Caching layer',
437
+ technology: dep,
438
+ source: pkgPath,
439
+ evidence: `Dependency: ${dep}`
440
+ });
441
+ }
442
+ }
443
+
444
+ // Queue system indicators
445
+ const queueDeps = ['bull', 'bullmq', 'rabbitmq', 'kafka-node', 'sqs-consumer', 'sidekiq', 'celery'];
446
+ for (const dep of queueDeps) {
447
+ if (Object.keys(allDeps).some(k => k.includes(dep))) {
448
+ needs.push({
449
+ type: 'scalability',
450
+ need: 'Message queue / Job processing',
451
+ technology: dep,
452
+ source: pkgPath,
453
+ evidence: `Dependency: ${dep}`
454
+ });
455
+ }
456
+ }
457
+
458
+ // Load balancing / clustering indicators
459
+ const clusterDeps = ['cluster', 'pm2', 'node-cluster', 'nginx', 'haproxy'];
460
+ for (const dep of clusterDeps) {
461
+ if (Object.keys(allDeps).some(k => k.includes(dep))) {
462
+ needs.push({
463
+ type: 'scalability',
464
+ need: 'Clustering / Load balancing',
465
+ technology: dep,
466
+ source: pkgPath,
467
+ evidence: `Dependency: ${dep}`
468
+ });
469
+ }
470
+ }
471
+
472
+ // Database scaling indicators
473
+ const dbScalingDeps = ['pg-promise', 'pg-pool', 'typeorm', 'prisma', 'mongoose'];
474
+ for (const dep of dbScalingDeps) {
475
+ if (Object.keys(allDeps).some(k => k.includes(dep))) {
476
+ needs.push({
477
+ type: 'scalability',
478
+ need: 'Database connection pooling',
479
+ technology: dep,
480
+ source: pkgPath,
481
+ evidence: `Dependency: ${dep}`
482
+ });
483
+ }
484
+ }
485
+ } catch (err) {
486
+ // Ignore parse errors
487
+ }
488
+ }
489
+
490
+ // Check for kubernetes/docker configs
491
+ const k8sPath = path.join(rootPath, 'kubernetes');
492
+ const dockerPath = path.join(rootPath, 'Dockerfile');
493
+ const dockerComposePath = path.join(rootPath, 'docker-compose.yml');
494
+
495
+ if (fs.existsSync(k8sPath)) {
496
+ needs.push({
497
+ type: 'scalability',
498
+ need: 'Kubernetes orchestration',
499
+ source: k8sPath,
500
+ evidence: 'Kubernetes configuration directory exists'
501
+ });
502
+ }
503
+
504
+ if (fs.existsSync(dockerPath)) {
505
+ needs.push({
506
+ type: 'scalability',
507
+ need: 'Container deployment',
508
+ source: dockerPath,
509
+ evidence: 'Dockerfile exists'
510
+ });
511
+ }
512
+
513
+ if (fs.existsSync(dockerComposePath)) {
514
+ needs.push({
515
+ type: 'scalability',
516
+ need: 'Multi-service deployment',
517
+ source: dockerComposePath,
518
+ evidence: 'docker-compose.yml exists'
519
+ });
520
+ }
521
+
522
+ return needs;
523
+ }
524
+ }
525
+
526
+ module.exports = { ConstraintExtractor };