claude-flow-guidance-implementation 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (275) hide show
  1. package/.agents/README.md +38 -0
  2. package/.agents/config.toml +298 -0
  3. package/.agents/skills/memory-management/SKILL.md +126 -0
  4. package/.agents/skills/memory-management/scripts/memory-backup.sh +16 -0
  5. package/.agents/skills/memory-management/scripts/memory-consolidate.sh +11 -0
  6. package/.agents/skills/security-audit/SKILL.md +135 -0
  7. package/.agents/skills/security-audit/scripts/cve-remediate.sh +16 -0
  8. package/.agents/skills/security-audit/scripts/security-scan.sh +33 -0
  9. package/.agents/skills/sparc-methodology/SKILL.md +118 -0
  10. package/.agents/skills/sparc-methodology/scripts/sparc-init.sh +21 -0
  11. package/.agents/skills/sparc-methodology/scripts/sparc-review.sh +18 -0
  12. package/.agents/skills/swarm-orchestration/SKILL.md +114 -0
  13. package/.agents/skills/swarm-orchestration/scripts/swarm-monitor.sh +8 -0
  14. package/.agents/skills/swarm-orchestration/scripts/swarm-start.sh +14 -0
  15. package/.claude/agents/analysis/analyze-code-quality.md +179 -0
  16. package/.claude/agents/analysis/code-analyzer.md +210 -0
  17. package/.claude/agents/analysis/code-review/analyze-code-quality.md +179 -0
  18. package/.claude/agents/architecture/system-design/arch-system-design.md +155 -0
  19. package/.claude/agents/consensus/README.md +253 -0
  20. package/.claude/agents/consensus/byzantine-coordinator.md +63 -0
  21. package/.claude/agents/consensus/crdt-synchronizer.md +997 -0
  22. package/.claude/agents/consensus/gossip-coordinator.md +63 -0
  23. package/.claude/agents/consensus/performance-benchmarker.md +851 -0
  24. package/.claude/agents/consensus/quorum-manager.md +823 -0
  25. package/.claude/agents/consensus/raft-manager.md +63 -0
  26. package/.claude/agents/consensus/security-manager.md +622 -0
  27. package/.claude/agents/core/coder.md +266 -0
  28. package/.claude/agents/core/planner.md +168 -0
  29. package/.claude/agents/core/researcher.md +190 -0
  30. package/.claude/agents/core/reviewer.md +326 -0
  31. package/.claude/agents/core/tester.md +319 -0
  32. package/.claude/agents/custom/test-long-runner.md +44 -0
  33. package/.claude/agents/data/ml/data-ml-model.md +193 -0
  34. package/.claude/agents/development/backend/dev-backend-api.md +142 -0
  35. package/.claude/agents/development/dev-backend-api.md +345 -0
  36. package/.claude/agents/devops/ci-cd/ops-cicd-github.md +164 -0
  37. package/.claude/agents/documentation/api-docs/docs-api-openapi.md +174 -0
  38. package/.claude/agents/dual-mode/README.md +94 -0
  39. package/.claude/agents/dual-mode/codex-coordinator.md +224 -0
  40. package/.claude/agents/dual-mode/codex-worker.md +211 -0
  41. package/.claude/agents/dual-mode/dual-orchestrator.md +291 -0
  42. package/.claude/agents/flow-nexus/app-store.md +88 -0
  43. package/.claude/agents/flow-nexus/authentication.md +69 -0
  44. package/.claude/agents/flow-nexus/challenges.md +81 -0
  45. package/.claude/agents/flow-nexus/neural-network.md +88 -0
  46. package/.claude/agents/flow-nexus/payments.md +83 -0
  47. package/.claude/agents/flow-nexus/sandbox.md +76 -0
  48. package/.claude/agents/flow-nexus/swarm.md +76 -0
  49. package/.claude/agents/flow-nexus/user-tools.md +96 -0
  50. package/.claude/agents/flow-nexus/workflow.md +84 -0
  51. package/.claude/agents/github/code-review-swarm.md +538 -0
  52. package/.claude/agents/github/github-modes.md +173 -0
  53. package/.claude/agents/github/issue-tracker.md +319 -0
  54. package/.claude/agents/github/multi-repo-swarm.md +553 -0
  55. package/.claude/agents/github/pr-manager.md +191 -0
  56. package/.claude/agents/github/project-board-sync.md +509 -0
  57. package/.claude/agents/github/release-manager.md +367 -0
  58. package/.claude/agents/github/release-swarm.md +583 -0
  59. package/.claude/agents/github/repo-architect.md +398 -0
  60. package/.claude/agents/github/swarm-issue.md +573 -0
  61. package/.claude/agents/github/swarm-pr.md +428 -0
  62. package/.claude/agents/github/sync-coordinator.md +452 -0
  63. package/.claude/agents/github/workflow-automation.md +635 -0
  64. package/.claude/agents/goal/agent.md +816 -0
  65. package/.claude/agents/goal/code-goal-planner.md +446 -0
  66. package/.claude/agents/goal/goal-planner.md +168 -0
  67. package/.claude/agents/hive-mind/collective-intelligence-coordinator.md +130 -0
  68. package/.claude/agents/hive-mind/queen-coordinator.md +203 -0
  69. package/.claude/agents/hive-mind/scout-explorer.md +242 -0
  70. package/.claude/agents/hive-mind/swarm-memory-manager.md +193 -0
  71. package/.claude/agents/hive-mind/worker-specialist.md +217 -0
  72. package/.claude/agents/optimization/README.md +250 -0
  73. package/.claude/agents/optimization/benchmark-suite.md +665 -0
  74. package/.claude/agents/optimization/load-balancer.md +431 -0
  75. package/.claude/agents/optimization/performance-monitor.md +672 -0
  76. package/.claude/agents/optimization/resource-allocator.md +674 -0
  77. package/.claude/agents/optimization/topology-optimizer.md +808 -0
  78. package/.claude/agents/payments/agentic-payments.md +126 -0
  79. package/.claude/agents/sona/sona-learning-optimizer.md +74 -0
  80. package/.claude/agents/sparc/architecture.md +472 -0
  81. package/.claude/agents/sparc/pseudocode.md +318 -0
  82. package/.claude/agents/sparc/refinement.md +525 -0
  83. package/.claude/agents/sparc/specification.md +276 -0
  84. package/.claude/agents/specialized/mobile/spec-mobile-react-native.md +225 -0
  85. package/.claude/agents/sublinear/consensus-coordinator.md +338 -0
  86. package/.claude/agents/sublinear/matrix-optimizer.md +185 -0
  87. package/.claude/agents/sublinear/pagerank-analyzer.md +299 -0
  88. package/.claude/agents/sublinear/performance-optimizer.md +368 -0
  89. package/.claude/agents/sublinear/trading-predictor.md +246 -0
  90. package/.claude/agents/swarm/README.md +190 -0
  91. package/.claude/agents/swarm/adaptive-coordinator.md +396 -0
  92. package/.claude/agents/swarm/hierarchical-coordinator.md +327 -0
  93. package/.claude/agents/swarm/mesh-coordinator.md +392 -0
  94. package/.claude/agents/templates/automation-smart-agent.md +205 -0
  95. package/.claude/agents/templates/coordinator-swarm-init.md +105 -0
  96. package/.claude/agents/templates/github-pr-manager.md +177 -0
  97. package/.claude/agents/templates/implementer-sparc-coder.md +259 -0
  98. package/.claude/agents/templates/memory-coordinator.md +187 -0
  99. package/.claude/agents/templates/migration-plan.md +746 -0
  100. package/.claude/agents/templates/orchestrator-task.md +139 -0
  101. package/.claude/agents/templates/performance-analyzer.md +199 -0
  102. package/.claude/agents/templates/sparc-coordinator.md +183 -0
  103. package/.claude/agents/testing/production-validator.md +395 -0
  104. package/.claude/agents/testing/tdd-london-swarm.md +244 -0
  105. package/.claude/agents/testing/unit/tdd-london-swarm.md +244 -0
  106. package/.claude/agents/testing/validation/production-validator.md +395 -0
  107. package/.claude/agents/v3/database-specialist.yaml +21 -0
  108. package/.claude/agents/v3/index.yaml +17 -0
  109. package/.claude/agents/v3/project-coordinator.yaml +15 -0
  110. package/.claude/agents/v3/python-specialist.yaml +21 -0
  111. package/.claude/agents/v3/test-architect.yaml +20 -0
  112. package/.claude/agents/v3/typescript-specialist.yaml +21 -0
  113. package/.claude/agents/v3/v3-integration-architect.md +346 -0
  114. package/.claude/agents/v3/v3-memory-specialist.md +318 -0
  115. package/.claude/agents/v3/v3-performance-engineer.md +397 -0
  116. package/.claude/agents/v3/v3-queen-coordinator.md +98 -0
  117. package/.claude/agents/v3/v3-security-architect.md +174 -0
  118. package/.claude/commands/analysis/COMMAND_COMPLIANCE_REPORT.md +54 -0
  119. package/.claude/commands/analysis/README.md +9 -0
  120. package/.claude/commands/analysis/bottleneck-detect.md +162 -0
  121. package/.claude/commands/analysis/performance-bottlenecks.md +59 -0
  122. package/.claude/commands/analysis/performance-report.md +25 -0
  123. package/.claude/commands/analysis/token-efficiency.md +45 -0
  124. package/.claude/commands/analysis/token-usage.md +25 -0
  125. package/.claude/commands/automation/README.md +9 -0
  126. package/.claude/commands/automation/auto-agent.md +122 -0
  127. package/.claude/commands/automation/self-healing.md +106 -0
  128. package/.claude/commands/automation/session-memory.md +90 -0
  129. package/.claude/commands/automation/smart-agents.md +73 -0
  130. package/.claude/commands/automation/smart-spawn.md +25 -0
  131. package/.claude/commands/automation/workflow-select.md +25 -0
  132. package/.claude/commands/claude-flow-help.md +103 -0
  133. package/.claude/commands/claude-flow-memory.md +107 -0
  134. package/.claude/commands/claude-flow-swarm.md +205 -0
  135. package/.claude/commands/github/README.md +11 -0
  136. package/.claude/commands/github/code-review-swarm.md +514 -0
  137. package/.claude/commands/github/code-review.md +25 -0
  138. package/.claude/commands/github/github-modes.md +147 -0
  139. package/.claude/commands/github/github-swarm.md +121 -0
  140. package/.claude/commands/github/issue-tracker.md +292 -0
  141. package/.claude/commands/github/issue-triage.md +25 -0
  142. package/.claude/commands/github/multi-repo-swarm.md +519 -0
  143. package/.claude/commands/github/pr-enhance.md +26 -0
  144. package/.claude/commands/github/pr-manager.md +170 -0
  145. package/.claude/commands/github/project-board-sync.md +471 -0
  146. package/.claude/commands/github/release-manager.md +338 -0
  147. package/.claude/commands/github/release-swarm.md +544 -0
  148. package/.claude/commands/github/repo-analyze.md +25 -0
  149. package/.claude/commands/github/repo-architect.md +367 -0
  150. package/.claude/commands/github/swarm-issue.md +482 -0
  151. package/.claude/commands/github/swarm-pr.md +285 -0
  152. package/.claude/commands/github/sync-coordinator.md +301 -0
  153. package/.claude/commands/github/workflow-automation.md +442 -0
  154. package/.claude/commands/hooks/README.md +11 -0
  155. package/.claude/commands/hooks/overview.md +58 -0
  156. package/.claude/commands/hooks/post-edit.md +117 -0
  157. package/.claude/commands/hooks/post-task.md +112 -0
  158. package/.claude/commands/hooks/pre-edit.md +113 -0
  159. package/.claude/commands/hooks/pre-task.md +111 -0
  160. package/.claude/commands/hooks/session-end.md +118 -0
  161. package/.claude/commands/hooks/setup.md +103 -0
  162. package/.claude/commands/monitoring/README.md +9 -0
  163. package/.claude/commands/monitoring/agent-metrics.md +25 -0
  164. package/.claude/commands/monitoring/agents.md +44 -0
  165. package/.claude/commands/monitoring/real-time-view.md +25 -0
  166. package/.claude/commands/monitoring/status.md +46 -0
  167. package/.claude/commands/monitoring/swarm-monitor.md +25 -0
  168. package/.claude/commands/optimization/README.md +9 -0
  169. package/.claude/commands/optimization/auto-topology.md +62 -0
  170. package/.claude/commands/optimization/cache-manage.md +25 -0
  171. package/.claude/commands/optimization/parallel-execute.md +25 -0
  172. package/.claude/commands/optimization/parallel-execution.md +50 -0
  173. package/.claude/commands/optimization/topology-optimize.md +25 -0
  174. package/.claude/commands/sparc/analyzer.md +52 -0
  175. package/.claude/commands/sparc/architect.md +53 -0
  176. package/.claude/commands/sparc/ask.md +97 -0
  177. package/.claude/commands/sparc/batch-executor.md +54 -0
  178. package/.claude/commands/sparc/code.md +89 -0
  179. package/.claude/commands/sparc/coder.md +54 -0
  180. package/.claude/commands/sparc/debug.md +83 -0
  181. package/.claude/commands/sparc/debugger.md +54 -0
  182. package/.claude/commands/sparc/designer.md +53 -0
  183. package/.claude/commands/sparc/devops.md +109 -0
  184. package/.claude/commands/sparc/docs-writer.md +80 -0
  185. package/.claude/commands/sparc/documenter.md +54 -0
  186. package/.claude/commands/sparc/innovator.md +54 -0
  187. package/.claude/commands/sparc/integration.md +83 -0
  188. package/.claude/commands/sparc/mcp.md +117 -0
  189. package/.claude/commands/sparc/memory-manager.md +54 -0
  190. package/.claude/commands/sparc/optimizer.md +54 -0
  191. package/.claude/commands/sparc/orchestrator.md +132 -0
  192. package/.claude/commands/sparc/post-deployment-monitoring-mode.md +83 -0
  193. package/.claude/commands/sparc/refinement-optimization-mode.md +83 -0
  194. package/.claude/commands/sparc/researcher.md +54 -0
  195. package/.claude/commands/sparc/reviewer.md +54 -0
  196. package/.claude/commands/sparc/security-review.md +80 -0
  197. package/.claude/commands/sparc/sparc-modes.md +174 -0
  198. package/.claude/commands/sparc/sparc.md +111 -0
  199. package/.claude/commands/sparc/spec-pseudocode.md +80 -0
  200. package/.claude/commands/sparc/supabase-admin.md +348 -0
  201. package/.claude/commands/sparc/swarm-coordinator.md +54 -0
  202. package/.claude/commands/sparc/tdd.md +54 -0
  203. package/.claude/commands/sparc/tester.md +54 -0
  204. package/.claude/commands/sparc/tutorial.md +79 -0
  205. package/.claude/commands/sparc/workflow-manager.md +54 -0
  206. package/.claude/helpers/hook-handler.cjs +168 -0
  207. package/.claude/helpers/intelligence.cjs +197 -0
  208. package/.claude/helpers/memory.js +83 -0
  209. package/.claude/helpers/post-commit +16 -0
  210. package/.claude/helpers/pre-commit +26 -0
  211. package/.claude/helpers/router.js +66 -0
  212. package/.claude/helpers/session.js +127 -0
  213. package/.claude/settings.json +250 -0
  214. package/.claude/skills/agentdb-advanced/SKILL.md +550 -0
  215. package/.claude/skills/agentdb-learning/SKILL.md +545 -0
  216. package/.claude/skills/agentdb-memory-patterns/SKILL.md +339 -0
  217. package/.claude/skills/agentdb-optimization/SKILL.md +509 -0
  218. package/.claude/skills/agentdb-vector-search/SKILL.md +339 -0
  219. package/.claude/skills/github-code-review/SKILL.md +1140 -0
  220. package/.claude/skills/github-multi-repo/SKILL.md +874 -0
  221. package/.claude/skills/github-project-management/SKILL.md +1277 -0
  222. package/.claude/skills/github-release-management/SKILL.md +1081 -0
  223. package/.claude/skills/github-workflow-automation/SKILL.md +1065 -0
  224. package/.claude/skills/hooks-automation/SKILL.md +1201 -0
  225. package/.claude/skills/pair-programming/SKILL.md +1202 -0
  226. package/.claude/skills/reasoningbank-agentdb/SKILL.md +446 -0
  227. package/.claude/skills/reasoningbank-intelligence/SKILL.md +201 -0
  228. package/.claude/skills/skill-builder/.claude-flow/metrics/agent-metrics.json +1 -0
  229. package/.claude/skills/skill-builder/.claude-flow/metrics/performance.json +87 -0
  230. package/.claude/skills/skill-builder/.claude-flow/metrics/task-metrics.json +10 -0
  231. package/.claude/skills/skill-builder/SKILL.md +910 -0
  232. package/.claude/skills/sparc-methodology/SKILL.md +1115 -0
  233. package/.claude/skills/stream-chain/SKILL.md +563 -0
  234. package/.claude/skills/swarm-advanced/SKILL.md +973 -0
  235. package/.claude/skills/swarm-orchestration/SKILL.md +179 -0
  236. package/.claude/skills/v3-cli-modernization/SKILL.md +872 -0
  237. package/.claude/skills/v3-core-implementation/SKILL.md +797 -0
  238. package/.claude/skills/v3-ddd-architecture/SKILL.md +442 -0
  239. package/.claude/skills/v3-integration-deep/SKILL.md +241 -0
  240. package/.claude/skills/v3-mcp-optimization/SKILL.md +777 -0
  241. package/.claude/skills/v3-memory-unification/SKILL.md +174 -0
  242. package/.claude/skills/v3-performance-optimization/SKILL.md +390 -0
  243. package/.claude/skills/v3-security-overhaul/SKILL.md +82 -0
  244. package/.claude/skills/v3-swarm-coordination/SKILL.md +340 -0
  245. package/.claude/skills/verification-quality/SKILL.md +649 -0
  246. package/.claude/statusline.mjs +109 -0
  247. package/.claude/statusline.sh +375 -0
  248. package/.claude-flow/CAPABILITIES.md +403 -0
  249. package/.claude-flow/config.yaml +43 -0
  250. package/.claude-flow/metrics/learning.json +17 -0
  251. package/.claude-flow/metrics/swarm-activity.json +18 -0
  252. package/.claude-flow/metrics/v3-progress.json +26 -0
  253. package/.claude-flow/security/audit-status.json +8 -0
  254. package/.mcp.json +20 -0
  255. package/AGENTS.md +145 -0
  256. package/CLAUDE.md +188 -0
  257. package/LICENSE +21 -0
  258. package/README.md +115 -0
  259. package/bin/cf-guidance-impl.mjs +74 -0
  260. package/package.json +23 -0
  261. package/scaffold/.claude/helpers/hook-handler.cjs +576 -0
  262. package/scaffold/docs/guidance-control-plane.md +441 -0
  263. package/scaffold/docs/guidance-implementation-guide.md +424 -0
  264. package/scaffold/scripts/analyze-guidance.js +176 -0
  265. package/scaffold/scripts/guidance-ab-benchmark.js +40 -0
  266. package/scaffold/scripts/guidance-autopilot.js +473 -0
  267. package/scaffold/scripts/guidance-codex-bridge.js +337 -0
  268. package/scaffold/scripts/guidance-integrations.js +587 -0
  269. package/scaffold/scripts/guidance-runtime.js +133 -0
  270. package/scaffold/scripts/scaffold-guidance.js +122 -0
  271. package/scaffold/src/guidance/advanced-runtime.js +658 -0
  272. package/scaffold/src/guidance/content-aware-executor.js +70 -0
  273. package/scaffold/src/guidance/phase1-runtime.js +151 -0
  274. package/src/default-settings.mjs +111 -0
  275. package/src/installer.mjs +415 -0
package/CLAUDE.md ADDED
@@ -0,0 +1,188 @@
1
+ # Claude Code Configuration - Claude Flow V3
2
+
3
+ ## Behavioral Rules (Always Enforced)
4
+
5
+ - Do what has been asked; nothing more, nothing less
6
+ - NEVER create files unless they're absolutely necessary for achieving your goal
7
+ - ALWAYS prefer editing an existing file to creating a new one
8
+ - NEVER proactively create documentation files (*.md) or README files unless explicitly requested
9
+ - NEVER save working files, text/mds, or tests to the root folder
10
+ - Never continuously check status after spawning a swarm — wait for results
11
+ - ALWAYS read a file before editing it
12
+ - NEVER commit secrets, credentials, or .env files
13
+
14
+ ## File Organization
15
+
16
+ - NEVER save to root folder — use the directories below
17
+ - Use `/src` for source code files
18
+ - Use `/tests` for test files
19
+ - Use `/docs` for documentation and markdown files
20
+ - Use `/config` for configuration files
21
+ - Use `/scripts` for utility scripts
22
+ - Use `/examples` for example code
23
+
24
+ ## Project Architecture
25
+
26
+ - Follow Domain-Driven Design with bounded contexts
27
+ - Keep files under 500 lines
28
+ - Use typed interfaces for all public APIs
29
+ - Prefer TDD London School (mock-first) for new code
30
+ - Use event sourcing for state changes
31
+ - Ensure input validation at system boundaries
32
+
33
+ ### Project Config
34
+
35
+ - **Topology**: hierarchical-mesh
36
+ - **Max Agents**: 15
37
+ - **Memory**: hybrid
38
+ - **HNSW**: Enabled
39
+ - **Neural**: Enabled
40
+
41
+ ## Build & Test
42
+
43
+ ```bash
44
+ # Build
45
+ npm run build
46
+
47
+ # Test
48
+ npm test
49
+
50
+ # Lint
51
+ npm run lint
52
+ ```
53
+
54
+ - ALWAYS run tests after making code changes
55
+ - ALWAYS verify build succeeds before committing
56
+
57
+ ## Security Rules
58
+
59
+ - NEVER hardcode API keys, secrets, or credentials in source files
60
+ - NEVER commit .env files or any file containing secrets
61
+ - Always validate user input at system boundaries
62
+ - Always sanitize file paths to prevent directory traversal
63
+ - Run `npx @claude-flow/cli@latest security scan` after security-related changes
64
+
65
+ ## Concurrency: 1 MESSAGE = ALL RELATED OPERATIONS
66
+
67
+ - All operations MUST be concurrent/parallel in a single message
68
+ - Use Claude Code's Task tool for spawning agents, not just MCP
69
+ - ALWAYS batch ALL todos in ONE TodoWrite call (5-10+ minimum)
70
+ - ALWAYS spawn ALL agents in ONE message with full instructions via Task tool
71
+ - ALWAYS batch ALL file reads/writes/edits in ONE message
72
+ - ALWAYS batch ALL Bash commands in ONE message
73
+
74
+ ## Swarm Orchestration
75
+
76
+ - MUST initialize the swarm using CLI tools when starting complex tasks
77
+ - MUST spawn concurrent agents using Claude Code's Task tool
78
+ - Never use CLI tools alone for execution — Task tool agents do the actual work
79
+ - MUST call CLI tools AND Task tool in ONE message for complex work
80
+
81
+ ### 3-Tier Model Routing (ADR-026)
82
+
83
+ | Tier | Handler | Latency | Cost | Use Cases |
84
+ |------|---------|---------|------|-----------|
85
+ | **1** | Agent Booster (WASM) | <1ms | $0 | Simple transforms (var→const, add types) — Skip LLM |
86
+ | **2** | Haiku | ~500ms | $0.0002 | Simple tasks, low complexity (<30%) |
87
+ | **3** | Sonnet/Opus | 2-5s | $0.003-0.015 | Complex reasoning, architecture, security (>30%) |
88
+
89
+ - Always check for `[AGENT_BOOSTER_AVAILABLE]` or `[TASK_MODEL_RECOMMENDATION]` before spawning agents
90
+ - Use Edit tool directly when `[AGENT_BOOSTER_AVAILABLE]`
91
+
92
+ ## Swarm Configuration & Anti-Drift
93
+
94
+ - ALWAYS use hierarchical topology for coding swarms
95
+ - Keep maxAgents at 6-8 for tight coordination
96
+ - Use specialized strategy for clear role boundaries
97
+ - Use `raft` consensus for hive-mind (leader maintains authoritative state)
98
+ - Run frequent checkpoints via `post-task` hooks
99
+ - Keep shared memory namespace for all agents
100
+
101
+ ```bash
102
+ npx @claude-flow/cli@latest swarm init --topology hierarchical --max-agents 8 --strategy specialized
103
+ ```
104
+
105
+ ## Swarm Execution Rules
106
+
107
+ - ALWAYS use `run_in_background: true` for all agent Task calls
108
+ - ALWAYS put ALL agent Task calls in ONE message for parallel execution
109
+ - After spawning, STOP — do NOT add more tool calls or check status
110
+ - Never poll TaskOutput or check swarm status — trust agents to return
111
+ - When agent results arrive, review ALL results before proceeding
112
+
113
+ ## V3 CLI Commands
114
+
115
+ ### Core Commands
116
+
117
+ | Command | Subcommands | Description |
118
+ |---------|-------------|-------------|
119
+ | `init` | 4 | Project initialization |
120
+ | `agent` | 8 | Agent lifecycle management |
121
+ | `swarm` | 6 | Multi-agent swarm coordination |
122
+ | `memory` | 11 | AgentDB memory with HNSW search |
123
+ | `task` | 6 | Task creation and lifecycle |
124
+ | `session` | 7 | Session state management |
125
+ | `hooks` | 17 | Self-learning hooks + 12 workers |
126
+ | `hive-mind` | 6 | Byzantine fault-tolerant consensus |
127
+
128
+ ### Quick CLI Examples
129
+
130
+ ```bash
131
+ npx @claude-flow/cli@latest init --wizard
132
+ npx @claude-flow/cli@latest agent spawn -t coder --name my-coder
133
+ npx @claude-flow/cli@latest swarm init --v3-mode
134
+ npx @claude-flow/cli@latest memory search --query "authentication patterns"
135
+ npx @claude-flow/cli@latest doctor --fix
136
+ ```
137
+
138
+ ## Available Agents (60+ Types)
139
+
140
+ ### Core Development
141
+ `coder`, `reviewer`, `tester`, `planner`, `researcher`
142
+
143
+ ### Specialized
144
+ `security-architect`, `security-auditor`, `memory-specialist`, `performance-engineer`
145
+
146
+ ### Swarm Coordination
147
+ `hierarchical-coordinator`, `mesh-coordinator`, `adaptive-coordinator`
148
+
149
+ ### GitHub & Repository
150
+ `pr-manager`, `code-review-swarm`, `issue-tracker`, `release-manager`
151
+
152
+ ### SPARC Methodology
153
+ `sparc-coord`, `sparc-coder`, `specification`, `pseudocode`, `architecture`
154
+
155
+ ## Memory Commands Reference
156
+
157
+ ```bash
158
+ # Store (REQUIRED: --key, --value; OPTIONAL: --namespace, --ttl, --tags)
159
+ npx @claude-flow/cli@latest memory store --key "pattern-auth" --value "JWT with refresh" --namespace patterns
160
+
161
+ # Search (REQUIRED: --query; OPTIONAL: --namespace, --limit, --threshold)
162
+ npx @claude-flow/cli@latest memory search --query "authentication patterns"
163
+
164
+ # List (OPTIONAL: --namespace, --limit)
165
+ npx @claude-flow/cli@latest memory list --namespace patterns --limit 10
166
+
167
+ # Retrieve (REQUIRED: --key; OPTIONAL: --namespace)
168
+ npx @claude-flow/cli@latest memory retrieve --key "pattern-auth" --namespace patterns
169
+ ```
170
+
171
+ ## Quick Setup
172
+
173
+ ```bash
174
+ claude mcp add claude-flow -- npx -y @claude-flow/cli@latest
175
+ npx @claude-flow/cli@latest daemon start
176
+ npx @claude-flow/cli@latest doctor --fix
177
+ ```
178
+
179
+ ## Claude Code vs CLI Tools
180
+
181
+ - Claude Code's Task tool handles ALL execution: agents, file ops, code generation, git
182
+ - CLI tools handle coordination via Bash: swarm init, memory, hooks, routing
183
+ - NEVER use CLI tools as a substitute for Task tool agents
184
+
185
+ ## Support
186
+
187
+ - Documentation: https://github.com/ruvnet/claude-flow
188
+ - Issues: https://github.com/ruvnet/claude-flow/issues
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,115 @@
1
+ # claude-flow-guidance-implementation
2
+
3
+ Reusable implementation kit for wiring `@claude-flow/guidance` into any repo with:
4
+ - guidance runtime scripts
5
+ - Claude Code hook bridge
6
+ - autopilot promotion loop (`CLAUDE.local.md` -> `CLAUDE.md`)
7
+ - verification runbook and docs
8
+
9
+ ## What this repo provides
10
+
11
+ - A reusable scaffold under `scaffold/`:
12
+ - `.claude/helpers/hook-handler.cjs`
13
+ - `scripts/guidance-*.js`
14
+ - `src/guidance/*.js`
15
+ - docs
16
+ - An installer CLI:
17
+ - `cf-guidance-impl install --target <repo>`
18
+ - `cf-guidance-impl verify --target <repo>`
19
+ - JSON merge logic for:
20
+ - `package.json` scripts + dependencies
21
+ - `.claude/settings.json` env + hooks
22
+ - `.agents/config.toml` Codex bridge section
23
+ - `AGENTS.md` Codex lifecycle usage section
24
+
25
+ ## Quickstart
26
+
27
+ ```bash
28
+ # clone this toolkit
29
+ cd ~/source
30
+ git clone https://github.com/sparkling/claude-flow-guidance-implementation.git
31
+ cd claude-flow-guidance-implementation
32
+
33
+ # initialize + wire another repo (runs `claude-flow init --dual`, install, verify)
34
+ node bin/cf-guidance-impl.mjs init --target ~/source/my-project --install-deps
35
+
36
+ # verify the wiring
37
+ node bin/cf-guidance-impl.mjs verify --target ~/source/my-project
38
+ ```
39
+
40
+ Init command options:
41
+ - `--no-dual`: run `claude-flow init` without `--dual`
42
+ - `--skip-cf-init`: skip `claude-flow init` and only apply toolkit wiring
43
+ - `--no-verify`: skip post-install verification
44
+
45
+ ## Integration modes for other repos
46
+
47
+ ## 1) Central toolkit mode (recommended)
48
+ Keep this repo as a shared toolkit and run installer into target repos:
49
+
50
+ ```bash
51
+ node ~/source/claude-flow-guidance-implementation/bin/cf-guidance-impl.mjs init --target ~/source/repo-a --install-deps
52
+ node ~/source/claude-flow-guidance-implementation/bin/cf-guidance-impl.mjs init --target ~/source/repo-b --install-deps
53
+ ```
54
+
55
+ ## 2) Submodule mode
56
+ Add this repo as a submodule in each project and invoke the installer from there.
57
+
58
+ ## 3) Copy mode
59
+ Copy `scaffold/` manually and merge settings/scripts manually.
60
+
61
+ ## What gets wired in the target repo
62
+
63
+ - Hook flow: `PreToolUse`/`PostToolUse`/`SessionStart`/`SessionEnd`
64
+ - Guidance events: `pre-command`, `pre-edit`, `pre-task`, `post-edit`, `post-task`, `session-end`
65
+ - Codex lifecycle bridge: `scripts/guidance-codex-bridge.js`
66
+ - Background session-end autopilot launch
67
+ - NPM wrappers:
68
+ - `guidance:analyze`, `guidance:status`, `guidance:all`
69
+ - `guidance:optimize`, `guidance:ab-benchmark`
70
+ - `guidance:scaffold`
71
+ - `guidance:autopilot:once`, `guidance:autopilot:daemon`
72
+ - `guidance:codex:status`
73
+ - `guidance:codex:pre-command`, `guidance:codex:pre-edit`, `guidance:codex:pre-task`
74
+ - `guidance:codex:post-edit`, `guidance:codex:post-task`
75
+ - `guidance:codex:session-start`, `guidance:codex:session-end`
76
+
77
+ ## Codex integration runbook
78
+
79
+ ```bash
80
+ # initialize lifecycle context
81
+ npm run guidance:codex:session-start
82
+
83
+ # gate the task and operations
84
+ npm run guidance:codex:pre-task -- --task-id task-123 --description "Implement feature X"
85
+ npm run guidance:codex:pre-command -- --task-id task-123 --command "git status"
86
+ npm run guidance:codex:pre-edit -- --task-id task-123 --file src/example.ts --operation modify
87
+
88
+ # record completion
89
+ npm run guidance:codex:post-edit -- --task-id task-123 --file src/example.ts
90
+ npm run guidance:codex:post-task -- --task-id task-123 --status completed --description "Implement feature X"
91
+ npm run guidance:codex:session-end -- --task-id task-123
92
+ ```
93
+
94
+ Validation:
95
+ ```bash
96
+ npm run guidance:codex:status
97
+ npm run guidance:codex:pre-task -- --task-id smoke-1 --description "smoke" --skip-cf-hooks
98
+ ```
99
+
100
+ Expected output is JSON:
101
+ - `handler.ok: true` means local bridge + hook-handler path passed.
102
+ - `claudeFlowHook.ok: true` means secondary `@claude-flow/cli` hook invocation passed.
103
+
104
+ ## Swarm commands
105
+
106
+ ```bash
107
+ npm run swarm:init
108
+ npm run swarm:route
109
+ ```
110
+
111
+ ## Notes
112
+
113
+ - Existing target repo config is merged, not replaced.
114
+ - `CLAUDE.local.md` is created if missing and added to `.gitignore`.
115
+ - The scaffold includes docs that explain operational details.
@@ -0,0 +1,74 @@
1
+ #!/usr/bin/env node
2
+ import { dirname, resolve } from 'node:path';
3
+ import { fileURLToPath } from 'node:url';
4
+
5
+ import { initRepo, installIntoRepo, verifyRepo } from '../src/installer.mjs';
6
+
7
+ const __dirname = dirname(fileURLToPath(import.meta.url));
8
+ const toolkitRoot = resolve(__dirname, '..');
9
+
10
+ function usage() {
11
+ console.log(`Usage:
12
+ cf-guidance-impl init --target <repoPath> [--force] [--install-deps] [--no-dual] [--skip-cf-init] [--no-verify]
13
+ cf-guidance-impl install --target <repoPath> [--force] [--install-deps]
14
+ cf-guidance-impl verify --target <repoPath>
15
+ `);
16
+ }
17
+
18
+ function getFlagValue(args, flag, fallback = null) {
19
+ const index = args.indexOf(flag);
20
+ if (index < 0 || index + 1 >= args.length) return fallback;
21
+ return args[index + 1];
22
+ }
23
+
24
+ function hasFlag(args, flag) {
25
+ return args.includes(flag);
26
+ }
27
+
28
+ async function main() {
29
+ const [, , command, ...args] = process.argv;
30
+
31
+ if (!command || command === '--help' || command === '-h') {
32
+ usage();
33
+ process.exit(command ? 0 : 1);
34
+ }
35
+
36
+ const target = getFlagValue(args, '--target', process.cwd());
37
+ const force = hasFlag(args, '--force');
38
+ const installDeps = hasFlag(args, '--install-deps');
39
+
40
+ if (command === 'init') {
41
+ const result = initRepo({
42
+ toolkitRoot,
43
+ targetRepo: target,
44
+ force,
45
+ installDeps,
46
+ dual: !hasFlag(args, '--no-dual'),
47
+ skipCfInit: hasFlag(args, '--skip-cf-init'),
48
+ verify: !hasFlag(args, '--no-verify'),
49
+ });
50
+ console.log(JSON.stringify(result, null, 2));
51
+ return;
52
+ }
53
+
54
+ if (command === 'install') {
55
+ const result = installIntoRepo({ toolkitRoot, targetRepo: target, force, installDeps });
56
+ console.log(JSON.stringify(result, null, 2));
57
+ return;
58
+ }
59
+
60
+ if (command === 'verify') {
61
+ const report = verifyRepo({ targetRepo: target });
62
+ console.log(JSON.stringify(report, null, 2));
63
+ process.exit(report.passed ? 0 : 2);
64
+ }
65
+
66
+ usage();
67
+ process.exit(1);
68
+ }
69
+
70
+ main().catch((error) => {
71
+ const message = error instanceof Error ? error.message : String(error);
72
+ console.error(message);
73
+ process.exit(1);
74
+ });
package/package.json ADDED
@@ -0,0 +1,23 @@
1
+ {
2
+ "name": "claude-flow-guidance-implementation",
3
+ "version": "0.1.0",
4
+ "description": "Reusable guidance control-plane implementation kit for wiring @claude-flow/guidance into any repo",
5
+ "type": "module",
6
+ "private": false,
7
+ "bin": {
8
+ "cf-guidance-impl": "bin/cf-guidance-impl.mjs"
9
+ },
10
+ "scripts": {
11
+ "lint": "node ./bin/cf-guidance-impl.mjs verify --target .",
12
+ "swarm:init": "npx @claude-flow/cli@latest swarm init --topology hierarchical --max-agents 8 --strategy specialized",
13
+ "swarm:route": "npx @claude-flow/cli@latest hooks route --task \"implement reusable guidance integration kit\""
14
+ },
15
+ "keywords": [
16
+ "claude-flow",
17
+ "guidance",
18
+ "hooks",
19
+ "claude-code",
20
+ "automation"
21
+ ],
22
+ "license": "MIT"
23
+ }