claude-flow-novice 2.15.5 → 2.15.6

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 (440) hide show
  1. package/.claude/cfn-extras/.gs-api-quota.json +16 -0
  2. package/.claude/cfn-extras/.gs-progress-state.json +22 -0
  3. package/.claude/cfn-extras/GOOGLE_SHEETS_IMPLEMENTATION_SUMMARY.md +414 -0
  4. package/.claude/cfn-extras/agents/google-sheets/README.md +114 -0
  5. package/.claude/cfn-extras/agents/google-sheets/google-sheets-advanced-analytics-specialist.md +288 -0
  6. package/.claude/cfn-extras/agents/google-sheets/google-sheets-api-integrator.md +127 -0
  7. package/.claude/cfn-extras/agents/google-sheets/google-sheets-automation-scripting-specialist.md +195 -0
  8. package/.claude/cfn-extras/agents/google-sheets/google-sheets-business-validator.md +179 -0
  9. package/.claude/cfn-extras/agents/google-sheets/google-sheets-collaboration-security-specialist.md +240 -0
  10. package/.claude/cfn-extras/agents/google-sheets/google-sheets-coordinator.md +214 -0
  11. package/.claude/cfn-extras/agents/google-sheets/google-sheets-data-transformer.md +127 -0
  12. package/.claude/cfn-extras/agents/google-sheets/google-sheets-data-validation-quality-specialist.md +177 -0
  13. package/.claude/cfn-extras/agents/google-sheets/google-sheets-data-validator.md +119 -0
  14. package/.claude/cfn-extras/agents/google-sheets/google-sheets-data-visualization-specialist.md +135 -0
  15. package/.claude/cfn-extras/agents/google-sheets/google-sheets-design-layout-specialist.md +109 -0
  16. package/.claude/cfn-extras/agents/google-sheets/google-sheets-formula-engineer.md +127 -0
  17. package/.claude/cfn-extras/agents/google-sheets/google-sheets-formula-engineering-specialist.md +138 -0
  18. package/.claude/cfn-extras/agents/google-sheets/google-sheets-formula-validator.md +128 -0
  19. package/.claude/cfn-extras/agents/google-sheets/google-sheets-generalist.md +645 -0
  20. package/.claude/cfn-extras/agents/google-sheets/google-sheets-integration-api-specialist.md +258 -0
  21. package/.claude/cfn-extras/agents/google-sheets/google-sheets-performance-analyst.md +125 -0
  22. package/.claude/cfn-extras/agents/google-sheets/google-sheets-performance-optimization-specialist.md +211 -0
  23. package/.claude/cfn-extras/agents/google-sheets/google-sheets-schema-designer.md +130 -0
  24. package/.claude/cfn-extras/agents/google-sheets/google-sheets-template-architecture-specialist.md +259 -0
  25. package/.claude/cfn-extras/docs/GOOGLE_SHEETS_CFN_LOOP.md +617 -0
  26. package/.claude/cfn-extras/skills/GOOGLE_SHEETS_SKILLS_README.md +453 -0
  27. package/.claude/cfn-extras/skills/google-sheets-api-coordinator/SKILL.md +272 -0
  28. package/.claude/cfn-extras/skills/google-sheets-api-coordinator/api-call.sh +254 -0
  29. package/.claude/cfn-extras/skills/google-sheets-api-coordinator/test.sh +174 -0
  30. package/.claude/cfn-extras/skills/google-sheets-api-coordinator/validate.sh +98 -0
  31. package/.claude/cfn-extras/skills/google-sheets-decomposition/SKILL.md +269 -0
  32. package/.claude/cfn-extras/skills/google-sheets-decomposition/decompose.sh +313 -0
  33. package/.claude/cfn-extras/skills/google-sheets-formula-builder/SKILL.md +237 -0
  34. package/.claude/cfn-extras/skills/google-sheets-formula-builder/build-formula.sh +220 -0
  35. package/.claude/cfn-extras/skills/google-sheets-formula-builder/test.sh +172 -0
  36. package/.claude/cfn-extras/skills/google-sheets-formula-builder/validate.sh +98 -0
  37. package/.claude/cfn-extras/skills/google-sheets-progress/SKILL.md +287 -0
  38. package/.claude/cfn-extras/skills/google-sheets-progress/test.sh +385 -0
  39. package/.claude/cfn-extras/skills/google-sheets-progress/track-progress.sh +516 -0
  40. package/.claude/cfn-extras/skills/google-sheets-progress/validate.sh +119 -0
  41. package/.claude/cfn-extras/skills/google-sheets-sprint-order/SKILL.md +277 -0
  42. package/.claude/cfn-extras/skills/google-sheets-sprint-order/order-sprints.sh +233 -0
  43. package/.claude/cfn-extras/skills/google-sheets-validation/SKILL.md +352 -0
  44. package/.claude/cfn-extras/skills/google-sheets-validation/test.sh +355 -0
  45. package/.claude/cfn-extras/skills/google-sheets-validation/validate-state.sh +374 -0
  46. package/.claude/cfn-extras/skills/google-sheets-validation/validate.sh +128 -0
  47. package/.claude/commands/cfn-context.md +10 -0
  48. package/.claude/commands/cfn-loop-cli.md +36 -15
  49. package/.claude/commands/google-sheets/google-sheets-loop.md +289 -0
  50. package/.claude/skills/cfn-agent-selector/SKILL.md +143 -0
  51. package/.claude/skills/cfn-agent-selector/select-agents.sh +94 -0
  52. package/.claude/skills/cfn-agent-spawning/get-agent-provider-env.sh +22 -2
  53. package/.claude/skills/cfn-docker-agent-spawning/spawn-agent.sh +21 -2
  54. package/.claude/skills/cfn-docker-loop-orchestration/orchestrate.sh +11 -5
  55. package/.claude/skills/cfn-docker-redis-coordination/MIGRATION_SUMMARY.md +348 -0
  56. package/.claude/skills/cfn-docker-redis-coordination/README.md +294 -0
  57. package/.claude/skills/cfn-docker-redis-coordination/jest.config.js +37 -0
  58. package/.claude/skills/cfn-docker-redis-coordination/package-lock.json +5259 -0
  59. package/.claude/skills/cfn-docker-redis-coordination/package.json +40 -0
  60. package/.claude/skills/cfn-docker-redis-coordination/src/coordinator.ts +801 -0
  61. package/.claude/skills/cfn-docker-redis-coordination/src/index.ts +42 -0
  62. package/.claude/skills/cfn-docker-redis-coordination/src/types.ts +351 -0
  63. package/.claude/skills/cfn-docker-redis-coordination/tests/coordinator.test.ts +1464 -0
  64. package/.claude/skills/cfn-docker-redis-coordination/tsconfig.json +30 -0
  65. package/.claude/skills/cfn-loop-orchestration/.eslintrc.js +56 -0
  66. package/.claude/skills/cfn-loop-orchestration/.prettierrc.json +18 -0
  67. package/.claude/skills/cfn-loop-orchestration/README.md +149 -41
  68. package/.claude/skills/cfn-loop-orchestration/jest.config.js +67 -0
  69. package/.claude/skills/cfn-loop-orchestration/orchestrate-wrapper.sh +268 -0
  70. package/.claude/skills/cfn-loop-orchestration/orchestrate.sh +91 -8
  71. package/.claude/skills/cfn-loop-orchestration/package-lock.json +5470 -0
  72. package/.claude/skills/cfn-loop-orchestration/package.json +49 -0
  73. package/.claude/skills/cfn-loop-orchestration/src/agent-spawner/agent-spawner.ts +34 -0
  74. package/.claude/skills/cfn-loop-orchestration/src/gate-checker/gate-checker.ts +36 -0
  75. package/.claude/skills/cfn-loop-orchestration/src/index.ts +14 -0
  76. package/.claude/skills/cfn-loop-orchestration/src/orchestrator/orchestrator.ts +31 -0
  77. package/.claude/skills/cfn-loop-orchestration/src/redis/redis-coordinator.ts +72 -0
  78. package/.claude/skills/cfn-loop-orchestration/src/types.ts +188 -0
  79. package/.claude/skills/cfn-loop-orchestration/src/utils/logger.ts +32 -0
  80. package/.claude/skills/cfn-loop-orchestration/tests/setup.ts +22 -0
  81. package/.claude/skills/cfn-loop-orchestration/tests/types.test.ts +132 -0
  82. package/.claude/skills/cfn-loop-orchestration/tsconfig.json +54 -0
  83. package/.claude/skills/cfn-redis-coordination/bash-wrappers/store-context.sh +23 -0
  84. package/.claude/skills/cfn-redis-coordination/dist/agent-logger.d.ts +92 -0
  85. package/.claude/skills/cfn-redis-coordination/dist/agent-logger.d.ts.map +1 -0
  86. package/.claude/skills/cfn-redis-coordination/dist/agent-logger.js +329 -0
  87. package/.claude/skills/cfn-redis-coordination/dist/agent-logger.js.map +1 -0
  88. package/.claude/skills/cfn-redis-coordination/dist/agent-recovery.d.ts +75 -0
  89. package/.claude/skills/cfn-redis-coordination/dist/agent-recovery.d.ts.map +1 -0
  90. package/.claude/skills/cfn-redis-coordination/dist/agent-recovery.js +302 -0
  91. package/.claude/skills/cfn-redis-coordination/dist/agent-recovery.js.map +1 -0
  92. package/.claude/skills/cfn-redis-coordination/dist/completion-reporter.d.ts +58 -0
  93. package/.claude/skills/cfn-redis-coordination/dist/completion-reporter.d.ts.map +1 -0
  94. package/.claude/skills/cfn-redis-coordination/dist/completion-reporter.js +237 -0
  95. package/.claude/skills/cfn-redis-coordination/dist/completion-reporter.js.map +1 -0
  96. package/.claude/skills/cfn-redis-coordination/dist/context-manager.d.ts +63 -0
  97. package/.claude/skills/cfn-redis-coordination/dist/context-manager.d.ts.map +1 -0
  98. package/.claude/skills/cfn-redis-coordination/dist/context-manager.js +230 -0
  99. package/.claude/skills/cfn-redis-coordination/dist/context-manager.js.map +1 -0
  100. package/.claude/skills/cfn-redis-coordination/dist/index.d.ts +45 -0
  101. package/.claude/skills/cfn-redis-coordination/dist/index.d.ts.map +1 -0
  102. package/.claude/skills/cfn-redis-coordination/dist/index.js +114 -0
  103. package/.claude/skills/cfn-redis-coordination/dist/index.js.map +1 -0
  104. package/.claude/skills/cfn-redis-coordination/dist/mode-detector.d.ts +31 -0
  105. package/.claude/skills/cfn-redis-coordination/dist/mode-detector.d.ts.map +1 -0
  106. package/.claude/skills/cfn-redis-coordination/dist/mode-detector.js +185 -0
  107. package/.claude/skills/cfn-redis-coordination/dist/mode-detector.js.map +1 -0
  108. package/.claude/skills/cfn-redis-coordination/dist/redis-client.d.ts +191 -0
  109. package/.claude/skills/cfn-redis-coordination/dist/redis-client.d.ts.map +1 -0
  110. package/.claude/skills/cfn-redis-coordination/dist/redis-client.js +509 -0
  111. package/.claude/skills/cfn-redis-coordination/dist/redis-client.js.map +1 -0
  112. package/.claude/skills/cfn-redis-coordination/dist/result-collector.d.ts +75 -0
  113. package/.claude/skills/cfn-redis-coordination/dist/result-collector.d.ts.map +1 -0
  114. package/.claude/skills/cfn-redis-coordination/dist/result-collector.js +281 -0
  115. package/.claude/skills/cfn-redis-coordination/dist/result-collector.js.map +1 -0
  116. package/.claude/skills/cfn-redis-coordination/dist/swarm-manager.d.ts +75 -0
  117. package/.claude/skills/cfn-redis-coordination/dist/swarm-manager.d.ts.map +1 -0
  118. package/.claude/skills/cfn-redis-coordination/dist/swarm-manager.js +354 -0
  119. package/.claude/skills/cfn-redis-coordination/dist/swarm-manager.js.map +1 -0
  120. package/.claude/skills/cfn-redis-coordination/dist/task-analyzer.d.ts +62 -0
  121. package/.claude/skills/cfn-redis-coordination/dist/task-analyzer.d.ts.map +1 -0
  122. package/.claude/skills/cfn-redis-coordination/dist/task-analyzer.js +305 -0
  123. package/.claude/skills/cfn-redis-coordination/dist/task-analyzer.js.map +1 -0
  124. package/.claude/skills/cfn-redis-coordination/dist/task-executor.d.ts +97 -0
  125. package/.claude/skills/cfn-redis-coordination/dist/task-executor.d.ts.map +1 -0
  126. package/.claude/skills/cfn-redis-coordination/dist/task-executor.js +283 -0
  127. package/.claude/skills/cfn-redis-coordination/dist/task-executor.js.map +1 -0
  128. package/.claude/skills/cfn-redis-coordination/dist/types.d.ts +176 -0
  129. package/.claude/skills/cfn-redis-coordination/dist/types.d.ts.map +1 -0
  130. package/.claude/skills/cfn-redis-coordination/dist/types.js +81 -0
  131. package/.claude/skills/cfn-redis-coordination/dist/types.js.map +1 -0
  132. package/.claude/skills/cfn-redis-coordination/dist/waiting-coordinator.d.ts +86 -0
  133. package/.claude/skills/cfn-redis-coordination/dist/waiting-coordinator.d.ts.map +1 -0
  134. package/.claude/skills/cfn-redis-coordination/dist/waiting-coordinator.js +419 -0
  135. package/.claude/skills/cfn-redis-coordination/dist/waiting-coordinator.js.map +1 -0
  136. package/.claude/skills/cfn-redis-coordination/docs/migration/PHASE_3_REDIS_COORDINATION_COMPLETION_REPORT.md +553 -0
  137. package/.claude/skills/cfn-redis-coordination/jest.config.js +23 -0
  138. package/.claude/skills/cfn-redis-coordination/package-lock.json +5272 -0
  139. package/.claude/skills/cfn-redis-coordination/package.json +45 -0
  140. package/.claude/skills/cfn-redis-coordination/redis-cli-wrapper.sh +21 -8
  141. package/.claude/skills/cfn-redis-coordination/src/agent-logger.ts +446 -0
  142. package/.claude/skills/cfn-redis-coordination/src/agent-recovery.ts +454 -0
  143. package/.claude/skills/cfn-redis-coordination/src/completion-reporter.ts +396 -0
  144. package/.claude/skills/cfn-redis-coordination/src/context-manager.ts +327 -0
  145. package/.claude/skills/cfn-redis-coordination/src/index.ts +82 -0
  146. package/.claude/skills/cfn-redis-coordination/src/mode-detector.ts +155 -0
  147. package/.claude/skills/cfn-redis-coordination/src/redis/redis-client.ts +305 -0
  148. package/.claude/skills/cfn-redis-coordination/src/redis/redis-functions.ts +283 -0
  149. package/.claude/skills/cfn-redis-coordination/src/redis-client.ts +654 -0
  150. package/.claude/skills/cfn-redis-coordination/src/result-collector.ts +437 -0
  151. package/.claude/skills/cfn-redis-coordination/src/swarm-manager.ts +494 -0
  152. package/.claude/skills/cfn-redis-coordination/src/task-analyzer.ts +404 -0
  153. package/.claude/skills/cfn-redis-coordination/src/task-executor.ts +423 -0
  154. package/.claude/skills/cfn-redis-coordination/src/types.ts +235 -0
  155. package/.claude/skills/cfn-redis-coordination/src/waiting-coordinator.ts +587 -0
  156. package/.claude/skills/cfn-redis-coordination/test-connection-attempts.js +70 -0
  157. package/.claude/skills/cfn-redis-coordination/test-mode-simple.js +121 -0
  158. package/.claude/skills/cfn-redis-coordination/test-redis-check.js +84 -0
  159. package/.claude/skills/cfn-redis-coordination/test-task-mode-redis.cjs +391 -0
  160. package/.claude/skills/cfn-redis-coordination/tests/coordination.test.ts +779 -0
  161. package/.claude/skills/cfn-redis-coordination/tsconfig.json +31 -0
  162. package/claude-assets/agents/cfn-dev-team/coordinators/cfn-v3-coordinator.md +172 -2
  163. package/claude-assets/agents/cfn-dev-team/testers/api-testing-specialist.md +1 -1
  164. package/claude-assets/agents/custom/cfn-redis-operations.md +530 -0
  165. package/claude-assets/agents/custom/cfn-system-expert.md +77 -0
  166. package/claude-assets/cfn-extras/.gs-api-quota.json +16 -0
  167. package/claude-assets/cfn-extras/.gs-progress-state.json +22 -0
  168. package/claude-assets/cfn-extras/GOOGLE_SHEETS_IMPLEMENTATION_SUMMARY.md +414 -0
  169. package/claude-assets/cfn-extras/agents/google-sheets/README.md +114 -0
  170. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-advanced-analytics-specialist.md +288 -0
  171. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-api-integrator.md +127 -0
  172. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-automation-scripting-specialist.md +195 -0
  173. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-business-validator.md +179 -0
  174. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-collaboration-security-specialist.md +240 -0
  175. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-coordinator.md +214 -0
  176. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-data-transformer.md +127 -0
  177. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-data-validation-quality-specialist.md +177 -0
  178. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-data-validator.md +119 -0
  179. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-data-visualization-specialist.md +135 -0
  180. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-design-layout-specialist.md +109 -0
  181. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-formula-engineer.md +127 -0
  182. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-formula-engineering-specialist.md +138 -0
  183. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-formula-validator.md +128 -0
  184. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-generalist.md +645 -0
  185. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-integration-api-specialist.md +258 -0
  186. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-performance-analyst.md +125 -0
  187. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-performance-optimization-specialist.md +211 -0
  188. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-schema-designer.md +130 -0
  189. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-template-architecture-specialist.md +259 -0
  190. package/claude-assets/cfn-extras/docs/GOOGLE_SHEETS_CFN_LOOP.md +617 -0
  191. package/claude-assets/cfn-extras/skills/GOOGLE_SHEETS_SKILLS_README.md +453 -0
  192. package/claude-assets/cfn-extras/skills/google-sheets-api-coordinator/SKILL.md +272 -0
  193. package/claude-assets/cfn-extras/skills/google-sheets-api-coordinator/api-call.sh +254 -0
  194. package/claude-assets/cfn-extras/skills/google-sheets-api-coordinator/test.sh +174 -0
  195. package/claude-assets/cfn-extras/skills/google-sheets-api-coordinator/validate.sh +98 -0
  196. package/claude-assets/cfn-extras/skills/google-sheets-decomposition/SKILL.md +269 -0
  197. package/claude-assets/cfn-extras/skills/google-sheets-decomposition/decompose.sh +313 -0
  198. package/claude-assets/cfn-extras/skills/google-sheets-formula-builder/SKILL.md +237 -0
  199. package/claude-assets/cfn-extras/skills/google-sheets-formula-builder/build-formula.sh +220 -0
  200. package/claude-assets/cfn-extras/skills/google-sheets-formula-builder/test.sh +172 -0
  201. package/claude-assets/cfn-extras/skills/google-sheets-formula-builder/validate.sh +98 -0
  202. package/claude-assets/cfn-extras/skills/google-sheets-progress/SKILL.md +287 -0
  203. package/claude-assets/cfn-extras/skills/google-sheets-progress/test.sh +385 -0
  204. package/claude-assets/cfn-extras/skills/google-sheets-progress/track-progress.sh +516 -0
  205. package/claude-assets/cfn-extras/skills/google-sheets-progress/validate.sh +119 -0
  206. package/claude-assets/cfn-extras/skills/google-sheets-sprint-order/SKILL.md +277 -0
  207. package/claude-assets/cfn-extras/skills/google-sheets-sprint-order/order-sprints.sh +233 -0
  208. package/claude-assets/cfn-extras/skills/google-sheets-validation/SKILL.md +352 -0
  209. package/claude-assets/cfn-extras/skills/google-sheets-validation/test.sh +355 -0
  210. package/claude-assets/cfn-extras/skills/google-sheets-validation/validate-state.sh +374 -0
  211. package/claude-assets/cfn-extras/skills/google-sheets-validation/validate.sh +128 -0
  212. package/claude-assets/commands/cfn-context.md +10 -0
  213. package/claude-assets/commands/cfn-loop-cli.md +36 -15
  214. package/claude-assets/commands/google-sheets/google-sheets-loop.md +289 -0
  215. package/claude-assets/hooks/cfn-pre-execution/SESSION_START_README.md +87 -0
  216. package/claude-assets/hooks/cfn-pre-execution/TEST_SESSION_START.md +128 -0
  217. package/claude-assets/hooks/cfn-pre-execution/session-start-context.sh +111 -0
  218. package/claude-assets/skills/cfn-agent-selection-with-fallback/INTEGRATION_EXAMPLE.md +209 -0
  219. package/claude-assets/skills/cfn-agent-selection-with-fallback/README.md +130 -0
  220. package/claude-assets/skills/cfn-agent-selection-with-fallback/SKILL.md +243 -0
  221. package/claude-assets/skills/cfn-agent-selection-with-fallback/agent-mappings.json +142 -0
  222. package/claude-assets/skills/cfn-agent-selection-with-fallback/select-agents.sh +173 -0
  223. package/claude-assets/skills/cfn-agent-selection-with-fallback/task-classifier.sh +71 -0
  224. package/claude-assets/skills/cfn-agent-selection-with-fallback/test-agent-selection.sh +282 -0
  225. package/claude-assets/skills/cfn-agent-selector/SKILL.md +143 -0
  226. package/claude-assets/skills/cfn-agent-selector/select-agents.sh +94 -0
  227. package/claude-assets/skills/cfn-agent-spawning/get-agent-provider-env.sh +22 -2
  228. package/claude-assets/skills/cfn-docker-agent-spawning/spawn-agent.sh +21 -2
  229. package/claude-assets/skills/cfn-docker-coordination/.eslintrc.json +33 -0
  230. package/claude-assets/skills/cfn-docker-coordination/README.md +349 -0
  231. package/claude-assets/skills/cfn-docker-coordination/docker-helpers.sh +433 -0
  232. package/claude-assets/skills/cfn-docker-coordination/jest.config.js +25 -0
  233. package/claude-assets/skills/cfn-docker-coordination/package-lock.json +6827 -0
  234. package/claude-assets/skills/cfn-docker-coordination/package.json +38 -0
  235. package/claude-assets/skills/cfn-docker-coordination/src/agent-container.ts +471 -0
  236. package/claude-assets/skills/cfn-docker-coordination/src/docker-client.ts +483 -0
  237. package/claude-assets/skills/cfn-docker-coordination/src/health-checker.ts +418 -0
  238. package/claude-assets/skills/cfn-docker-coordination/src/index.ts +45 -0
  239. package/claude-assets/skills/cfn-docker-coordination/src/network-manager.ts +377 -0
  240. package/claude-assets/skills/cfn-docker-coordination/src/types.ts +412 -0
  241. package/claude-assets/skills/cfn-docker-coordination/src/volume-manager.ts +389 -0
  242. package/claude-assets/skills/cfn-docker-coordination/tests/agent-container.test.ts +379 -0
  243. package/claude-assets/skills/cfn-docker-coordination/tests/docker-client.test.ts +345 -0
  244. package/claude-assets/skills/cfn-docker-coordination/tests/health-checker.test.ts +535 -0
  245. package/claude-assets/skills/cfn-docker-coordination/tests/integration.test.ts +193 -0
  246. package/claude-assets/skills/cfn-docker-coordination/tests/network-manager.test.ts +352 -0
  247. package/claude-assets/skills/cfn-docker-coordination/tests/setup.ts +36 -0
  248. package/claude-assets/skills/cfn-docker-coordination/tsconfig.json +29 -0
  249. package/claude-assets/skills/cfn-docker-logging/INTEGRATION.md +268 -0
  250. package/claude-assets/skills/cfn-docker-logging/SAMPLE_OUTPUTS.md +237 -0
  251. package/claude-assets/skills/cfn-docker-logging/SKILL.md +442 -0
  252. package/claude-assets/skills/cfn-docker-logging/capture-container-logs.sh +120 -0
  253. package/claude-assets/skills/cfn-docker-logging/enable-logging.sh +430 -0
  254. package/claude-assets/skills/cfn-docker-logging/init-hybrid-logging.sh +210 -0
  255. package/claude-assets/skills/cfn-docker-logging/queries/analytics-summary.sh +87 -0
  256. package/claude-assets/skills/cfn-docker-logging/queries/query-agent-timeline.sh +51 -0
  257. package/claude-assets/skills/cfn-docker-logging/queries/query-consensus-history.sh +56 -0
  258. package/claude-assets/skills/cfn-docker-logging/queries/query-coordination-timeline.sh +39 -0
  259. package/claude-assets/skills/cfn-docker-logging/queries/query-failed-containers.sh +40 -0
  260. package/claude-assets/skills/cfn-docker-logging/queries/query-gate-checks.sh +39 -0
  261. package/claude-assets/skills/cfn-docker-logging/schema.sql +111 -0
  262. package/claude-assets/skills/cfn-docker-logging/sqlite-helpers.sh +240 -0
  263. package/claude-assets/skills/cfn-docker-logging/test-hybrid-logging.sh +331 -0
  264. package/claude-assets/skills/cfn-docker-loop-orchestration/orchestrate.sh +11 -5
  265. package/claude-assets/skills/cfn-docker-redis-coordination/MIGRATION_SUMMARY.md +348 -0
  266. package/claude-assets/skills/cfn-docker-redis-coordination/README.md +294 -0
  267. package/claude-assets/skills/cfn-docker-redis-coordination/jest.config.js +37 -0
  268. package/claude-assets/skills/cfn-docker-redis-coordination/package-lock.json +5259 -0
  269. package/claude-assets/skills/cfn-docker-redis-coordination/package.json +40 -0
  270. package/claude-assets/skills/cfn-docker-redis-coordination/src/coordinator.ts +801 -0
  271. package/claude-assets/skills/cfn-docker-redis-coordination/src/index.ts +42 -0
  272. package/claude-assets/skills/cfn-docker-redis-coordination/src/types.ts +351 -0
  273. package/claude-assets/skills/cfn-docker-redis-coordination/tests/coordinator.test.ts +1464 -0
  274. package/claude-assets/skills/cfn-docker-redis-coordination/tsconfig.json +30 -0
  275. package/claude-assets/skills/cfn-error-logging/.eslintrc.json +57 -0
  276. package/claude-assets/skills/cfn-error-logging/.prettierrc.json +10 -0
  277. package/claude-assets/skills/cfn-error-logging/MIGRATION_SUMMARY.md +485 -0
  278. package/claude-assets/skills/cfn-error-logging/package.json +47 -0
  279. package/claude-assets/skills/cfn-error-logging/src/error-logger.ts +1042 -0
  280. package/claude-assets/skills/cfn-error-logging/src/index.ts +12 -0
  281. package/claude-assets/skills/cfn-error-logging/src/types.ts +456 -0
  282. package/claude-assets/skills/cfn-error-logging/tests/error-logger.test.ts +1302 -0
  283. package/claude-assets/skills/cfn-error-logging/tsconfig.json +38 -0
  284. package/claude-assets/skills/cfn-loop-orchestration/.eslintrc.js +56 -0
  285. package/claude-assets/skills/cfn-loop-orchestration/.prettierrc.json +18 -0
  286. package/claude-assets/skills/cfn-loop-orchestration/README.md +149 -41
  287. package/claude-assets/skills/cfn-loop-orchestration/jest.config.js +67 -0
  288. package/claude-assets/skills/cfn-loop-orchestration/orchestrate-wrapper.sh +268 -0
  289. package/claude-assets/skills/cfn-loop-orchestration/orchestrate.sh +91 -8
  290. package/claude-assets/skills/cfn-loop-orchestration/package-lock.json +5470 -0
  291. package/claude-assets/skills/cfn-loop-orchestration/package.json +49 -0
  292. package/claude-assets/skills/cfn-loop-orchestration/src/agent-spawner/agent-spawner.ts +34 -0
  293. package/claude-assets/skills/cfn-loop-orchestration/src/gate-checker/gate-checker.ts +36 -0
  294. package/claude-assets/skills/cfn-loop-orchestration/src/index.ts +14 -0
  295. package/claude-assets/skills/cfn-loop-orchestration/src/orchestrator/orchestrator.ts +31 -0
  296. package/claude-assets/skills/cfn-loop-orchestration/src/redis/redis-coordinator.ts +72 -0
  297. package/claude-assets/skills/cfn-loop-orchestration/src/types.ts +188 -0
  298. package/claude-assets/skills/cfn-loop-orchestration/src/utils/logger.ts +32 -0
  299. package/claude-assets/skills/cfn-loop-orchestration/tests/setup.ts +22 -0
  300. package/claude-assets/skills/cfn-loop-orchestration/tests/types.test.ts +132 -0
  301. package/claude-assets/skills/cfn-loop-orchestration/tsconfig.json +54 -0
  302. package/claude-assets/skills/cfn-redis-coordination/bash-wrappers/store-context.sh +23 -0
  303. package/claude-assets/skills/cfn-redis-coordination/dist/agent-logger.d.ts +92 -0
  304. package/claude-assets/skills/cfn-redis-coordination/dist/agent-logger.d.ts.map +1 -0
  305. package/claude-assets/skills/cfn-redis-coordination/dist/agent-logger.js +329 -0
  306. package/claude-assets/skills/cfn-redis-coordination/dist/agent-logger.js.map +1 -0
  307. package/claude-assets/skills/cfn-redis-coordination/dist/agent-recovery.d.ts +75 -0
  308. package/claude-assets/skills/cfn-redis-coordination/dist/agent-recovery.d.ts.map +1 -0
  309. package/claude-assets/skills/cfn-redis-coordination/dist/agent-recovery.js +302 -0
  310. package/claude-assets/skills/cfn-redis-coordination/dist/agent-recovery.js.map +1 -0
  311. package/claude-assets/skills/cfn-redis-coordination/dist/completion-reporter.d.ts +58 -0
  312. package/claude-assets/skills/cfn-redis-coordination/dist/completion-reporter.d.ts.map +1 -0
  313. package/claude-assets/skills/cfn-redis-coordination/dist/completion-reporter.js +237 -0
  314. package/claude-assets/skills/cfn-redis-coordination/dist/completion-reporter.js.map +1 -0
  315. package/claude-assets/skills/cfn-redis-coordination/dist/context-manager.d.ts +63 -0
  316. package/claude-assets/skills/cfn-redis-coordination/dist/context-manager.d.ts.map +1 -0
  317. package/claude-assets/skills/cfn-redis-coordination/dist/context-manager.js +230 -0
  318. package/claude-assets/skills/cfn-redis-coordination/dist/context-manager.js.map +1 -0
  319. package/claude-assets/skills/cfn-redis-coordination/dist/index.d.ts +45 -0
  320. package/claude-assets/skills/cfn-redis-coordination/dist/index.d.ts.map +1 -0
  321. package/claude-assets/skills/cfn-redis-coordination/dist/index.js +114 -0
  322. package/claude-assets/skills/cfn-redis-coordination/dist/index.js.map +1 -0
  323. package/claude-assets/skills/cfn-redis-coordination/dist/mode-detector.d.ts +31 -0
  324. package/claude-assets/skills/cfn-redis-coordination/dist/mode-detector.d.ts.map +1 -0
  325. package/claude-assets/skills/cfn-redis-coordination/dist/mode-detector.js +185 -0
  326. package/claude-assets/skills/cfn-redis-coordination/dist/mode-detector.js.map +1 -0
  327. package/claude-assets/skills/cfn-redis-coordination/dist/redis-client.d.ts +191 -0
  328. package/claude-assets/skills/cfn-redis-coordination/dist/redis-client.d.ts.map +1 -0
  329. package/claude-assets/skills/cfn-redis-coordination/dist/redis-client.js +509 -0
  330. package/claude-assets/skills/cfn-redis-coordination/dist/redis-client.js.map +1 -0
  331. package/claude-assets/skills/cfn-redis-coordination/dist/result-collector.d.ts +75 -0
  332. package/claude-assets/skills/cfn-redis-coordination/dist/result-collector.d.ts.map +1 -0
  333. package/claude-assets/skills/cfn-redis-coordination/dist/result-collector.js +281 -0
  334. package/claude-assets/skills/cfn-redis-coordination/dist/result-collector.js.map +1 -0
  335. package/claude-assets/skills/cfn-redis-coordination/dist/swarm-manager.d.ts +75 -0
  336. package/claude-assets/skills/cfn-redis-coordination/dist/swarm-manager.d.ts.map +1 -0
  337. package/claude-assets/skills/cfn-redis-coordination/dist/swarm-manager.js +354 -0
  338. package/claude-assets/skills/cfn-redis-coordination/dist/swarm-manager.js.map +1 -0
  339. package/claude-assets/skills/cfn-redis-coordination/dist/task-analyzer.d.ts +62 -0
  340. package/claude-assets/skills/cfn-redis-coordination/dist/task-analyzer.d.ts.map +1 -0
  341. package/claude-assets/skills/cfn-redis-coordination/dist/task-analyzer.js +305 -0
  342. package/claude-assets/skills/cfn-redis-coordination/dist/task-analyzer.js.map +1 -0
  343. package/claude-assets/skills/cfn-redis-coordination/dist/task-executor.d.ts +97 -0
  344. package/claude-assets/skills/cfn-redis-coordination/dist/task-executor.d.ts.map +1 -0
  345. package/claude-assets/skills/cfn-redis-coordination/dist/task-executor.js +283 -0
  346. package/claude-assets/skills/cfn-redis-coordination/dist/task-executor.js.map +1 -0
  347. package/claude-assets/skills/cfn-redis-coordination/dist/types.d.ts +176 -0
  348. package/claude-assets/skills/cfn-redis-coordination/dist/types.d.ts.map +1 -0
  349. package/claude-assets/skills/cfn-redis-coordination/dist/types.js +81 -0
  350. package/claude-assets/skills/cfn-redis-coordination/dist/types.js.map +1 -0
  351. package/claude-assets/skills/cfn-redis-coordination/dist/waiting-coordinator.d.ts +86 -0
  352. package/claude-assets/skills/cfn-redis-coordination/dist/waiting-coordinator.d.ts.map +1 -0
  353. package/claude-assets/skills/cfn-redis-coordination/dist/waiting-coordinator.js +419 -0
  354. package/claude-assets/skills/cfn-redis-coordination/dist/waiting-coordinator.js.map +1 -0
  355. package/claude-assets/skills/cfn-redis-coordination/docs/migration/PHASE_3_REDIS_COORDINATION_COMPLETION_REPORT.md +553 -0
  356. package/claude-assets/skills/cfn-redis-coordination/jest.config.js +23 -0
  357. package/claude-assets/skills/cfn-redis-coordination/package-lock.json +5272 -0
  358. package/claude-assets/skills/cfn-redis-coordination/package.json +45 -0
  359. package/claude-assets/skills/cfn-redis-coordination/redis-cli-wrapper.sh +21 -8
  360. package/claude-assets/skills/cfn-redis-coordination/src/agent-logger.ts +446 -0
  361. package/claude-assets/skills/cfn-redis-coordination/src/agent-recovery.ts +454 -0
  362. package/claude-assets/skills/cfn-redis-coordination/src/completion-reporter.ts +396 -0
  363. package/claude-assets/skills/cfn-redis-coordination/src/context-manager.ts +327 -0
  364. package/claude-assets/skills/cfn-redis-coordination/src/index.ts +82 -0
  365. package/claude-assets/skills/cfn-redis-coordination/src/mode-detector.ts +155 -0
  366. package/claude-assets/skills/cfn-redis-coordination/src/redis/redis-client.ts +305 -0
  367. package/claude-assets/skills/cfn-redis-coordination/src/redis/redis-functions.ts +283 -0
  368. package/claude-assets/skills/cfn-redis-coordination/src/redis-client.ts +654 -0
  369. package/claude-assets/skills/cfn-redis-coordination/src/result-collector.ts +437 -0
  370. package/claude-assets/skills/cfn-redis-coordination/src/swarm-manager.ts +494 -0
  371. package/claude-assets/skills/cfn-redis-coordination/src/task-analyzer.ts +404 -0
  372. package/claude-assets/skills/cfn-redis-coordination/src/task-executor.ts +423 -0
  373. package/claude-assets/skills/cfn-redis-coordination/src/types.ts +235 -0
  374. package/claude-assets/skills/cfn-redis-coordination/src/waiting-coordinator.ts +587 -0
  375. package/claude-assets/skills/cfn-redis-coordination/test-connection-attempts.js +70 -0
  376. package/claude-assets/skills/cfn-redis-coordination/test-mode-simple.js +121 -0
  377. package/claude-assets/skills/cfn-redis-coordination/test-redis-check.js +84 -0
  378. package/claude-assets/skills/cfn-redis-coordination/test-task-mode-redis.cjs +391 -0
  379. package/claude-assets/skills/cfn-redis-coordination/tests/coordination.test.ts +779 -0
  380. package/claude-assets/skills/cfn-redis-coordination/tsconfig.json +31 -0
  381. package/claude-assets/skills/cfn-skill-propagation/README.md +233 -0
  382. package/claude-assets/skills/cfn-skill-propagation/package-lock.json +5174 -0
  383. package/claude-assets/skills/cfn-skill-propagation/package.json +52 -0
  384. package/claude-assets/skills/cfn-skill-propagation/propagate-skill-update.sh +32 -0
  385. package/claude-assets/skills/cfn-skill-propagation/src/cli.ts +75 -0
  386. package/claude-assets/skills/cfn-skill-propagation/src/database-adapter.ts +239 -0
  387. package/claude-assets/skills/cfn-skill-propagation/src/file-system-adapter.ts +113 -0
  388. package/claude-assets/skills/cfn-skill-propagation/src/index.ts +72 -0
  389. package/claude-assets/skills/cfn-skill-propagation/src/logger.ts +43 -0
  390. package/claude-assets/skills/cfn-skill-propagation/src/metadata-parser.ts +154 -0
  391. package/claude-assets/skills/cfn-skill-propagation/src/skill-propagator.ts +274 -0
  392. package/claude-assets/skills/cfn-skill-propagation/src/skill-validator.ts +179 -0
  393. package/claude-assets/skills/cfn-skill-propagation/src/types.ts +143 -0
  394. package/claude-assets/skills/cfn-skill-propagation/src/version-manager.ts +118 -0
  395. package/claude-assets/skills/cfn-skill-propagation/tests/file-system-adapter.test.ts +91 -0
  396. package/claude-assets/skills/cfn-skill-propagation/tests/metadata-parser.test.ts +176 -0
  397. package/claude-assets/skills/cfn-skill-propagation/tests/skill-propagator.test.ts +209 -0
  398. package/claude-assets/skills/cfn-skill-propagation/tests/skill-validator.test.ts +203 -0
  399. package/claude-assets/skills/cfn-skill-propagation/tests/version-manager.test.ts +115 -0
  400. package/claude-assets/skills/cfn-skill-propagation/tsconfig.json +34 -0
  401. package/claude-assets/skills/task-classifier/SKILL.md +81 -0
  402. package/claude-assets/skills/task-classifier/classify-task.sh +62 -0
  403. package/claude-assets/skills/workflow-codification/package-lock.json +5170 -0
  404. package/claude-assets/skills/workflow-codification/package.json +30 -0
  405. package/claude-assets/skills/workflow-codification/src/index.ts +24 -0
  406. package/claude-assets/skills/workflow-codification/src/pattern-analyzer.ts +537 -0
  407. package/claude-assets/skills/workflow-codification/src/types.ts +180 -0
  408. package/claude-assets/skills/workflow-codification/tests/pattern-analyzer.test.ts +960 -0
  409. package/claude-assets/skills/workflow-codification/tsconfig.json +34 -0
  410. package/claude-assets/skills/workflow-codification/workflow-codification.db +0 -0
  411. package/dist/agent-spawner/agent-spawner.js +448 -0
  412. package/dist/agent-spawner/agent-spawner.js.map +1 -0
  413. package/dist/agent-spawner/index.js +10 -0
  414. package/dist/agent-spawner/index.js.map +1 -0
  415. package/dist/agent-spawner/types.js +14 -0
  416. package/dist/agent-spawner/types.js.map +1 -0
  417. package/dist/agents/agent-loader.js +146 -165
  418. package/dist/agents/agent-loader.js.map +1 -1
  419. package/dist/cli/agent-executor.js +47 -1
  420. package/dist/cli/agent-executor.js.map +1 -1
  421. package/dist/cli/agent-spawn.js +4 -1
  422. package/dist/cli/agent-spawn.js.map +1 -1
  423. package/dist/cli/tool-executor.js +3 -1
  424. package/dist/cli/tool-executor.js.map +1 -1
  425. package/dist/gate-checker/gate-checker.js +292 -0
  426. package/dist/gate-checker/gate-checker.js.map +1 -0
  427. package/dist/gate-checker/types.js +94 -0
  428. package/dist/gate-checker/types.js.map +1 -0
  429. package/dist/lib/database-service/connection-pool-manager.js +2 -1
  430. package/dist/lib/database-service/connection-pool-manager.js.map +1 -1
  431. package/dist/orchestrator/index.js +10 -0
  432. package/dist/orchestrator/index.js.map +1 -0
  433. package/dist/orchestrator/orchestrate.js +496 -0
  434. package/dist/orchestrator/orchestrate.js.map +1 -0
  435. package/dist/orchestrator/types.js +58 -0
  436. package/dist/orchestrator/types.js.map +1 -0
  437. package/package.json +1 -1
  438. package/scripts/switch-api.sh +142 -4
  439. package/scripts/verify-no-secrets.sh +6 -13
  440. package/tests/README.md +175 -58
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/orchestrator/types.ts"],"sourcesContent":["/**\r\n * CFN Loop Orchestrator Type Definitions\r\n *\r\n * Comprehensive type definitions for the orchestrator workflow including:\r\n * - Orchestration configuration and modes\r\n * - Agent management and execution\r\n * - Decision types and outcomes\r\n * - Iteration context and state\r\n * - Error handling and validation\r\n *\r\n * @module orchestrator/types\r\n */\r\n\r\nimport { GateResult, TestResult } from '@/gate-checker/types';\r\nimport type { ExecutionMode } from '@/gate-checker/types';\r\n\r\n/**\r\n * CFN Loop execution decision from Product Owner\r\n */\r\nexport type LoopDecision = 'PROCEED' | 'ITERATE' | 'ABORT';\r\n\r\n/**\r\n * Main orchestrator configuration\r\n */\r\nexport interface OrchestratorConfig {\r\n taskId: string;\r\n mode: ExecutionMode;\r\n loop3Agents: string[];\r\n loop2Agents: string[];\r\n productOwner: string;\r\n maxIterations: number;\r\n gateThreshold?: number;\r\n consensusThreshold?: number;\r\n timeout?: number;\r\n epicContext?: Record<string, unknown>;\r\n phaseContext?: Record<string, unknown>;\r\n successCriteria?: Record<string, unknown>;\r\n expectedFiles?: string[];\r\n phaseId?: string;\r\n minQuorumLoop3?: number;\r\n minQuorumLoop2?: number;\r\n}\r\n\r\n/**\r\n * Result from spawning agents\r\n */\r\nexport interface AgentSpawnResult {\r\n agentId: string;\r\n agentType: string;\r\n iteration: number;\r\n pid?: number;\r\n success: boolean;\r\n error?: string;\r\n}\r\n\r\n/**\r\n * Aggregated results from agent execution\r\n */\r\nexport interface AgentExecutionResults {\r\n agentId: string;\r\n iteration: number;\r\n testResults?: TestResult[];\r\n consensusScore?: number;\r\n confidence?: number;\r\n completed: boolean;\r\n error?: string;\r\n}\r\n\r\n/**\r\n * State of a single iteration\r\n */\r\nexport interface IterationState {\r\n iteration: number;\r\n loop3Spawned: AgentSpawnResult[];\r\n loop3Completed: AgentExecutionResults[];\r\n deliverableVerified: boolean;\r\n gateCheckResult?: GateResult;\r\n gatePassed: boolean;\r\n loop2Spawned: AgentSpawnResult[];\r\n loop2Completed: AgentExecutionResults[];\r\n consensusReached: boolean;\r\n consensusScore?: number;\r\n productOwnerDecision?: LoopDecision;\r\n finalDecision?: LoopDecision;\r\n startTime: number;\r\n endTime?: number;\r\n errors: string[];\r\n}\r\n\r\n/**\r\n * Complete orchestration execution state\r\n */\r\nexport interface OrchestrationState {\r\n taskId: string;\r\n config: OrchestratorConfig;\r\n iterations: IterationState[];\r\n currentIteration: number;\r\n finalDecision?: LoopDecision;\r\n finalLoop3Confidence?: number;\r\n finalLoop2Consensus?: number;\r\n deliverableVerified: boolean;\r\n totalExecutionTime?: number;\r\n aborted: boolean;\r\n abortReason?: string;\r\n}\r\n\r\n/**\r\n * Consensus check result\r\n */\r\nexport interface ConsensusResult {\r\n consensus: number; // 0.0 to 1.0\r\n threshold: number;\r\n passed: boolean;\r\n agentCount: number;\r\n completedAgentCount: number;\r\n gap?: number; // threshold - consensus when fails\r\n}\r\n\r\n/**\r\n * Product Owner decision with reasoning\r\n */\r\nexport interface ProductOwnerDecision {\r\n decision: LoopDecision;\r\n rationale: string;\r\n confidence: number;\r\n timestamp: number;\r\n}\r\n\r\n/**\r\n * Deliverable verification options\r\n */\r\nexport interface DeliverableVerificationOptions {\r\n expectedFiles?: string[];\r\n taskType?: string;\r\n strict?: boolean;\r\n}\r\n\r\n/**\r\n * Deliverable verification result\r\n */\r\nexport interface DeliverableVerificationResult {\r\n verified: boolean;\r\n filesChecked: number;\r\n filesFound: number;\r\n missingFiles?: string[];\r\n errors?: string[];\r\n timestamp: number;\r\n}\r\n\r\n/**\r\n * Iteration feedback for agents\r\n */\r\nexport interface IterationFeedback {\r\n iteration: number;\r\n previousGateStatus?: string;\r\n previousPassRate?: number;\r\n failedTests?: string[];\r\n consensusScore?: number;\r\n recommendations?: string[];\r\n}\r\n\r\n/**\r\n * Orchestrator result/outcome\r\n */\r\nexport interface OrchestrationResult {\r\n status: 'success' | 'failed' | 'aborted';\r\n finalDecision: LoopDecision;\r\n iterationsCompleted: number;\r\n maxIterations: number;\r\n loop3Confidence: number;\r\n loop2Consensus: number;\r\n deliverableVerified: boolean;\r\n executionTimeSeconds: number;\r\n errors: string[];\r\n successReason?: string;\r\n failureReason?: string;\r\n}\r\n\r\n/**\r\n * Context injection payload\r\n */\r\nexport interface ContextPayload {\r\n taskDescription: string;\r\n deliverables?: string[];\r\n acceptanceCriteria?: string[];\r\n epicContext?: Record<string, unknown>;\r\n phaseContext?: Record<string, unknown>;\r\n targetFiles?: string[];\r\n iteration: number;\r\n feedback?: IterationFeedback;\r\n}\r\n\r\n/**\r\n * Agent context for execution\r\n */\r\nexport interface AgentContext {\r\n taskId: string;\r\n iteration: number;\r\n agentType: string;\r\n originalContext: string;\r\n enrichedContext?: string;\r\n feedback?: IterationFeedback;\r\n loopType?: 'loop3' | 'loop2';\r\n}\r\n\r\n/**\r\n * Redis coordination event\r\n */\r\nexport interface CoordinationEvent {\r\n type: 'agent_spawned' | 'agent_completed' | 'gate_check' | 'consensus_check' | 'decision';\r\n taskId: string;\r\n iteration: number;\r\n agentId?: string;\r\n payload: Record<string, unknown>;\r\n timestamp: number;\r\n}\r\n\r\n/**\r\n * Orchestrator error types\r\n */\r\nexport type OrchestratorErrorCode =\r\n | 'CONFIG_INVALID'\r\n | 'SPAWN_FAILED'\r\n | 'TIMEOUT'\r\n | 'GATE_FAILED'\r\n | 'CONSENSUS_FAILED'\r\n | 'DECISION_FAILED'\r\n | 'ITERATION_LIMIT'\r\n | 'REDIS_ERROR'\r\n | 'DELIVERABLE_VERIFICATION_FAILED';\r\n\r\n/**\r\n * Orchestrator error with code\r\n */\r\nexport class OrchestratorError extends Error {\r\n constructor(\r\n message: string,\r\n public code: OrchestratorErrorCode,\r\n public metadata?: Record<string, unknown>\r\n ) {\r\n super(message);\r\n this.name = 'OrchestratorError';\r\n Object.setPrototypeOf(this, OrchestratorError.prototype);\r\n }\r\n}\r\n\r\n/**\r\n * Logger interface for dependency injection\r\n */\r\nexport interface ILogger {\r\n info(message: string, data?: unknown): void;\r\n warn(message: string, data?: unknown): void;\r\n error(message: string, data?: unknown): void;\r\n debug(message: string, data?: unknown): void;\r\n}\r\n\r\n/**\r\n * Redis client interface for coordination\r\n */\r\nexport interface IRedisClient {\r\n get(key: string): Promise<string | null>;\r\n set(key: string, value: string, exSeconds?: number): Promise<string | null>;\r\n lpush(key: string, value: string): Promise<number>;\r\n blpop(key: string, timeoutSeconds: number): Promise<[string, string] | null>;\r\n smembers(key: string): Promise<string[]>;\r\n sadd(key: string, member: string): Promise<number>;\r\n del(key: string): Promise<number>;\r\n eval(script: string, numKeys: number, ...keys: string[]): Promise<unknown>;\r\n expire(key: string, seconds: number): Promise<number>;\r\n}\r\n\r\n/**\r\n * Gate checker interface for dependency injection\r\n */\r\nexport interface IGateChecker {\r\n checkGate(\r\n taskId: string,\r\n agents: string[],\r\n threshold: number,\r\n minQuorum?: number\r\n ): Promise<GateResult>;\r\n}\r\n\r\n/**\r\n * Agent spawner interface for dependency injection\r\n */\r\nexport interface IAgentSpawner {\r\n spawn(\r\n taskId: string,\r\n iteration: number,\r\n agents: string[],\r\n loopType: 'loop3' | 'loop2',\r\n context?: string\r\n ): Promise<AgentSpawnResult[]>;\r\n}\r\n\r\n/**\r\n * Product owner decision provider interface\r\n */\r\nexport interface IProductOwnerDecision {\r\n makeDecision(\r\n taskId: string,\r\n iteration: number,\r\n consensus: number,\r\n threshold: number,\r\n maxIterations: number\r\n ): Promise<ProductOwnerDecision>;\r\n}\r\n\r\n/**\r\n * Deliverable verifier interface\r\n */\r\nexport interface IDeliverableVerifier {\r\n verify(options: DeliverableVerificationOptions): Promise<DeliverableVerificationResult>;\r\n}\r\n\r\n/**\r\n * Mode-specific thresholds\r\n */\r\nexport const ModeThresholds = {\r\n mvp: { gate: 0.70, consensus: 0.80 },\r\n standard: { gate: 0.95, consensus: 0.90 },\r\n enterprise: { gate: 0.98, consensus: 0.95 },\r\n} as const;\r\n\r\n/**\r\n * Type guards and validators\r\n */\r\n\r\nexport function isValidLoopDecision(value: unknown): value is LoopDecision {\r\n return value === 'PROCEED' || value === 'ITERATE' || value === 'ABORT';\r\n}\r\n\r\nexport function isValidExecutionMode(value: unknown): value is ExecutionMode {\r\n return value === 'mvp' || value === 'standard' || value === 'enterprise';\r\n}\r\n\r\nexport function isValidOrchestratorConfig(value: unknown): value is OrchestratorConfig {\r\n if (typeof value !== 'object' || value === null) {\r\n return false;\r\n }\r\n\r\n const config = value as Record<string, unknown>;\r\n return (\r\n typeof config.taskId === 'string' &&\r\n isValidExecutionMode(config.mode) &&\r\n Array.isArray(config.loop3Agents) &&\r\n Array.isArray(config.loop2Agents) &&\r\n typeof config.productOwner === 'string' &&\r\n typeof config.maxIterations === 'number' &&\r\n config.maxIterations > 0\r\n );\r\n}\r\n\r\nexport function getThresholdsForMode(mode: ExecutionMode): {\r\n gate: number;\r\n consensus: number;\r\n} {\r\n return ModeThresholds[mode as keyof typeof ModeThresholds];\r\n}\r\n"],"names":["OrchestratorError","Error","message","code","metadata","name","Object","setPrototypeOf","prototype","ModeThresholds","mvp","gate","consensus","standard","enterprise","isValidLoopDecision","value","isValidExecutionMode","isValidOrchestratorConfig","config","taskId","mode","Array","isArray","loop3Agents","loop2Agents","productOwner","maxIterations","getThresholdsForMode"],"mappings":"AAAA;;;;;;;;;;;CAWC,GA4ND;;CAEC,GACD,OAAO,MAAMA,0BAA0BC;;;IACrC,YACEC,OAAe,EACf,AAAOC,IAA2B,EAClC,AAAOC,QAAkC,CACzC;QACA,KAAK,CAACF,eAHCC,OAAAA,WACAC,WAAAA;QAGP,IAAI,CAACC,IAAI,GAAG;QACZC,OAAOC,cAAc,CAAC,IAAI,EAAEP,kBAAkBQ,SAAS;IACzD;AACF;AAwEA;;CAEC,GACD,OAAO,MAAMC,iBAAiB;IAC5BC,KAAK;QAAEC,MAAM;QAAMC,WAAW;IAAK;IACnCC,UAAU;QAAEF,MAAM;QAAMC,WAAW;IAAK;IACxCE,YAAY;QAAEH,MAAM;QAAMC,WAAW;IAAK;AAC5C,EAAW;AAEX;;CAEC,GAED,OAAO,SAASG,oBAAoBC,KAAc;IAChD,OAAOA,UAAU,aAAaA,UAAU,aAAaA,UAAU;AACjE;AAEA,OAAO,SAASC,qBAAqBD,KAAc;IACjD,OAAOA,UAAU,SAASA,UAAU,cAAcA,UAAU;AAC9D;AAEA,OAAO,SAASE,0BAA0BF,KAAc;IACtD,IAAI,OAAOA,UAAU,YAAYA,UAAU,MAAM;QAC/C,OAAO;IACT;IAEA,MAAMG,SAASH;IACf,OACE,OAAOG,OAAOC,MAAM,KAAK,YACzBH,qBAAqBE,OAAOE,IAAI,KAChCC,MAAMC,OAAO,CAACJ,OAAOK,WAAW,KAChCF,MAAMC,OAAO,CAACJ,OAAOM,WAAW,KAChC,OAAON,OAAOO,YAAY,KAAK,YAC/B,OAAOP,OAAOQ,aAAa,KAAK,YAChCR,OAAOQ,aAAa,GAAG;AAE3B;AAEA,OAAO,SAASC,qBAAqBP,IAAmB;IAItD,OAAOZ,cAAc,CAACY,KAAoC;AAC5D"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-flow-novice",
3
- "version": "2.15.5",
3
+ "version": "2.15.6",
4
4
  "description": "AI agent orchestration framework with namespace-isolated skills, agents, and CFN Loop validation. Safe installation with ~0.01% collision risk.",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -2,11 +2,13 @@
2
2
  ##############################################################################
3
3
  # Claude API Switcher - Main Chat & Task Tool Provider Routing
4
4
  #
5
- # Usage: scripts/switch-api.sh [zai|kimi|openrouter|max|status]
5
+ # Usage: scripts/switch-api.sh [zai|kimi|gemini|xai|openrouter|max|status]
6
6
  #
7
7
  # What it does:
8
8
  # - zai: Main Chat + Task tool use Z.ai
9
9
  # - kimi: Main Chat + Task tool use Moonshot Kimi
10
+ # - gemini: Main Chat + Task tool use Google Gemini (via OpenRouter)
11
+ # - xai: Main Chat + Task tool use XAi (Grok)
10
12
  # - openrouter: Main Chat + Task tool use OpenRouter
11
13
  # - max: Main Chat + Task tool use Anthropic (requires re-login)
12
14
  # - CLI: Respects custom routing when enabled (see agent profiles)
@@ -66,11 +68,22 @@ show_status() {
66
68
  echo " Base URL: $BASE_URL"
67
69
  echo " Model: $MODEL"
68
70
  echo " Cost: ~\$2/1M tokens"
69
- elif [[ "$BASE_URL" == *"openrouter.ai"* ]]; then
70
- echo -e "${GREEN}✓ Main Chat/Task Tool:${NC} OpenRouter"
71
+ elif [[ "$BASE_URL" == *"x.ai"* ]]; then
72
+ echo -e "${GREEN}✓ Main Chat/Task Tool:${NC} XAi (Grok)"
71
73
  echo " Base URL: $BASE_URL"
72
74
  echo " Model: $MODEL"
73
- echo " Cost: Varies by model"
75
+ echo " Anthropic-compatible API"
76
+ elif [[ "$BASE_URL" == *"openrouter.ai"* ]]; then
77
+ if [[ "$MODEL" == google/gemini* ]]; then
78
+ echo -e "${GREEN}✓ Main Chat/Task Tool:${NC} Google Gemini (via OpenRouter)"
79
+ echo " Model: $MODEL"
80
+ echo " Cost: ~\$0.30/1M tokens (input), ~\$1.20/1M tokens (output)"
81
+ else
82
+ echo -e "${GREEN}✓ Main Chat/Task Tool:${NC} OpenRouter"
83
+ echo " Base URL: $BASE_URL"
84
+ echo " Model: $MODEL"
85
+ echo " Cost: Varies by model"
86
+ fi
74
87
  else
75
88
  echo -e "${GREEN}✓ Main Chat/Task Tool:${NC} Custom"
76
89
  echo " Base URL: $BASE_URL"
@@ -196,6 +209,117 @@ switch_to_kimi() {
196
209
  echo ""
197
210
  }
198
211
 
212
+ ##############################################################################
213
+ # Switch to Gemini (via OpenRouter) for Main Chat and Task Tool
214
+ ##############################################################################
215
+ switch_to_gemini() {
216
+ echo -e "${BLUE}Switching Main Chat/Task Tool to Google Gemini...${NC}"
217
+ echo ""
218
+
219
+ # Backup current settings
220
+ if [ -f "$SETTINGS_FILE" ]; then
221
+ BACKUP_NAME="settings-$(date +%Y%m%d-%H%M%S)-before-gemini.json"
222
+ cp "$SETTINGS_FILE" "$BACKUP_DIR/$BACKUP_NAME"
223
+ echo -e "${GREEN}✓${NC} Backed up: $BACKUP_DIR/$BACKUP_NAME"
224
+ fi
225
+
226
+ # Read current settings or create empty object
227
+ if [ -f "$SETTINGS_FILE" ]; then
228
+ CURRENT_SETTINGS=$(cat "$SETTINGS_FILE")
229
+ else
230
+ CURRENT_SETTINGS='{}'
231
+ fi
232
+
233
+ # Add Gemini env vars to settings (via OpenRouter with Gemini model)
234
+ OPENROUTER_KEY=$(grep -E "^OPENROUTER_API_KEY=" .env | head -1 | cut -d'=' -f2 | sed 's/#.*//' | xargs)
235
+ if [ -z "$OPENROUTER_KEY" ]; then
236
+ echo -e "${RED}Error: OPENROUTER_API_KEY not found in .env${NC}"
237
+ exit 1
238
+ fi
239
+ # Use Gemini 2.0 Flash as default (fast, cost-effective)
240
+ NEW_SETTINGS=$(echo "$CURRENT_SETTINGS" | jq --arg key "$OPENROUTER_KEY" '. + {"env": ((.env // {}) + {"ANTHROPIC_BASE_URL": "https://openrouter.ai/api/v1", "ANTHROPIC_AUTH_TOKEN": $key, "ANTHROPIC_MODEL": "google/gemini-2.0-flash-001", "ANTHROPIC_SMALL_FAST_MODEL": "google/gemini-2.0-flash-001"})}')
241
+
242
+ echo "$NEW_SETTINGS" > "$SETTINGS_FILE"
243
+
244
+ echo ""
245
+ echo -e "${GREEN}═══════════════════════════════════════${NC}"
246
+ echo -e "${GREEN}✓ Switched to Google Gemini${NC}"
247
+ echo -e "${GREEN}═══════════════════════════════════════${NC}"
248
+ echo ""
249
+ echo -e "${GREEN}Main Chat + Task Tool:${NC} Gemini (via OpenRouter)"
250
+ echo " • All Task() spawned agents use Gemini"
251
+ echo " • Model: google/gemini-2.0-flash-001"
252
+ echo " • Cost: ~\$0.30/1M tokens (input), ~\$1.20/1M tokens (output)"
253
+ echo " • No login required"
254
+ echo ""
255
+ echo -e "${BLUE}Available Gemini Models:${NC}"
256
+ echo " • google/gemini-2.0-flash-001 (default, fast)"
257
+ echo " • google/gemini-pro"
258
+ echo " • google/gemini-pro-vision"
259
+ echo " • Edit model in .claude/settings.json"
260
+ echo ""
261
+ echo -e "${YELLOW}Next Steps:${NC}"
262
+ echo " 1. Restart Claude desktop (if running)"
263
+ echo " 2. Test: Main Chat should use Gemini"
264
+ echo " 3. Visit: https://openrouter.ai/models for model pricing"
265
+ echo ""
266
+ }
267
+
268
+ ##############################################################################
269
+ # Switch to XAi (Grok) for Main Chat and Task Tool
270
+ ##############################################################################
271
+ switch_to_xai() {
272
+ echo -e "${BLUE}Switching Main Chat/Task Tool to XAi (Grok)...${NC}"
273
+ echo ""
274
+
275
+ # Backup current settings
276
+ if [ -f "$SETTINGS_FILE" ]; then
277
+ BACKUP_NAME="settings-$(date +%Y%m%d-%H%M%S)-before-xai.json"
278
+ cp "$SETTINGS_FILE" "$BACKUP_DIR/$BACKUP_NAME"
279
+ echo -e "${GREEN}✓${NC} Backed up: $BACKUP_DIR/$BACKUP_NAME"
280
+ fi
281
+
282
+ # Read current settings or create empty object
283
+ if [ -f "$SETTINGS_FILE" ]; then
284
+ CURRENT_SETTINGS=$(cat "$SETTINGS_FILE")
285
+ else
286
+ CURRENT_SETTINGS='{}'
287
+ fi
288
+
289
+ # Add XAi env vars to settings (read from .env)
290
+ XAI_KEY=$(grep -E "^XAI_API_KEY=" .env | head -1 | cut -d'=' -f2 | sed 's/#.*//' | xargs)
291
+ if [ -z "$XAI_KEY" ]; then
292
+ echo -e "${RED}Error: XAI_API_KEY not found in .env${NC}"
293
+ exit 1
294
+ fi
295
+ # Use Grok Beta as default (Anthropic-compatible API)
296
+ NEW_SETTINGS=$(echo "$CURRENT_SETTINGS" | jq --arg key "$XAI_KEY" '. + {"env": ((.env // {}) + {"ANTHROPIC_BASE_URL": "https://api.x.ai/v1", "ANTHROPIC_AUTH_TOKEN": $key, "ANTHROPIC_MODEL": "grok-beta", "ANTHROPIC_SMALL_FAST_MODEL": "grok-beta"})}')
297
+
298
+ echo "$NEW_SETTINGS" > "$SETTINGS_FILE"
299
+
300
+ echo ""
301
+ echo -e "${GREEN}═══════════════════════════════════════${NC}"
302
+ echo -e "${GREEN}✓ Switched to XAi (Grok)${NC}"
303
+ echo -e "${GREEN}═══════════════════════════════════════${NC}"
304
+ echo ""
305
+ echo -e "${GREEN}Main Chat + Task Tool:${NC} XAi (Grok)"
306
+ echo " • All Task() spawned agents use XAi"
307
+ echo " • Model: grok-beta"
308
+ echo " • Anthropic-compatible API format"
309
+ echo " • No login required"
310
+ echo ""
311
+ echo -e "${BLUE}Available Models:${NC}"
312
+ echo " • grok-beta (default)"
313
+ echo " • grok-vision-beta (with vision capabilities)"
314
+ echo " • Edit model in .claude/settings.json"
315
+ echo ""
316
+ echo -e "${YELLOW}Next Steps:${NC}"
317
+ echo " 1. Restart Claude desktop (if running)"
318
+ echo " 2. Test: Main Chat should use XAi"
319
+ echo " 3. Visit: https://x.ai/api for more info"
320
+ echo ""
321
+ }
322
+
199
323
  ##############################################################################
200
324
  # Switch to OpenRouter for Main Chat and Task Tool
201
325
  ##############################################################################
@@ -323,6 +447,16 @@ case "${1:-status}" in
323
447
  show_status
324
448
  ;;
325
449
 
450
+ gemini|google)
451
+ switch_to_gemini
452
+ show_status
453
+ ;;
454
+
455
+ xai|grok)
456
+ switch_to_xai
457
+ show_status
458
+ ;;
459
+
326
460
  openrouter|or)
327
461
  switch_to_openrouter
328
462
  show_status
@@ -342,6 +476,8 @@ case "${1:-status}" in
342
476
  echo " status Show current API configuration (default)"
343
477
  echo " zai Switch Main Chat/Task tool to Z.ai"
344
478
  echo " kimi Switch Main Chat/Task tool to Moonshot Kimi"
479
+ echo " gemini Switch Main Chat/Task tool to Google Gemini"
480
+ echo " xai Switch Main Chat/Task tool to XAi (Grok)"
345
481
  echo " openrouter Switch Main Chat/Task tool to OpenRouter"
346
482
  echo " max Switch Main Chat/Task tool to Anthropic"
347
483
  echo ""
@@ -349,6 +485,8 @@ case "${1:-status}" in
349
485
  echo " $0 # Show current status"
350
486
  echo " $0 zai # Use Z.ai for Main Chat (\$0.50/1M tokens)"
351
487
  echo " $0 kimi # Use Moonshot Kimi (~\$2/1M tokens)"
488
+ echo " $0 gemini # Use Google Gemini (~\$0.30/1M input tokens)"
489
+ echo " $0 xai # Use XAi Grok (Anthropic-compatible)"
352
490
  echo " $0 openrouter # Use OpenRouter (varies by model)"
353
491
  echo " $0 max # Use Anthropic (\$15/1M tokens, requires re-login)"
354
492
  echo ""
@@ -38,23 +38,16 @@ fi
38
38
 
39
39
  # Expanded secret patterns (CVSS 9.0 critical fixes)
40
40
  SECRET_PATTERNS=(
41
- # Anthropic keys
41
+ # Anthropic keys (real format, not templates)
42
42
  "sk-ant-v1-[a-zA-Z0-9_-]{50,}"
43
43
 
44
- # Environment variable assignments with secrets
44
+ # Environment variable assignments with ACTUAL secrets (not variables/templates)
45
45
  "(ANTHROPIC_API_KEY|ZAI_API_KEY|NPM_API_KEY|REDIS_PASSWORD|POSTGRES_PASSWORD|JWT_SECRET|SESSION_SECRET)=[A-Za-z0-9_-/+]{20,}"
46
46
 
47
- # AWS keys
47
+ # AWS keys (real format)
48
48
  "AKIA[0-9A-Z]{16}"
49
- "aws_secret_access_key"
50
49
 
51
- # Database credentials
52
- "(postgres|mysql|mongo).*password.*[a-zA-Z0-9!@#$]{8,}"
53
-
54
- # Bearer tokens
55
- "Bearer\s+[a-zA-Z0-9_.-]{20,}"
56
-
57
- # Private keys
50
+ # Private keys (actual PEM format)
58
51
  "-----BEGIN.*PRIVATE KEY"
59
52
  )
60
53
 
@@ -62,7 +55,7 @@ SECRET_PATTERNS=(
62
55
  if [ -d "dist" ]; then
63
56
  echo "Scanning dist/ directory..."
64
57
  for pattern in "${SECRET_PATTERNS[@]}"; do
65
- if grep -r -E "$pattern" dist/ 2>/dev/null || true | grep -q .; then
58
+ if grep -r -E "$pattern" dist/ --exclude="*.js.map" --exclude="*.map" 2>/dev/null || true | grep -q .; then
66
59
  echo -e "${RED}[ERROR] Secret pattern detected in dist/: $pattern${NC}"
67
60
  FOUND_SECRETS=1
68
61
  fi
@@ -72,7 +65,7 @@ fi
72
65
  if [ -d ".claude" ]; then
73
66
  echo "Scanning .claude/ directory..."
74
67
  for pattern in "${SECRET_PATTERNS[@]}"; do
75
- if grep -r -E "$pattern" .claude/ --exclude-dir=legacy 2>/dev/null || true | grep -q .; then
68
+ if grep -r -E "$pattern" .claude/ --exclude-dir=legacy --exclude-dir=hooks 2>/dev/null || true | grep -q .; then
76
69
  echo -e "${RED}[ERROR] Secret pattern detected in .claude/: $pattern${NC}"
77
70
  FOUND_SECRETS=1
78
71
  fi
package/tests/README.md CHANGED
@@ -1,84 +1,201 @@
1
1
  # Claude Flow Novice Test Suite
2
2
 
3
- ## Overview
3
+ Comprehensive test suite for CLI and Docker mode execution.
4
4
 
5
- This test suite validates the core functionality and resilience of the Claude Flow Novice system across multiple layers and scenarios.
5
+ ## Quick Reference
6
6
 
7
- ## Test Layers
7
+ | Test Suite | Command | Tests Run | Duration | When to Use |
8
+ |------------|---------|-----------|----------|-------------|
9
+ | **CLI Quick** | `tests/cli-mode/run-all-tests.sh --quick` | 4 unit tests | ~1 min | Pre-commit, fast validation |
10
+ | **CLI Integration** | `tests/cli-mode/run-all-tests.sh --integration` | 10 tests (unit + integration) | ~5 min | PR validation |
11
+ | **CLI Full** | `tests/cli-mode/run-all-tests.sh --full` | 12 tests (all core) | ~15 min | Release validation |
12
+ | **Docker Quick** | `tests/docker/run-all-tests.sh --quick` | Critical integration | ~2 min | Pre-commit, fast validation |
13
+ | **Docker Integration** | `tests/docker/run-all-tests.sh --integration` | All integration | ~10 min | PR validation |
14
+ | **Docker Full** | `tests/docker/run-all-tests.sh --full` | 17 core tests | ~30 min | Release validation |
8
15
 
9
- ### Layer 0: Agent Tooling Validation
10
- - Verifies individual tool functionality
11
- - Ensures tools can be instantiated and used
12
- - Tests error handling and coordination
16
+ **Note:** Test runners automatically exclude legacy/ tests (historical reference only).
13
17
 
14
- ### Layer 1: Mesh Coordination
15
- - Redis pub/sub integration tests
16
- - Validates agent communication patterns
17
- - Checks distributed messaging reliability
18
+ ## Quick Start
18
19
 
19
- ### Layer 2: Review Handoff
20
- - Dynamic reviewer pool testing
21
- - Validates context transfer mechanisms
22
- - Ensures smooth agent transitions
23
-
24
- ### Layer 3: Error Handling
25
- - 50% error injection scenarios
26
- - Circuit breaker and fallback mechanisms
27
- - Resilience and recovery validation
20
+ ```bash
21
+ # CLI Mode Tests (from project root)
22
+ tests/cli-mode/run-all-tests.sh --quick # Fast validation (~1 min)
23
+ tests/cli-mode/run-all-tests.sh --integration # Pre-commit (~5 min)
24
+ tests/cli-mode/run-all-tests.sh --full # Full suite (~15 min)
25
+
26
+ # Docker Mode Tests (from project root)
27
+ tests/docker/run-all-tests.sh --quick # Fast validation (~2 min)
28
+ tests/docker/run-all-tests.sh --integration # Pre-commit (~10 min)
29
+ tests/docker/run-all-tests.sh --full # Full suite (~30 min)
30
+ ```
28
31
 
29
- ## Running Tests
32
+ ## Test Organization
30
33
 
31
- ### Prerequisites
32
- - Node.js 18+
33
- - Redis
34
- - Docker (optional, for containerized testing)
34
+ ### CLI Mode (12 core tests + 3 legacy)
35
+ ```
36
+ tests/cli-mode/
37
+ ├── core/
38
+ │ ├── unit/ 4 tests - Parameter validation, tool access, thresholds
39
+ │ ├── integration/ 6 tests - Coordinator spawning, orchestrator workflow
40
+ │ ├── e2e/ 2 tests - TRUE E2E with real production scripts
41
+ │ └── legacy/ 3 tests - Superseded by TRUE E2E (historical reference)
42
+ ├── archive/ 5 tests - Obsolete/redundant
43
+ └── run-all-tests.sh Comprehensive test runner (excludes legacy/)
44
+ ```
35
45
 
36
- ### Commands
46
+ **Run Commands:**
37
47
  ```bash
38
- # Run all tests
39
- npm test
48
+ tests/cli-mode/run-all-tests.sh --quick # Unit tests only (~1 min)
49
+ tests/cli-mode/run-all-tests.sh --integration # Unit + Integration (~5 min)
50
+ tests/cli-mode/run-all-tests.sh --full # All tests including E2E (~15 min)
51
+ ```
40
52
 
41
- # Run specific test layer
42
- npm test -- --testNamePattern="Layer 0"
53
+ ### Docker Mode (17 core tests + 14 legacy)
54
+ ```
55
+ tests/docker/
56
+ ├── core/
57
+ │ ├── 17 tests Agent lifecycle, coordinators, wave orchestration
58
+ │ └── legacy/ 14 tests - Bug-specific validation (historical)
59
+ ├── integration/ 5 tests - Integration validation
60
+ ├── unit/ 1 test - Syntax validation
61
+ ├── archive/ Experimental/obsolete tests
62
+ └── run-all-tests.sh Comprehensive test runner (excludes legacy/)
63
+ ```
43
64
 
44
- # Generate coverage report
45
- npm run test:coverage
65
+ **Run Commands:**
66
+ ```bash
67
+ tests/docker/run-all-tests.sh --quick # Critical integration (~2 min)
68
+ tests/docker/run-all-tests.sh --integration # All integration tests (~10 min)
69
+ tests/docker/run-all-tests.sh --full # Full suite with E2E (~30 min)
46
70
  ```
47
71
 
48
- ## Coverage Requirements
72
+ **Legacy Tests:**
73
+ - Not included in test runners by default
74
+ - Preserved for historical reference and regression debugging
75
+ - See `tests/cli-mode/core/legacy/README.md` and `tests/docker/core/legacy/README.md`
76
+
77
+ ## Test Categories
78
+
79
+ ### Unit Tests
80
+ - **Purpose**: Component validation
81
+ - **Runtime**: 1-2 minutes
82
+ - **Prerequisites**: None
83
+ - **Examples**: Parameter validation, syntax checking, path resolution
49
84
 
50
- | Layer | Branches | Functions | Lines | Statements |
51
- |-------|----------|-----------|-------|------------|
52
- | Layer 0 | 90% | 85% | 95% | 90% |
53
- | Layer 1 | 85% | 80% | 90% | 85% |
54
- | Layer 2 | 80% | 75% | 85% | 80% |
55
- | Layer 3 | 75% | 70% | 80% | 75% |
85
+ ### Integration Tests
86
+ - **Purpose**: Component interaction
87
+ - **Runtime**: 5-10 minutes
88
+ - **Prerequisites**: Redis, Docker
89
+ - **Examples**: Coordinator spawning, Redis coordination, workflow execution
56
90
 
57
- ## Chaos Testing
91
+ ### E2E/Core Tests
92
+ - **Purpose**: End-to-end validation with production code paths
93
+ - **Runtime**: 15-30 minutes
94
+ - **Prerequisites**: Redis, Docker, NPX, CFN agent image
95
+ - **Examples**: Full CFN Loop execution, agent spawning, deliverable validation
58
96
 
59
- Includes resilience tests for:
60
- - Redis connection failures
61
- - SQLite data corruption
62
- - Coordinator process termination
97
+ ## Bug Tracking
63
98
 
64
- ## Best Practices
99
+ ### BUG #21: Agent Spawning Mechanism
100
+ **Tests:**
101
+ - Unit: `tests/docker/unit/test-spawn-command-syntax.sh`
102
+ - Integration: `tests/docker/integration/test-real-agent-spawning.sh`
103
+ - E2E: `tests/cli-mode/core/e2e/test-cfn-loop-cli-real-execution.sh`
65
104
 
66
- - All tests use TypeScript
67
- - Strict mode enforcement
68
- - Clear, descriptive assertions
69
- - Proper resource cleanup
70
- - Deterministic test environments
105
+ ### BUG #22: Empty Parameter Handling
106
+ **Tests:**
107
+ - Unit: `tests/cli-mode/core/unit/test-command-parameter-validation.sh`
108
+ - E2E: `tests/cli-mode/core/e2e/test-cfn-loop-cli-real-execution.sh`
109
+
110
+ ## Prerequisites
111
+
112
+ ### Required
113
+ - Docker daemon running
114
+ - Redis running (or redis-server available)
115
+ - NPX available
116
+ - Git repository (for PROJECT_ROOT)
117
+
118
+ ### Optional
119
+ - docker-compose (for Docker mode tests)
120
+ - CFN agent image (built automatically if needed)
121
+
122
+ ## Documentation
123
+
124
+ ### Core Documentation
125
+ - **Core Test Summary**: `tests/CORE_TEST_SUMMARY.md` - **START HERE** - Post-reorganization summary
126
+ - **Comprehensive Guide**: `tests/TEST_ORGANIZATION.md` - Complete test organization, categories, and usage
127
+ - **Test Standards**: `tests/CLAUDE.md` - Test authoring standards and boilerplate (includes BUG #21 lesson)
128
+
129
+ ### Mode-Specific Documentation
130
+ - **CLI Mode Tests**: `tests/cli-mode/README*.md` - CLI-specific documentation
131
+ - **CLI Legacy Tests**: `tests/cli-mode/core/legacy/README.md` - Historical CLI test reference
132
+ - **Docker Tests**: `tests/docker/TEST_SUITE_README.md` - Docker-specific documentation
133
+ - **Docker Legacy Tests**: `tests/docker/core/legacy/README.md` - Historical Docker test reference
134
+
135
+ ### Bug Documentation
136
+ - **BUG #21**: `docs/BUG_21_PRODUCTION_TESTING_REQUIREMENTS.md` - Production testing requirements
137
+ - **BUG #22**: `docs/BUG_CLI_MODE_COORDINATOR_EMPTY_PARAMS.md` - Empty parameter handling
138
+
139
+ ## CI/CD Integration
140
+
141
+ ### Pre-commit Hooks
142
+ ```bash
143
+ tests/cli-mode/run-all-tests.sh --quick
144
+ tests/docker/run-all-tests.sh --quick
145
+ ```
146
+
147
+ ### Pull Request Validation
148
+ ```bash
149
+ tests/cli-mode/run-all-tests.sh --integration
150
+ tests/docker/run-all-tests.sh --integration
151
+ ```
152
+
153
+ ### Release Validation
154
+ ```bash
155
+ tests/cli-mode/run-all-tests.sh --full
156
+ tests/docker/run-all-tests.sh --full
157
+ ```
71
158
 
72
159
  ## Troubleshooting
73
160
 
74
- 1. Ensure Redis is running
75
- 2. Check network configurations
76
- 3. Verify dependency versions
77
- 4. Run with increased verbosity: `npm test -- --verbose`
161
+ ### Line Ending Issues
162
+ ```bash
163
+ dos2unix tests/cli-mode/run-all-tests.sh
164
+ dos2unix tests/docker/run-all-tests.sh
165
+ # or
166
+ sed -i 's/\r$//' tests/cli-mode/run-all-tests.sh
167
+ sed -i 's/\r$//' tests/docker/run-all-tests.sh
168
+ ```
169
+
170
+ ### Redis Not Running
171
+ ```bash
172
+ redis-server --daemonize yes
173
+ ```
174
+
175
+ ### Docker Not Running
176
+ ```bash
177
+ sudo systemctl start docker
178
+ ```
179
+
180
+ ### CFN Agent Image Missing
181
+ ```bash
182
+ ./.claude/skills/docker-build/build.sh \
183
+ --dockerfile docker/Dockerfile.agent \
184
+ --tag cfn-agent:latest
185
+ ```
78
186
 
79
187
  ## Contributing
80
188
 
81
- - Add new tests in respective layer directories
82
- - Follow existing patterns
83
- - Update coverage documentation
84
- - Write clear, concise test descriptions
189
+ When adding new tests:
190
+ 1. Follow standards in `tests/CLAUDE.md`
191
+ 2. Place in appropriate directory (unit/integration/e2e)
192
+ 3. Update relevant documentation
193
+ 4. Test with runner scripts before committing
194
+ 5. Archive obsolete tests (don't delete)
195
+
196
+ ## Support
197
+
198
+ For detailed information, see:
199
+ - `tests/TEST_ORGANIZATION.md` - Complete organization guide
200
+ - `tests/CLAUDE.md` - Test authoring standards
201
+ - `docs/BUG_21_PRODUCTION_TESTING_REQUIREMENTS.md` - Production testing requirements