claude-flow-novice 1.6.1 → 1.6.3

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 (273) hide show
  1. package/.claude/agents/cfn-loop/product-owner.md +54 -4
  2. package/.claude/commands/cfn-claude-sync.md +303 -0
  3. package/.claude/commands/cfn-loop-epic.md +290 -0
  4. package/.claude/commands/cfn-loop-single.md +168 -0
  5. package/.claude/commands/cfn-loop-sprints.md +384 -0
  6. package/.claude/commands/cfn-loop.md +180 -0
  7. package/.claude/commands/metrics-summary.md +58 -0
  8. package/.claude/commands/parse-epic.md +357 -0
  9. package/.claude/settings.json +5 -4
  10. package/.claude/settings.local.json +9 -2
  11. package/.claude-flow-novice/.claude/agents/cfn-loop/product-owner.md +792 -0
  12. package/.claude-flow-novice/dist/mcp/server.js +21 -2
  13. package/.claude-flow-novice/dist/src/api/auth-service.js +84 -38
  14. package/.claude-flow-novice/dist/src/api/auth-service.js.map +1 -1
  15. package/.claude-flow-novice/dist/src/api/claude-client.js +138 -3
  16. package/.claude-flow-novice/dist/src/api/claude-client.js.map +1 -1
  17. package/.claude-flow-novice/dist/src/cfn-loop/phase-orchestrator-example.js +1 -1
  18. package/.claude-flow-novice/dist/src/cfn-loop/scope-control.js +247 -0
  19. package/.claude-flow-novice/dist/src/cfn-loop/scope-control.js.map +1 -0
  20. package/.claude-flow-novice/dist/src/cli/commands/swarm.js +32 -15
  21. package/.claude-flow-novice/dist/src/cli/commands/swarm.js.map +1 -1
  22. package/.claude-flow-novice/dist/src/cli/commands/transparency.js +455 -0
  23. package/.claude-flow-novice/dist/src/cli/commands/transparency.js.map +1 -0
  24. package/.claude-flow-novice/dist/src/cli/simple-commands/init/templates/CLAUDE.md +129 -13
  25. package/.claude-flow-novice/dist/src/components/visualizations/index.js +9 -0
  26. package/.claude-flow-novice/dist/src/components/visualizations/index.js.map +1 -0
  27. package/.claude-flow-novice/dist/src/coordination/adapters/v1-coordinator-adapter.js +462 -0
  28. package/.claude-flow-novice/dist/src/coordination/adapters/v1-coordinator-adapter.js.map +1 -0
  29. package/.claude-flow-novice/dist/src/coordination/config-translator.js +248 -0
  30. package/.claude-flow-novice/dist/src/coordination/config-translator.js.map +1 -0
  31. package/.claude-flow-novice/dist/src/coordination/coordination-toggle.js +287 -0
  32. package/.claude-flow-novice/dist/src/coordination/coordination-toggle.js.map +1 -0
  33. package/.claude-flow-novice/dist/src/coordination/distributed-consensus.js +68 -9
  34. package/.claude-flow-novice/dist/src/coordination/distributed-consensus.js.map +1 -1
  35. package/.claude-flow-novice/dist/src/coordination/feature-flags.js +166 -0
  36. package/.claude-flow-novice/dist/src/coordination/feature-flags.js.map +1 -0
  37. package/.claude-flow-novice/dist/src/coordination/queen-agent.js +18 -4
  38. package/.claude-flow-novice/dist/src/coordination/queen-agent.js.map +1 -1
  39. package/.claude-flow-novice/dist/src/coordination/role-assignment.js +6 -110
  40. package/.claude-flow-novice/dist/src/coordination/role-assignment.js.map +1 -1
  41. package/.claude-flow-novice/dist/src/coordination/v2/cache/artifact-cache-optimizer.js +632 -0
  42. package/.claude-flow-novice/dist/src/coordination/v2/cache/artifact-cache-optimizer.js.map +1 -0
  43. package/.claude-flow-novice/dist/src/coordination/v2/cache/index.js +11 -0
  44. package/.claude-flow-novice/dist/src/coordination/v2/cache/index.js.map +1 -0
  45. package/.claude-flow-novice/dist/src/coordination/v2/checkpoints/checkpoint-compressor.js +318 -0
  46. package/.claude-flow-novice/dist/src/coordination/v2/checkpoints/checkpoint-compressor.js.map +1 -0
  47. package/.claude-flow-novice/dist/src/coordination/v2/coordinators/cascading-shutdown.example.js +364 -0
  48. package/.claude-flow-novice/dist/src/coordination/v2/coordinators/cascading-shutdown.example.js.map +1 -0
  49. package/.claude-flow-novice/dist/src/coordination/v2/coordinators/cascading-shutdown.js +492 -0
  50. package/.claude-flow-novice/dist/src/coordination/v2/coordinators/cascading-shutdown.js.map +1 -0
  51. package/.claude-flow-novice/dist/src/coordination/v2/coordinators/hierarchical-coordinator.js +786 -0
  52. package/.claude-flow-novice/dist/src/coordination/v2/coordinators/hierarchical-coordinator.js.map +1 -0
  53. package/.claude-flow-novice/dist/src/coordination/v2/coordinators/index.js +16 -0
  54. package/.claude-flow-novice/dist/src/coordination/v2/coordinators/index.js.map +1 -0
  55. package/.claude-flow-novice/dist/src/coordination/v2/coordinators/parent-child-manager.js +342 -0
  56. package/.claude-flow-novice/dist/src/coordination/v2/coordinators/parent-child-manager.js.map +1 -0
  57. package/.claude-flow-novice/dist/src/coordination/v2/coordinators/swarm-coordinator-v2.js +601 -0
  58. package/.claude-flow-novice/dist/src/coordination/v2/coordinators/swarm-coordinator-v2.js.map +1 -0
  59. package/.claude-flow-novice/dist/src/coordination/v2/core/help-request-metrics.js +211 -0
  60. package/.claude-flow-novice/dist/src/coordination/v2/core/help-request-metrics.js.map +1 -0
  61. package/.claude-flow-novice/dist/src/coordination/v2/core/index.js +1 -0
  62. package/.claude-flow-novice/dist/src/coordination/v2/core/index.js.map +1 -1
  63. package/.claude-flow-novice/dist/src/coordination/v2/core/message-broker.js +365 -6
  64. package/.claude-flow-novice/dist/src/coordination/v2/core/message-broker.js.map +1 -1
  65. package/.claude-flow-novice/dist/src/coordination/v2/core/resource-manager-safe.js +478 -0
  66. package/.claude-flow-novice/dist/src/coordination/v2/core/resource-manager-safe.js.map +1 -0
  67. package/.claude-flow-novice/dist/src/coordination/v2/core/state-machine-config.js +5 -2
  68. package/.claude-flow-novice/dist/src/coordination/v2/core/state-machine-config.js.map +1 -1
  69. package/.claude-flow-novice/dist/src/coordination/v2/core/state-machine.js +189 -0
  70. package/.claude-flow-novice/dist/src/coordination/v2/core/state-machine.js.map +1 -1
  71. package/.claude-flow-novice/dist/src/coordination/v2/deadlock/deadlock-detector.js +424 -0
  72. package/.claude-flow-novice/dist/src/coordination/v2/deadlock/deadlock-detector.js.map +1 -0
  73. package/.claude-flow-novice/dist/src/coordination/v2/deadlock/index.js +9 -0
  74. package/.claude-flow-novice/dist/src/coordination/v2/deadlock/index.js.map +1 -0
  75. package/.claude-flow-novice/dist/src/coordination/v2/deadlock/resource-manager.js +669 -0
  76. package/.claude-flow-novice/dist/src/coordination/v2/deadlock/resource-manager.js.map +1 -0
  77. package/.claude-flow-novice/dist/src/coordination/v2/dependency/artifact-storage.js +451 -0
  78. package/.claude-flow-novice/dist/src/coordination/v2/dependency/artifact-storage.js.map +1 -0
  79. package/.claude-flow-novice/dist/src/coordination/v2/dependency/cycle-detector.js +271 -0
  80. package/.claude-flow-novice/dist/src/coordination/v2/dependency/cycle-detector.js.map +1 -0
  81. package/.claude-flow-novice/dist/src/coordination/v2/dependency/dependency-graph.js +335 -0
  82. package/.claude-flow-novice/dist/src/coordination/v2/dependency/dependency-graph.js.map +1 -0
  83. package/.claude-flow-novice/dist/src/coordination/v2/dependency/dependency-manager.js +439 -0
  84. package/.claude-flow-novice/dist/src/coordination/v2/dependency/dependency-manager.js.map +1 -0
  85. package/.claude-flow-novice/dist/src/coordination/v2/dependency/dependency-request.js +92 -0
  86. package/.claude-flow-novice/dist/src/coordination/v2/dependency/dependency-request.js.map +1 -0
  87. package/.claude-flow-novice/dist/src/coordination/v2/dependency/index.js +21 -0
  88. package/.claude-flow-novice/dist/src/coordination/v2/dependency/index.js.map +1 -0
  89. package/.claude-flow-novice/dist/src/coordination/v2/dependency/topological-sort.js +223 -0
  90. package/.claude-flow-novice/dist/src/coordination/v2/dependency/topological-sort.js.map +1 -0
  91. package/.claude-flow-novice/dist/src/coordination/v2/help-system/help-coordinator.js +436 -0
  92. package/.claude-flow-novice/dist/src/coordination/v2/help-system/help-coordinator.js.map +1 -0
  93. package/.claude-flow-novice/dist/src/coordination/v2/help-system/help-matcher.js +278 -0
  94. package/.claude-flow-novice/dist/src/coordination/v2/help-system/help-matcher.js.map +1 -0
  95. package/.claude-flow-novice/dist/src/coordination/v2/help-system/help-request-handler.js +317 -0
  96. package/.claude-flow-novice/dist/src/coordination/v2/help-system/help-request-handler.js.map +1 -0
  97. package/.claude-flow-novice/dist/src/coordination/v2/help-system/help-request.js +273 -0
  98. package/.claude-flow-novice/dist/src/coordination/v2/help-system/help-request.js.map +1 -0
  99. package/.claude-flow-novice/dist/src/coordination/v2/help-system/index.js +15 -0
  100. package/.claude-flow-novice/dist/src/coordination/v2/help-system/index.js.map +1 -0
  101. package/.claude-flow-novice/dist/src/coordination/v2/help-system/waiting-agent-pool.js +512 -0
  102. package/.claude-flow-novice/dist/src/coordination/v2/help-system/waiting-agent-pool.js.map +1 -0
  103. package/.claude-flow-novice/dist/src/coordination/v2/index.js +6 -0
  104. package/.claude-flow-novice/dist/src/coordination/v2/index.js.map +1 -1
  105. package/.claude-flow-novice/dist/src/coordination/v2/integration/help-deadlock-integration.js +557 -0
  106. package/.claude-flow-novice/dist/src/coordination/v2/integration/help-deadlock-integration.js.map +1 -0
  107. package/.claude-flow-novice/dist/src/coordination/v2/integration/index.js +14 -0
  108. package/.claude-flow-novice/dist/src/coordination/v2/integration/index.js.map +1 -0
  109. package/.claude-flow-novice/dist/src/coordination/v2/integration/message-bus-completion-integration.example.js +212 -0
  110. package/.claude-flow-novice/dist/src/coordination/v2/integration/message-bus-completion-integration.example.js.map +1 -0
  111. package/.claude-flow-novice/dist/src/coordination/v2/integration/message-bus-completion-integration.js +552 -0
  112. package/.claude-flow-novice/dist/src/coordination/v2/integration/message-bus-completion-integration.js.map +1 -0
  113. package/.claude-flow-novice/dist/src/coordination/v2/memory/dependency-storage.js +367 -0
  114. package/.claude-flow-novice/dist/src/coordination/v2/memory/dependency-storage.js.map +1 -0
  115. package/.claude-flow-novice/dist/src/coordination/v2/memory/index.js +1 -0
  116. package/.claude-flow-novice/dist/src/coordination/v2/memory/index.js.map +1 -1
  117. package/.claude-flow-novice/dist/src/coordination/v2/messaging/channel.js +371 -0
  118. package/.claude-flow-novice/dist/src/coordination/v2/messaging/channel.js.map +1 -0
  119. package/.claude-flow-novice/dist/src/coordination/v2/messaging/channels/dependency-channel.js +355 -0
  120. package/.claude-flow-novice/dist/src/coordination/v2/messaging/channels/dependency-channel.js.map +1 -0
  121. package/.claude-flow-novice/dist/src/coordination/v2/messaging/channels/help-channel.js +424 -0
  122. package/.claude-flow-novice/dist/src/coordination/v2/messaging/channels/help-channel.js.map +1 -0
  123. package/.claude-flow-novice/dist/src/coordination/v2/messaging/channels/index.js +16 -0
  124. package/.claude-flow-novice/dist/src/coordination/v2/messaging/channels/index.js.map +1 -0
  125. package/.claude-flow-novice/dist/src/coordination/v2/messaging/channels/state-channel.js +295 -0
  126. package/.claude-flow-novice/dist/src/coordination/v2/messaging/channels/state-channel.js.map +1 -0
  127. package/.claude-flow-novice/dist/src/coordination/v2/messaging/channels/task-channel.js +411 -0
  128. package/.claude-flow-novice/dist/src/coordination/v2/messaging/channels/task-channel.js.map +1 -0
  129. package/.claude-flow-novice/dist/src/coordination/v2/messaging/index.js +14 -0
  130. package/.claude-flow-novice/dist/src/coordination/v2/messaging/index.js.map +1 -0
  131. package/.claude-flow-novice/dist/src/coordination/v2/messaging/message-bus.js +387 -0
  132. package/.claude-flow-novice/dist/src/coordination/v2/messaging/message-bus.js.map +1 -0
  133. package/.claude-flow-novice/dist/src/coordination/v2/messaging/message-persistence.js +589 -0
  134. package/.claude-flow-novice/dist/src/coordination/v2/messaging/message-persistence.js.map +1 -0
  135. package/.claude-flow-novice/dist/src/coordination/v2/messaging/message-router.js +444 -0
  136. package/.claude-flow-novice/dist/src/coordination/v2/messaging/message-router.js.map +1 -0
  137. package/.claude-flow-novice/dist/src/coordination/v2/sdk/checkpoint-manager.js +29 -8
  138. package/.claude-flow-novice/dist/src/coordination/v2/sdk/checkpoint-manager.js.map +1 -1
  139. package/.claude-flow-novice/dist/src/coordination/v2/sdk/help-coordinator.js +470 -0
  140. package/.claude-flow-novice/dist/src/coordination/v2/sdk/help-coordinator.js.map +1 -0
  141. package/.claude-flow-novice/dist/src/coordination/v2/sdk/hierarchical-background-integration.js +450 -0
  142. package/.claude-flow-novice/dist/src/coordination/v2/sdk/hierarchical-background-integration.js.map +1 -0
  143. package/.claude-flow-novice/dist/src/coordination/v2/sdk/index.js +5 -0
  144. package/.claude-flow-novice/dist/src/coordination/v2/sdk/index.js.map +1 -1
  145. package/.claude-flow-novice/dist/src/coordination/v2/sdk/multi-level-control.js +545 -0
  146. package/.claude-flow-novice/dist/src/coordination/v2/sdk/multi-level-control.js.map +1 -0
  147. package/.claude-flow-novice/dist/src/coordination/v2/sdk/query-controller.js +44 -0
  148. package/.claude-flow-novice/dist/src/coordination/v2/sdk/query-controller.js.map +1 -1
  149. package/.claude-flow-novice/dist/src/coordination/v2/sdk/query-message-integration.js +415 -0
  150. package/.claude-flow-novice/dist/src/coordination/v2/sdk/query-message-integration.js.map +1 -0
  151. package/.claude-flow-novice/dist/src/coordination/v2/sdk/session-pool-optimizer.js +615 -0
  152. package/.claude-flow-novice/dist/src/coordination/v2/sdk/session-pool-optimizer.js.map +1 -0
  153. package/.claude-flow-novice/dist/src/coordination/v2/security/payload-validator.js +259 -0
  154. package/.claude-flow-novice/dist/src/coordination/v2/security/payload-validator.js.map +1 -0
  155. package/.claude-flow-novice/dist/src/coordination/v2/transparency/index.js +17 -0
  156. package/.claude-flow-novice/dist/src/coordination/v2/transparency/index.js.map +1 -0
  157. package/.claude-flow-novice/dist/src/coordination/v2/transparency/transparency-integration.js +357 -0
  158. package/.claude-flow-novice/dist/src/coordination/v2/transparency/transparency-integration.js.map +1 -0
  159. package/.claude-flow-novice/dist/src/coordination/v2/transparency/transparency-system.js +679 -0
  160. package/.claude-flow-novice/dist/src/coordination/v2/transparency/transparency-system.js.map +1 -0
  161. package/.claude-flow-novice/dist/src/core/agent-manager.js +30 -0
  162. package/.claude-flow-novice/dist/src/core/agent-manager.js.map +1 -1
  163. package/.claude-flow-novice/dist/src/mcp/server.js +21 -2
  164. package/.claude-flow-novice/dist/src/mcp/server.js.map +1 -1
  165. package/.claude-flow-novice/dist/src/monitoring/apm/apm-integration.js +719 -0
  166. package/.claude-flow-novice/dist/src/monitoring/apm/apm-integration.js.map +1 -0
  167. package/.claude-flow-novice/dist/src/monitoring/apm/datadog-collector.js +363 -0
  168. package/.claude-flow-novice/dist/src/monitoring/apm/datadog-collector.js.map +1 -0
  169. package/.claude-flow-novice/dist/src/monitoring/apm/index.js +97 -0
  170. package/.claude-flow-novice/dist/src/monitoring/apm/index.js.map +1 -0
  171. package/.claude-flow-novice/dist/src/monitoring/apm/newrelic-collector.js +384 -0
  172. package/.claude-flow-novice/dist/src/monitoring/apm/newrelic-collector.js.map +1 -0
  173. package/.claude-flow-novice/dist/src/monitoring/apm/performance-optimizer.js +612 -0
  174. package/.claude-flow-novice/dist/src/monitoring/apm/performance-optimizer.js.map +1 -0
  175. package/.claude-flow-novice/dist/src/monitoring/metrics-collector.js +282 -0
  176. package/.claude-flow-novice/dist/src/monitoring/metrics-collector.js.map +1 -0
  177. package/.claude-flow-novice/dist/src/observability/metrics-counter.js +268 -0
  178. package/.claude-flow-novice/dist/src/observability/metrics-counter.js.map +1 -0
  179. package/.claude-flow-novice/dist/src/observability/metrics-storage.js +265 -0
  180. package/.claude-flow-novice/dist/src/observability/metrics-storage.js.map +1 -0
  181. package/.claude-flow-novice/dist/src/observability/telemetry.js +26 -0
  182. package/.claude-flow-novice/dist/src/observability/telemetry.js.map +1 -1
  183. package/.claude-flow-novice/dist/src/providers/tiered-router.js +64 -10
  184. package/.claude-flow-novice/dist/src/providers/tiered-router.js.map +1 -1
  185. package/.claude-flow-novice/dist/src/providers/zai-provider.js +196 -97
  186. package/.claude-flow-novice/dist/src/providers/zai-provider.js.map +1 -1
  187. package/.claude-flow-novice/dist/src/slash-commands/cfn-claude-sync.js +533 -0
  188. package/.claude-flow-novice/dist/src/slash-commands/index.js +5 -0
  189. package/.claude-flow-novice/dist/src/slash-commands/metrics-summary-class.js +74 -0
  190. package/.claude-flow-novice/dist/src/slash-commands/metrics-summary.js +335 -0
  191. package/.claude-flow-novice/dist/src/slash-commands/register-all-commands.js +12 -0
  192. package/.claude-flow-novice/dist/src/verification/checkpoint-compression-demo.js +96 -0
  193. package/.claude-flow-novice/dist/src/verification/checkpoint-compression-demo.js.map +1 -0
  194. package/.claude-flow-novice/dist/src/verification/checkpoint-compression.js +406 -0
  195. package/.claude-flow-novice/dist/src/verification/checkpoint-compression.js.map +1 -0
  196. package/.claude-flow-novice/dist/src/verification/checkpoint-manager.js +35 -5
  197. package/.claude-flow-novice/dist/src/verification/checkpoint-manager.js.map +1 -1
  198. package/.claude-flow-novice/dist/src/web/api/apm-routes.js +355 -0
  199. package/.claude-flow-novice/dist/src/web/api/apm-routes.js.map +1 -0
  200. package/.claude-flow-novice/dist/src/web/api/config/api-config.js +186 -0
  201. package/.claude-flow-novice/dist/src/web/api/config/api-config.js.map +1 -0
  202. package/.claude-flow-novice/dist/src/web/api/middleware/auth.js +205 -0
  203. package/.claude-flow-novice/dist/src/web/api/middleware/auth.js.map +1 -0
  204. package/.claude-flow-novice/dist/src/web/api/middleware/cache.js +262 -0
  205. package/.claude-flow-novice/dist/src/web/api/middleware/cache.js.map +1 -0
  206. package/.claude-flow-novice/dist/src/web/api/middleware/error-handler.js +250 -0
  207. package/.claude-flow-novice/dist/src/web/api/middleware/error-handler.js.map +1 -0
  208. package/.claude-flow-novice/dist/src/web/api/middleware/request-logger.js +217 -0
  209. package/.claude-flow-novice/dist/src/web/api/middleware/request-logger.js.map +1 -0
  210. package/.claude-flow-novice/dist/src/web/api/middleware/validation.js +325 -0
  211. package/.claude-flow-novice/dist/src/web/api/middleware/validation.js.map +1 -0
  212. package/.claude-flow-novice/dist/src/web/api/routes/events.js +465 -0
  213. package/.claude-flow-novice/dist/src/web/api/routes/events.js.map +1 -0
  214. package/.claude-flow-novice/dist/src/web/api/routes/hierarchy.js +302 -0
  215. package/.claude-flow-novice/dist/src/web/api/routes/hierarchy.js.map +1 -0
  216. package/.claude-flow-novice/dist/src/web/api/routes/index.js +14 -0
  217. package/.claude-flow-novice/dist/src/web/api/routes/index.js.map +1 -0
  218. package/.claude-flow-novice/dist/src/web/api/routes/metrics.js +561 -0
  219. package/.claude-flow-novice/dist/src/web/api/routes/metrics.js.map +1 -0
  220. package/.claude-flow-novice/dist/src/web/api/routes/status.js +450 -0
  221. package/.claude-flow-novice/dist/src/web/api/routes/status.js.map +1 -0
  222. package/.claude-flow-novice/dist/src/web/api/server.js +451 -0
  223. package/.claude-flow-novice/dist/src/web/api/server.js.map +1 -0
  224. package/.claude-flow-novice/dist/src/web/dashboard/hooks/useWebSocket.js +385 -0
  225. package/.claude-flow-novice/dist/src/web/dashboard/hooks/useWebSocket.js.map +1 -0
  226. package/.claude-flow-novice/dist/src/web/dashboard/index.js +87 -0
  227. package/.claude-flow-novice/dist/src/web/dashboard/index.js.map +1 -0
  228. package/.claude-flow-novice/dist/src/web/dashboard/types.js +6 -0
  229. package/.claude-flow-novice/dist/src/web/dashboard/types.js.map +1 -0
  230. package/.claude-flow-novice/dist/src/web/frontend/src/utils/security.js +425 -0
  231. package/.claude-flow-novice/dist/src/web/frontend/src/utils/security.js.map +1 -0
  232. package/.claude-flow-novice/dist/src/web/security/security-middleware.js +379 -0
  233. package/.claude-flow-novice/dist/src/web/security/security-middleware.js.map +1 -0
  234. package/.claude-flow-novice/dist/src/web/websocket/apm-websocket-handler.js +441 -0
  235. package/.claude-flow-novice/dist/src/web/websocket/apm-websocket-handler.js.map +1 -0
  236. package/.claude-flow-novice/dist/src/web/websocket/websocket-manager.js +255 -1
  237. package/.claude-flow-novice/dist/src/web/websocket/websocket-manager.js.map +1 -1
  238. package/.claude-flow-novice/metrics.db +0 -0
  239. package/.claude-flow-novice/metrics.db-shm +0 -0
  240. package/.claude-flow-novice/metrics.db-wal +0 -0
  241. package/AGENT_PERFORMANCE_GUIDELINES.md +88 -0
  242. package/CLAUDE.md +60 -3
  243. package/MEMORY_LEAK_ROOT_CAUSE.md +149 -0
  244. package/README.md +27 -0
  245. package/config/hooks/post-edit-pipeline.js +36 -2
  246. package/examples/metrics-counter-demo.ts +106 -0
  247. package/examples/persistent-metrics-demo.ts +83 -0
  248. package/examples/phase-5-multi-level-control.ts +282 -0
  249. package/examples/session-pool-optimizer-example.ts +311 -0
  250. package/package.json +18 -4
  251. package/scripts/check-routing-stats.cjs +122 -0
  252. package/scripts/monitor-loop.sh +65 -0
  253. package/scripts/monitor-memory.sh +47 -0
  254. package/scripts/monitor.py +43 -0
  255. package/scripts/pre-publish-validation.cjs +212 -0
  256. package/scripts/test-provider-routing.cjs +228 -0
  257. package/scripts/test-routing-telemetry.cjs +147 -0
  258. package/scripts/test-zai-10k.cjs +81 -0
  259. package/scripts/test-zai-api.cjs +191 -0
  260. package/scripts/test-zai-diagnostic.cjs +151 -0
  261. package/scripts/test-zai-final.cjs +128 -0
  262. package/scripts/test-zai-with-env.cjs +85 -0
  263. package/scripts/validate-coordination-cli.js +69 -0
  264. package/scripts/validate-coordination-toggle-integration.cjs +501 -0
  265. package/src/cli/simple-commands/init/templates/CLAUDE.md +29 -0
  266. package/src/observability/metrics-counter.ts +347 -0
  267. package/src/observability/metrics-storage.ts +356 -0
  268. package/src/observability/telemetry.ts +658 -0
  269. package/src/slash-commands/cfn-claude-sync.js +533 -0
  270. package/src/slash-commands/index.js +5 -0
  271. package/src/slash-commands/metrics-summary-class.js +74 -0
  272. package/src/slash-commands/metrics-summary.js +335 -0
  273. package/src/slash-commands/register-all-commands.js +12 -0
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: product-owner
3
3
  description: "CFN Loop Product Owner using Goal-Oriented Action Planning (GOAP) for autonomous scope enforcement and decision authority. Uses A* search algorithms to find optimal paths through decision spaces while maintaining strict scope boundaries. MUST BE USED after consensus validation when score <90% or validators suggest out-of-scope work. Use PROACTIVELY for scope enforcement, trade-off decisions, phase approval, and autonomous CFN Loop progression. ALWAYS delegate when consensus fails, scope creep detected, or critical decision needed. Keywords - GOAP, product owner, scope enforcement, autonomous decision, CFN Loop, consensus validation, trade-off analysis, A* search, decision authority"
4
- tools: [Read, Write, Edit, Bash, TodoWrite, mcp__claude-flow-novice__memory_usage, mcp__claude-flow-novice__swarm_status]
4
+ tools: Read, Write, Edit, Bash, TodoWrite, mcp__claude-flow-novice__memory_usage, mcp__claude-flow-novice__swarm_status
5
5
  model: sonnet
6
6
  provider: anthropic
7
7
  color: purple
@@ -39,6 +39,8 @@ npx claude-flow-novice hooks post-edit [FILE_PATH] --memory-key "product-owner/d
39
39
  - **Phase Approval**: Approve phase transitions based on goal state achievement
40
40
  - **Trade-off Resolution**: Resolve security vs velocity, quality vs speed decisions
41
41
  - **Loop Progression**: Drive autonomous CFN Loop continuation without permission
42
+ - **Backlog Management**: Add deferred tasks to todo list to ensure visibility and future implementation
43
+ - **Session Continuation**: Provide clear decisions to continue sessions or stop for user feedback (rare)
42
44
 
43
45
  ### 3. GOAP Algorithm Execution
44
46
  - **State Space Reasoning**: Current state → Goal state transformation
@@ -328,6 +330,7 @@ if (consensusScore < 0.90) {
328
330
  },
329
331
  "scope_impact": "maintained",
330
332
  "deferred_items": ["JWT auth - out of scope"],
333
+ "backlog_todo_added": ["Implement JWT authentication (Phase 2)"],
331
334
  "next_action": "IMMEDIATELY spawn Loop 3 agents"
332
335
  }
333
336
  `, "product-owner")
@@ -470,7 +473,8 @@ const act = (decision: Decision): void => {
470
473
  if (decision.decision === "PROCEED") {
471
474
  spawnLoop3Agents(decision.agents, decision.focus);
472
475
  } else if (decision.decision === "DEFER") {
473
- saveToBa cklog(decision.deferredItems);
476
+ saveToBacklog(decision.deferredItems);
477
+ addBacklogItemsToTodoList(decision.deferredItems);
474
478
  approvePhase();
475
479
  } else if (decision.decision === "ESCALATE") {
476
480
  generateEscalationReport(decision.options);
@@ -586,6 +590,7 @@ const actions = [
586
590
  "reasoning": "JWT authentication is out-of-scope for Phase 1 (internal-only admin process). A* search assigned cost=1000 to scope expansion, cost=20 to defer.",
587
591
  "action": "defer_to_backlog",
588
592
  "deferred_items": ["JWT authentication with RS256 - Phase 2 candidate"],
593
+ "backlog_todo_added": ["Implement JWT authentication with RS256 (Phase 2)"],
589
594
  "current_action": "Approve phase with basic auth (in-scope implementation)",
590
595
  "next_action": "AUTO-TRANSITION to Phase 2"
591
596
  }
@@ -726,6 +731,47 @@ mcp__claude-flow-novice__memory_usage({
726
731
  - **Store**: Decision rationale, deferred items, lessons learned
727
732
  - **Share**: Context for future Product Owner decisions
728
733
 
734
+ ## Backlog Todo Management
735
+
736
+ ### Adding Deferred Items to Todo List
737
+
738
+ **MANDATORY**: When deferring items to backlog, also add them to the todo list to ensure visibility:
739
+
740
+ ```typescript
741
+ const addBacklogItemsToTodoList = (deferredItems: string[]): void => {
742
+ TodoWrite({
743
+ todos: deferredItems.map(item => ({
744
+ content: item,
745
+ status: "pending",
746
+ activeForm: `Deferred to backlog: ${item}`
747
+ }))
748
+ });
749
+ };
750
+ ```
751
+
752
+ **Benefits:**
753
+ - Ensures deferred items remain visible
754
+ - Provides context for future phase planning
755
+ - Prevents forgotten scope creep
756
+ - Maintains traceability of out-of-scope decisions
757
+
758
+ ### Session Continuation Decisions
759
+
760
+ **CRITICAL**: Product Owner must provide clear session continuation guidance:
761
+
762
+ ```json
763
+ {
764
+ "session_decision": "CONTINUE|STOP|REQUEST_FEEDBACK",
765
+ "session_rationale": "Why session should continue or stop",
766
+ "next_milestone": "What will be accomplished in next phase/iteration"
767
+ }
768
+ ```
769
+
770
+ **Decision Guidelines:**
771
+ - **CONTINUE**: Default for all normal operations (>95% of cases)
772
+ - **STOP**: Only for critical errors, ambiguous requirements, or explicit user request
773
+ - **REQUEST_FEEDBACK**: Rare - only when truly blocked or high-risk decisions needed
774
+
729
775
  ## Anti-Patterns to Avoid
730
776
 
731
777
  **❌ FORBIDDEN Behaviors:**
@@ -734,6 +780,7 @@ mcp__claude-flow-novice__memory_usage({
734
780
  3. **Subjective Decisions**: Making trade-offs based on "feeling" vs GOAP analysis
735
781
  4. **Premature Escalation**: Escalating before attempting GOAP optimization
736
782
  5. **Ignoring Iteration Limits**: Continuing beyond Loop 2/3 max iterations
783
+ 6. **Forgotten Backlog**: Deferring items without adding to todo list (loses visibility)
737
784
 
738
785
  **✅ REQUIRED Behaviors:**
739
786
  1. **Autonomous Execution**: Execute GOAP decision immediately without permission
@@ -741,6 +788,7 @@ mcp__claude-flow-novice__memory_usage({
741
788
  3. **Algorithmic Decisions**: Use A* search for all trade-off evaluations
742
789
  4. **Transparent Reasoning**: Output full GOAP analysis in structured JSON
743
790
  5. **Continuous Learning**: Store decision outcomes for future optimization
791
+ 6. **Backlog Visibility**: Add all deferred items to todo list for future implementation
744
792
 
745
793
  ## Example Session
746
794
 
@@ -780,8 +828,10 @@ ACT:
780
828
  "architect: Add HELPING state to state machine"
781
829
  ],
782
830
  "deferred_items": ["JWT authentication - out of scope for internal tool"],
831
+ "backlog_todo_added": ["Implement JWT authentication for internal tool (future phase)"],
783
832
  "next_action": "IMMEDIATELY spawning Loop 3 Iteration 3/10",
784
- "autonomous_execution": true
833
+ "autonomous_execution": true,
834
+ "session_decision": "CONTINUE"
785
835
  }
786
836
 
787
837
  [Loop 3 agents spawning NOW - no approval needed]
@@ -789,4 +839,4 @@ ACT:
789
839
 
790
840
  ---
791
841
 
792
- **Remember**: You are an algorithmic decision-maker, not a human proxy. Use GOAP to find optimal paths, enforce scope ruthlessly through cost functions, and execute decisions autonomously. The CFN Loop depends on your ability to make fast, optimal, scope-aware decisions that keep the project moving forward.
842
+ **Remember**: You are an algorithmic decision-maker, not a human proxy. Use GOAP to find optimal paths, enforce scope ruthlessly through cost functions, and execute decisions autonomously. The CFN Loop depends on your ability to make fast, optimal, scope-aware decisions that keep the project moving forward. Always maintain backlog visibility through todo list integration and provide clear session continuation guidance.
@@ -0,0 +1,303 @@
1
+ ---
2
+ description: "Sync CFN Loop rules from CLAUDE.md to slash command files (DRY principle enforcement)"
3
+ argument-hint: "[--dry-run] [--verbose]"
4
+ allowed-tools: ["Read", "Write", "Edit", "Bash", "Glob", "Grep"]
5
+ ---
6
+
7
+ # CFN Claude Sync - Synchronize CFN Loop Documentation
8
+
9
+ Automatically synchronize CFN Loop rules from CLAUDE.md to all slash command files, ensuring single source of truth.
10
+
11
+ **Task**: Sync CFN Loop configuration across codebase
12
+
13
+ ## What This Command Does
14
+
15
+ 1. **Extracts** CFN Loop rules from CLAUDE.md (consensus thresholds, confidence gates, iteration limits, loop structure)
16
+ 2. **Updates** `.claude/commands/cfn-loop*.md` markdown templates with extracted rules
17
+ 3. **Updates** `src/slash-commands/cfn-loop*.js` JavaScript generators with extracted configuration
18
+ 4. **Validates** consistency across all CFN Loop files
19
+ 5. **Reports** changes made and any conflicts detected
20
+
21
+ ## Command Options
22
+
23
+ ```bash
24
+ /cfn-claude-sync # Sync all CFN Loop files
25
+ /cfn-claude-sync --dry-run # Preview changes without writing
26
+ /cfn-claude-sync --verbose # Show detailed extraction and replacement
27
+ ```
28
+
29
+ **Options:**
30
+ - `--dry-run`: Show what would change without modifying files
31
+ - `--verbose`: Display detailed sync process and extracted values
32
+
33
+ ## Extracted Configuration
34
+
35
+ The sync process extracts these values from CLAUDE.md:
36
+
37
+ ```yaml
38
+ cfn_loop_config:
39
+ consensus_threshold: "≥90%" # Loop 2 consensus requirement
40
+ confidence_gate: "≥75%" # Loop 3 self-assessment gate
41
+ loop2_max_iterations: 10 # Consensus validation max
42
+ loop3_max_iterations: 10 # Primary swarm max
43
+
44
+ complexity_tiers:
45
+ simple: { agents: "2-3", topology: "mesh" }
46
+ medium: { agents: "4-6", topology: "mesh" }
47
+ complex: { agents: "8-12", topology: "hierarchical" }
48
+ enterprise: { agents: "15-20", topology: "hierarchical" }
49
+
50
+ goap_decision_types:
51
+ - "PROCEED" # In-scope blockers → retry Loop 3
52
+ - "DEFER" # Out-of-scope → backlog
53
+ - "ESCALATE" # Critical ambiguity → human
54
+
55
+ autonomous_rules:
56
+ - "NO approval needed for retries"
57
+ - "IMMEDIATE relaunch on consensus failure"
58
+ - "AUTO-TRANSITION on phase completion"
59
+ ```
60
+
61
+ ## Files Updated
62
+
63
+ ### 1. Markdown Templates (4 files)
64
+ - `.claude/commands/cfn-loop.md`
65
+ - `.claude/commands/cfn-loop-epic.md`
66
+ - `.claude/commands/cfn-loop-sprints.md`
67
+ - `.claude/commands/cfn-loop-single.md`
68
+
69
+ ### 2. JavaScript Generators (4 files)
70
+ - `src/slash-commands/cfn-loop.js`
71
+ - `src/slash-commands/cfn-loop-epic.js`
72
+ - `src/slash-commands/cfn-loop-sprints.js`
73
+ - `src/slash-commands/cfn-loop-single.js`
74
+
75
+ ## Sync Process
76
+
77
+ ### Step 1: Extract from CLAUDE.md
78
+
79
+ ```javascript
80
+ // Read CLAUDE.md
81
+ const claudeMd = Read("CLAUDE.md");
82
+
83
+ // Extract CFN Loop section
84
+ const cfnSection = extractSection(claudeMd, "## 🔄 MANDATORY CFN LOOP");
85
+
86
+ // Parse configuration values
87
+ const config = {
88
+ consensusThreshold: extractPattern(cfnSection, /≥(\d+)%.*consensus/i),
89
+ confidenceGate: extractPattern(cfnSection, /≥(\d+)%.*confidence/i),
90
+ loop2Max: extractPattern(cfnSection, /Loop 2.*max.*?(\d+)/i),
91
+ loop3Max: extractPattern(cfnSection, /Loop 3.*max.*?(\d+)/i),
92
+ // ... additional extractions
93
+ };
94
+ ```
95
+
96
+ ### Step 2: Update Markdown Templates
97
+
98
+ ```javascript
99
+ // For each .claude/commands/cfn-loop*.md file
100
+ const mdFiles = Glob(".claude/commands/cfn-loop*.md");
101
+
102
+ for (const file of mdFiles) {
103
+ const content = Read(file);
104
+
105
+ // Replace consensus threshold
106
+ const updated = content.replace(
107
+ /≥\d+%.*Byzantine consensus/g,
108
+ `≥${config.consensusThreshold}% Byzantine consensus`
109
+ );
110
+
111
+ // Replace confidence gate
112
+ updated = updated.replace(
113
+ /ALL agents ≥\d+%/g,
114
+ `ALL agents ≥${config.confidenceGate}%`
115
+ );
116
+
117
+ // Replace iteration limits
118
+ updated = updated.replace(
119
+ /max.*?(\d+) iterations/g,
120
+ `max ${config.loop2Max} iterations`
121
+ );
122
+
123
+ Write(file, updated);
124
+ }
125
+ ```
126
+
127
+ ### Step 3: Update JavaScript Generators
128
+
129
+ ```javascript
130
+ // For each src/slash-commands/cfn-loop*.js file
131
+ const jsFiles = Glob("src/slash-commands/cfn-loop*.js");
132
+
133
+ for (const file of jsFiles) {
134
+ const content = Read(file);
135
+
136
+ // Update default values in parseArgs()
137
+ const updated = content.replace(
138
+ /maxLoop2:\s*\d+/,
139
+ `maxLoop2: ${config.loop2Max}`
140
+ );
141
+
142
+ updated = updated.replace(
143
+ /maxLoop3:\s*\d+/,
144
+ `maxLoop3: ${config.loop3Max}`
145
+ );
146
+
147
+ // Update complexity tiers in getSwarmConfig()
148
+ updated = updated.replace(
149
+ /simple:\s*\{\s*agentCount:\s*\d+/,
150
+ `simple: { agentCount: ${config.complexity.simple.min}`
151
+ );
152
+
153
+ Write(file, updated);
154
+ }
155
+ ```
156
+
157
+ ### Step 4: Validation
158
+
159
+ ```javascript
160
+ // Verify all files now match CLAUDE.md
161
+ const validationResults = [];
162
+
163
+ for (const file of [...mdFiles, ...jsFiles]) {
164
+ const content = Read(file);
165
+
166
+ const checks = {
167
+ consensusThreshold: content.includes(`≥${config.consensusThreshold}%`),
168
+ confidenceGate: content.includes(`≥${config.confidenceGate}%`),
169
+ loop2Max: content.includes(config.loop2Max.toString()),
170
+ loop3Max: content.includes(config.loop3Max.toString()),
171
+ };
172
+
173
+ validationResults.push({ file, checks });
174
+ }
175
+
176
+ // Report any mismatches
177
+ const failures = validationResults.filter(r =>
178
+ !Object.values(r.checks).every(Boolean)
179
+ );
180
+
181
+ if (failures.length > 0) {
182
+ console.error("Validation failures:", failures);
183
+ }
184
+ ```
185
+
186
+ ## Output Format
187
+
188
+ ### Dry Run Output
189
+ ```
190
+ 🔍 CFN Claude Sync (DRY RUN)
191
+
192
+ Extracted from CLAUDE.md:
193
+ Consensus threshold: ≥90%
194
+ Confidence gate: ≥75%
195
+ Loop 2 max iterations: 10
196
+ Loop 3 max iterations: 10
197
+
198
+ Changes to be made:
199
+ .claude/commands/cfn-loop.md:
200
+ Line 20: ≥85% → ≥90% (consensus)
201
+ Line 63: ≥70% → ≥75% (confidence gate)
202
+
203
+ src/slash-commands/cfn-loop.js:
204
+ Line 92: maxLoop2: 5 → maxLoop2: 10
205
+ Line 93: maxLoop3: 15 → maxLoop3: 10
206
+
207
+ Total files to update: 8
208
+ Run without --dry-run to apply changes.
209
+ ```
210
+
211
+ ### Actual Sync Output
212
+ ```
213
+ ✅ CFN Claude Sync Complete
214
+
215
+ Updated files:
216
+ ✅ .claude/commands/cfn-loop.md (2 changes)
217
+ ✅ .claude/commands/cfn-loop-epic.md (3 changes)
218
+ ✅ .claude/commands/cfn-loop-sprints.md (2 changes)
219
+ ✅ .claude/commands/cfn-loop-single.md (2 changes)
220
+ ✅ src/slash-commands/cfn-loop.js (2 changes)
221
+ ✅ src/slash-commands/cfn-loop-epic.js (2 changes)
222
+ ✅ src/slash-commands/cfn-loop-sprints.js (2 changes)
223
+ ✅ src/slash-commands/cfn-loop-single.js (2 changes)
224
+
225
+ Validation: ALL PASSED ✅
226
+
227
+ Configuration now synchronized:
228
+ Consensus threshold: ≥90%
229
+ Confidence gate: ≥75%
230
+ Loop 2 max: 10 iterations
231
+ Loop 3 max: 10 iterations
232
+ ```
233
+
234
+ ## Error Handling
235
+
236
+ ### Missing CLAUDE.md
237
+ ```
238
+ ❌ Error: CLAUDE.md not found in project root
239
+ Please ensure CLAUDE.md exists before running sync.
240
+ ```
241
+
242
+ ### Parse Failures
243
+ ```
244
+ ⚠️ Warning: Could not extract consensus threshold from CLAUDE.md
245
+ Using fallback value: ≥90%
246
+ ```
247
+
248
+ ### Validation Failures
249
+ ```
250
+ ❌ Validation failed for 2 files:
251
+ src/slash-commands/cfn-loop.js:
252
+ Expected maxLoop2: 10, found: 5
253
+ .claude/commands/cfn-loop-epic.md:
254
+ Expected ≥90% consensus, found: ≥85%
255
+
256
+ Please review and manually fix inconsistencies.
257
+ ```
258
+
259
+ ## Safety Features
260
+
261
+ 1. **Backup Creation**: Original files backed up to `.claude/backups/cfn-sync-{timestamp}/`
262
+ 2. **Atomic Updates**: All files updated in transaction (rollback on any failure)
263
+ 3. **Git Integration**: Auto-commit with message "chore: sync CFN Loop from CLAUDE.md"
264
+ 4. **Conflict Detection**: Warns if custom modifications detected in target files
265
+
266
+ ## Integration Example
267
+
268
+ ```bash
269
+ # After editing CLAUDE.md CFN Loop section
270
+ /cfn-claude-sync --verbose
271
+
272
+ # Review changes in dry-run mode first
273
+ /cfn-claude-sync --dry-run
274
+
275
+ # Apply changes
276
+ /cfn-claude-sync
277
+ ```
278
+
279
+ ## Next Steps After Sync
280
+
281
+ After sync completes:
282
+ 1. ✅ Review git diff to verify changes
283
+ 2. ✅ Run tests: `npm test`
284
+ 3. ✅ Validate slash commands: `/cfn-loop "test task" --dry-run`
285
+ 4. ✅ Commit changes: `git commit -m "chore: sync CFN Loop configuration"`
286
+
287
+ ## Maintenance
288
+
289
+ **When to run this command:**
290
+ - After editing CFN Loop rules in CLAUDE.md
291
+ - Before publishing new package version
292
+ - When adding new CFN Loop slash commands
293
+ - During CFN Loop architecture refactoring
294
+
295
+ **Automation:**
296
+ Add to pre-commit hook:
297
+ ```bash
298
+ # .git/hooks/pre-commit
299
+ if git diff --cached --name-only | grep -q "CLAUDE.md"; then
300
+ /cfn-claude-sync --dry-run
301
+ echo "⚠️ CLAUDE.md changed - run /cfn-claude-sync before committing"
302
+ fi
303
+ ```