claude-flow-novice 1.6.1 → 1.6.2

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 (244) 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 +4 -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/claude-client.js +138 -3
  14. package/.claude-flow-novice/dist/src/api/claude-client.js.map +1 -1
  15. package/.claude-flow-novice/dist/src/cfn-loop/phase-orchestrator-example.js +1 -1
  16. package/.claude-flow-novice/dist/src/cfn-loop/scope-control.js +247 -0
  17. package/.claude-flow-novice/dist/src/cfn-loop/scope-control.js.map +1 -0
  18. package/.claude-flow-novice/dist/src/cli/commands/swarm.js +32 -15
  19. package/.claude-flow-novice/dist/src/cli/commands/swarm.js.map +1 -1
  20. package/.claude-flow-novice/dist/src/cli/commands/transparency.js +455 -0
  21. package/.claude-flow-novice/dist/src/cli/commands/transparency.js.map +1 -0
  22. package/.claude-flow-novice/dist/src/cli/simple-commands/init/templates/CLAUDE.md +129 -13
  23. package/.claude-flow-novice/dist/src/components/visualizations/index.js +9 -0
  24. package/.claude-flow-novice/dist/src/components/visualizations/index.js.map +1 -0
  25. package/.claude-flow-novice/dist/src/coordination/adapters/v1-coordinator-adapter.js +462 -0
  26. package/.claude-flow-novice/dist/src/coordination/adapters/v1-coordinator-adapter.js.map +1 -0
  27. package/.claude-flow-novice/dist/src/coordination/config-translator.js +248 -0
  28. package/.claude-flow-novice/dist/src/coordination/config-translator.js.map +1 -0
  29. package/.claude-flow-novice/dist/src/coordination/coordination-toggle.js +287 -0
  30. package/.claude-flow-novice/dist/src/coordination/coordination-toggle.js.map +1 -0
  31. package/.claude-flow-novice/dist/src/coordination/distributed-consensus.js +68 -9
  32. package/.claude-flow-novice/dist/src/coordination/distributed-consensus.js.map +1 -1
  33. package/.claude-flow-novice/dist/src/coordination/feature-flags.js +166 -0
  34. package/.claude-flow-novice/dist/src/coordination/feature-flags.js.map +1 -0
  35. package/.claude-flow-novice/dist/src/coordination/queen-agent.js +18 -4
  36. package/.claude-flow-novice/dist/src/coordination/queen-agent.js.map +1 -1
  37. package/.claude-flow-novice/dist/src/coordination/role-assignment.js +6 -110
  38. package/.claude-flow-novice/dist/src/coordination/role-assignment.js.map +1 -1
  39. package/.claude-flow-novice/dist/src/coordination/v2/cache/artifact-cache-optimizer.js +632 -0
  40. package/.claude-flow-novice/dist/src/coordination/v2/cache/artifact-cache-optimizer.js.map +1 -0
  41. package/.claude-flow-novice/dist/src/coordination/v2/cache/index.js +11 -0
  42. package/.claude-flow-novice/dist/src/coordination/v2/cache/index.js.map +1 -0
  43. package/.claude-flow-novice/dist/src/coordination/v2/checkpoints/checkpoint-compressor.js +318 -0
  44. package/.claude-flow-novice/dist/src/coordination/v2/checkpoints/checkpoint-compressor.js.map +1 -0
  45. package/.claude-flow-novice/dist/src/coordination/v2/coordinators/cascading-shutdown.example.js +364 -0
  46. package/.claude-flow-novice/dist/src/coordination/v2/coordinators/cascading-shutdown.example.js.map +1 -0
  47. package/.claude-flow-novice/dist/src/coordination/v2/coordinators/cascading-shutdown.js +492 -0
  48. package/.claude-flow-novice/dist/src/coordination/v2/coordinators/cascading-shutdown.js.map +1 -0
  49. package/.claude-flow-novice/dist/src/coordination/v2/coordinators/hierarchical-coordinator.js +786 -0
  50. package/.claude-flow-novice/dist/src/coordination/v2/coordinators/hierarchical-coordinator.js.map +1 -0
  51. package/.claude-flow-novice/dist/src/coordination/v2/coordinators/index.js +16 -0
  52. package/.claude-flow-novice/dist/src/coordination/v2/coordinators/index.js.map +1 -0
  53. package/.claude-flow-novice/dist/src/coordination/v2/coordinators/parent-child-manager.js +342 -0
  54. package/.claude-flow-novice/dist/src/coordination/v2/coordinators/parent-child-manager.js.map +1 -0
  55. package/.claude-flow-novice/dist/src/coordination/v2/coordinators/swarm-coordinator-v2.js +601 -0
  56. package/.claude-flow-novice/dist/src/coordination/v2/coordinators/swarm-coordinator-v2.js.map +1 -0
  57. package/.claude-flow-novice/dist/src/coordination/v2/core/help-request-metrics.js +211 -0
  58. package/.claude-flow-novice/dist/src/coordination/v2/core/help-request-metrics.js.map +1 -0
  59. package/.claude-flow-novice/dist/src/coordination/v2/core/index.js +1 -0
  60. package/.claude-flow-novice/dist/src/coordination/v2/core/index.js.map +1 -1
  61. package/.claude-flow-novice/dist/src/coordination/v2/core/message-broker.js +365 -6
  62. package/.claude-flow-novice/dist/src/coordination/v2/core/message-broker.js.map +1 -1
  63. package/.claude-flow-novice/dist/src/coordination/v2/core/resource-manager-safe.js +478 -0
  64. package/.claude-flow-novice/dist/src/coordination/v2/core/resource-manager-safe.js.map +1 -0
  65. package/.claude-flow-novice/dist/src/coordination/v2/core/state-machine-config.js +5 -2
  66. package/.claude-flow-novice/dist/src/coordination/v2/core/state-machine-config.js.map +1 -1
  67. package/.claude-flow-novice/dist/src/coordination/v2/core/state-machine.js +189 -0
  68. package/.claude-flow-novice/dist/src/coordination/v2/core/state-machine.js.map +1 -1
  69. package/.claude-flow-novice/dist/src/coordination/v2/deadlock/deadlock-detector.js +424 -0
  70. package/.claude-flow-novice/dist/src/coordination/v2/deadlock/deadlock-detector.js.map +1 -0
  71. package/.claude-flow-novice/dist/src/coordination/v2/deadlock/index.js +9 -0
  72. package/.claude-flow-novice/dist/src/coordination/v2/deadlock/index.js.map +1 -0
  73. package/.claude-flow-novice/dist/src/coordination/v2/deadlock/resource-manager.js +669 -0
  74. package/.claude-flow-novice/dist/src/coordination/v2/deadlock/resource-manager.js.map +1 -0
  75. package/.claude-flow-novice/dist/src/coordination/v2/dependency/artifact-storage.js +451 -0
  76. package/.claude-flow-novice/dist/src/coordination/v2/dependency/artifact-storage.js.map +1 -0
  77. package/.claude-flow-novice/dist/src/coordination/v2/dependency/cycle-detector.js +271 -0
  78. package/.claude-flow-novice/dist/src/coordination/v2/dependency/cycle-detector.js.map +1 -0
  79. package/.claude-flow-novice/dist/src/coordination/v2/dependency/dependency-graph.js +335 -0
  80. package/.claude-flow-novice/dist/src/coordination/v2/dependency/dependency-graph.js.map +1 -0
  81. package/.claude-flow-novice/dist/src/coordination/v2/dependency/dependency-manager.js +439 -0
  82. package/.claude-flow-novice/dist/src/coordination/v2/dependency/dependency-manager.js.map +1 -0
  83. package/.claude-flow-novice/dist/src/coordination/v2/dependency/dependency-request.js +92 -0
  84. package/.claude-flow-novice/dist/src/coordination/v2/dependency/dependency-request.js.map +1 -0
  85. package/.claude-flow-novice/dist/src/coordination/v2/dependency/index.js +21 -0
  86. package/.claude-flow-novice/dist/src/coordination/v2/dependency/index.js.map +1 -0
  87. package/.claude-flow-novice/dist/src/coordination/v2/dependency/topological-sort.js +223 -0
  88. package/.claude-flow-novice/dist/src/coordination/v2/dependency/topological-sort.js.map +1 -0
  89. package/.claude-flow-novice/dist/src/coordination/v2/help-system/help-coordinator.js +436 -0
  90. package/.claude-flow-novice/dist/src/coordination/v2/help-system/help-coordinator.js.map +1 -0
  91. package/.claude-flow-novice/dist/src/coordination/v2/help-system/help-matcher.js +278 -0
  92. package/.claude-flow-novice/dist/src/coordination/v2/help-system/help-matcher.js.map +1 -0
  93. package/.claude-flow-novice/dist/src/coordination/v2/help-system/help-request-handler.js +317 -0
  94. package/.claude-flow-novice/dist/src/coordination/v2/help-system/help-request-handler.js.map +1 -0
  95. package/.claude-flow-novice/dist/src/coordination/v2/help-system/help-request.js +273 -0
  96. package/.claude-flow-novice/dist/src/coordination/v2/help-system/help-request.js.map +1 -0
  97. package/.claude-flow-novice/dist/src/coordination/v2/help-system/index.js +15 -0
  98. package/.claude-flow-novice/dist/src/coordination/v2/help-system/index.js.map +1 -0
  99. package/.claude-flow-novice/dist/src/coordination/v2/help-system/waiting-agent-pool.js +512 -0
  100. package/.claude-flow-novice/dist/src/coordination/v2/help-system/waiting-agent-pool.js.map +1 -0
  101. package/.claude-flow-novice/dist/src/coordination/v2/index.js +6 -0
  102. package/.claude-flow-novice/dist/src/coordination/v2/index.js.map +1 -1
  103. package/.claude-flow-novice/dist/src/coordination/v2/integration/help-deadlock-integration.js +557 -0
  104. package/.claude-flow-novice/dist/src/coordination/v2/integration/help-deadlock-integration.js.map +1 -0
  105. package/.claude-flow-novice/dist/src/coordination/v2/integration/index.js +14 -0
  106. package/.claude-flow-novice/dist/src/coordination/v2/integration/index.js.map +1 -0
  107. package/.claude-flow-novice/dist/src/coordination/v2/integration/message-bus-completion-integration.example.js +212 -0
  108. package/.claude-flow-novice/dist/src/coordination/v2/integration/message-bus-completion-integration.example.js.map +1 -0
  109. package/.claude-flow-novice/dist/src/coordination/v2/integration/message-bus-completion-integration.js +552 -0
  110. package/.claude-flow-novice/dist/src/coordination/v2/integration/message-bus-completion-integration.js.map +1 -0
  111. package/.claude-flow-novice/dist/src/coordination/v2/memory/dependency-storage.js +367 -0
  112. package/.claude-flow-novice/dist/src/coordination/v2/memory/dependency-storage.js.map +1 -0
  113. package/.claude-flow-novice/dist/src/coordination/v2/memory/index.js +1 -0
  114. package/.claude-flow-novice/dist/src/coordination/v2/memory/index.js.map +1 -1
  115. package/.claude-flow-novice/dist/src/coordination/v2/messaging/channel.js +371 -0
  116. package/.claude-flow-novice/dist/src/coordination/v2/messaging/channel.js.map +1 -0
  117. package/.claude-flow-novice/dist/src/coordination/v2/messaging/channels/dependency-channel.js +355 -0
  118. package/.claude-flow-novice/dist/src/coordination/v2/messaging/channels/dependency-channel.js.map +1 -0
  119. package/.claude-flow-novice/dist/src/coordination/v2/messaging/channels/help-channel.js +424 -0
  120. package/.claude-flow-novice/dist/src/coordination/v2/messaging/channels/help-channel.js.map +1 -0
  121. package/.claude-flow-novice/dist/src/coordination/v2/messaging/channels/index.js +16 -0
  122. package/.claude-flow-novice/dist/src/coordination/v2/messaging/channels/index.js.map +1 -0
  123. package/.claude-flow-novice/dist/src/coordination/v2/messaging/channels/state-channel.js +295 -0
  124. package/.claude-flow-novice/dist/src/coordination/v2/messaging/channels/state-channel.js.map +1 -0
  125. package/.claude-flow-novice/dist/src/coordination/v2/messaging/channels/task-channel.js +411 -0
  126. package/.claude-flow-novice/dist/src/coordination/v2/messaging/channels/task-channel.js.map +1 -0
  127. package/.claude-flow-novice/dist/src/coordination/v2/messaging/index.js +14 -0
  128. package/.claude-flow-novice/dist/src/coordination/v2/messaging/index.js.map +1 -0
  129. package/.claude-flow-novice/dist/src/coordination/v2/messaging/message-bus.js +387 -0
  130. package/.claude-flow-novice/dist/src/coordination/v2/messaging/message-bus.js.map +1 -0
  131. package/.claude-flow-novice/dist/src/coordination/v2/messaging/message-persistence.js +589 -0
  132. package/.claude-flow-novice/dist/src/coordination/v2/messaging/message-persistence.js.map +1 -0
  133. package/.claude-flow-novice/dist/src/coordination/v2/messaging/message-router.js +444 -0
  134. package/.claude-flow-novice/dist/src/coordination/v2/messaging/message-router.js.map +1 -0
  135. package/.claude-flow-novice/dist/src/coordination/v2/sdk/checkpoint-manager.js +29 -8
  136. package/.claude-flow-novice/dist/src/coordination/v2/sdk/checkpoint-manager.js.map +1 -1
  137. package/.claude-flow-novice/dist/src/coordination/v2/sdk/help-coordinator.js +470 -0
  138. package/.claude-flow-novice/dist/src/coordination/v2/sdk/help-coordinator.js.map +1 -0
  139. package/.claude-flow-novice/dist/src/coordination/v2/sdk/hierarchical-background-integration.js +450 -0
  140. package/.claude-flow-novice/dist/src/coordination/v2/sdk/hierarchical-background-integration.js.map +1 -0
  141. package/.claude-flow-novice/dist/src/coordination/v2/sdk/index.js +5 -0
  142. package/.claude-flow-novice/dist/src/coordination/v2/sdk/index.js.map +1 -1
  143. package/.claude-flow-novice/dist/src/coordination/v2/sdk/multi-level-control.js +545 -0
  144. package/.claude-flow-novice/dist/src/coordination/v2/sdk/multi-level-control.js.map +1 -0
  145. package/.claude-flow-novice/dist/src/coordination/v2/sdk/query-controller.js +44 -0
  146. package/.claude-flow-novice/dist/src/coordination/v2/sdk/query-controller.js.map +1 -1
  147. package/.claude-flow-novice/dist/src/coordination/v2/sdk/query-message-integration.js +415 -0
  148. package/.claude-flow-novice/dist/src/coordination/v2/sdk/query-message-integration.js.map +1 -0
  149. package/.claude-flow-novice/dist/src/coordination/v2/sdk/session-pool-optimizer.js +615 -0
  150. package/.claude-flow-novice/dist/src/coordination/v2/sdk/session-pool-optimizer.js.map +1 -0
  151. package/.claude-flow-novice/dist/src/coordination/v2/security/payload-validator.js +259 -0
  152. package/.claude-flow-novice/dist/src/coordination/v2/security/payload-validator.js.map +1 -0
  153. package/.claude-flow-novice/dist/src/coordination/v2/transparency/index.js +17 -0
  154. package/.claude-flow-novice/dist/src/coordination/v2/transparency/index.js.map +1 -0
  155. package/.claude-flow-novice/dist/src/coordination/v2/transparency/transparency-integration.js +357 -0
  156. package/.claude-flow-novice/dist/src/coordination/v2/transparency/transparency-integration.js.map +1 -0
  157. package/.claude-flow-novice/dist/src/coordination/v2/transparency/transparency-system.js +679 -0
  158. package/.claude-flow-novice/dist/src/coordination/v2/transparency/transparency-system.js.map +1 -0
  159. package/.claude-flow-novice/dist/src/core/agent-manager.js +30 -0
  160. package/.claude-flow-novice/dist/src/core/agent-manager.js.map +1 -1
  161. package/.claude-flow-novice/dist/src/mcp/server.js +21 -2
  162. package/.claude-flow-novice/dist/src/mcp/server.js.map +1 -1
  163. package/.claude-flow-novice/dist/src/observability/metrics-counter.js +268 -0
  164. package/.claude-flow-novice/dist/src/observability/metrics-counter.js.map +1 -0
  165. package/.claude-flow-novice/dist/src/observability/metrics-storage.js +265 -0
  166. package/.claude-flow-novice/dist/src/observability/metrics-storage.js.map +1 -0
  167. package/.claude-flow-novice/dist/src/observability/telemetry.js +26 -0
  168. package/.claude-flow-novice/dist/src/observability/telemetry.js.map +1 -1
  169. package/.claude-flow-novice/dist/src/providers/tiered-router.js +64 -10
  170. package/.claude-flow-novice/dist/src/providers/tiered-router.js.map +1 -1
  171. package/.claude-flow-novice/dist/src/providers/zai-provider.js +196 -97
  172. package/.claude-flow-novice/dist/src/providers/zai-provider.js.map +1 -1
  173. package/.claude-flow-novice/dist/src/slash-commands/cfn-claude-sync.js +533 -0
  174. package/.claude-flow-novice/dist/src/slash-commands/index.js +5 -0
  175. package/.claude-flow-novice/dist/src/slash-commands/metrics-summary-class.js +74 -0
  176. package/.claude-flow-novice/dist/src/slash-commands/metrics-summary.js +335 -0
  177. package/.claude-flow-novice/dist/src/slash-commands/register-all-commands.js +12 -0
  178. package/.claude-flow-novice/dist/src/verification/checkpoint-compression-demo.js +96 -0
  179. package/.claude-flow-novice/dist/src/verification/checkpoint-compression-demo.js.map +1 -0
  180. package/.claude-flow-novice/dist/src/verification/checkpoint-compression.js +406 -0
  181. package/.claude-flow-novice/dist/src/verification/checkpoint-compression.js.map +1 -0
  182. package/.claude-flow-novice/dist/src/verification/checkpoint-manager.js +35 -5
  183. package/.claude-flow-novice/dist/src/verification/checkpoint-manager.js.map +1 -1
  184. package/.claude-flow-novice/dist/src/web/api/config/api-config.js +186 -0
  185. package/.claude-flow-novice/dist/src/web/api/config/api-config.js.map +1 -0
  186. package/.claude-flow-novice/dist/src/web/api/middleware/auth.js +205 -0
  187. package/.claude-flow-novice/dist/src/web/api/middleware/auth.js.map +1 -0
  188. package/.claude-flow-novice/dist/src/web/api/middleware/cache.js +262 -0
  189. package/.claude-flow-novice/dist/src/web/api/middleware/cache.js.map +1 -0
  190. package/.claude-flow-novice/dist/src/web/api/middleware/error-handler.js +250 -0
  191. package/.claude-flow-novice/dist/src/web/api/middleware/error-handler.js.map +1 -0
  192. package/.claude-flow-novice/dist/src/web/api/middleware/request-logger.js +217 -0
  193. package/.claude-flow-novice/dist/src/web/api/middleware/request-logger.js.map +1 -0
  194. package/.claude-flow-novice/dist/src/web/api/middleware/validation.js +325 -0
  195. package/.claude-flow-novice/dist/src/web/api/middleware/validation.js.map +1 -0
  196. package/.claude-flow-novice/dist/src/web/api/routes/events.js +465 -0
  197. package/.claude-flow-novice/dist/src/web/api/routes/events.js.map +1 -0
  198. package/.claude-flow-novice/dist/src/web/api/routes/hierarchy.js +302 -0
  199. package/.claude-flow-novice/dist/src/web/api/routes/hierarchy.js.map +1 -0
  200. package/.claude-flow-novice/dist/src/web/api/routes/index.js +14 -0
  201. package/.claude-flow-novice/dist/src/web/api/routes/index.js.map +1 -0
  202. package/.claude-flow-novice/dist/src/web/api/routes/metrics.js +561 -0
  203. package/.claude-flow-novice/dist/src/web/api/routes/metrics.js.map +1 -0
  204. package/.claude-flow-novice/dist/src/web/api/routes/status.js +450 -0
  205. package/.claude-flow-novice/dist/src/web/api/routes/status.js.map +1 -0
  206. package/.claude-flow-novice/dist/src/web/api/server.js +451 -0
  207. package/.claude-flow-novice/dist/src/web/api/server.js.map +1 -0
  208. package/.claude-flow-novice/dist/src/web/dashboard/hooks/useWebSocket.js +385 -0
  209. package/.claude-flow-novice/dist/src/web/dashboard/hooks/useWebSocket.js.map +1 -0
  210. package/.claude-flow-novice/dist/src/web/dashboard/index.js +87 -0
  211. package/.claude-flow-novice/dist/src/web/dashboard/index.js.map +1 -0
  212. package/.claude-flow-novice/dist/src/web/dashboard/types.js +6 -0
  213. package/.claude-flow-novice/dist/src/web/dashboard/types.js.map +1 -0
  214. package/.claude-flow-novice/metrics.db +0 -0
  215. package/.claude-flow-novice/metrics.db-shm +0 -0
  216. package/.claude-flow-novice/metrics.db-wal +0 -0
  217. package/CLAUDE.md +29 -0
  218. package/README.md +27 -0
  219. package/config/hooks/post-edit-pipeline.js +36 -2
  220. package/examples/metrics-counter-demo.ts +106 -0
  221. package/examples/persistent-metrics-demo.ts +83 -0
  222. package/examples/phase-5-multi-level-control.ts +282 -0
  223. package/examples/session-pool-optimizer-example.ts +311 -0
  224. package/package.json +15 -3
  225. package/scripts/check-routing-stats.cjs +122 -0
  226. package/scripts/pre-publish-validation.cjs +212 -0
  227. package/scripts/test-provider-routing.cjs +228 -0
  228. package/scripts/test-routing-telemetry.cjs +147 -0
  229. package/scripts/test-zai-10k.cjs +81 -0
  230. package/scripts/test-zai-api.cjs +191 -0
  231. package/scripts/test-zai-diagnostic.cjs +151 -0
  232. package/scripts/test-zai-final.cjs +128 -0
  233. package/scripts/test-zai-with-env.cjs +85 -0
  234. package/scripts/validate-coordination-cli.js +69 -0
  235. package/scripts/validate-coordination-toggle-integration.cjs +501 -0
  236. package/src/cli/simple-commands/init/templates/CLAUDE.md +29 -0
  237. package/src/observability/metrics-counter.ts +347 -0
  238. package/src/observability/metrics-storage.ts +356 -0
  239. package/src/observability/telemetry.ts +658 -0
  240. package/src/slash-commands/cfn-claude-sync.js +533 -0
  241. package/src/slash-commands/index.js +5 -0
  242. package/src/slash-commands/metrics-summary-class.js +74 -0
  243. package/src/slash-commands/metrics-summary.js +335 -0
  244. package/src/slash-commands/register-all-commands.js +12 -0
@@ -0,0 +1,290 @@
1
+ ---
2
+ description: "Execute multi-phase epic with CFN Loop orchestration and autonomous phase transitions"
3
+ argument-hint: "<epic description>"
4
+ allowed-tools: ["Task", "TodoWrite", "Read", "Write", "Edit", "Bash", "Glob", "Grep"]
5
+ ---
6
+
7
+ # CFN Loop Epic - Multi-Phase Autonomous Development
8
+
9
+ Execute a large multi-phase epic using the full 4-loop CFN structure with autonomous phase orchestration.
10
+
11
+ 🚨 **AUTONOMOUS MULTI-PHASE SELF-LOOPING PROCESS**
12
+
13
+ **Epic Goal**: $ARGUMENTS
14
+
15
+ ## CFN Loop Structure (4 Loops)
16
+
17
+ ```
18
+ LOOP 0: Epic/Sprint Orchestration (THIS COMMAND)
19
+ ├─ Phase 1 → Phase 2 → Phase 3 → ... → Phase N
20
+
21
+ LOOP 1: Phase Execution (current phase)
22
+
23
+ LOOP 2: Consensus Validation (≥90% Byzantine consensus)
24
+
25
+ LOOP 3: Primary Swarm Execution (implementation with confidence scores)
26
+ ```
27
+
28
+ ## Epic Planning (Loop 0)
29
+
30
+ ### Step 1: Parse Epic into Phases
31
+ ```javascript
32
+ // Use parse-epic utility to break down epic
33
+ const epicPlan = {
34
+ epic_name: "auth-system",
35
+ phases: [
36
+ {
37
+ phase_id: "1",
38
+ name: "User Authentication",
39
+ deliverables: ["Login API", "JWT generation", "Password hashing"],
40
+ dependencies: [],
41
+ estimated_agents: 5
42
+ },
43
+ {
44
+ phase_id: "2",
45
+ name: "Authorization & RBAC",
46
+ deliverables: ["Role system", "Permission checks", "Middleware"],
47
+ dependencies: ["1"],
48
+ estimated_agents: 6
49
+ },
50
+ {
51
+ phase_id: "3",
52
+ name: "Session Management",
53
+ deliverables: ["Refresh tokens", "Logout", "Session tracking"],
54
+ dependencies: ["1", "2"],
55
+ estimated_agents: 4
56
+ }
57
+ ]
58
+ }
59
+ ```
60
+
61
+ ### Step 2: Store Scope Boundaries (CRITICAL)
62
+ ```javascript
63
+ mcp__claude-flow-novice__memory_usage({
64
+ action: "store",
65
+ namespace: "scope-control",
66
+ key: "project-boundaries",
67
+ value: JSON.stringify({
68
+ primary_goal: "Build complete authentication system",
69
+ in_scope: [
70
+ "JWT authentication",
71
+ "Role-based access control",
72
+ "Session management",
73
+ "Password security (bcrypt)"
74
+ ],
75
+ out_of_scope: [
76
+ "OAuth/social login",
77
+ "Multi-factor authentication",
78
+ "Biometric authentication",
79
+ "Advanced rate limiting beyond basic"
80
+ ],
81
+ risk_profile: "public-facing-medium-risk",
82
+ decision_authority_config: {
83
+ auto_approve_threshold: 0.90,
84
+ auto_relaunch_max_iteration: 10,
85
+ escalation_criteria: ["security vulnerability", "data loss risk"]
86
+ }
87
+ })
88
+ })
89
+ ```
90
+
91
+ ## Phase Execution (Loop 1)
92
+
93
+ For EACH phase in epic:
94
+
95
+ ### Phase Initialization
96
+ 1. Check dependencies satisfied
97
+ 2. Load scope boundaries from memory
98
+ 3. Initialize swarm for phase
99
+ 4. Execute Loop 2 & Loop 3 (as defined in /cfn-loop command)
100
+
101
+ ### Phase Pattern
102
+ ```javascript
103
+ // PHASE 1: User Authentication
104
+ mcp__claude-flow-novice__swarm_init({
105
+ topology: "mesh",
106
+ maxAgents: 5,
107
+ strategy: "balanced"
108
+ })
109
+
110
+ // Loop 3: Primary swarm
111
+ Task("Coder 1", `
112
+ Implement JWT generation...
113
+
114
+ MANDATORY: After EVERY file edit:
115
+ node config/hooks/post-edit-pipeline.js "[FILE_PATH]" --memory-key "swarm/auth/coder-1"
116
+
117
+ Report confidence score.
118
+ `, "backend-dev")
119
+
120
+ // ... more agents
121
+
122
+ // Self-Assessment Gate → Consensus → Product Owner → Action
123
+
124
+ // If Phase 1 consensus ≥90% → AUTO-TRANSITION to Phase 2
125
+ ```
126
+
127
+ ### Phase Transition Logic
128
+ ```javascript
129
+ // After each phase completes
130
+ if (consensusScore >= 0.90 && allDeliverablesComplete) {
131
+ // Store phase results
132
+ mcp__claude-flow-novice__memory_usage({
133
+ action: "store",
134
+ namespace: "epic-progress",
135
+ key: `phase-${phaseId}-results`,
136
+ value: JSON.stringify({
137
+ consensus: consensusScore,
138
+ deliverables: completedDeliverables,
139
+ timestamp: Date.now()
140
+ })
141
+ })
142
+
143
+ // Check next phase dependencies
144
+ const nextPhase = epicPlan.phases[currentPhaseIndex + 1];
145
+ if (dependenciesSatisfied(nextPhase)) {
146
+ // IMMEDIATELY transition (NO approval needed)
147
+ executePhase(nextPhase);
148
+ }
149
+ }
150
+ ```
151
+
152
+ ## Product Owner Integration (GOAP)
153
+
154
+ Product Owner operates at EACH phase completion:
155
+
156
+ ```javascript
157
+ Task("Product Owner", `
158
+ GOAP DECISION - Phase ${phaseId} Complete
159
+
160
+ CURRENT STATE:
161
+ - Phase ${phaseId} consensus: ${consensusScore}
162
+ - Remaining phases: ${remainingPhases}
163
+ - Validator concerns: ${concerns}
164
+
165
+ RETRIEVE EPIC SCOPE:
166
+ mcp__claude-flow-novice__memory_usage({
167
+ action: "retrieve",
168
+ namespace: "scope-control",
169
+ key: "project-boundaries"
170
+ })
171
+
172
+ EXECUTE GOAP A* SEARCH:
173
+ 1. Classify phase completion quality
174
+ 2. Evaluate scope adherence
175
+ 3. Calculate cost of scope expansion vs backlog defer
176
+ 4. Make autonomous decision
177
+
178
+ DECISION OPTIONS:
179
+ - PROCEED_NEXT_PHASE (dependencies satisfied, scope intact)
180
+ - DEFER_CONCERNS (save to backlog, continue epic)
181
+ - ESCALATE (critical scope violation or blocker)
182
+
183
+ OUTPUT: {decision: "...", next_action: "..."}
184
+ `, "product-owner")
185
+ ```
186
+
187
+ ## Autonomous Multi-Phase Execution
188
+
189
+ **FORBIDDEN PATTERNS:**
190
+ - ❌ "Phase 1 complete. Proceed to Phase 2?" (AUTO-PROCEED)
191
+ - ❌ "Should I continue the epic?" (ALWAYS continue until all phases done)
192
+ - ❌ Waiting for approval between phases (AUTONOMOUS TRANSITION)
193
+
194
+ **REQUIRED PATTERNS:**
195
+ ```
196
+ Phase 1 consensus: 94% ✅
197
+ Dependencies for Phase 2 satisfied.
198
+ IMMEDIATELY transitioning to Phase 2...
199
+
200
+ Phase 2: Authorization & RBAC
201
+ [Spawning agents autonomously - no permission needed]
202
+ ```
203
+
204
+ ## Iteration Limits (Per Phase)
205
+ - **Loop 2** (Consensus): 10 iterations max per phase
206
+ - **Loop 3** (Primary Swarm): 10 iterations max per phase
207
+ - **Loop 1** (Phases): Unlimited (continues until all phases complete)
208
+
209
+ ## Epic Progress Tracking
210
+
211
+ ```javascript
212
+ // Query epic progress
213
+ mcp__claude-flow-novice__memory_usage({
214
+ action: "list",
215
+ namespace: "epic-progress"
216
+ })
217
+
218
+ // Output:
219
+ {
220
+ "phase-1-results": {consensus: 0.94, deliverables: [...]},
221
+ "phase-2-results": {consensus: 0.91, deliverables: [...]},
222
+ "phase-3-results": null // Current phase in progress
223
+ }
224
+ ```
225
+
226
+ ## Example Multi-Phase Execution
227
+
228
+ ```
229
+ [Turn 1] Epic: Auth System (3 phases)
230
+ → Scope boundaries stored in memory
231
+ → Phase 1: User Authentication
232
+
233
+ [Turn 2-5] Phase 1 Execution (Loop 3 + Loop 2)
234
+ → Loop 3 iterations (confidence checks)
235
+ → Loop 2 consensus validation
236
+ → Product Owner: PROCEED_NEXT_PHASE
237
+ → Phase 1 COMPLETE (consensus: 94%)
238
+
239
+ [Turn 6] AUTONOMOUS TRANSITION
240
+ → Dependencies for Phase 2 satisfied
241
+ → IMMEDIATELY starting Phase 2: Authorization & RBAC
242
+
243
+ [Turn 7-10] Phase 2 Execution
244
+ → Loop 3 + Loop 2 cycles
245
+ → Product Owner: DEFER (OAuth out-of-scope)
246
+ → Phase 2 COMPLETE (consensus: 91%)
247
+
248
+ [Turn 11] AUTONOMOUS TRANSITION
249
+ → Phase 3: Session Management
250
+
251
+ [Turn 12-14] Phase 3 Execution
252
+ → Final phase completion
253
+ → Epic COMPLETE ✅
254
+ ```
255
+
256
+ ## Output Format
257
+
258
+ ```
259
+ Epic: auth-system (3 phases)
260
+ Phase 1/3: User Authentication
261
+
262
+ Loop 3 Iteration 2/10 - Confidence: 85% avg ✅
263
+ Loop 2 Iteration 1/10 - Consensus: 94% ✅
264
+
265
+ Phase 1 COMPLETE
266
+ Dependencies satisfied for Phase 2.
267
+ IMMEDIATELY transitioning to Phase 2...
268
+
269
+ ─────────────────────────────────
270
+ Phase 2/3: Authorization & RBAC
271
+ [Executing autonomously - no permission needed]
272
+ ```
273
+
274
+ ## Epic Completion
275
+
276
+ When final phase achieves ≥90% consensus:
277
+ ```
278
+ Phase 3 COMPLETE - Consensus: 92% ✅
279
+
280
+ Epic: auth-system - ALL PHASES COMPLETE ✅
281
+ - Phase 1: User Authentication (94%)
282
+ - Phase 2: Authorization & RBAC (91%)
283
+ - Phase 3: Session Management (92%)
284
+
285
+ Deferred items saved to backlog:
286
+ - OAuth/social login integration
287
+ - Multi-factor authentication
288
+
289
+ Epic execution complete. Self-looping terminated.
290
+ ```
@@ -0,0 +1,168 @@
1
+ ---
2
+ description: "Execute single task through autonomous CFN Loop (natural language, file path, or partial reference)"
3
+ argument-hint: "<task description or file reference>"
4
+ allowed-tools: ["Task", "TodoWrite", "Read", "Write", "Edit", "Bash", "Glob", "Grep"]
5
+ ---
6
+
7
+ # CFN Loop Single - Single Task Autonomous Execution
8
+
9
+ Execute a single task through the CFN Loop without sprint/phase structure. Supports natural language, file paths, or partial file references.
10
+
11
+ 🚨 **AUTONOMOUS SELF-LOOPING PROCESS**
12
+
13
+ **Task**: $ARGUMENTS
14
+
15
+ ## CFN Loop Structure (4 Loops)
16
+
17
+ ```
18
+ LOOP 0: Epic/Sprint Orchestration (use /cfn-loop-epic or /cfn-loop-sprints)
19
+
20
+ LOOP 1: Phase Execution (this command - single phase)
21
+
22
+ LOOP 2: Consensus Validation (≥90% Byzantine consensus)
23
+
24
+ LOOP 3: Primary Swarm Execution (implementation with confidence scores)
25
+ ```
26
+
27
+ ## Execution Pattern
28
+
29
+ ### Step 1: Initialize Swarm (MANDATORY)
30
+ ```javascript
31
+ mcp__claude-flow-novice__swarm_init({
32
+ topology: "mesh", // mesh for 2-7, hierarchical for 8+
33
+ maxAgents: 5, // match actual agent count
34
+ strategy: "balanced"
35
+ })
36
+ ```
37
+
38
+ ### Step 2: Execute - Primary Swarm (Loop 3)
39
+ ```javascript
40
+ // Spawn ALL agents in ONE message
41
+ Task("Coder 1", `
42
+ Implementation task...
43
+
44
+ MANDATORY: After EVERY file edit, run:
45
+ node config/hooks/post-edit-pipeline.js "[FILE_PATH]" --memory-key "swarm/coder-1/step-1"
46
+
47
+ Report confidence score when complete.
48
+ `, "coder")
49
+
50
+ Task("Tester 1", "...", "tester")
51
+ Task("Backend Dev 1", "...", "backend-dev")
52
+ ```
53
+
54
+ ### Step 3: Self-Assessment Gate
55
+ - Collect confidence scores from ALL agents
56
+ - **PASS** (all ≥75%) → Proceed to Step 4
57
+ - **FAIL** (any <75%) → IMMEDIATELY relaunch Loop 3 with targeted agents (NO approval)
58
+
59
+ ### Step 4: Verify - Consensus Swarm
60
+ **CRITICAL**: Spawn validators in SEPARATE message AFTER implementation complete:
61
+
62
+ ```javascript
63
+ // MESSAGE 2: Validators (AFTER implementation)
64
+ mcp__claude-flow-novice__swarm_init({
65
+ topology: "mesh",
66
+ maxAgents: 3,
67
+ strategy: "balanced"
68
+ })
69
+
70
+ Task("Validator 1", "Review completed work at [files]", "reviewer")
71
+ Task("Validator 2", "Security audit of implementation", "security-specialist")
72
+ Task("Validator 3", "Architecture validation", "system-architect")
73
+ ```
74
+
75
+ ### Step 5: Product Owner Decision Gate (GOAP)
76
+ ```javascript
77
+ Task("Product Owner", `
78
+ GOAP DECISION EXECUTION - Loop 2 Iteration ${iteration}/10
79
+
80
+ CURRENT STATE:
81
+ - Consensus: ${consensusScore} (target: ≥0.90)
82
+ - Validator concerns: ${JSON.stringify(concerns)}
83
+
84
+ RETRIEVE SCOPE:
85
+ mcp__claude-flow-novice__memory_usage({
86
+ action: "retrieve",
87
+ namespace: "scope-control",
88
+ key: "project-boundaries"
89
+ })
90
+
91
+ EXECUTE GOAP A* SEARCH:
92
+ 1. Classify concerns: in-scope vs out-of-scope
93
+ 2. Generate action space with cost functions
94
+ 3. Run A* pathfinding
95
+ 4. Make autonomous decision
96
+
97
+ OUTPUT: {decision: "PROCEED|DEFER|ESCALATE", ...}
98
+ `, "product-owner")
99
+ ```
100
+
101
+ **Decision Outcomes:**
102
+ - **PROCEED** → IMMEDIATELY relaunch Loop 3 with targeted agents (NO approval)
103
+ - **DEFER** → Save to backlog, approve phase
104
+ - **ESCALATE** → Generate alternatives (rare)
105
+
106
+ ### Step 6: Action Based on Decision
107
+ - **PROCEED** → Spawn Loop 3 swarm with Product Owner's agent selections
108
+ - **DEFER** → Transition to next phase (if applicable)
109
+ - **ESCALATE** → Only STOP if critical error
110
+
111
+ ## Autonomous Execution Rules
112
+
113
+ **YOU ARE FORBIDDEN FROM:**
114
+ - ❌ Asking "Should I retry?" (ALWAYS retry if iterations < 10)
115
+ - ❌ Asking "Proceed to next step?" (AUTO-PROCEED)
116
+ - ❌ Waiting for approval during CFN Loop cycles
117
+
118
+ **YOU MUST:**
119
+ - ✅ IMMEDIATELY relaunch Loop 3 on low confidence (iteration < 10)
120
+ - ✅ IMMEDIATELY relaunch Loop 3 on consensus failure (iteration < 10)
121
+ - ✅ AUTOMATICALLY select better agents based on failure analysis
122
+ - ✅ ONLY escalate when truly blocked (critical error or max iterations)
123
+
124
+ ## Iteration Limits
125
+ - **Loop 2** (Consensus): 10 iterations max
126
+ - **Loop 3** (Primary Swarm): 10 iterations max
127
+
128
+ ## Example Execution
129
+
130
+ ```
131
+ [Turn 1] Loop 3 Iteration 1/10
132
+ → Primary swarm (coder, tester, backend-dev)
133
+ → Confidence: 68%, 72%, 85%
134
+ → Gate FAILS (2 agents <75%)
135
+ → IMMEDIATELY retry Loop 3 (autonomous)
136
+
137
+ [Turn 2] Loop 3 Iteration 2/10
138
+ → Primary swarm with feedback
139
+ → Confidence: 82%, 79%, 88%
140
+ → Gate PASSES (all ≥75%)
141
+ → Proceed to Loop 2
142
+
143
+ [Turn 3] Loop 2 Iteration 1/10
144
+ → Consensus validators spawned
145
+ → Consensus: 85% (below 90%)
146
+ → IMMEDIATELY retry (autonomous)
147
+
148
+ [Turn 4] Loop 2 Iteration 2/10
149
+ → Product Owner: PROCEED (GOAP cost=50)
150
+ → Loop 3 relaunched with targeted agents
151
+ → Consensus achieved: 94% ✅
152
+ → PHASE COMPLETE
153
+ ```
154
+
155
+ ## Output Format
156
+
157
+ Concise, action-oriented:
158
+ ```
159
+ Loop 3 Iteration 2/10 - Confidence: 82% avg ✅
160
+ Proceeding to Loop 2 (Consensus)...
161
+
162
+ Loop 2 Iteration 1/10 - Consensus: 87% ❌
163
+ Product Owner: PROCEED (5 in-scope blockers)
164
+ IMMEDIATELY relaunching Loop 3 with:
165
+ - backend-dev (fix SQL injection)
166
+ - security-specialist (validate fix)
167
+ [Executing autonomously - no permission needed]
168
+ ```