claude-flow-novice 2.15.10 → 2.16.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 (652) hide show
  1. package/.claude/cfn-extras/agents/cfn-v3-coordinator.md +517 -0
  2. package/.claude/commands/cfn-loop-cli.md +158 -464
  3. package/.claude/commands/cfn-loop-trigger.md +114 -0
  4. package/.claude/hooks/cfn-invoke-post-edit-ts.sh +100 -0
  5. package/.claude/hooks/cfn-invoke-post-edit-ts.sh.backup +78 -0
  6. package/.claude/hooks/cfn-invoke-post-edit.sh +22 -0
  7. package/.claude/hooks/cfn-invoke-post-edit.sh.backup +87 -0
  8. package/.claude/hooks/cfn-invoke-pre-edit-ts.sh +116 -0
  9. package/.claude/hooks/cfn-invoke-pre-edit-ts.sh.backup +94 -0
  10. package/.claude/hooks/cfn-invoke-pre-edit.sh +22 -0
  11. package/.claude/hooks/cfn-invoke-pre-edit.sh.backup +88 -0
  12. package/.claude/skills/cfn-agent-spawning/SKILL.md +48 -1
  13. package/.claude/skills/cfn-agent-spawning/SKILL.md.backup +135 -0
  14. package/.claude/skills/cfn-agent-spawning/TYPESCRIPT_MIGRATION.md +567 -0
  15. package/.claude/skills/cfn-agent-spawning/check-dependencies.sh +22 -0
  16. package/.claude/skills/{cfn-redis-coordination/check-dependencies.sh → cfn-agent-spawning/check-dependencies.sh.backup} +3 -5
  17. package/.claude/skills/cfn-agent-spawning/get-agent-provider-env.sh +22 -0
  18. package/.claude/skills/cfn-agent-spawning/get-agent-provider-env.sh.backup +127 -0
  19. package/.claude/skills/cfn-agent-spawning/parse-agent-provider.sh +22 -0
  20. package/.claude/skills/cfn-agent-spawning/parse-agent-provider.sh.backup +59 -0
  21. package/.claude/skills/cfn-agent-spawning/spawn-agent-wrapper.sh +63 -0
  22. package/.claude/skills/cfn-agent-spawning/spawn-agent-wrapper.sh.backup +41 -0
  23. package/.claude/skills/cfn-agent-spawning/spawn-agent.sh +26 -1
  24. package/.claude/skills/cfn-agent-spawning/spawn-templates.sh +22 -0
  25. package/.claude/skills/cfn-agent-spawning/spawn-templates.sh.backup +613 -0
  26. package/.claude/skills/cfn-agent-spawning/spawn-worker.sh +22 -0
  27. package/.claude/skills/cfn-agent-spawning/spawn-worker.sh.backup +176 -0
  28. package/.claude/skills/cfn-loop-orchestration/.backups/unknown/1763619700_33aff4a69b99159e4e849107ebc4d09f/metadata.json +8 -0
  29. package/.claude/skills/cfn-loop-orchestration/.backups/unknown/1763619700_33aff4a69b99159e4e849107ebc4d09f/original +271 -0
  30. package/.claude/skills/cfn-loop-orchestration/.backups/unknown/1763619700_33aff4a69b99159e4e849107ebc4d09f/revert.sh +7 -0
  31. package/.claude/skills/cfn-loop-orchestration/.backups/unknown/1763671642_06496e8c399a79db08167cc00ed4b31e/metadata.json +8 -0
  32. package/.claude/skills/cfn-loop-orchestration/.backups/unknown/1763671642_06496e8c399a79db08167cc00ed4b31e/original +325 -0
  33. package/.claude/skills/cfn-loop-orchestration/.backups/unknown/1763671642_06496e8c399a79db08167cc00ed4b31e/revert.sh +7 -0
  34. package/.claude/skills/cfn-loop-orchestration/CLI_IMPLEMENTATION_SUMMARY.md +330 -0
  35. package/.claude/skills/cfn-loop-orchestration/CONFIGURATION_IMPROVEMENTS.md +318 -0
  36. package/.claude/skills/cfn-loop-orchestration/CONTEXT_LOOKUP_MIGRATION.md +308 -0
  37. package/.claude/skills/cfn-loop-orchestration/CONTEXT_LOOKUP_QUICK_START.md +378 -0
  38. package/.claude/skills/cfn-loop-orchestration/E2E_VALIDATION_REPORT.md +262 -0
  39. package/.claude/skills/cfn-loop-orchestration/IMPLEMENTATION_SUMMARY.md +319 -519
  40. package/.claude/skills/cfn-loop-orchestration/NORTH_STAR_E2E_REPORT.md +299 -0
  41. package/.claude/skills/cfn-loop-orchestration/NORTH_STAR_EXECUTION_SUMMARY.md +403 -0
  42. package/.claude/skills/cfn-loop-orchestration/NORTH_STAR_INDEX.md +323 -0
  43. package/.claude/skills/cfn-loop-orchestration/SKILL.md +159 -48
  44. package/.claude/skills/cfn-loop-orchestration/SPAWN_AGENTS_IMPLEMENTATION.md +188 -0
  45. package/.claude/skills/cfn-loop-orchestration/TEST_COVERAGE_REPORT.md +335 -0
  46. package/.claude/skills/cfn-loop-orchestration/TEST_COVERAGE_SUMMARY.md +456 -0
  47. package/.claude/skills/cfn-loop-orchestration/TYPESCRIPT_INTEGRATION_REPORT.md +709 -0
  48. package/.claude/skills/cfn-loop-orchestration/TYPESCRIPT_INTEGRATION_SUMMARY.md +257 -0
  49. package/.claude/skills/cfn-loop-orchestration/VALIDATION_REPORT.md +572 -0
  50. package/.claude/skills/cfn-loop-orchestration/VALIDATION_SUMMARY.txt +196 -0
  51. package/.claude/skills/cfn-loop-orchestration/VALIDATOR_MODULE_GUIDE.md +526 -0
  52. package/.claude/skills/cfn-loop-orchestration/archive/legacy-bash/README.md +167 -0
  53. package/.claude/skills/cfn-loop-orchestration/archive/legacy-bash/orchestrate-enhanced.sh +548 -0
  54. package/{claude-assets/skills/cfn-loop-orchestration → .claude/skills/cfn-loop-orchestration/archive/legacy-bash}/orchestrate-wrapper.sh +11 -1
  55. package/.claude/skills/cfn-loop-orchestration/archive/legacy-bash/orchestrate.sh +182 -0
  56. package/.claude/skills/cfn-loop-orchestration/e2e-validation-fixed.js +240 -0
  57. package/.claude/skills/cfn-loop-orchestration/e2e-validation.js +213 -0
  58. package/.claude/skills/cfn-loop-orchestration/package-lock.json +3 -0
  59. package/.claude/skills/cfn-loop-orchestration/package.json +4 -0
  60. package/.claude/skills/cfn-loop-orchestration/run-north-star-e2e.ts +210 -0
  61. package/.claude/skills/cfn-loop-orchestration/src/cli/orchestrator-cli.ts +396 -0
  62. package/.claude/skills/cfn-loop-orchestration/src/helpers/CONFIDENCE_AGGREGATOR.md +564 -0
  63. package/.claude/skills/cfn-loop-orchestration/src/helpers/CONFIDENCE_AGGREGATOR_QUICK_REF.md +241 -0
  64. package/.claude/skills/cfn-loop-orchestration/src/helpers/CONTEXT_INJECTOR_IMPLEMENTATION.md +375 -0
  65. package/.claude/skills/cfn-loop-orchestration/src/helpers/CONTEXT_INJECTOR_QUICK_REFERENCE.md +362 -0
  66. package/.claude/skills/cfn-loop-orchestration/src/helpers/CONTEXT_INJECTOR_README.md +307 -0
  67. package/.claude/skills/cfn-loop-orchestration/src/helpers/CONTEXT_INJECTOR_USAGE_GUIDE.md +508 -0
  68. package/.claude/skills/cfn-loop-orchestration/src/helpers/confidence-aggregator.ts +473 -0
  69. package/.claude/skills/cfn-loop-orchestration/src/helpers/consensus.ts +1 -1
  70. package/.claude/skills/cfn-loop-orchestration/src/helpers/context-injector.ts +349 -0
  71. package/.claude/skills/cfn-loop-orchestration/src/helpers/context-lookup.ts +486 -0
  72. package/.claude/skills/cfn-loop-orchestration/src/helpers/deliverable-verifier.ts +6 -2
  73. package/.claude/skills/cfn-loop-orchestration/src/helpers/gate-check.ts +1 -1
  74. package/.claude/skills/cfn-loop-orchestration/src/helpers/product-owner-decision.ts +316 -0
  75. package/.claude/skills/cfn-loop-orchestration/src/helpers/spawn-agents.ts +357 -0
  76. package/.claude/skills/cfn-loop-orchestration/src/helpers/validator.ts +276 -0
  77. package/.claude/skills/cfn-loop-orchestration/src/index.ts +2 -0
  78. package/.claude/skills/cfn-loop-orchestration/src/orchestrate.ts +743 -2
  79. package/.claude/skills/cfn-loop-orchestration/src/types.ts +56 -0
  80. package/.claude/skills/cfn-loop-orchestration/test-cli.sh +92 -0
  81. package/.claude/skills/cfn-loop-orchestration/test-typescript-integration.sh +442 -0
  82. package/.claude/skills/cfn-loop-orchestration/tests/agent-spawner.test.ts +124 -0
  83. package/.claude/skills/cfn-loop-orchestration/tests/confidence-aggregator.test.ts +604 -0
  84. package/.claude/skills/cfn-loop-orchestration/tests/context-injector.test.ts +561 -0
  85. package/.claude/skills/cfn-loop-orchestration/tests/context-lookup.test.ts +661 -0
  86. package/.claude/skills/cfn-loop-orchestration/tests/deliverable-verifier.test.ts +2 -2
  87. package/.claude/skills/cfn-loop-orchestration/tests/gate-check-edge-cases.test.ts +422 -0
  88. package/.claude/skills/cfn-loop-orchestration/tests/gate-checker.test.ts +276 -0
  89. package/.claude/skills/cfn-loop-orchestration/tests/logger.test.ts +291 -0
  90. package/.claude/skills/cfn-loop-orchestration/tests/north-star-e2e.test.ts +334 -0
  91. package/.claude/skills/cfn-loop-orchestration/tests/redis-coordinator.test.ts +321 -0
  92. package/.claude/skills/cfn-loop-orchestration/tests/spawn-agents.test.ts +284 -0
  93. package/.claude/skills/cfn-loop-orchestration/tests/validator.test.ts +643 -0
  94. package/.claude/skills/cfn-loop-validation/IMPLEMENTATION_SUMMARY.md +672 -0
  95. package/.claude/skills/cfn-loop-validation/INDEX.md +531 -0
  96. package/.claude/skills/cfn-loop-validation/README_TYPESCRIPT.md +454 -0
  97. package/.claude/skills/cfn-loop-validation/SKILL.md +48 -1
  98. package/.claude/skills/cfn-loop-validation/SKILL.md.backup +353 -0
  99. package/.claude/skills/cfn-loop-validation/SKILL_TYPESCRIPT.md +782 -0
  100. package/.claude/skills/cfn-loop-validation/VAPOR_DETECTION_EXAMPLES.md +598 -0
  101. package/.claude/skills/cfn-loop-validation/check-dependencies.sh +22 -0
  102. package/{claude-assets/skills/cfn-redis-coordination/check-dependencies.sh → .claude/skills/cfn-loop-validation/check-dependencies.sh.backup} +4 -5
  103. package/.claude/skills/cfn-loop-validation/detect-vapor.sh +59 -0
  104. package/.claude/skills/cfn-loop-validation/detect-vapor.sh.backup +37 -0
  105. package/.claude/skills/cfn-loop-validation/dist/.tsbuildinfo +1 -0
  106. package/.claude/skills/cfn-loop-validation/dist/cli/detect-vapor.d.ts +14 -0
  107. package/.claude/skills/cfn-loop-validation/dist/cli/detect-vapor.d.ts.map +1 -0
  108. package/.claude/skills/cfn-loop-validation/dist/cli/detect-vapor.js +185 -0
  109. package/.claude/skills/cfn-loop-validation/dist/cli/detect-vapor.js.map +1 -0
  110. package/.claude/skills/cfn-loop-validation/dist/cli/validate-deliverables.d.ts +14 -0
  111. package/.claude/skills/cfn-loop-validation/dist/cli/validate-deliverables.d.ts.map +1 -0
  112. package/.claude/skills/cfn-loop-validation/dist/cli/validate-deliverables.js +176 -0
  113. package/.claude/skills/cfn-loop-validation/dist/cli/validate-deliverables.js.map +1 -0
  114. package/.claude/skills/cfn-loop-validation/dist/cli/validate-gate.d.ts +19 -0
  115. package/.claude/skills/cfn-loop-validation/dist/cli/validate-gate.d.ts.map +1 -0
  116. package/.claude/skills/cfn-loop-validation/dist/cli/validate-gate.js +123 -0
  117. package/.claude/skills/cfn-loop-validation/dist/cli/validate-gate.js.map +1 -0
  118. package/.claude/skills/cfn-loop-validation/dist/types.d.ts +156 -0
  119. package/.claude/skills/cfn-loop-validation/dist/types.d.ts.map +1 -0
  120. package/.claude/skills/cfn-loop-validation/dist/types.js +66 -0
  121. package/.claude/skills/cfn-loop-validation/dist/types.js.map +1 -0
  122. package/.claude/skills/cfn-loop-validation/dist/validator.d.ts +85 -0
  123. package/.claude/skills/cfn-loop-validation/dist/validator.d.ts.map +1 -0
  124. package/.claude/skills/cfn-loop-validation/dist/validator.js +411 -0
  125. package/.claude/skills/cfn-loop-validation/dist/validator.js.map +1 -0
  126. package/.claude/skills/cfn-loop-validation/orchestrate-cfn-loop.sh +22 -0
  127. package/.claude/skills/cfn-loop-validation/orchestrate-cfn-loop.sh.backup +252 -0
  128. package/.claude/skills/cfn-loop-validation/package.json +93 -0
  129. package/.claude/skills/cfn-loop-validation/src/cli/detect-vapor.ts +177 -0
  130. package/.claude/skills/cfn-loop-validation/src/cli/validate-deliverables.ts +161 -0
  131. package/.claude/skills/cfn-loop-validation/src/cli/validate-gate.ts +139 -0
  132. package/.claude/skills/cfn-loop-validation/src/types.ts +215 -0
  133. package/.claude/skills/cfn-loop-validation/src/validator.ts +503 -0
  134. package/.claude/skills/cfn-loop-validation/tests/validator.test.ts +537 -0
  135. package/.claude/skills/{cfn-redis-coordination → cfn-loop-validation}/tsconfig.json +34 -31
  136. package/.claude/skills/cfn-loop-validation/validate-deliverables.sh +59 -0
  137. package/.claude/skills/cfn-loop-validation/validate-deliverables.sh.backup +37 -0
  138. package/.claude/skills/cfn-loop-validation/validate-gate.sh +63 -0
  139. package/.claude/skills/cfn-loop-validation/validate-gate.sh.backup +41 -0
  140. package/.claude/skills/cfn-loop-validation/validate-iteration.sh +22 -0
  141. package/.claude/skills/cfn-loop-validation/validate-iteration.sh.backup +134 -0
  142. package/.claude/skills/cfn-product-owner-decision/SKILL.md +479 -147
  143. package/.claude/skills/cfn-product-owner-decision/TYPESCRIPT_IMPLEMENTATION.md +653 -0
  144. package/{claude-assets/skills/cfn-product-owner-decision → .claude/skills/cfn-product-owner-decision/archive/legacy-bash}/execute-decision.sh +24 -2
  145. package/.claude/skills/pre-edit-backup/SKILL.md +324 -0
  146. package/.claude/skills/pre-edit-backup/SKILL.md.backup +277 -0
  147. package/.claude/skills/pre-edit-backup/backup.sh +22 -0
  148. package/.claude/skills/pre-edit-backup/backup.sh.backup +107 -0
  149. package/claude-assets/agents/cfn-dev-team/CLAUDE.md +9 -81
  150. package/claude-assets/agents/cfn-dev-team/architecture/base-template-generator.md +4 -4
  151. package/claude-assets/agents/cfn-dev-team/architecture/planner.md +4 -4
  152. package/claude-assets/agents/cfn-dev-team/architecture/system-architect.md +5 -5
  153. package/claude-assets/agents/cfn-dev-team/coordinators/cfn-frontend-coordinator.md +1 -0
  154. package/claude-assets/agents/cfn-dev-team/coordinators/consensus-builder.md +1 -0
  155. package/claude-assets/agents/cfn-dev-team/coordinators/handoff-coordinator.md +1 -0
  156. package/claude-assets/agents/cfn-dev-team/coordinators/multi-sprint-coordinator.md +1 -0
  157. package/claude-assets/agents/cfn-dev-team/dev-ops/devops-engineer.md +14 -4
  158. package/claude-assets/agents/cfn-dev-team/dev-ops/docker-specialist.md +63 -70
  159. package/claude-assets/agents/cfn-dev-team/dev-ops/kubernetes-specialist.md +50 -70
  160. package/claude-assets/agents/cfn-dev-team/dev-ops/monitoring-specialist.md +13 -4
  161. package/claude-assets/agents/cfn-dev-team/developers/api-gateway-specialist.md +27 -58
  162. package/claude-assets/agents/cfn-dev-team/developers/backend-developer.md +40 -58
  163. package/claude-assets/agents/cfn-dev-team/developers/data/data-engineer.md +18 -20
  164. package/claude-assets/agents/cfn-dev-team/developers/database/database-architect.md +19 -28
  165. package/claude-assets/agents/cfn-dev-team/developers/frontend/mobile-dev.md +15 -19
  166. package/claude-assets/agents/cfn-dev-team/developers/frontend/react-frontend-engineer.md +15 -10
  167. package/claude-assets/agents/cfn-dev-team/developers/frontend/typescript-specialist.md +15 -10
  168. package/claude-assets/agents/cfn-dev-team/developers/frontend/ui-designer.md +15 -25
  169. package/claude-assets/agents/cfn-dev-team/developers/graphql-specialist.md +17 -21
  170. package/claude-assets/agents/cfn-dev-team/developers/rust-developer.md +17 -21
  171. package/claude-assets/agents/cfn-dev-team/product-owners/accessibility-advocate-persona.md +4 -4
  172. package/claude-assets/agents/cfn-dev-team/product-owners/cto-agent.md +4 -4
  173. package/claude-assets/agents/cfn-dev-team/product-owners/power-user-persona.md +4 -4
  174. package/claude-assets/agents/cfn-dev-team/product-owners/product-owner.md +19 -27
  175. package/claude-assets/agents/cfn-dev-team/reviewers/code-reviewer.md +20 -51
  176. package/claude-assets/agents/cfn-dev-team/reviewers/quality/code-quality-validator.md +22 -71
  177. package/claude-assets/agents/cfn-dev-team/reviewers/quality/perf-analyzer.md +21 -64
  178. package/claude-assets/agents/cfn-dev-team/reviewers/quality/performance-benchmarker.md +22 -67
  179. package/claude-assets/agents/cfn-dev-team/reviewers/quality/security-specialist.md +23 -67
  180. package/claude-assets/agents/cfn-dev-team/testers/api-testing-specialist.md +14 -70
  181. package/claude-assets/agents/cfn-dev-team/testers/chaos-engineering-specialist.md +25 -73
  182. package/claude-assets/agents/cfn-dev-team/testers/contract-tester.md +26 -65
  183. package/claude-assets/agents/cfn-dev-team/testers/e2e/playwright-tester.md +5 -5
  184. package/claude-assets/agents/cfn-dev-team/testers/integration-tester.md +27 -67
  185. package/claude-assets/agents/cfn-dev-team/testers/interaction-tester.md +16 -73
  186. package/claude-assets/agents/cfn-dev-team/testers/load-testing-specialist.md +27 -67
  187. package/claude-assets/agents/cfn-dev-team/testers/mutation-testing-specialist.md +27 -60
  188. package/claude-assets/agents/cfn-dev-team/testers/playwright-tester.md +15 -74
  189. package/claude-assets/agents/cfn-dev-team/testers/tester.md +14 -60
  190. package/claude-assets/agents/cfn-dev-team/testers/unit/tdd-london-unit-swarm.md +5 -5
  191. package/claude-assets/agents/cfn-dev-team/testers/validation/validation-production-validator.md +4 -4
  192. package/claude-assets/agents/cfn-dev-team/testing/test-validation-agent.md +4 -4
  193. package/claude-assets/agents/cfn-dev-team/utility/agent-builder.md +16 -16
  194. package/claude-assets/agents/cfn-dev-team/utility/analyst.md +16 -32
  195. package/claude-assets/agents/cfn-dev-team/utility/code-booster.md +17 -17
  196. package/claude-assets/agents/cfn-dev-team/utility/context-curator.md +10 -5
  197. package/claude-assets/agents/cfn-dev-team/utility/epic-creator.md +12 -102
  198. package/claude-assets/agents/cfn-dev-team/utility/memory-leak-specialist.md +127 -814
  199. package/claude-assets/agents/cfn-dev-team/utility/researcher.md +16 -25
  200. package/claude-assets/agents/cfn-dev-team/utility/z-ai-specialist.md +157 -667
  201. package/claude-assets/agents/custom/cfn-docker-expert.md +102 -0
  202. package/claude-assets/agents/custom/cfn-loops-cli-expert.md +129 -0
  203. package/claude-assets/cfn-extras/agents/cfn-v3-coordinator.md +517 -0
  204. package/claude-assets/commands/cfn-loop-cli.md +158 -464
  205. package/claude-assets/commands/cfn-loop-trigger.md +114 -0
  206. package/claude-assets/hooks/SKILL.md +518 -0
  207. package/claude-assets/hooks/SKILL.md.backup +471 -0
  208. package/claude-assets/hooks/cfn-invoke-post-edit-ts.sh +100 -0
  209. package/claude-assets/hooks/cfn-invoke-post-edit-ts.sh.backup +78 -0
  210. package/claude-assets/hooks/cfn-invoke-post-edit.sh +22 -0
  211. package/claude-assets/hooks/cfn-invoke-post-edit.sh.backup +87 -0
  212. package/claude-assets/hooks/cfn-invoke-pre-edit-ts.sh +116 -0
  213. package/claude-assets/hooks/cfn-invoke-pre-edit-ts.sh.backup +94 -0
  214. package/claude-assets/hooks/cfn-invoke-pre-edit.sh +22 -0
  215. package/claude-assets/hooks/cfn-invoke-pre-edit.sh.backup +88 -0
  216. package/claude-assets/skills/cfn-agent-selection-with-fallback/DELIVERABLES.md +409 -0
  217. package/claude-assets/skills/cfn-agent-selection-with-fallback/IMPLEMENTATION_SUMMARY.md +396 -0
  218. package/claude-assets/skills/cfn-agent-selection-with-fallback/INTEGRATION_GUIDE.md +308 -0
  219. package/claude-assets/skills/cfn-agent-selection-with-fallback/QUICK_REFERENCE.md +239 -0
  220. package/claude-assets/skills/cfn-agent-selection-with-fallback/SKILL.md +107 -1
  221. package/claude-assets/skills/cfn-agent-selection-with-fallback/SKILL.md.backup +302 -0
  222. package/claude-assets/skills/cfn-agent-selection-with-fallback/TYPESCRIPT_MIGRATION.md +295 -0
  223. package/claude-assets/skills/cfn-agent-selection-with-fallback/dist/agent-selector.cjs +297 -0
  224. package/claude-assets/skills/cfn-agent-selection-with-fallback/dist/agent-selector.js +297 -0
  225. package/claude-assets/skills/cfn-agent-selection-with-fallback/dist/cli.cjs +96 -0
  226. package/claude-assets/skills/cfn-agent-selection-with-fallback/dist/cli.js +96 -0
  227. package/claude-assets/skills/cfn-agent-selection-with-fallback/select-agents-ts.sh +45 -0
  228. package/claude-assets/skills/cfn-agent-selection-with-fallback/select-agents-ts.sh.backup +23 -0
  229. package/claude-assets/skills/cfn-agent-selection-with-fallback/select-agents.sh +22 -0
  230. package/claude-assets/skills/cfn-agent-selection-with-fallback/select-agents.sh.backup +173 -0
  231. package/claude-assets/skills/cfn-agent-selection-with-fallback/src/agent-selector.test.ts +357 -0
  232. package/claude-assets/skills/cfn-agent-selection-with-fallback/src/agent-selector.ts +350 -0
  233. package/claude-assets/skills/cfn-agent-selection-with-fallback/src/cli.ts +74 -0
  234. package/claude-assets/skills/cfn-agent-selection-with-fallback/task-classifier.sh +22 -0
  235. package/claude-assets/skills/cfn-agent-selection-with-fallback/task-classifier.sh.backup +71 -0
  236. package/claude-assets/skills/cfn-agent-selection-with-fallback/tsconfig.json +18 -0
  237. package/claude-assets/skills/cfn-agent-spawning/SKILL.md +48 -1
  238. package/claude-assets/skills/cfn-agent-spawning/SKILL.md.backup +135 -0
  239. package/claude-assets/skills/cfn-agent-spawning/TYPESCRIPT_MIGRATION.md +567 -0
  240. package/claude-assets/skills/cfn-agent-spawning/check-dependencies.sh +22 -0
  241. package/claude-assets/skills/cfn-agent-spawning/check-dependencies.sh.backup +30 -0
  242. package/claude-assets/skills/cfn-agent-spawning/get-agent-provider-env.sh +22 -0
  243. package/claude-assets/skills/cfn-agent-spawning/get-agent-provider-env.sh.backup +127 -0
  244. package/claude-assets/skills/cfn-agent-spawning/parse-agent-provider.sh +22 -0
  245. package/claude-assets/skills/cfn-agent-spawning/parse-agent-provider.sh.backup +59 -0
  246. package/claude-assets/skills/cfn-agent-spawning/spawn-agent-wrapper.sh +63 -0
  247. package/claude-assets/skills/cfn-agent-spawning/spawn-agent-wrapper.sh.backup +41 -0
  248. package/claude-assets/skills/cfn-agent-spawning/spawn-agent.sh +26 -1
  249. package/claude-assets/skills/cfn-agent-spawning/spawn-templates.sh +22 -0
  250. package/claude-assets/skills/cfn-agent-spawning/spawn-templates.sh.backup +613 -0
  251. package/claude-assets/skills/cfn-agent-spawning/spawn-worker.sh +22 -0
  252. package/claude-assets/skills/cfn-agent-spawning/spawn-worker.sh.backup +176 -0
  253. package/claude-assets/skills/cfn-coordination/agent-completion.sh.backup +36 -0
  254. package/claude-assets/skills/cfn-coordination/coordination-signal.sh.backup +36 -0
  255. package/claude-assets/skills/cfn-coordination/coordination-wait.sh.backup +36 -0
  256. package/claude-assets/skills/cfn-dependency-ingestion/README.md +101 -0
  257. package/claude-assets/skills/cfn-dependency-ingestion/SKILL.md +369 -0
  258. package/claude-assets/skills/cfn-dependency-ingestion/build.sh +23 -0
  259. package/claude-assets/skills/cfn-dependency-ingestion/dist/ingest-dependencies.js +478 -0
  260. package/claude-assets/skills/cfn-dependency-ingestion/ingest-dependencies.sh +295 -0
  261. package/claude-assets/skills/cfn-dependency-ingestion/src/ingest-dependencies.ts +563 -0
  262. package/claude-assets/skills/cfn-loop-orchestration/.backups/unknown/1763619700_33aff4a69b99159e4e849107ebc4d09f/metadata.json +8 -0
  263. package/claude-assets/skills/cfn-loop-orchestration/.backups/unknown/1763619700_33aff4a69b99159e4e849107ebc4d09f/original +271 -0
  264. package/claude-assets/skills/cfn-loop-orchestration/.backups/unknown/1763619700_33aff4a69b99159e4e849107ebc4d09f/revert.sh +7 -0
  265. package/claude-assets/skills/cfn-loop-orchestration/.backups/unknown/1763671642_06496e8c399a79db08167cc00ed4b31e/metadata.json +8 -0
  266. package/claude-assets/skills/cfn-loop-orchestration/.backups/unknown/1763671642_06496e8c399a79db08167cc00ed4b31e/original +325 -0
  267. package/claude-assets/skills/cfn-loop-orchestration/.backups/unknown/1763671642_06496e8c399a79db08167cc00ed4b31e/revert.sh +7 -0
  268. package/claude-assets/skills/cfn-loop-orchestration/CLI_IMPLEMENTATION_SUMMARY.md +330 -0
  269. package/claude-assets/skills/cfn-loop-orchestration/CONFIGURATION_IMPROVEMENTS.md +318 -0
  270. package/claude-assets/skills/cfn-loop-orchestration/CONTEXT_LOOKUP_MIGRATION.md +308 -0
  271. package/claude-assets/skills/cfn-loop-orchestration/CONTEXT_LOOKUP_QUICK_START.md +378 -0
  272. package/claude-assets/skills/cfn-loop-orchestration/E2E_VALIDATION_REPORT.md +262 -0
  273. package/claude-assets/skills/cfn-loop-orchestration/IMPLEMENTATION_SUMMARY.md +319 -519
  274. package/claude-assets/skills/cfn-loop-orchestration/NORTH_STAR_E2E_REPORT.md +299 -0
  275. package/claude-assets/skills/cfn-loop-orchestration/NORTH_STAR_EXECUTION_SUMMARY.md +403 -0
  276. package/claude-assets/skills/cfn-loop-orchestration/NORTH_STAR_INDEX.md +323 -0
  277. package/claude-assets/skills/cfn-loop-orchestration/SKILL.md +159 -48
  278. package/claude-assets/skills/cfn-loop-orchestration/SPAWN_AGENTS_IMPLEMENTATION.md +188 -0
  279. package/claude-assets/skills/cfn-loop-orchestration/TEST_COVERAGE_REPORT.md +335 -0
  280. package/claude-assets/skills/cfn-loop-orchestration/TEST_COVERAGE_SUMMARY.md +456 -0
  281. package/claude-assets/skills/cfn-loop-orchestration/TYPESCRIPT_INTEGRATION_REPORT.md +709 -0
  282. package/claude-assets/skills/cfn-loop-orchestration/TYPESCRIPT_INTEGRATION_SUMMARY.md +257 -0
  283. package/claude-assets/skills/cfn-loop-orchestration/VALIDATION_REPORT.md +572 -0
  284. package/claude-assets/skills/cfn-loop-orchestration/VALIDATION_SUMMARY.txt +196 -0
  285. package/claude-assets/skills/cfn-loop-orchestration/VALIDATOR_MODULE_GUIDE.md +526 -0
  286. package/claude-assets/skills/cfn-loop-orchestration/archive/legacy-bash/README.md +167 -0
  287. package/claude-assets/skills/cfn-loop-orchestration/archive/legacy-bash/orchestrate-enhanced.sh +548 -0
  288. package/{.claude/skills/cfn-loop-orchestration → claude-assets/skills/cfn-loop-orchestration/archive/legacy-bash}/orchestrate-wrapper.sh +11 -1
  289. package/claude-assets/skills/cfn-loop-orchestration/archive/legacy-bash/orchestrate.sh +182 -0
  290. package/claude-assets/skills/cfn-loop-orchestration/e2e-validation-fixed.js +240 -0
  291. package/claude-assets/skills/cfn-loop-orchestration/e2e-validation.js +213 -0
  292. package/claude-assets/skills/cfn-loop-orchestration/package-lock.json +3 -0
  293. package/claude-assets/skills/cfn-loop-orchestration/package.json +4 -0
  294. package/claude-assets/skills/cfn-loop-orchestration/run-north-star-e2e.ts +210 -0
  295. package/claude-assets/skills/cfn-loop-orchestration/src/cli/orchestrator-cli.ts +396 -0
  296. package/claude-assets/skills/cfn-loop-orchestration/src/helpers/CONFIDENCE_AGGREGATOR.md +564 -0
  297. package/claude-assets/skills/cfn-loop-orchestration/src/helpers/CONFIDENCE_AGGREGATOR_QUICK_REF.md +241 -0
  298. package/claude-assets/skills/cfn-loop-orchestration/src/helpers/CONTEXT_INJECTOR_IMPLEMENTATION.md +375 -0
  299. package/claude-assets/skills/cfn-loop-orchestration/src/helpers/CONTEXT_INJECTOR_QUICK_REFERENCE.md +362 -0
  300. package/claude-assets/skills/cfn-loop-orchestration/src/helpers/CONTEXT_INJECTOR_README.md +307 -0
  301. package/claude-assets/skills/cfn-loop-orchestration/src/helpers/CONTEXT_INJECTOR_USAGE_GUIDE.md +508 -0
  302. package/claude-assets/skills/cfn-loop-orchestration/src/helpers/confidence-aggregator.ts +473 -0
  303. package/claude-assets/skills/cfn-loop-orchestration/src/helpers/consensus.ts +1 -1
  304. package/claude-assets/skills/cfn-loop-orchestration/src/helpers/context-injector.ts +349 -0
  305. package/claude-assets/skills/cfn-loop-orchestration/src/helpers/context-lookup.ts +486 -0
  306. package/claude-assets/skills/cfn-loop-orchestration/src/helpers/deliverable-verifier.ts +6 -2
  307. package/claude-assets/skills/cfn-loop-orchestration/src/helpers/gate-check.ts +1 -1
  308. package/claude-assets/skills/cfn-loop-orchestration/src/helpers/product-owner-decision.ts +316 -0
  309. package/claude-assets/skills/cfn-loop-orchestration/src/helpers/spawn-agents.ts +357 -0
  310. package/claude-assets/skills/cfn-loop-orchestration/src/helpers/validator.ts +276 -0
  311. package/claude-assets/skills/cfn-loop-orchestration/src/index.ts +2 -0
  312. package/claude-assets/skills/cfn-loop-orchestration/src/orchestrate.ts +743 -2
  313. package/claude-assets/skills/cfn-loop-orchestration/src/types.ts +56 -0
  314. package/claude-assets/skills/cfn-loop-orchestration/test-cli.sh +92 -0
  315. package/claude-assets/skills/cfn-loop-orchestration/test-typescript-integration.sh +442 -0
  316. package/claude-assets/skills/cfn-loop-orchestration/tests/agent-spawner.test.ts +124 -0
  317. package/claude-assets/skills/cfn-loop-orchestration/tests/confidence-aggregator.test.ts +604 -0
  318. package/claude-assets/skills/cfn-loop-orchestration/tests/context-injector.test.ts +561 -0
  319. package/claude-assets/skills/cfn-loop-orchestration/tests/context-lookup.test.ts +661 -0
  320. package/claude-assets/skills/cfn-loop-orchestration/tests/deliverable-verifier.test.ts +2 -2
  321. package/claude-assets/skills/cfn-loop-orchestration/tests/gate-check-edge-cases.test.ts +422 -0
  322. package/claude-assets/skills/cfn-loop-orchestration/tests/gate-checker.test.ts +276 -0
  323. package/claude-assets/skills/cfn-loop-orchestration/tests/logger.test.ts +291 -0
  324. package/claude-assets/skills/cfn-loop-orchestration/tests/north-star-e2e.test.ts +334 -0
  325. package/claude-assets/skills/cfn-loop-orchestration/tests/redis-coordinator.test.ts +321 -0
  326. package/claude-assets/skills/cfn-loop-orchestration/tests/spawn-agents.test.ts +284 -0
  327. package/claude-assets/skills/cfn-loop-orchestration/tests/validator.test.ts +643 -0
  328. package/claude-assets/skills/cfn-loop-output-processing/.eslintrc.json +33 -0
  329. package/claude-assets/skills/cfn-loop-output-processing/DELIVERY_SUMMARY.txt +462 -0
  330. package/claude-assets/skills/cfn-loop-output-processing/DEPRECATION_NOTICE.md +183 -0
  331. package/claude-assets/skills/cfn-loop-output-processing/EXAMPLES.md +609 -0
  332. package/claude-assets/skills/cfn-loop-output-processing/IMPLEMENTATION_SUMMARY.md +418 -0
  333. package/claude-assets/skills/cfn-loop-output-processing/INDEX.md +531 -0
  334. package/claude-assets/skills/cfn-loop-output-processing/MIGRATION.md +362 -0
  335. package/claude-assets/skills/cfn-loop-output-processing/README.md +114 -0
  336. package/claude-assets/skills/cfn-loop-output-processing/SKILL.md +633 -0
  337. package/{.claude/skills/cfn-docker-redis-coordination → claude-assets/skills/cfn-loop-output-processing}/jest.config.js +7 -15
  338. package/claude-assets/skills/cfn-loop-output-processing/package.json +50 -0
  339. package/claude-assets/skills/cfn-loop-output-processing/src/cli/process-loop2.ts +195 -0
  340. package/claude-assets/skills/cfn-loop-output-processing/src/cli/process-loop3.ts +157 -0
  341. package/claude-assets/skills/cfn-loop-output-processing/src/output-processor.ts +632 -0
  342. package/claude-assets/skills/cfn-loop-output-processing/tests/output-processor.test.ts +617 -0
  343. package/claude-assets/skills/{cfn-docker-redis-coordination → cfn-loop-output-processing}/tsconfig.json +16 -7
  344. package/claude-assets/skills/cfn-loop-validation/IMPLEMENTATION_SUMMARY.md +672 -0
  345. package/claude-assets/skills/cfn-loop-validation/INDEX.md +531 -0
  346. package/claude-assets/skills/cfn-loop-validation/README_TYPESCRIPT.md +454 -0
  347. package/claude-assets/skills/cfn-loop-validation/SKILL.md +48 -1
  348. package/claude-assets/skills/cfn-loop-validation/SKILL.md.backup +353 -0
  349. package/claude-assets/skills/cfn-loop-validation/SKILL_TYPESCRIPT.md +782 -0
  350. package/claude-assets/skills/cfn-loop-validation/VAPOR_DETECTION_EXAMPLES.md +598 -0
  351. package/claude-assets/skills/cfn-loop-validation/check-dependencies.sh +22 -0
  352. package/claude-assets/skills/cfn-loop-validation/check-dependencies.sh.backup +31 -0
  353. package/claude-assets/skills/cfn-loop-validation/detect-vapor.sh +59 -0
  354. package/claude-assets/skills/cfn-loop-validation/detect-vapor.sh.backup +37 -0
  355. package/claude-assets/skills/cfn-loop-validation/dist/.tsbuildinfo +1 -0
  356. package/claude-assets/skills/cfn-loop-validation/dist/cli/detect-vapor.d.ts +14 -0
  357. package/claude-assets/skills/cfn-loop-validation/dist/cli/detect-vapor.d.ts.map +1 -0
  358. package/claude-assets/skills/cfn-loop-validation/dist/cli/detect-vapor.js +185 -0
  359. package/claude-assets/skills/cfn-loop-validation/dist/cli/detect-vapor.js.map +1 -0
  360. package/claude-assets/skills/cfn-loop-validation/dist/cli/validate-deliverables.d.ts +14 -0
  361. package/claude-assets/skills/cfn-loop-validation/dist/cli/validate-deliverables.d.ts.map +1 -0
  362. package/claude-assets/skills/cfn-loop-validation/dist/cli/validate-deliverables.js +176 -0
  363. package/claude-assets/skills/cfn-loop-validation/dist/cli/validate-deliverables.js.map +1 -0
  364. package/claude-assets/skills/cfn-loop-validation/dist/cli/validate-gate.d.ts +19 -0
  365. package/claude-assets/skills/cfn-loop-validation/dist/cli/validate-gate.d.ts.map +1 -0
  366. package/claude-assets/skills/cfn-loop-validation/dist/cli/validate-gate.js +123 -0
  367. package/claude-assets/skills/cfn-loop-validation/dist/cli/validate-gate.js.map +1 -0
  368. package/claude-assets/skills/cfn-loop-validation/dist/types.d.ts +156 -0
  369. package/claude-assets/skills/cfn-loop-validation/dist/types.d.ts.map +1 -0
  370. package/claude-assets/skills/cfn-loop-validation/dist/types.js +66 -0
  371. package/claude-assets/skills/cfn-loop-validation/dist/types.js.map +1 -0
  372. package/claude-assets/skills/cfn-loop-validation/dist/validator.d.ts +85 -0
  373. package/claude-assets/skills/cfn-loop-validation/dist/validator.d.ts.map +1 -0
  374. package/claude-assets/skills/cfn-loop-validation/dist/validator.js +411 -0
  375. package/claude-assets/skills/cfn-loop-validation/dist/validator.js.map +1 -0
  376. package/claude-assets/skills/cfn-loop-validation/orchestrate-cfn-loop.sh +22 -0
  377. package/claude-assets/skills/cfn-loop-validation/orchestrate-cfn-loop.sh.backup +252 -0
  378. package/claude-assets/skills/cfn-loop-validation/package.json +93 -0
  379. package/claude-assets/skills/cfn-loop-validation/src/cli/detect-vapor.ts +177 -0
  380. package/claude-assets/skills/cfn-loop-validation/src/cli/validate-deliverables.ts +161 -0
  381. package/claude-assets/skills/cfn-loop-validation/src/cli/validate-gate.ts +139 -0
  382. package/claude-assets/skills/cfn-loop-validation/src/types.ts +215 -0
  383. package/claude-assets/skills/cfn-loop-validation/src/validator.ts +503 -0
  384. package/claude-assets/skills/cfn-loop-validation/tests/validator.test.ts +537 -0
  385. package/claude-assets/skills/{cfn-redis-coordination → cfn-loop-validation}/tsconfig.json +34 -31
  386. package/claude-assets/skills/cfn-loop-validation/validate-deliverables.sh +59 -0
  387. package/claude-assets/skills/cfn-loop-validation/validate-deliverables.sh.backup +37 -0
  388. package/claude-assets/skills/cfn-loop-validation/validate-gate.sh +63 -0
  389. package/claude-assets/skills/cfn-loop-validation/validate-gate.sh.backup +41 -0
  390. package/claude-assets/skills/cfn-loop-validation/validate-iteration.sh +22 -0
  391. package/claude-assets/skills/cfn-loop-validation/validate-iteration.sh.backup +134 -0
  392. package/claude-assets/skills/cfn-product-owner-decision/SKILL.md +479 -147
  393. package/claude-assets/skills/cfn-product-owner-decision/TYPESCRIPT_IMPLEMENTATION.md +653 -0
  394. package/{.claude/skills/cfn-product-owner-decision → claude-assets/skills/cfn-product-owner-decision/archive/legacy-bash}/execute-decision.sh +24 -2
  395. package/claude-assets/skills/cfn-provider-routing/README.md +129 -0
  396. package/claude-assets/skills/cfn-provider-routing/SKILL.md +192 -0
  397. package/claude-assets/skills/cfn-provider-routing/resolve-provider-model.ts +223 -0
  398. package/claude-assets/skills/pre-edit-backup/SKILL.md +324 -0
  399. package/claude-assets/skills/pre-edit-backup/SKILL.md.backup +277 -0
  400. package/claude-assets/skills/pre-edit-backup/backup.sh +22 -0
  401. package/claude-assets/skills/pre-edit-backup/backup.sh.backup +107 -0
  402. package/dist/agents/agent-loader.js +146 -165
  403. package/dist/agents/agent-loader.js.map +1 -1
  404. package/dist/api/auth-endpoints.js +415 -0
  405. package/dist/api/auth-endpoints.js.map +1 -0
  406. package/dist/api/task-endpoints.js +562 -0
  407. package/dist/api/task-endpoints.js.map +1 -0
  408. package/dist/backend/server.js +418 -0
  409. package/dist/backend/server.js.map +1 -0
  410. package/dist/cfn-loop/product-owner/decision-parser.js +356 -0
  411. package/dist/cfn-loop/product-owner/decision-parser.js.map +1 -0
  412. package/dist/cfn-loop/product-owner/index.js +1 -0
  413. package/dist/cfn-loop/product-owner/index.js.map +1 -1
  414. package/dist/cli/agent-command.js +1 -1
  415. package/dist/cli/agent-command.js.map +1 -1
  416. package/dist/cli/agent-completion.js +273 -0
  417. package/dist/cli/agent-completion.js.map +1 -0
  418. package/dist/cli/agent-definition-parser.js +37 -4
  419. package/dist/cli/agent-definition-parser.js.map +1 -1
  420. package/dist/cli/agent-executor.js +32 -2
  421. package/dist/cli/agent-executor.js.map +1 -1
  422. package/dist/cli/agent-prompt-builder.js +83 -48
  423. package/dist/cli/agent-prompt-builder.js.map +1 -1
  424. package/dist/cli/agent-spawner.js +499 -0
  425. package/dist/cli/agent-spawner.js.map +1 -0
  426. package/dist/cli/anthropic-client.js +10 -3
  427. package/dist/cli/anthropic-client.js.map +1 -1
  428. package/dist/cli/config-manager.js.map +1 -1
  429. package/dist/cli/index.js +11 -0
  430. package/dist/cli/index.js.map +1 -1
  431. package/dist/cli/parse-decision-cli.js +268 -0
  432. package/dist/cli/parse-decision-cli.js.map +1 -0
  433. package/dist/cli/post-edit-hook.js +83 -0
  434. package/dist/cli/post-edit-hook.js.map +1 -0
  435. package/dist/cli/pre-edit-hook.js +77 -0
  436. package/dist/cli/pre-edit-hook.js.map +1 -0
  437. package/dist/cli/spawn-agent-cli.js +209 -0
  438. package/dist/cli/spawn-agent-cli.js.map +1 -0
  439. package/dist/coordination/coordination-wrapper.js +383 -0
  440. package/dist/coordination/coordination-wrapper.js.map +1 -0
  441. package/dist/coordination/store-success-criteria.js +68 -0
  442. package/dist/coordination/store-success-criteria.js.map +1 -0
  443. package/dist/coordination/store-task-context.js +65 -0
  444. package/dist/coordination/store-task-context.js.map +1 -0
  445. package/dist/hooks/backup-manager.js +273 -0
  446. package/dist/hooks/backup-manager.js.map +1 -0
  447. package/dist/hooks/post-edit-validator.js +388 -0
  448. package/dist/hooks/post-edit-validator.js.map +1 -0
  449. package/dist/integration/index.js +19 -0
  450. package/dist/integration/index.js.map +1 -0
  451. package/dist/integration/task-mode-adapter.js +297 -0
  452. package/dist/integration/task-mode-adapter.js.map +1 -0
  453. package/dist/integration/trigger-dev-client.js +253 -0
  454. package/dist/integration/trigger-dev-client.js.map +1 -0
  455. package/dist/integration/trigger-dev-webhooks.js +362 -0
  456. package/dist/integration/trigger-dev-webhooks.js.map +1 -0
  457. package/dist/lib/path-validator.js +14 -5
  458. package/dist/lib/path-validator.js.map +1 -1
  459. package/dist/lib/redis-queue-manager.js +5 -1
  460. package/dist/lib/redis-queue-manager.js.map +1 -1
  461. package/dist/middleware/authentication.js +317 -0
  462. package/dist/middleware/authentication.js.map +1 -0
  463. package/dist/services/authentication.js +669 -0
  464. package/dist/services/authentication.js.map +1 -0
  465. package/dist/services/session-management.js +436 -0
  466. package/dist/services/session-management.js.map +1 -0
  467. package/dist/services/skill-deployment.js +8 -6
  468. package/dist/services/skill-deployment.js.map +1 -1
  469. package/dist/services/user-service.js +710 -0
  470. package/dist/services/user-service.js.map +1 -0
  471. package/dist/types/trigger-dev-events.d.js +10 -0
  472. package/dist/types/trigger-dev-events.d.js.map +1 -0
  473. package/docs/README.md +240 -0
  474. package/package.json +13 -4
  475. package/scripts/compare-workflow-performance.sh +556 -0
  476. package/scripts/migrate-to-optimized-workflows.sh +438 -0
  477. package/scripts/organize-docs.sh +338 -0
  478. package/scripts/trigger-dev-setup.sh +267 -0
  479. package/.claude/skills/cfn-docker-redis-coordination/MIGRATION_SUMMARY.md +0 -348
  480. package/.claude/skills/cfn-docker-redis-coordination/README.md +0 -294
  481. package/.claude/skills/cfn-docker-redis-coordination/SKILL.md +0 -435
  482. package/.claude/skills/cfn-docker-redis-coordination/coordinate.sh +0 -650
  483. package/.claude/skills/cfn-docker-redis-coordination/coordinate.sh.backup-1763145142 +0 -641
  484. package/.claude/skills/cfn-docker-redis-coordination/package-lock.json +0 -5259
  485. package/.claude/skills/cfn-docker-redis-coordination/package.json +0 -40
  486. package/.claude/skills/cfn-docker-redis-coordination/src/coordinator.ts +0 -801
  487. package/.claude/skills/cfn-docker-redis-coordination/src/index.ts +0 -42
  488. package/.claude/skills/cfn-docker-redis-coordination/src/types.ts +0 -351
  489. package/.claude/skills/cfn-docker-redis-coordination/tests/coordinator.test.ts +0 -1464
  490. package/.claude/skills/cfn-docker-redis-coordination/tsconfig.json +0 -30
  491. package/.claude/skills/cfn-loop-orchestration/helpers/auto-tune-timeouts.sh +0 -228
  492. package/.claude/skills/cfn-loop-orchestration/helpers/consensus-ts.sh +0 -104
  493. package/.claude/skills/cfn-loop-orchestration/helpers/consensus.sh +0 -94
  494. package/.claude/skills/cfn-loop-orchestration/helpers/context-injection.sh +0 -142
  495. package/.claude/skills/cfn-loop-orchestration/helpers/context-lookup.sh +0 -359
  496. package/.claude/skills/cfn-loop-orchestration/helpers/deliverable-verifier-ts.sh +0 -123
  497. package/.claude/skills/cfn-loop-orchestration/helpers/deliverable-verifier.sh +0 -71
  498. package/.claude/skills/cfn-loop-orchestration/helpers/gate-check.sh +0 -56
  499. package/.claude/skills/cfn-loop-orchestration/helpers/iteration-manager-ts.sh +0 -89
  500. package/.claude/skills/cfn-loop-orchestration/helpers/iteration-manager.sh +0 -87
  501. package/.claude/skills/cfn-loop-orchestration/helpers/orchestrate-ts.sh +0 -104
  502. package/.claude/skills/cfn-loop-orchestration/helpers/parse-test-results.sh +0 -56
  503. package/.claude/skills/cfn-loop-orchestration/helpers/spawn-agents.sh +0 -290
  504. package/.claude/skills/cfn-loop-orchestration/helpers/timeout-calculator-ts.sh +0 -47
  505. package/.claude/skills/cfn-loop-orchestration/helpers/timeout-calculator.sh +0 -51
  506. package/.claude/skills/cfn-loop-orchestration/orchestrate.sh +0 -1345
  507. package/.claude/skills/cfn-redis-coordination/AGENT_LOGGING.md +0 -280
  508. package/.claude/skills/cfn-redis-coordination/BZPOPMIN_FIX_SUMMARY.md +0 -209
  509. package/.claude/skills/cfn-redis-coordination/CENTRALIZED_REDIS_WRAPPER.md +0 -319
  510. package/.claude/skills/cfn-redis-coordination/agent-log.sh.bak +0 -124
  511. package/.claude/skills/cfn-redis-coordination/config.json +0 -61
  512. package/.claude/skills/cfn-redis-coordination/demos/phase4-wake-queue-test-report.md +0 -82
  513. package/.claude/skills/cfn-redis-coordination/demos/test-bzpopmin-fix.sh +0 -274
  514. package/.claude/skills/cfn-redis-coordination/demos/test-cancel-swarm.sh +0 -0
  515. package/.claude/skills/cfn-redis-coordination/docs/migration/PHASE_3_REDIS_COORDINATION_COMPLETION_REPORT.md +0 -553
  516. package/.claude/skills/cfn-redis-coordination/jest.config.js +0 -23
  517. package/.claude/skills/cfn-redis-coordination/package-lock.json +0 -5272
  518. package/.claude/skills/cfn-redis-coordination/package.json +0 -45
  519. package/.claude/skills/cfn-redis-coordination/src/agent-logger.ts +0 -446
  520. package/.claude/skills/cfn-redis-coordination/src/agent-recovery.ts +0 -454
  521. package/.claude/skills/cfn-redis-coordination/src/completion-reporter.ts +0 -396
  522. package/.claude/skills/cfn-redis-coordination/src/context-manager.ts +0 -327
  523. package/.claude/skills/cfn-redis-coordination/src/index.ts +0 -82
  524. package/.claude/skills/cfn-redis-coordination/src/mode-detector.ts +0 -155
  525. package/.claude/skills/cfn-redis-coordination/src/redis/redis-client.ts +0 -305
  526. package/.claude/skills/cfn-redis-coordination/src/redis/redis-functions.ts +0 -283
  527. package/.claude/skills/cfn-redis-coordination/src/redis-client.ts +0 -654
  528. package/.claude/skills/cfn-redis-coordination/src/result-collector.ts +0 -437
  529. package/.claude/skills/cfn-redis-coordination/src/swarm-manager.ts +0 -494
  530. package/.claude/skills/cfn-redis-coordination/src/task-analyzer.ts +0 -404
  531. package/.claude/skills/cfn-redis-coordination/src/task-executor.ts +0 -423
  532. package/.claude/skills/cfn-redis-coordination/src/types.ts +0 -235
  533. package/.claude/skills/cfn-redis-coordination/src/waiting-coordinator.ts +0 -587
  534. package/.claude/skills/cfn-redis-coordination/store-success-criteria.sh +0 -85
  535. package/.claude/skills/cfn-redis-coordination/test-connection-attempts.js +0 -70
  536. package/.claude/skills/cfn-redis-coordination/test-mode-simple.js +0 -121
  537. package/.claude/skills/cfn-redis-coordination/test-redis-check.js +0 -84
  538. package/.claude/skills/cfn-redis-coordination/test-task-mode-redis.cjs +0 -391
  539. package/.claude/skills/cfn-redis-coordination/tests/coordination.test.ts +0 -788
  540. package/.claude/skills/cfn-redis-coordination/update-all-scripts.sh +0 -67
  541. package/claude-assets/agents/cfn-dev-team/coordinators/cfn-v3-coordinator.md +0 -976
  542. package/claude-assets/agents/typescript-specialist.md +0 -280
  543. package/claude-assets/skills/cfn-docker-redis-coordination/MIGRATION_SUMMARY.md +0 -348
  544. package/claude-assets/skills/cfn-docker-redis-coordination/README.md +0 -294
  545. package/claude-assets/skills/cfn-docker-redis-coordination/SKILL.md +0 -435
  546. package/claude-assets/skills/cfn-docker-redis-coordination/coordinate.sh +0 -650
  547. package/claude-assets/skills/cfn-docker-redis-coordination/coordinate.sh.backup-1763145142 +0 -641
  548. package/claude-assets/skills/cfn-docker-redis-coordination/jest.config.js +0 -37
  549. package/claude-assets/skills/cfn-docker-redis-coordination/package-lock.json +0 -5259
  550. package/claude-assets/skills/cfn-docker-redis-coordination/package.json +0 -40
  551. package/claude-assets/skills/cfn-docker-redis-coordination/src/coordinator.ts +0 -801
  552. package/claude-assets/skills/cfn-docker-redis-coordination/src/index.ts +0 -42
  553. package/claude-assets/skills/cfn-docker-redis-coordination/src/types.ts +0 -351
  554. package/claude-assets/skills/cfn-docker-redis-coordination/tests/coordinator.test.ts +0 -1464
  555. package/claude-assets/skills/cfn-loop-orchestration/helpers/auto-tune-timeouts.sh +0 -228
  556. package/claude-assets/skills/cfn-loop-orchestration/helpers/consensus-ts.sh +0 -104
  557. package/claude-assets/skills/cfn-loop-orchestration/helpers/consensus.sh +0 -94
  558. package/claude-assets/skills/cfn-loop-orchestration/helpers/context-injection.sh +0 -142
  559. package/claude-assets/skills/cfn-loop-orchestration/helpers/context-lookup.sh +0 -359
  560. package/claude-assets/skills/cfn-loop-orchestration/helpers/deliverable-verifier-ts.sh +0 -123
  561. package/claude-assets/skills/cfn-loop-orchestration/helpers/deliverable-verifier.sh +0 -71
  562. package/claude-assets/skills/cfn-loop-orchestration/helpers/gate-check.sh +0 -56
  563. package/claude-assets/skills/cfn-loop-orchestration/helpers/iteration-manager-ts.sh +0 -89
  564. package/claude-assets/skills/cfn-loop-orchestration/helpers/iteration-manager.sh +0 -87
  565. package/claude-assets/skills/cfn-loop-orchestration/helpers/orchestrate-ts.sh +0 -104
  566. package/claude-assets/skills/cfn-loop-orchestration/helpers/parse-test-results.sh +0 -56
  567. package/claude-assets/skills/cfn-loop-orchestration/helpers/spawn-agents.sh +0 -290
  568. package/claude-assets/skills/cfn-loop-orchestration/helpers/timeout-calculator-ts.sh +0 -47
  569. package/claude-assets/skills/cfn-loop-orchestration/helpers/timeout-calculator.sh +0 -51
  570. package/claude-assets/skills/cfn-loop-orchestration/orchestrate.sh +0 -1345
  571. package/claude-assets/skills/cfn-redis-cleanup/cleanup-redis.sh +0 -130
  572. package/claude-assets/skills/cfn-redis-coordination/AGENT_LOGGING.md +0 -280
  573. package/claude-assets/skills/cfn-redis-coordination/BZPOPMIN_FIX_SUMMARY.md +0 -209
  574. package/claude-assets/skills/cfn-redis-coordination/CENTRALIZED_REDIS_WRAPPER.md +0 -319
  575. package/claude-assets/skills/cfn-redis-coordination/agent-log.sh.bak +0 -124
  576. package/claude-assets/skills/cfn-redis-coordination/config.json +0 -61
  577. package/claude-assets/skills/cfn-redis-coordination/demos/phase4-wake-queue-test-report.md +0 -82
  578. package/claude-assets/skills/cfn-redis-coordination/demos/test-bzpopmin-fix.sh +0 -274
  579. package/claude-assets/skills/cfn-redis-coordination/demos/test-cancel-swarm.sh +0 -0
  580. package/claude-assets/skills/cfn-redis-coordination/docs/migration/PHASE_3_REDIS_COORDINATION_COMPLETION_REPORT.md +0 -553
  581. package/claude-assets/skills/cfn-redis-coordination/jest.config.js +0 -23
  582. package/claude-assets/skills/cfn-redis-coordination/package-lock.json +0 -5272
  583. package/claude-assets/skills/cfn-redis-coordination/package.json +0 -45
  584. package/claude-assets/skills/cfn-redis-coordination/src/agent-logger.ts +0 -446
  585. package/claude-assets/skills/cfn-redis-coordination/src/agent-recovery.ts +0 -454
  586. package/claude-assets/skills/cfn-redis-coordination/src/completion-reporter.ts +0 -396
  587. package/claude-assets/skills/cfn-redis-coordination/src/context-manager.ts +0 -327
  588. package/claude-assets/skills/cfn-redis-coordination/src/index.ts +0 -82
  589. package/claude-assets/skills/cfn-redis-coordination/src/mode-detector.ts +0 -155
  590. package/claude-assets/skills/cfn-redis-coordination/src/redis/redis-client.ts +0 -305
  591. package/claude-assets/skills/cfn-redis-coordination/src/redis/redis-functions.ts +0 -283
  592. package/claude-assets/skills/cfn-redis-coordination/src/redis-client.ts +0 -654
  593. package/claude-assets/skills/cfn-redis-coordination/src/result-collector.ts +0 -437
  594. package/claude-assets/skills/cfn-redis-coordination/src/swarm-manager.ts +0 -494
  595. package/claude-assets/skills/cfn-redis-coordination/src/task-analyzer.ts +0 -404
  596. package/claude-assets/skills/cfn-redis-coordination/src/task-executor.ts +0 -423
  597. package/claude-assets/skills/cfn-redis-coordination/src/types.ts +0 -235
  598. package/claude-assets/skills/cfn-redis-coordination/src/waiting-coordinator.ts +0 -587
  599. package/claude-assets/skills/cfn-redis-coordination/store-success-criteria.sh +0 -85
  600. package/claude-assets/skills/cfn-redis-coordination/test-connection-attempts.js +0 -70
  601. package/claude-assets/skills/cfn-redis-coordination/test-mode-simple.js +0 -121
  602. package/claude-assets/skills/cfn-redis-coordination/test-redis-check.js +0 -84
  603. package/claude-assets/skills/cfn-redis-coordination/test-task-mode-redis.cjs +0 -391
  604. package/claude-assets/skills/cfn-redis-coordination/tests/coordination.test.ts +0 -788
  605. package/claude-assets/skills/cfn-redis-coordination/update-all-scripts.sh +0 -67
  606. package/claude-assets/skills/cfn-redis-data-extraction/SKILL.md +0 -442
  607. package/claude-assets/skills/cfn-redis-data-extraction/extract.sh +0 -306
  608. package/dist/coordination/index.js +0 -25
  609. package/dist/coordination/index.js.map +0 -1
  610. package/docs/BUG_19_MEMORY_LEAK_TASK_MODE.md +0 -405
  611. package/docs/MEMORY_CLEANUP_GUIDE.md +0 -358
  612. package/docs/MEMORY_LEAK_FIX_SUMMARY.md +0 -322
  613. package/docs/REDIS_CLEANUP_EXECUTIVE_SUMMARY.md +0 -319
  614. package/docs/REDIS_CLEANUP_VERIFICATION_REPORT.md +0 -574
  615. /package/.claude/skills/cfn-loop-orchestration/{inject-loop-context.sh → archive/legacy-bash/inject-loop-context.sh} +0 -0
  616. /package/.claude/skills/cfn-loop-orchestration/{monitor-execution.sh → archive/legacy-bash/monitor-execution.sh} +0 -0
  617. /package/.claude/skills/cfn-redis-coordination/{agent-log.sh → agent-log.sh.backup} +0 -0
  618. /package/.claude/skills/cfn-redis-coordination/{agent-recovery.sh → agent-recovery.sh.backup} +0 -0
  619. /package/.claude/skills/cfn-redis-coordination/{analyze-task-complexity.sh → analyze-task-complexity.sh.backup} +0 -0
  620. /package/.claude/skills/cfn-redis-coordination/bash-wrappers/{store-context.sh → store-context.sh.backup} +0 -0
  621. /package/.claude/skills/cfn-redis-coordination/{cancel-swarm.sh → cancel-swarm.sh.backup} +0 -0
  622. /package/.claude/skills/cfn-redis-coordination/{cfn-loop-exec.sh → cfn-loop-exec.sh.backup} +0 -0
  623. /package/.claude/skills/cfn-redis-coordination/{cfn-loop-relaunch.sh → cfn-loop-relaunch.sh.backup} +0 -0
  624. /package/.claude/skills/cfn-redis-coordination/{collect-confidence-scores.sh → collect-confidence-scores.sh.backup} +0 -0
  625. /package/.claude/skills/cfn-redis-coordination/{collect-results.sh → collect-results.sh.backup} +0 -0
  626. /package/.claude/skills/cfn-redis-coordination/{complete-swarm.sh → complete-swarm.sh.backup} +0 -0
  627. /package/.claude/skills/cfn-redis-coordination/{get-context.sh → get-context.sh.backup} +0 -0
  628. /package/.claude/skills/cfn-redis-coordination/{get-success-criteria.sh → get-success-criteria.sh.backup} +0 -0
  629. /package/.claude/skills/cfn-redis-coordination/{invoke-waiting-mode.sh → invoke-waiting-mode.sh.backup} +0 -0
  630. /package/.claude/skills/cfn-redis-coordination/{redis-cli-wrapper.sh → redis-cli-wrapper.sh.backup} +0 -0
  631. /package/.claude/skills/cfn-redis-coordination/{redis-functions.sh → redis-functions.sh.backup} +0 -0
  632. /package/.claude/skills/cfn-redis-coordination/{report-completion.sh → report-completion.sh.backup} +0 -0
  633. /package/.claude/skills/cfn-redis-coordination/{store-context.sh → store-context.sh.backup} +0 -0
  634. /package/claude-assets/skills/cfn-loop-orchestration/{inject-loop-context.sh → archive/legacy-bash/inject-loop-context.sh} +0 -0
  635. /package/claude-assets/skills/cfn-loop-orchestration/{monitor-execution.sh → archive/legacy-bash/monitor-execution.sh} +0 -0
  636. /package/claude-assets/skills/cfn-redis-coordination/{agent-log.sh → agent-log.sh.backup} +0 -0
  637. /package/claude-assets/skills/cfn-redis-coordination/{agent-recovery.sh → agent-recovery.sh.backup} +0 -0
  638. /package/claude-assets/skills/cfn-redis-coordination/{analyze-task-complexity.sh → analyze-task-complexity.sh.backup} +0 -0
  639. /package/claude-assets/skills/cfn-redis-coordination/bash-wrappers/{store-context.sh → store-context.sh.backup} +0 -0
  640. /package/claude-assets/skills/cfn-redis-coordination/{cancel-swarm.sh → cancel-swarm.sh.backup} +0 -0
  641. /package/claude-assets/skills/cfn-redis-coordination/{cfn-loop-exec.sh → cfn-loop-exec.sh.backup} +0 -0
  642. /package/claude-assets/skills/cfn-redis-coordination/{cfn-loop-relaunch.sh → cfn-loop-relaunch.sh.backup} +0 -0
  643. /package/claude-assets/skills/cfn-redis-coordination/{collect-confidence-scores.sh → collect-confidence-scores.sh.backup} +0 -0
  644. /package/claude-assets/skills/cfn-redis-coordination/{collect-results.sh → collect-results.sh.backup} +0 -0
  645. /package/claude-assets/skills/cfn-redis-coordination/{complete-swarm.sh → complete-swarm.sh.backup} +0 -0
  646. /package/claude-assets/skills/cfn-redis-coordination/{get-context.sh → get-context.sh.backup} +0 -0
  647. /package/claude-assets/skills/cfn-redis-coordination/{get-success-criteria.sh → get-success-criteria.sh.backup} +0 -0
  648. /package/claude-assets/skills/cfn-redis-coordination/{invoke-waiting-mode.sh → invoke-waiting-mode.sh.backup} +0 -0
  649. /package/claude-assets/skills/cfn-redis-coordination/{redis-cli-wrapper.sh → redis-cli-wrapper.sh.backup} +0 -0
  650. /package/claude-assets/skills/cfn-redis-coordination/{redis-functions.sh → redis-functions.sh.backup} +0 -0
  651. /package/claude-assets/skills/cfn-redis-coordination/{report-completion.sh → report-completion.sh.backup} +0 -0
  652. /package/claude-assets/skills/cfn-redis-coordination/{store-context.sh → store-context.sh.backup} +0 -0
@@ -0,0 +1,356 @@
1
+ /**
2
+ * Product Owner Decision Parser
3
+ * Parses Product Owner agent output to extract decision, reasoning, and validation
4
+ *
5
+ * Prevents "consensus on vapor" (claiming completion without deliverables)
6
+ * Handles multiple output formats with robust fallback patterns
7
+ */ import { promises as fs } from 'fs';
8
+ import { execSync } from 'child_process';
9
+ /**
10
+ * Decision Parser Error
11
+ */ export class DecisionParserError extends Error {
12
+ code;
13
+ details;
14
+ constructor(message, code, details){
15
+ super(message), this.code = code, this.details = details;
16
+ this.name = 'DecisionParserError';
17
+ }
18
+ }
19
+ /**
20
+ * Parse Product Owner output and extract decision
21
+ */ export class DecisionParser {
22
+ strict;
23
+ validateDeliverables;
24
+ taskContext;
25
+ taskId;
26
+ constructor(options = {}){
27
+ this.strict = options.strict ?? true;
28
+ this.validateDeliverables = options.validateDeliverables ?? true;
29
+ this.taskContext = options.taskContext;
30
+ this.taskId = options.taskId;
31
+ }
32
+ /**
33
+ * Parse decision from text output
34
+ */ parse(output) {
35
+ if (!output || typeof output !== 'string') {
36
+ throw new DecisionParserError('Invalid output: must be non-empty string', 'INVALID_OUTPUT');
37
+ }
38
+ const decision = this.extractDecision(output);
39
+ const reasoning = this.extractReasoning(output);
40
+ const confidence = this.extractConfidence(output);
41
+ const deliverables = this.extractDeliverables(output);
42
+ const auditAnalysis = this.extractAuditAnalysis(output);
43
+ const agentPerformanceObservations = this.extractAgentPerformance(output);
44
+ // Validate decision
45
+ const validationErrors = this.validateDecision(decision, reasoning, deliverables, confidence);
46
+ // Prevent "consensus on vapor"
47
+ if (decision === 'PROCEED' && this.validateDeliverables) {
48
+ const vapourCheck = this.checkConsensusOnVapor(output, deliverables);
49
+ if (vapourCheck.isVapor) {
50
+ validationErrors.push(...vapourCheck.errors);
51
+ if (this.strict) {
52
+ return {
53
+ decision: 'ITERATE',
54
+ reasoning: `Override PROCEED → ITERATE: ${vapourCheck.errors.join('; ')}`,
55
+ deliverables: [],
56
+ confidence: Math.min(confidence, 0.7),
57
+ validationErrors: vapourCheck.errors,
58
+ raw: {
59
+ fullOutput: output,
60
+ decisionLine: this.findDecisionLine(output)
61
+ }
62
+ };
63
+ }
64
+ }
65
+ }
66
+ return {
67
+ decision,
68
+ reasoning: reasoning || 'No reasoning provided',
69
+ deliverables,
70
+ confidence,
71
+ validationErrors,
72
+ auditAnalysis,
73
+ agentPerformanceObservations,
74
+ raw: {
75
+ fullOutput: output,
76
+ decisionLine: this.findDecisionLine(output)
77
+ }
78
+ };
79
+ }
80
+ /**
81
+ * Parse decision from file
82
+ */ async parseFile(filePath) {
83
+ try {
84
+ const content = await fs.readFile(filePath, 'utf-8');
85
+ return this.parse(content);
86
+ } catch (error) {
87
+ throw new DecisionParserError(`Failed to read decision file: ${filePath}`, 'FILE_READ_ERROR', {
88
+ originalError: String(error)
89
+ });
90
+ }
91
+ }
92
+ /**
93
+ * Extract decision keyword (PROCEED, ITERATE, ABORT)
94
+ * Multiple fallback patterns for robustness
95
+ */ extractDecision(output) {
96
+ // Pattern 1: Explicit "Decision: PROCEED"
97
+ let match = output.match(/Decision:\s*(PROCEED|ITERATE|ABORT)/i);
98
+ if (match) {
99
+ return match[1].toUpperCase();
100
+ }
101
+ // Pattern 2: Standalone keyword at start of line
102
+ match = output.match(/^(PROCEED|ITERATE|ABORT)/im);
103
+ if (match) {
104
+ return match[1].toUpperCase();
105
+ }
106
+ // Pattern 3: Decision in parentheses
107
+ match = output.match(/\((PROCEED|ITERATE|ABORT)\)/i);
108
+ if (match) {
109
+ return match[1].toUpperCase();
110
+ }
111
+ // Pattern 4: JSON format
112
+ try {
113
+ const jsonMatch = output.match(/\{[\s\S]*?"decision"\s*:\s*"(PROCEED|ITERATE|ABORT)"[\s\S]*?\}/i);
114
+ if (jsonMatch) {
115
+ const json = JSON.parse(jsonMatch[0]);
116
+ if (json.decision && /^(PROCEED|ITERATE|ABORT)$/i.test(json.decision)) {
117
+ return json.decision.toUpperCase();
118
+ }
119
+ }
120
+ } catch {
121
+ // JSON parse failed, continue to next pattern
122
+ }
123
+ // Pattern 5: First occurrence of keyword (case-insensitive)
124
+ const keywords = output.match(/\b(PROCEED|ITERATE|ABORT)\b/i);
125
+ if (keywords) {
126
+ return keywords[1].toUpperCase();
127
+ }
128
+ // Default: No decision found
129
+ if (this.strict) {
130
+ throw new DecisionParserError('Could not extract decision from Product Owner output', 'NO_DECISION_FOUND', {
131
+ availablePatterns: [
132
+ 'Decision:',
133
+ 'Standalone keyword',
134
+ 'Parentheses',
135
+ 'JSON',
136
+ 'First keyword'
137
+ ]
138
+ });
139
+ }
140
+ // Non-strict: default to ITERATE (safe fallback)
141
+ return 'ITERATE';
142
+ }
143
+ /**
144
+ * Extract reasoning explanation
145
+ */ extractReasoning(output) {
146
+ // Pattern 1: Explicit "Reasoning: ..."
147
+ let match = output.match(/Reasoning:\s*(.+?)(?:\n[A-Z]|\$|$)/i);
148
+ if (match) {
149
+ return match[1].trim();
150
+ }
151
+ // Pattern 2: "Because" or "Explanation"
152
+ match = output.match(/(?:Because|Explanation):\s*(.+?)(?:\n[A-Z]|\$|$)/i);
153
+ if (match) {
154
+ return match[1].trim();
155
+ }
156
+ // Pattern 3: JSON format
157
+ try {
158
+ const jsonMatch = output.match(/\{[\s\S]*?"reasoning"\s*:\s*"(.+?)"[\s\S]*?\}/i);
159
+ if (jsonMatch) {
160
+ const json = JSON.parse(jsonMatch[0]);
161
+ if (json.reasoning) {
162
+ return json.reasoning;
163
+ }
164
+ }
165
+ } catch {
166
+ // JSON parse failed
167
+ }
168
+ // Pattern 4: Extract paragraph after decision
169
+ const decisionIndex = output.search(/Decision:|PROCEED|ITERATE|ABORT/i);
170
+ if (decisionIndex !== -1) {
171
+ const afterDecision = output.substring(decisionIndex + 20);
172
+ match = afterDecision.match(/(.{20,500}?)(?:\n\n|Confidence|$)/);
173
+ if (match) {
174
+ return match[1].trim();
175
+ }
176
+ }
177
+ return '';
178
+ }
179
+ /**
180
+ * Extract confidence score
181
+ */ extractConfidence(output) {
182
+ // Pattern 1: Confidence as percentage (check first, more specific)
183
+ let match = output.match(/Confidence:\s*(\d+)%/i);
184
+ if (match) {
185
+ return parseFloat(match[1]) / 100;
186
+ }
187
+ // Pattern 2: "Confidence: 0.95" (decimal, must not be followed by %)
188
+ match = output.match(/Confidence:\s*(0?\.[0-9]+|[0-9]+\.[0-9]+)/i);
189
+ if (match) {
190
+ const value = parseFloat(match[1]);
191
+ return Math.min(Math.max(value, 0), 1); // Clamp to 0-1
192
+ }
193
+ // Pattern 3: JSON format
194
+ try {
195
+ const jsonMatch = output.match(/\{[\s\S]*?"confidence"\s*:\s*([0-9.]+)[\s\S]*?\}/i);
196
+ if (jsonMatch) {
197
+ const json = JSON.parse(jsonMatch[0]);
198
+ if (typeof json.confidence === 'number') {
199
+ return Math.min(Math.max(json.confidence, 0), 1);
200
+ }
201
+ }
202
+ } catch {
203
+ // JSON parse failed
204
+ }
205
+ // Default: moderate confidence
206
+ return 0.75;
207
+ }
208
+ /**
209
+ * Extract deliverables mentioned in output
210
+ */ extractDeliverables(output) {
211
+ const deliverables = [];
212
+ // Pattern 1: Bulleted lists after "Deliverables" section
213
+ const deliverablesSection = output.match(/(?:Deliverables|Deliverable|Outputs?):\s*([\s\S]*?)(?:\n\n|Confidence|$)/i);
214
+ if (deliverablesSection) {
215
+ const items = deliverablesSection[1].match(/[-*•]\s+(.+?)(?=\n|$)/gm);
216
+ if (items) {
217
+ items.forEach((item)=>{
218
+ const cleaned = item.replace(/^[-*•]\s+/, '').trim();
219
+ if (cleaned.length > 0) {
220
+ deliverables.push(cleaned);
221
+ }
222
+ });
223
+ }
224
+ }
225
+ // Pattern 2: JSON array format
226
+ try {
227
+ const jsonMatch = output.match(/\{[\s\S]*?"deliverables"\s*:\s*\[([\s\S]*?)\][\s\S]*?\}/i);
228
+ if (jsonMatch) {
229
+ const json = JSON.parse(jsonMatch[0]);
230
+ if (Array.isArray(json.deliverables)) {
231
+ deliverables.push(...json.deliverables);
232
+ }
233
+ }
234
+ } catch {
235
+ // JSON parse failed
236
+ }
237
+ // Remove duplicates using Set
238
+ const uniqueSet = new Set(deliverables);
239
+ return Array.from(uniqueSet);
240
+ }
241
+ /**
242
+ * Extract audit analysis section
243
+ */ extractAuditAnalysis(output) {
244
+ // Match "Audit Analysis: ..." to end of line or next capital letter
245
+ const match = output.match(/Audit Analysis:\s*(.+?)(?:\n[A-Z]|\n$|$)/i);
246
+ if (match) {
247
+ return match[1].trim();
248
+ }
249
+ return undefined;
250
+ }
251
+ /**
252
+ * Extract agent performance observations
253
+ */ extractAgentPerformance(output) {
254
+ // Match "Agent Performance: ..." to end of line or end of string
255
+ const match = output.match(/Agent Performance:\s*(.+?)(?:\n|$)/i);
256
+ if (match) {
257
+ return match[1].trim();
258
+ }
259
+ return undefined;
260
+ }
261
+ /**
262
+ * Find the line containing the decision
263
+ */ findDecisionLine(output) {
264
+ const lines = output.split('\n');
265
+ for (const line of lines){
266
+ if (/Decision:|PROCEED|ITERATE|ABORT/i.test(line)) {
267
+ return line.trim();
268
+ }
269
+ }
270
+ return undefined;
271
+ }
272
+ /**
273
+ * Validate decision consistency
274
+ */ validateDecision(decision, reasoning, deliverables, confidence) {
275
+ const errors = [];
276
+ // Check confidence is valid
277
+ if (confidence < 0 || confidence > 1) {
278
+ errors.push(`Invalid confidence score: ${confidence} (must be 0-1)`);
279
+ }
280
+ // ITERATE requires explanation
281
+ if (decision === 'ITERATE' && !reasoning) {
282
+ errors.push('ITERATE decision requires reasoning for improvements');
283
+ }
284
+ // ABORT requires strong reasoning
285
+ if (decision === 'ABORT' && confidence > 0.5) {
286
+ errors.push('ABORT decision should have lower confidence (indicates critical issue)');
287
+ }
288
+ // PROCEED with low confidence is suspicious
289
+ if (decision === 'PROCEED' && confidence < 0.6) {
290
+ errors.push('PROCEED decision with low confidence (<0.6) indicates uncertainty');
291
+ }
292
+ return errors;
293
+ }
294
+ /**
295
+ * Check for "consensus on vapor" (claims complete without deliverables)
296
+ */ checkConsensusOnVapor(output, deliverables) {
297
+ const errors = [];
298
+ // Check if task requires files
299
+ if (!this.taskContext) {
300
+ return {
301
+ isVapor: false,
302
+ errors: []
303
+ };
304
+ }
305
+ const requiresImplementation = /create|build|implement|generate|write|add|code|file|component|module|test/i.test(this.taskContext);
306
+ if (!requiresImplementation) {
307
+ return {
308
+ isVapor: false,
309
+ errors: []
310
+ };
311
+ }
312
+ // Check actual file changes in git
313
+ try {
314
+ const changedFiles = execSync('git status --short 2>/dev/null | grep -E "^(A|M|\\?\\?)" | wc -l', {
315
+ encoding: 'utf-8'
316
+ }).trim();
317
+ const fileCount = parseInt(changedFiles, 10) || 0;
318
+ if (fileCount === 0 && deliverables.length === 0) {
319
+ errors.push('No files created despite implementation task - consensus on plans only (consensus on vapor)');
320
+ return {
321
+ isVapor: true,
322
+ errors
323
+ };
324
+ }
325
+ if (fileCount === 0 && deliverables.length > 0) {
326
+ errors.push('Deliverables claimed but no files created - high risk of vapor consensus');
327
+ return {
328
+ isVapor: true,
329
+ errors
330
+ };
331
+ }
332
+ } catch {
333
+ // Git command failed, skip vapor check
334
+ // This is non-critical in non-git environments
335
+ }
336
+ return {
337
+ isVapor: false,
338
+ errors
339
+ };
340
+ }
341
+ }
342
+ /**
343
+ * Parse decision from output string (convenience function)
344
+ */ export async function parseDecision(output, options) {
345
+ const parser = new DecisionParser(options);
346
+ return parser.parse(output);
347
+ }
348
+ /**
349
+ * Parse decision from file (convenience function)
350
+ */ export async function parseDecisionFile(filePath, options) {
351
+ const parser = new DecisionParser(options);
352
+ return parser.parseFile(filePath);
353
+ }
354
+ export default DecisionParser;
355
+
356
+ //# sourceMappingURL=decision-parser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/cfn-loop/product-owner/decision-parser.ts"],"sourcesContent":["/**\r\n * Product Owner Decision Parser\r\n * Parses Product Owner agent output to extract decision, reasoning, and validation\r\n *\r\n * Prevents \"consensus on vapor\" (claiming completion without deliverables)\r\n * Handles multiple output formats with robust fallback patterns\r\n */\r\n\r\nimport { promises as fs } from 'fs';\r\nimport { execSync } from 'child_process';\r\n\r\n/**\r\n * Parsed decision from Product Owner output\r\n */\r\nexport interface ParsedDecision {\r\n decision: 'PROCEED' | 'ITERATE' | 'ABORT';\r\n reasoning: string;\r\n deliverables: string[];\r\n confidence: number;\r\n validationErrors: string[];\r\n auditAnalysis?: string;\r\n agentPerformanceObservations?: string;\r\n raw: {\r\n fullOutput: string;\r\n decisionLine?: string;\r\n };\r\n}\r\n\r\n/**\r\n * Decision Parser Options\r\n */\r\nexport interface DecisionParserOptions {\r\n strict?: boolean;\r\n validateDeliverables?: boolean;\r\n taskContext?: string;\r\n taskId?: string;\r\n}\r\n\r\n/**\r\n * Decision Parser Error\r\n */\r\nexport class DecisionParserError extends Error {\r\n constructor(\r\n message: string,\r\n public code: string,\r\n public details?: Record<string, any>\r\n ) {\r\n super(message);\r\n this.name = 'DecisionParserError';\r\n }\r\n}\r\n\r\n/**\r\n * Parse Product Owner output and extract decision\r\n */\r\nexport class DecisionParser {\r\n private strict: boolean;\r\n private validateDeliverables: boolean;\r\n private taskContext?: string;\r\n private taskId?: string;\r\n\r\n constructor(options: DecisionParserOptions = {}) {\r\n this.strict = options.strict ?? true;\r\n this.validateDeliverables = options.validateDeliverables ?? true;\r\n this.taskContext = options.taskContext;\r\n this.taskId = options.taskId;\r\n }\r\n\r\n /**\r\n * Parse decision from text output\r\n */\r\n public parse(output: string): ParsedDecision {\r\n if (!output || typeof output !== 'string') {\r\n throw new DecisionParserError(\r\n 'Invalid output: must be non-empty string',\r\n 'INVALID_OUTPUT'\r\n );\r\n }\r\n\r\n const decision = this.extractDecision(output);\r\n const reasoning = this.extractReasoning(output);\r\n const confidence = this.extractConfidence(output);\r\n const deliverables = this.extractDeliverables(output);\r\n const auditAnalysis = this.extractAuditAnalysis(output);\r\n const agentPerformanceObservations = this.extractAgentPerformance(output);\r\n\r\n // Validate decision\r\n const validationErrors = this.validateDecision(\r\n decision,\r\n reasoning,\r\n deliverables,\r\n confidence\r\n );\r\n\r\n // Prevent \"consensus on vapor\"\r\n if (decision === 'PROCEED' && this.validateDeliverables) {\r\n const vapourCheck = this.checkConsensusOnVapor(output, deliverables);\r\n if (vapourCheck.isVapor) {\r\n validationErrors.push(...vapourCheck.errors);\r\n if (this.strict) {\r\n return {\r\n decision: 'ITERATE',\r\n reasoning: `Override PROCEED → ITERATE: ${vapourCheck.errors.join('; ')}`,\r\n deliverables: [],\r\n confidence: Math.min(confidence, 0.7),\r\n validationErrors: vapourCheck.errors,\r\n raw: {\r\n fullOutput: output,\r\n decisionLine: this.findDecisionLine(output)\r\n }\r\n };\r\n }\r\n }\r\n }\r\n\r\n return {\r\n decision,\r\n reasoning: reasoning || 'No reasoning provided',\r\n deliverables,\r\n confidence,\r\n validationErrors,\r\n auditAnalysis,\r\n agentPerformanceObservations,\r\n raw: {\r\n fullOutput: output,\r\n decisionLine: this.findDecisionLine(output)\r\n }\r\n };\r\n }\r\n\r\n /**\r\n * Parse decision from file\r\n */\r\n public async parseFile(filePath: string): Promise<ParsedDecision> {\r\n try {\r\n const content = await fs.readFile(filePath, 'utf-8');\r\n return this.parse(content);\r\n } catch (error) {\r\n throw new DecisionParserError(\r\n `Failed to read decision file: ${filePath}`,\r\n 'FILE_READ_ERROR',\r\n { originalError: String(error) }\r\n );\r\n }\r\n }\r\n\r\n /**\r\n * Extract decision keyword (PROCEED, ITERATE, ABORT)\r\n * Multiple fallback patterns for robustness\r\n */\r\n private extractDecision(output: string): 'PROCEED' | 'ITERATE' | 'ABORT' {\r\n // Pattern 1: Explicit \"Decision: PROCEED\"\r\n let match = output.match(/Decision:\\s*(PROCEED|ITERATE|ABORT)/i);\r\n if (match) {\r\n return match[1].toUpperCase() as 'PROCEED' | 'ITERATE' | 'ABORT';\r\n }\r\n\r\n // Pattern 2: Standalone keyword at start of line\r\n match = output.match(/^(PROCEED|ITERATE|ABORT)/im);\r\n if (match) {\r\n return match[1].toUpperCase() as 'PROCEED' | 'ITERATE' | 'ABORT';\r\n }\r\n\r\n // Pattern 3: Decision in parentheses\r\n match = output.match(/\\((PROCEED|ITERATE|ABORT)\\)/i);\r\n if (match) {\r\n return match[1].toUpperCase() as 'PROCEED' | 'ITERATE' | 'ABORT';\r\n }\r\n\r\n // Pattern 4: JSON format\r\n try {\r\n const jsonMatch = output.match(/\\{[\\s\\S]*?\"decision\"\\s*:\\s*\"(PROCEED|ITERATE|ABORT)\"[\\s\\S]*?\\}/i);\r\n if (jsonMatch) {\r\n const json = JSON.parse(jsonMatch[0]);\r\n if (json.decision && /^(PROCEED|ITERATE|ABORT)$/i.test(json.decision)) {\r\n return json.decision.toUpperCase() as 'PROCEED' | 'ITERATE' | 'ABORT';\r\n }\r\n }\r\n } catch {\r\n // JSON parse failed, continue to next pattern\r\n }\r\n\r\n // Pattern 5: First occurrence of keyword (case-insensitive)\r\n const keywords = output.match(/\\b(PROCEED|ITERATE|ABORT)\\b/i);\r\n if (keywords) {\r\n return keywords[1].toUpperCase() as 'PROCEED' | 'ITERATE' | 'ABORT';\r\n }\r\n\r\n // Default: No decision found\r\n if (this.strict) {\r\n throw new DecisionParserError(\r\n 'Could not extract decision from Product Owner output',\r\n 'NO_DECISION_FOUND',\r\n { availablePatterns: ['Decision:', 'Standalone keyword', 'Parentheses', 'JSON', 'First keyword'] }\r\n );\r\n }\r\n\r\n // Non-strict: default to ITERATE (safe fallback)\r\n return 'ITERATE';\r\n }\r\n\r\n /**\r\n * Extract reasoning explanation\r\n */\r\n private extractReasoning(output: string): string {\r\n // Pattern 1: Explicit \"Reasoning: ...\"\r\n let match = output.match(/Reasoning:\\s*(.+?)(?:\\n[A-Z]|\\$|$)/i);\r\n if (match) {\r\n return match[1].trim();\r\n }\r\n\r\n // Pattern 2: \"Because\" or \"Explanation\"\r\n match = output.match(/(?:Because|Explanation):\\s*(.+?)(?:\\n[A-Z]|\\$|$)/i);\r\n if (match) {\r\n return match[1].trim();\r\n }\r\n\r\n // Pattern 3: JSON format\r\n try {\r\n const jsonMatch = output.match(/\\{[\\s\\S]*?\"reasoning\"\\s*:\\s*\"(.+?)\"[\\s\\S]*?\\}/i);\r\n if (jsonMatch) {\r\n const json = JSON.parse(jsonMatch[0]);\r\n if (json.reasoning) {\r\n return json.reasoning;\r\n }\r\n }\r\n } catch {\r\n // JSON parse failed\r\n }\r\n\r\n // Pattern 4: Extract paragraph after decision\r\n const decisionIndex = output.search(/Decision:|PROCEED|ITERATE|ABORT/i);\r\n if (decisionIndex !== -1) {\r\n const afterDecision = output.substring(decisionIndex + 20);\r\n match = afterDecision.match(/(.{20,500}?)(?:\\n\\n|Confidence|$)/);\r\n if (match) {\r\n return match[1].trim();\r\n }\r\n }\r\n\r\n return '';\r\n }\r\n\r\n /**\r\n * Extract confidence score\r\n */\r\n private extractConfidence(output: string): number {\r\n // Pattern 1: Confidence as percentage (check first, more specific)\r\n let match = output.match(/Confidence:\\s*(\\d+)%/i);\r\n if (match) {\r\n return parseFloat(match[1]) / 100;\r\n }\r\n\r\n // Pattern 2: \"Confidence: 0.95\" (decimal, must not be followed by %)\r\n match = output.match(/Confidence:\\s*(0?\\.[0-9]+|[0-9]+\\.[0-9]+)/i);\r\n if (match) {\r\n const value = parseFloat(match[1]);\r\n return Math.min(Math.max(value, 0), 1); // Clamp to 0-1\r\n }\r\n\r\n // Pattern 3: JSON format\r\n try {\r\n const jsonMatch = output.match(/\\{[\\s\\S]*?\"confidence\"\\s*:\\s*([0-9.]+)[\\s\\S]*?\\}/i);\r\n if (jsonMatch) {\r\n const json = JSON.parse(jsonMatch[0]);\r\n if (typeof json.confidence === 'number') {\r\n return Math.min(Math.max(json.confidence, 0), 1);\r\n }\r\n }\r\n } catch {\r\n // JSON parse failed\r\n }\r\n\r\n // Default: moderate confidence\r\n return 0.75;\r\n }\r\n\r\n /**\r\n * Extract deliverables mentioned in output\r\n */\r\n private extractDeliverables(output: string): string[] {\r\n const deliverables: string[] = [];\r\n\r\n // Pattern 1: Bulleted lists after \"Deliverables\" section\r\n const deliverablesSection = output.match(\r\n /(?:Deliverables|Deliverable|Outputs?):\\s*([\\s\\S]*?)(?:\\n\\n|Confidence|$)/i\r\n );\r\n\r\n if (deliverablesSection) {\r\n const items = deliverablesSection[1].match(/[-*•]\\s+(.+?)(?=\\n|$)/gm);\r\n if (items) {\r\n items.forEach(item => {\r\n const cleaned = item.replace(/^[-*•]\\s+/, '').trim();\r\n if (cleaned.length > 0) {\r\n deliverables.push(cleaned);\r\n }\r\n });\r\n }\r\n }\r\n\r\n // Pattern 2: JSON array format\r\n try {\r\n const jsonMatch = output.match(/\\{[\\s\\S]*?\"deliverables\"\\s*:\\s*\\[([\\s\\S]*?)\\][\\s\\S]*?\\}/i);\r\n if (jsonMatch) {\r\n const json = JSON.parse(jsonMatch[0]);\r\n if (Array.isArray(json.deliverables)) {\r\n deliverables.push(...json.deliverables);\r\n }\r\n }\r\n } catch {\r\n // JSON parse failed\r\n }\r\n\r\n // Remove duplicates using Set\r\n const uniqueSet = new Set(deliverables);\r\n return Array.from(uniqueSet);\r\n }\r\n\r\n /**\r\n * Extract audit analysis section\r\n */\r\n private extractAuditAnalysis(output: string): string | undefined {\r\n // Match \"Audit Analysis: ...\" to end of line or next capital letter\r\n const match = output.match(/Audit Analysis:\\s*(.+?)(?:\\n[A-Z]|\\n$|$)/i);\r\n if (match) {\r\n return match[1].trim();\r\n }\r\n return undefined;\r\n }\r\n\r\n /**\r\n * Extract agent performance observations\r\n */\r\n private extractAgentPerformance(output: string): string | undefined {\r\n // Match \"Agent Performance: ...\" to end of line or end of string\r\n const match = output.match(/Agent Performance:\\s*(.+?)(?:\\n|$)/i);\r\n if (match) {\r\n return match[1].trim();\r\n }\r\n return undefined;\r\n }\r\n\r\n /**\r\n * Find the line containing the decision\r\n */\r\n private findDecisionLine(output: string): string | undefined {\r\n const lines = output.split('\\n');\r\n for (const line of lines) {\r\n if (/Decision:|PROCEED|ITERATE|ABORT/i.test(line)) {\r\n return line.trim();\r\n }\r\n }\r\n return undefined;\r\n }\r\n\r\n /**\r\n * Validate decision consistency\r\n */\r\n private validateDecision(\r\n decision: string,\r\n reasoning: string,\r\n deliverables: string[],\r\n confidence: number\r\n ): string[] {\r\n const errors: string[] = [];\r\n\r\n // Check confidence is valid\r\n if (confidence < 0 || confidence > 1) {\r\n errors.push(`Invalid confidence score: ${confidence} (must be 0-1)`);\r\n }\r\n\r\n // ITERATE requires explanation\r\n if (decision === 'ITERATE' && !reasoning) {\r\n errors.push('ITERATE decision requires reasoning for improvements');\r\n }\r\n\r\n // ABORT requires strong reasoning\r\n if (decision === 'ABORT' && confidence > 0.5) {\r\n errors.push('ABORT decision should have lower confidence (indicates critical issue)');\r\n }\r\n\r\n // PROCEED with low confidence is suspicious\r\n if (decision === 'PROCEED' && confidence < 0.6) {\r\n errors.push('PROCEED decision with low confidence (<0.6) indicates uncertainty');\r\n }\r\n\r\n return errors;\r\n }\r\n\r\n /**\r\n * Check for \"consensus on vapor\" (claims complete without deliverables)\r\n */\r\n private checkConsensusOnVapor(\r\n output: string,\r\n deliverables: string[]\r\n ): { isVapor: boolean; errors: string[] } {\r\n const errors: string[] = [];\r\n\r\n // Check if task requires files\r\n if (!this.taskContext) {\r\n return { isVapor: false, errors: [] };\r\n }\r\n\r\n const requiresImplementation = /create|build|implement|generate|write|add|code|file|component|module|test/i.test(\r\n this.taskContext\r\n );\r\n\r\n if (!requiresImplementation) {\r\n return { isVapor: false, errors: [] };\r\n }\r\n\r\n // Check actual file changes in git\r\n try {\r\n const changedFiles = execSync('git status --short 2>/dev/null | grep -E \"^(A|M|\\\\?\\\\?)\" | wc -l', {\r\n encoding: 'utf-8'\r\n }).trim();\r\n\r\n const fileCount = parseInt(changedFiles, 10) || 0;\r\n\r\n if (fileCount === 0 && deliverables.length === 0) {\r\n errors.push('No files created despite implementation task - consensus on plans only (consensus on vapor)');\r\n return { isVapor: true, errors };\r\n }\r\n\r\n if (fileCount === 0 && deliverables.length > 0) {\r\n errors.push('Deliverables claimed but no files created - high risk of vapor consensus');\r\n return { isVapor: true, errors };\r\n }\r\n } catch {\r\n // Git command failed, skip vapor check\r\n // This is non-critical in non-git environments\r\n }\r\n\r\n return { isVapor: false, errors };\r\n }\r\n}\r\n\r\n/**\r\n * Parse decision from output string (convenience function)\r\n */\r\nexport async function parseDecision(\r\n output: string,\r\n options?: DecisionParserOptions\r\n): Promise<ParsedDecision> {\r\n const parser = new DecisionParser(options);\r\n return parser.parse(output);\r\n}\r\n\r\n/**\r\n * Parse decision from file (convenience function)\r\n */\r\nexport async function parseDecisionFile(\r\n filePath: string,\r\n options?: DecisionParserOptions\r\n): Promise<ParsedDecision> {\r\n const parser = new DecisionParser(options);\r\n return parser.parseFile(filePath);\r\n}\r\n\r\nexport default DecisionParser;\r\n"],"names":["promises","fs","execSync","DecisionParserError","Error","message","code","details","name","DecisionParser","strict","validateDeliverables","taskContext","taskId","options","parse","output","decision","extractDecision","reasoning","extractReasoning","confidence","extractConfidence","deliverables","extractDeliverables","auditAnalysis","extractAuditAnalysis","agentPerformanceObservations","extractAgentPerformance","validationErrors","validateDecision","vapourCheck","checkConsensusOnVapor","isVapor","push","errors","join","Math","min","raw","fullOutput","decisionLine","findDecisionLine","parseFile","filePath","content","readFile","error","originalError","String","match","toUpperCase","jsonMatch","json","JSON","test","keywords","availablePatterns","trim","decisionIndex","search","afterDecision","substring","parseFloat","value","max","deliverablesSection","items","forEach","item","cleaned","replace","length","Array","isArray","uniqueSet","Set","from","undefined","lines","split","line","requiresImplementation","changedFiles","encoding","fileCount","parseInt","parseDecision","parser","parseDecisionFile"],"mappings":"AAAA;;;;;;CAMC,GAED,SAASA,YAAYC,EAAE,QAAQ,KAAK;AACpC,SAASC,QAAQ,QAAQ,gBAAgB;AA6BzC;;CAEC,GACD,O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QAEA,OAAO;YAAEF,SAAS;YAAOE;QAAO;IAClC;AACF;AAEA;;CAEC,GACD,OAAO,eAAeoD,cACpBvE,MAAc,EACdF,OAA+B;IAE/B,MAAM0E,SAAS,IAAI/E,eAAeK;IAClC,OAAO0E,OAAOzE,KAAK,CAACC;AACtB;AAEA;;CAEC,GACD,OAAO,eAAeyE,kBACpB7C,QAAgB,EAChB9B,OAA+B;IAE/B,MAAM0E,SAAS,IAAI/E,eAAeK;IAClC,OAAO0E,OAAO7C,SAAS,CAACC;AAC1B;AAEA,eAAenC,eAAe"}
@@ -3,6 +3,7 @@
3
3
  * Centralized export of all product owner implementations
4
4
  */ export { MVPOwner } from './mvp-owner.js';
5
5
  export { EnterpriseOwnerTeam } from './enterprise-owner-team.js';
6
+ export { DecisionParser, DecisionParserError, parseDecision, parseDecisionFile } from './decision-parser.js';
6
7
  import { MVPOwner } from './mvp-owner.js';
7
8
  import { EnterpriseOwnerTeam } from './enterprise-owner-team.js';
8
9
  /**
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/cfn-loop/product-owner/index.ts"],"sourcesContent":["/**\r\n * Product Owner System Exports\r\n * Centralized export of all product owner implementations\r\n */\r\n\r\nexport { MVPOwner } from './mvp-owner.js';\r\nexport { EnterpriseOwnerTeam } from './enterprise-owner-team.js';\r\n\r\nexport type {\r\n POConfig,\r\n PODecision,\r\n PODecisionResult,\r\n GOAPState,\r\n GOAPAction,\r\n TeamVote,\r\n TeamDecisionResult,\r\n ProductOwner,\r\n} from './types.js';\r\n\r\nimport { MVPOwner } from './mvp-owner.js';\r\nimport { EnterpriseOwnerTeam } from './enterprise-owner-team.js';\r\nimport type { CFNLoopModeName } from '../modes/types.js';\r\nimport type { ProductOwner } from './types.js';\r\n\r\n/**\r\n * Get product owner implementation for mode\r\n */\r\nexport function getProductOwnerForMode(\r\n mode: CFNLoopModeName,\r\n memoryManager?: unknown\r\n): ProductOwner {\r\n switch (mode) {\r\n case 'mvp':\r\n case 'standard':\r\n return new MVPOwner(memoryManager);\r\n case 'enterprise':\r\n return new EnterpriseOwnerTeam(memoryManager);\r\n default:\r\n throw new Error(`Unknown mode for product owner: ${mode}`);\r\n }\r\n}\r\n\r\n/**\r\n * Execute MVP owner decision (legacy function wrapper)\r\n */\r\nexport async function executeMVPOwnerDecision(\r\n state: import('./types.js').GOAPState,\r\n memoryManager?: unknown\r\n): Promise<import('./types.js').PODecisionResult> {\r\n const owner = new MVPOwner(memoryManager);\r\n return owner.makeDecision(state);\r\n}\r\n\r\n/**\r\n * Execute Enterprise board decision (legacy function wrapper)\r\n */\r\nexport async function executeEnterpriseBoardDecision(\r\n state: import('./types.js').GOAPState,\r\n memoryManager?: unknown\r\n): Promise<import('./types.js').TeamDecisionResult> {\r\n const team = new EnterpriseOwnerTeam(memoryManager);\r\n return team.makeDecision(state);\r\n}\r\n"],"names":["MVPOwner","EnterpriseOwnerTeam","getProductOwnerForMode","mode","memoryManager","Error","executeMVPOwnerDecision","state","owner","makeDecision","executeEnterpriseBoardDecision","team"],"mappings":"AAAA;;;CAGC,GAED,SAASA,QAAQ,QAAQ,iBAAiB;AAC1C,SAASC,mBAAmB,QAAQ,6BAA6B;AAajE,SAASD,QAAQ,QAAQ,iBAAiB;AAC1C,SAASC,mBAAmB,QAAQ,6BAA6B;AAIjE;;CAEC,GACD,OAAO,SAASC,uBACdC,IAAqB,EACrBC,aAAuB;IAEvB,OAAQD;QACN,KAAK;QACL,KAAK;YACH,OAAO,IAAIH,SAASI;QACtB,KAAK;YACH,OAAO,IAAIH,oBAAoBG;QACjC;YACE,MAAM,IAAIC,MAAM,CAAC,gCAAgC,EAAEF,MAAM;IAC7D;AACF;AAEA;;CAEC,GACD,OAAO,eAAeG,wBACpBC,KAAqC,EACrCH,aAAuB;IAEvB,MAAMI,QAAQ,IAAIR,SAASI;IAC3B,OAAOI,MAAMC,YAAY,CAACF;AAC5B;AAEA;;CAEC,GACD,OAAO,eAAeG,+BACpBH,KAAqC,EACrCH,aAAuB;IAEvB,MAAMO,OAAO,IAAIV,oBAAoBG;IACrC,OAAOO,KAAKF,YAAY,CAACF;AAC3B"}
1
+ {"version":3,"sources":["../../../src/cfn-loop/product-owner/index.ts"],"sourcesContent":["/**\r\n * Product Owner System Exports\r\n * Centralized export of all product owner implementations\r\n */\r\n\r\nexport { MVPOwner } from './mvp-owner.js';\r\nexport { EnterpriseOwnerTeam } from './enterprise-owner-team.js';\r\nexport { DecisionParser, DecisionParserError, parseDecision, parseDecisionFile } from './decision-parser.js';\r\n\r\nexport type {\r\n POConfig,\r\n PODecision,\r\n PODecisionResult,\r\n GOAPState,\r\n GOAPAction,\r\n TeamVote,\r\n TeamDecisionResult,\r\n ProductOwner,\r\n} from './types.js';\r\n\r\nexport type { ParsedDecision, DecisionParserOptions } from './decision-parser.js';\r\n\r\nimport { MVPOwner } from './mvp-owner.js';\r\nimport { EnterpriseOwnerTeam } from './enterprise-owner-team.js';\r\nimport type { CFNLoopModeName } from '../modes/types.js';\r\nimport type { ProductOwner } from './types.js';\r\n\r\n/**\r\n * Get product owner implementation for mode\r\n */\r\nexport function getProductOwnerForMode(\r\n mode: CFNLoopModeName,\r\n memoryManager?: unknown\r\n): ProductOwner {\r\n switch (mode) {\r\n case 'mvp':\r\n case 'standard':\r\n return new MVPOwner(memoryManager);\r\n case 'enterprise':\r\n return new EnterpriseOwnerTeam(memoryManager);\r\n default:\r\n throw new Error(`Unknown mode for product owner: ${mode}`);\r\n }\r\n}\r\n\r\n/**\r\n * Execute MVP owner decision (legacy function wrapper)\r\n */\r\nexport async function executeMVPOwnerDecision(\r\n state: import('./types.js').GOAPState,\r\n memoryManager?: unknown\r\n): Promise<import('./types.js').PODecisionResult> {\r\n const owner = new MVPOwner(memoryManager);\r\n return owner.makeDecision(state);\r\n}\r\n\r\n/**\r\n * Execute Enterprise board decision (legacy function wrapper)\r\n */\r\nexport async function executeEnterpriseBoardDecision(\r\n state: import('./types.js').GOAPState,\r\n memoryManager?: unknown\r\n): Promise<import('./types.js').TeamDecisionResult> {\r\n const team = new EnterpriseOwnerTeam(memoryManager);\r\n return team.makeDecision(state);\r\n}\r\n"],"names":["MVPOwner","EnterpriseOwnerTeam","DecisionParser","DecisionParserError","parseDecision","parseDecisionFile","getProductOwnerForMode","mode","memoryManager","Error","executeMVPOwnerDecision","state","owner","makeDecision","executeEnterpriseBoardDecision","team"],"mappings":"AAAA;;;CAGC,GAED,SAASA,QAAQ,QAAQ,iBAAiB;AAC1C,SAASC,mBAAmB,QAAQ,6BAA6B;AACjE,SAASC,cAAc,EAAEC,mBAAmB,EAAEC,aAAa,EAAEC,iBAAiB,QAAQ,uBAAuB;AAe7G,SAASL,QAAQ,QAAQ,iBAAiB;AAC1C,SAASC,mBAAmB,QAAQ,6BAA6B;AAIjE;;CAEC,GACD,OAAO,SAASK,uBACdC,IAAqB,EACrBC,aAAuB;IAEvB,OAAQD;QACN,KAAK;QACL,KAAK;YACH,OAAO,IAAIP,SAASQ;QACtB,KAAK;YACH,OAAO,IAAIP,oBAAoBO;QACjC;YACE,MAAM,IAAIC,MAAM,CAAC,gCAAgC,EAAEF,MAAM;IAC7D;AACF;AAEA;;CAEC,GACD,OAAO,eAAeG,wBACpBC,KAAqC,EACrCH,aAAuB;IAEvB,MAAMI,QAAQ,IAAIZ,SAASQ;IAC3B,OAAOI,MAAMC,YAAY,CAACF;AAC5B;AAEA;;CAEC,GACD,OAAO,eAAeG,+BACpBH,KAAqC,EACrCH,aAAuB;IAEvB,MAAMO,OAAO,IAAId,oBAAoBO;IACrC,OAAOO,KAAKF,YAAY,CAACF;AAC3B"}
@@ -166,7 +166,7 @@ Documentation:
166
166
  };
167
167
  const prompt = await buildAgentPrompt(definition, taskContext);
168
168
  console.log(` ✓ Prompt size: ${prompt.length} characters`);
169
- console.log(` ✓ CFN Loop protocol: ${prompt.includes('CFN Loop Redis Completion Protocol') ? 'included' : 'not applicable'}`);
169
+ console.log(` ✓ CFN Loop protocol: ${prompt.includes('CLI Mode Redis Completion Protocol') ? 'included' : 'not applicable'}`);
170
170
  console.log(` ✓ Iteration history: ${prompt.includes('## Iteration History') ? 'included' : 'not applicable'}`);
171
171
  console.log('');
172
172
  // Step 3: Execute agent
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/cli/agent-command.ts"],"sourcesContent":["/**\r\n * Agent Command Handler\r\n *\r\n * Handles `npx claude-flow-novice agent <type> [options]` commands.\r\n * Orchestrates agent definition parsing, prompt building, and execution.\r\n */\r\n\r\nimport { parseAgentDefinition, listAgentDefinitions } from './agent-definition-parser.js';\r\nimport { buildAgentPrompt, TaskContext } from './agent-prompt-builder.js';\r\nimport { executeAgent } from './agent-executor.js';\r\n\r\nexport interface AgentCommandOptions {\r\n taskId?: string;\r\n iteration?: number;\r\n context?: string;\r\n mode?: string;\r\n priority?: number;\r\n parentTaskId?: string;\r\n agentId?: string;\r\n list?: boolean;\r\n help?: boolean;\r\n memoryLimit?: number;\r\n enableProfiling?: boolean;\r\n debug?: boolean;\r\n}\r\n\r\n/**\r\n * Display agent command help\r\n */\r\nexport function displayAgentHelp(): void {\r\n console.log(`\r\nClaude Flow Novice - Agent Spawning\r\n\r\nUsage:\r\n npx claude-flow-novice agent <type> [options]\r\n\r\nArguments:\r\n <type> Agent type (e.g., rust-enterprise-developer, coder, reviewer)\r\n\r\nOptions:\r\n --task-id <id> Task identifier for CFN Loop coordination\r\n --iteration <n> Iteration number (default: 1)\r\n --agent-id <id> Explicit agent ID (overrides auto-generated ID)\r\n --context <text> Task context/description\r\n --mode <mode> Execution mode (cli, api, hybrid)\r\n --priority <n> Task priority (1-10)\r\n --parent-task-id <id> Parent task identifier\r\n --memory-limit <mb> Set memory limit in MB (default: 8192)\r\n --enable-profiling Enable heap profiling for debugging\r\n --debug Enable debug mode with profiling\r\n --list List all available agents\r\n --help Show this help message\r\n\r\nExamples:\r\n # Simple agent spawn\r\n npx claude-flow-novice agent coder --context \"Implement JWT auth\"\r\n\r\n # CFN Loop agent with memory limits\r\n npx claude-flow-novice agent rust-enterprise-developer \\\\\r\n --task-id task-123 \\\\\r\n --iteration 1 \\\\\r\n --mode standard \\\\\r\n --memory-limit 4096\r\n\r\n # Debug mode with profiling\r\n npx claude-flow-novice agent tester \\\\\r\n --context \"Test authentication system\" \\\\\r\n --debug \\\\\r\n --enable-profiling\r\n\r\n # List available agents\r\n npx claude-flow-novice agent --list\r\n\r\nMemory Management:\r\n Claude automatically applies memory limits to prevent leaks:\r\n - Default limit: 8GB (reduced from 16GB)\r\n - Use --memory-limit to set custom limits\r\n - Use --debug to enable profiling and monitoring\r\n - Memory profiles saved to /tmp/claude-memory-profiles/\r\n\r\n For advanced memory management:\r\n ./scripts/memory-leak-prevention.sh --help\r\n\r\nAvailable Agents:\r\n Agents are defined in .claude/agents/ directory:\r\n - core-agents/ Production-ready core agents\r\n - specialized/ Domain-specific specialists\r\n - development/ Development-focused agents\r\n - security/ Security-focused agents\r\n - custom/ Your custom agents\r\n\r\nDocumentation:\r\n See .claude/agents/CLAUDE.md for agent creation guide\r\n`);\r\n}\r\n\r\n/**\r\n * List all available agent definitions\r\n */\r\nexport async function listAgents(): Promise<void> {\r\n console.log('Searching for agent definitions...\\n');\r\n\r\n const agents = await listAgentDefinitions();\r\n\r\n if (agents.length === 0) {\r\n console.log('No agent definitions found in .claude/agents/');\r\n console.log('\\nTo create agents, see: .claude/agents/CLAUDE.md');\r\n return;\r\n }\r\n\r\n console.log(`Found ${agents.length} agent(s):\\n`);\r\n\r\n // Group by category\r\n const grouped: Record<string, string[]> = {};\r\n\r\n for (const agent of agents) {\r\n const parts = agent.split('/');\r\n const category = parts.length > 1 ? parts[0] : 'root';\r\n const name = parts.length > 1 ? parts.slice(1).join('/') : parts[0];\r\n\r\n if (!grouped[category]) {\r\n grouped[category] = [];\r\n }\r\n grouped[category].push(name);\r\n }\r\n\r\n // Display grouped agents\r\n for (const [category, names] of Object.entries(grouped).sort()) {\r\n console.log(`${category}/`);\r\n for (const name of names.sort()) {\r\n console.log(` - ${name}`);\r\n }\r\n console.log('');\r\n }\r\n\r\n console.log('Usage:');\r\n console.log(' npx claude-flow-novice agent <name> [options]');\r\n}\r\n\r\n/**\r\n * Execute agent command\r\n */\r\nexport async function agentCommand(\r\n agentType: string | undefined,\r\n options: AgentCommandOptions\r\n): Promise<void> {\r\n // Handle --list flag\r\n if (options.list) {\r\n await listAgents();\r\n return;\r\n }\r\n\r\n // Handle --help flag\r\n if (options.help || !agentType) {\r\n displayAgentHelp();\r\n return;\r\n }\r\n\r\n try {\r\n // Apply memory management options\r\n if (options.memoryLimit) {\r\n console.log(`[agent-command] Setting memory limit: ${options.memoryLimit}MB`);\r\n const currentOptions = process.env.NODE_OPTIONS || '';\r\n const newOptions = currentOptions.replace(/--max-old-space-size=\\d+/, `--max-old-space-size=${options.memoryLimit}`);\r\n process.env.NODE_OPTIONS = newOptions || `--max-old-space-size=${options.memoryLimit}`;\r\n }\r\n\r\n if (options.enableProfiling || options.debug) {\r\n console.log(`[agent-command] Enabling memory profiling`);\r\n if (!process.env.NODE_OPTIONS.includes('heap-prof')) {\r\n process.env.NODE_OPTIONS += ' --heap-prof';\r\n }\r\n if (!process.env.NODE_OPTIONS.includes('inspect') && options.debug) {\r\n process.env.NODE_OPTIONS += ' --inspect=0.0.0.0:9229';\r\n }\r\n }\r\n\r\n if (options.debug) {\r\n console.log(`[agent-command] Debug mode enabled`);\r\n process.env.CLAUDE_DEBUG = 'true';\r\n process.env.CLAUDE_MEMORY_MONITORING = 'true';\r\n }\r\n\r\n console.log(`[agent-command] Spawning agent: ${agentType}`);\r\n console.log(`[agent-command] Memory settings: ${process.env.NODE_OPTIONS}`);\r\n console.log('');\r\n\r\n // Step 1: Parse agent definition\r\n console.log('[1/3] Parsing agent definition...');\r\n const definition = await parseAgentDefinition(agentType);\r\n console.log(` ✓ Found: ${definition.name}`);\r\n console.log(` ✓ Type: ${definition.type || 'specialist'}`);\r\n console.log(` ✓ Model: ${definition.model}`);\r\n console.log(` ✓ Tools: ${definition.tools.join(', ')}`);\r\n console.log('');\r\n\r\n // Step 2: Build agent prompt\r\n console.log('[2/3] Building agent prompt...');\r\n const taskContext: TaskContext = {\r\n taskId: options.taskId,\r\n iteration: options.iteration,\r\n agentId: options.agentId,\r\n context: options.context,\r\n mode: options.mode,\r\n priority: options.priority,\r\n parentTaskId: options.parentTaskId,\r\n };\r\n\r\n const prompt = await buildAgentPrompt(definition, taskContext);\r\n console.log(` ✓ Prompt size: ${prompt.length} characters`);\r\n console.log(` ✓ CFN Loop protocol: ${prompt.includes('CFN Loop Redis Completion Protocol') ? 'included' : 'not applicable'}`);\r\n console.log(` ✓ Iteration history: ${prompt.includes('## Iteration History') ? 'included' : 'not applicable'}`);\r\n console.log('');\r\n\r\n // Step 3: Execute agent\r\n console.log('[3/3] Executing agent...');\r\n const result = await executeAgent(definition, prompt, taskContext);\r\n\r\n console.log('');\r\n console.log('=== Execution Result ===');\r\n console.log(`Agent ID: ${result.agentId}`);\r\n console.log(`Status: ${result.success ? '✓ Success' : '✗ Failed'}`);\r\n console.log(`Exit Code: ${result.exitCode}`);\r\n\r\n if (result.error) {\r\n console.error(`Error: ${result.error}`);\r\n process.exit(1);\r\n }\r\n\r\n if (result.output) {\r\n console.log('\\nOutput:');\r\n console.log(result.output);\r\n }\r\n\r\n process.exit(result.exitCode);\r\n } catch (error) {\r\n console.error('\\n[agent-command] Error:', error instanceof Error ? error.message : String(error));\r\n process.exit(1);\r\n }\r\n}\r\n"],"names":["parseAgentDefinition","listAgentDefinitions","buildAgentPrompt","executeAgent","displayAgentHelp","console","log","listAgents","agents","length","grouped","agent","parts","split","category","name","slice","join","push","names","Object","entries","sort","agentCommand","agentType","options","list","help","memoryLimit","currentOptions","process","env","NODE_OPTIONS","newOptions","replace","enableProfiling","debug","includes","CLAUDE_DEBUG","CLAUDE_MEMORY_MONITORING","definition","type","model","tools","taskContext","taskId","iteration","agentId","context","mode","priority","parentTaskId","prompt","result","success","exitCode","error","exit","output","Error","message","String"],"mappings":"AAAA;;;;;CAKC,GAED,SAASA,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AM+C,SAAS,MAAMlD,aAAaqC,YAAYY,QAAQR;QAEtDvC,QAAQC,GAAG,CAAC;QACZD,QAAQC,GAAG,CAAC;QACZD,QAAQC,GAAG,CAAC,CAAC,UAAU,EAAE+C,OAAON,OAAO,EAAE;QACzC1C,QAAQC,GAAG,CAAC,CAAC,QAAQ,EAAE+C,OAAOC,OAAO,GAAG,cAAc,YAAY;QAClEjD,QAAQC,GAAG,CAAC,CAAC,WAAW,EAAE+C,OAAOE,QAAQ,EAAE;QAE3C,IAAIF,OAAOG,KAAK,EAAE;YAChBnD,QAAQmD,KAAK,CAAC,CAAC,OAAO,EAAEH,OAAOG,KAAK,EAAE;YACtC1B,QAAQ2B,IAAI,CAAC;QACf;QAEA,IAAIJ,OAAOK,MAAM,EAAE;YACjBrD,QAAQC,GAAG,CAAC;YACZD,QAAQC,GAAG,CAAC+C,OAAOK,MAAM;QAC3B;QAEA5B,QAAQ2B,IAAI,CAACJ,OAAOE,QAAQ;IAC9B,EAAE,OAAOC,OAAO;QACdnD,QAAQmD,KAAK,CAAC,4BAA4BA,iBAAiBG,QAAQH,MAAMI,OAAO,GAAGC,OAAOL;QAC1F1B,QAAQ2B,IAAI,CAAC;IACf;AACF"}
1
+ {"version":3,"sources":["../../src/cli/agent-command.ts"],"sourcesContent":["/**\r\n * Agent Command Handler\r\n *\r\n * Handles `npx claude-flow-novice agent <type> [options]` commands.\r\n * Orchestrates agent definition parsing, prompt building, and execution.\r\n */\r\n\r\nimport { parseAgentDefinition, listAgentDefinitions } from './agent-definition-parser.js';\r\nimport { buildAgentPrompt, TaskContext } from './agent-prompt-builder.js';\r\nimport { executeAgent } from './agent-executor.js';\r\n\r\nexport interface AgentCommandOptions {\r\n taskId?: string;\r\n iteration?: number;\r\n context?: string;\r\n mode?: string;\r\n priority?: number;\r\n parentTaskId?: string;\r\n agentId?: string;\r\n list?: boolean;\r\n help?: boolean;\r\n memoryLimit?: number;\r\n enableProfiling?: boolean;\r\n debug?: boolean;\r\n}\r\n\r\n/**\r\n * Display agent command help\r\n */\r\nexport function displayAgentHelp(): void {\r\n console.log(`\r\nClaude Flow Novice - Agent Spawning\r\n\r\nUsage:\r\n npx claude-flow-novice agent <type> [options]\r\n\r\nArguments:\r\n <type> Agent type (e.g., rust-enterprise-developer, coder, reviewer)\r\n\r\nOptions:\r\n --task-id <id> Task identifier for CFN Loop coordination\r\n --iteration <n> Iteration number (default: 1)\r\n --agent-id <id> Explicit agent ID (overrides auto-generated ID)\r\n --context <text> Task context/description\r\n --mode <mode> Execution mode (cli, api, hybrid)\r\n --priority <n> Task priority (1-10)\r\n --parent-task-id <id> Parent task identifier\r\n --memory-limit <mb> Set memory limit in MB (default: 8192)\r\n --enable-profiling Enable heap profiling for debugging\r\n --debug Enable debug mode with profiling\r\n --list List all available agents\r\n --help Show this help message\r\n\r\nExamples:\r\n # Simple agent spawn\r\n npx claude-flow-novice agent coder --context \"Implement JWT auth\"\r\n\r\n # CFN Loop agent with memory limits\r\n npx claude-flow-novice agent rust-enterprise-developer \\\\\r\n --task-id task-123 \\\\\r\n --iteration 1 \\\\\r\n --mode standard \\\\\r\n --memory-limit 4096\r\n\r\n # Debug mode with profiling\r\n npx claude-flow-novice agent tester \\\\\r\n --context \"Test authentication system\" \\\\\r\n --debug \\\\\r\n --enable-profiling\r\n\r\n # List available agents\r\n npx claude-flow-novice agent --list\r\n\r\nMemory Management:\r\n Claude automatically applies memory limits to prevent leaks:\r\n - Default limit: 8GB (reduced from 16GB)\r\n - Use --memory-limit to set custom limits\r\n - Use --debug to enable profiling and monitoring\r\n - Memory profiles saved to /tmp/claude-memory-profiles/\r\n\r\n For advanced memory management:\r\n ./scripts/memory-leak-prevention.sh --help\r\n\r\nAvailable Agents:\r\n Agents are defined in .claude/agents/ directory:\r\n - core-agents/ Production-ready core agents\r\n - specialized/ Domain-specific specialists\r\n - development/ Development-focused agents\r\n - security/ Security-focused agents\r\n - custom/ Your custom agents\r\n\r\nDocumentation:\r\n See .claude/agents/CLAUDE.md for agent creation guide\r\n`);\r\n}\r\n\r\n/**\r\n * List all available agent definitions\r\n */\r\nexport async function listAgents(): Promise<void> {\r\n console.log('Searching for agent definitions...\\n');\r\n\r\n const agents = await listAgentDefinitions();\r\n\r\n if (agents.length === 0) {\r\n console.log('No agent definitions found in .claude/agents/');\r\n console.log('\\nTo create agents, see: .claude/agents/CLAUDE.md');\r\n return;\r\n }\r\n\r\n console.log(`Found ${agents.length} agent(s):\\n`);\r\n\r\n // Group by category\r\n const grouped: Record<string, string[]> = {};\r\n\r\n for (const agent of agents) {\r\n const parts = agent.split('/');\r\n const category = parts.length > 1 ? parts[0] : 'root';\r\n const name = parts.length > 1 ? parts.slice(1).join('/') : parts[0];\r\n\r\n if (!grouped[category]) {\r\n grouped[category] = [];\r\n }\r\n grouped[category].push(name);\r\n }\r\n\r\n // Display grouped agents\r\n for (const [category, names] of Object.entries(grouped).sort()) {\r\n console.log(`${category}/`);\r\n for (const name of names.sort()) {\r\n console.log(` - ${name}`);\r\n }\r\n console.log('');\r\n }\r\n\r\n console.log('Usage:');\r\n console.log(' npx claude-flow-novice agent <name> [options]');\r\n}\r\n\r\n/**\r\n * Execute agent command\r\n */\r\nexport async function agentCommand(\r\n agentType: string | undefined,\r\n options: AgentCommandOptions\r\n): Promise<void> {\r\n // Handle --list flag\r\n if (options.list) {\r\n await listAgents();\r\n return;\r\n }\r\n\r\n // Handle --help flag\r\n if (options.help || !agentType) {\r\n displayAgentHelp();\r\n return;\r\n }\r\n\r\n try {\r\n // Apply memory management options\r\n if (options.memoryLimit) {\r\n console.log(`[agent-command] Setting memory limit: ${options.memoryLimit}MB`);\r\n const currentOptions = process.env.NODE_OPTIONS || '';\r\n const newOptions = currentOptions.replace(/--max-old-space-size=\\d+/, `--max-old-space-size=${options.memoryLimit}`);\r\n process.env.NODE_OPTIONS = newOptions || `--max-old-space-size=${options.memoryLimit}`;\r\n }\r\n\r\n if (options.enableProfiling || options.debug) {\r\n console.log(`[agent-command] Enabling memory profiling`);\r\n if (!process.env.NODE_OPTIONS.includes('heap-prof')) {\r\n process.env.NODE_OPTIONS += ' --heap-prof';\r\n }\r\n if (!process.env.NODE_OPTIONS.includes('inspect') && options.debug) {\r\n process.env.NODE_OPTIONS += ' --inspect=0.0.0.0:9229';\r\n }\r\n }\r\n\r\n if (options.debug) {\r\n console.log(`[agent-command] Debug mode enabled`);\r\n process.env.CLAUDE_DEBUG = 'true';\r\n process.env.CLAUDE_MEMORY_MONITORING = 'true';\r\n }\r\n\r\n console.log(`[agent-command] Spawning agent: ${agentType}`);\r\n console.log(`[agent-command] Memory settings: ${process.env.NODE_OPTIONS}`);\r\n console.log('');\r\n\r\n // Step 1: Parse agent definition\r\n console.log('[1/3] Parsing agent definition...');\r\n const definition = await parseAgentDefinition(agentType);\r\n console.log(` ✓ Found: ${definition.name}`);\r\n console.log(` ✓ Type: ${definition.type || 'specialist'}`);\r\n console.log(` ✓ Model: ${definition.model}`);\r\n console.log(` ✓ Tools: ${definition.tools.join(', ')}`);\r\n console.log('');\r\n\r\n // Step 2: Build agent prompt\r\n console.log('[2/3] Building agent prompt...');\r\n const taskContext: TaskContext = {\r\n taskId: options.taskId,\r\n iteration: options.iteration,\r\n agentId: options.agentId,\r\n context: options.context,\r\n mode: options.mode,\r\n priority: options.priority,\r\n parentTaskId: options.parentTaskId,\r\n };\r\n\r\n const prompt = await buildAgentPrompt(definition, taskContext);\r\n console.log(` ✓ Prompt size: ${prompt.length} characters`);\r\n console.log(` ✓ CFN Loop protocol: ${prompt.includes('CLI Mode Redis Completion Protocol') ? 'included' : 'not applicable'}`);\r\n console.log(` ✓ Iteration history: ${prompt.includes('## Iteration History') ? 'included' : 'not applicable'}`);\r\n console.log('');\r\n\r\n // Step 3: Execute agent\r\n console.log('[3/3] Executing agent...');\r\n const result = await executeAgent(definition, prompt, taskContext);\r\n\r\n console.log('');\r\n console.log('=== Execution Result ===');\r\n console.log(`Agent ID: ${result.agentId}`);\r\n console.log(`Status: ${result.success ? '✓ Success' : '✗ Failed'}`);\r\n console.log(`Exit Code: ${result.exitCode}`);\r\n\r\n if (result.error) {\r\n console.error(`Error: ${result.error}`);\r\n process.exit(1);\r\n }\r\n\r\n if (result.output) {\r\n console.log('\\nOutput:');\r\n console.log(result.output);\r\n }\r\n\r\n process.exit(result.exitCode);\r\n } catch (error) {\r\n console.error('\\n[agent-command] Error:', error instanceof Error ? error.message : String(error));\r\n process.exit(1);\r\n }\r\n}\r\n"],"names":["parseAgentDefinition","listAgentDefinitions","buildAgentPrompt","executeAgent","displayAgentHelp","console","log","listAgents","agents","length","grouped","agent","parts","split","category","name","slice","join","push","names","Object","entries","sort","agentCommand","agentType","options","list","help","memoryLimit","currentOptions","process","env","NODE_OPTIONS","newOptions","replace","enableProfiling","debug","includes","CLAUDE_DEBUG","CLAUDE_MEMORY_MONITORING","definition","type","model","tools","taskContext","taskId","iteration","agentId","context","mode","priority","parentTaskId","prompt","result","success","exitCode","error","exit","output","Error","message","String"],"mappings":"AAAA;;;;;CAKC,GAED,SAASA,oBAAoB,EAAEC,oBAAoB,QAAQ,+BAA+B;AAC1F,SAASC,gBAAgB,QAAqB,4BAA4B;AAC1E,SAASC,YAAY,QAAQ,sBAAsB;AAiBnD;;CAEC,GACD,OAAO,SAASC;IACdC,QAAQC,GAAG,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+Df,CAAC;AACD;AAEA;;CAEC,GACD,OAAO,eAAeC;IACpBF,QAAQC,GAAG,CAAC;IAEZ,MAAME,SAAS,MAAMP;IAErB,IAAIO,OAAOC,MAAM,KAAK,GAAG;QACvBJ,QAAQC,GAAG,CAAC;QACZD,QAAQC,GAAG,CAAC;QACZ;IACF;IAEAD,QAAQC,GAAG,CAAC,CAAC,MAAM,EAAEE,OAAOC,MAAM,CAAC,YAAY,CAAC;IAEhD,oBAAoB;IACpB,MAAMC,UAAoC,CAAC;IAE3C,KAAK,MAAMC,SAASH,OA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