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
@@ -0,0 +1,54 @@
1
+ # SPARC Swarm Coordinator Mode
2
+
3
+ ## Purpose
4
+ Specialized swarm management with batch coordination capabilities.
5
+
6
+ ## Activation
7
+
8
+ ### Option 1: Using MCP Tools (Preferred in Claude Code)
9
+ ```javascript
10
+ mcp__claude-flow__sparc_mode {
11
+ mode: "swarm-coordinator",
12
+ task_description: "manage development swarm",
13
+ options: {
14
+ topology: "hierarchical",
15
+ max_agents: 10
16
+ }
17
+ }
18
+ ```
19
+
20
+ ### Option 2: Using NPX CLI (Fallback when MCP not available)
21
+ ```bash
22
+ # Use when running from terminal or MCP tools unavailable
23
+ npx claude-flow sparc run swarm-coordinator "manage development swarm"
24
+
25
+ # For alpha features
26
+ npx claude-flow@alpha sparc run swarm-coordinator "manage development swarm"
27
+ ```
28
+
29
+ ### Option 3: Local Installation
30
+ ```bash
31
+ # If claude-flow is installed locally
32
+ ./claude-flow sparc run swarm-coordinator "manage development swarm"
33
+ ```
34
+
35
+ ## Core Capabilities
36
+ - Swarm initialization
37
+ - Agent management
38
+ - Task distribution
39
+ - Load balancing
40
+ - Result collection
41
+
42
+ ## Coordination Modes
43
+ - Hierarchical swarms
44
+ - Mesh networks
45
+ - Pipeline coordination
46
+ - Adaptive strategies
47
+ - Hybrid approaches
48
+
49
+ ## Management Features
50
+ - Dynamic scaling
51
+ - Resource optimization
52
+ - Failure recovery
53
+ - Performance monitoring
54
+ - Quality assurance
@@ -0,0 +1,54 @@
1
+ # SPARC TDD Mode
2
+
3
+ ## Purpose
4
+ Test-driven development with TodoWrite planning and comprehensive testing.
5
+
6
+ ## Activation
7
+
8
+ ### Option 1: Using MCP Tools (Preferred in Claude Code)
9
+ ```javascript
10
+ mcp__claude-flow__sparc_mode {
11
+ mode: "tdd",
12
+ task_description: "shopping cart feature",
13
+ options: {
14
+ coverage_target: 90,
15
+ test_framework: "jest"
16
+ }
17
+ }
18
+ ```
19
+
20
+ ### Option 2: Using NPX CLI (Fallback when MCP not available)
21
+ ```bash
22
+ # Use when running from terminal or MCP tools unavailable
23
+ npx claude-flow sparc run tdd "shopping cart feature"
24
+
25
+ # For alpha features
26
+ npx claude-flow@alpha sparc run tdd "shopping cart feature"
27
+ ```
28
+
29
+ ### Option 3: Local Installation
30
+ ```bash
31
+ # If claude-flow is installed locally
32
+ ./claude-flow sparc run tdd "shopping cart feature"
33
+ ```
34
+
35
+ ## Core Capabilities
36
+ - Test-first development
37
+ - Red-green-refactor cycle
38
+ - Test suite design
39
+ - Coverage optimization
40
+ - Continuous testing
41
+
42
+ ## TDD Workflow
43
+ 1. Write failing tests
44
+ 2. Implement minimum code
45
+ 3. Make tests pass
46
+ 4. Refactor code
47
+ 5. Repeat cycle
48
+
49
+ ## Testing Strategies
50
+ - Unit testing
51
+ - Integration testing
52
+ - End-to-end testing
53
+ - Performance testing
54
+ - Security testing
@@ -0,0 +1,54 @@
1
+ # SPARC Tester Mode
2
+
3
+ ## Purpose
4
+ Comprehensive testing with parallel execution capabilities.
5
+
6
+ ## Activation
7
+
8
+ ### Option 1: Using MCP Tools (Preferred in Claude Code)
9
+ ```javascript
10
+ mcp__claude-flow__sparc_mode {
11
+ mode: "tester",
12
+ task_description: "full regression suite",
13
+ options: {
14
+ parallel: true,
15
+ coverage: true
16
+ }
17
+ }
18
+ ```
19
+
20
+ ### Option 2: Using NPX CLI (Fallback when MCP not available)
21
+ ```bash
22
+ # Use when running from terminal or MCP tools unavailable
23
+ npx claude-flow sparc run tester "full regression suite"
24
+
25
+ # For alpha features
26
+ npx claude-flow@alpha sparc run tester "full regression suite"
27
+ ```
28
+
29
+ ### Option 3: Local Installation
30
+ ```bash
31
+ # If claude-flow is installed locally
32
+ ./claude-flow sparc run tester "full regression suite"
33
+ ```
34
+
35
+ ## Core Capabilities
36
+ - Test planning
37
+ - Test execution
38
+ - Bug detection
39
+ - Coverage analysis
40
+ - Report generation
41
+
42
+ ## Test Types
43
+ - Unit tests
44
+ - Integration tests
45
+ - E2E tests
46
+ - Performance tests
47
+ - Security tests
48
+
49
+ ## Parallel Features
50
+ - Concurrent test runs
51
+ - Distributed testing
52
+ - Load testing
53
+ - Cross-browser testing
54
+ - Multi-environment validation
@@ -0,0 +1,79 @@
1
+ ---
2
+ name: sparc-tutorial
3
+ description: 📘 SPARC Tutorial - You are the SPARC onboarding and education assistant. Your job is to guide users through the full...
4
+ ---
5
+
6
+ # 📘 SPARC Tutorial
7
+
8
+ ## Role Definition
9
+ You are the SPARC onboarding and education assistant. Your job is to guide users through the full SPARC development process using structured thinking models. You help users understand how to navigate complex projects using the specialized SPARC modes and properly formulate tasks using new_task.
10
+
11
+ ## Custom Instructions
12
+ You teach developers how to apply the SPARC methodology through actionable examples and mental models.
13
+
14
+ ## Available Tools
15
+ - **read**: File reading and viewing
16
+
17
+ ## Usage
18
+
19
+ ### Option 1: Using MCP Tools (Preferred in Claude Code)
20
+ ```javascript
21
+ mcp__claude-flow__sparc_mode {
22
+ mode: "tutorial",
23
+ task_description: "guide me through SPARC methodology",
24
+ options: {
25
+ namespace: "tutorial",
26
+ non_interactive: false
27
+ }
28
+ }
29
+ ```
30
+
31
+ ### Option 2: Using NPX CLI (Fallback when MCP not available)
32
+ ```bash
33
+ # Use when running from terminal or MCP tools unavailable
34
+ npx claude-flow sparc run tutorial "guide me through SPARC methodology"
35
+
36
+ # For alpha features
37
+ npx claude-flow@alpha sparc run tutorial "guide me through SPARC methodology"
38
+
39
+ # With namespace
40
+ npx claude-flow sparc run tutorial "your task" --namespace tutorial
41
+
42
+ # Non-interactive mode
43
+ npx claude-flow sparc run tutorial "your task" --non-interactive
44
+ ```
45
+
46
+ ### Option 3: Local Installation
47
+ ```bash
48
+ # If claude-flow is installed locally
49
+ ./claude-flow sparc run tutorial "guide me through SPARC methodology"
50
+ ```
51
+
52
+ ## Memory Integration
53
+
54
+ ### Using MCP Tools (Preferred)
55
+ ```javascript
56
+ // Store mode-specific context
57
+ mcp__claude-flow__memory_usage {
58
+ action: "store",
59
+ key: "tutorial_context",
60
+ value: "important decisions",
61
+ namespace: "tutorial"
62
+ }
63
+
64
+ // Query previous work
65
+ mcp__claude-flow__memory_search {
66
+ pattern: "tutorial",
67
+ namespace: "tutorial",
68
+ limit: 5
69
+ }
70
+ ```
71
+
72
+ ### Using NPX CLI (Fallback)
73
+ ```bash
74
+ # Store mode-specific context
75
+ npx claude-flow memory store "tutorial_context" "important decisions" --namespace tutorial
76
+
77
+ # Query previous work
78
+ npx claude-flow memory query "tutorial" --limit 5
79
+ ```
@@ -0,0 +1,54 @@
1
+ # SPARC Workflow Manager Mode
2
+
3
+ ## Purpose
4
+ Process automation with TodoWrite planning and Task execution.
5
+
6
+ ## Activation
7
+
8
+ ### Option 1: Using MCP Tools (Preferred in Claude Code)
9
+ ```javascript
10
+ mcp__claude-flow__sparc_mode {
11
+ mode: "workflow-manager",
12
+ task_description: "automate deployment",
13
+ options: {
14
+ pipeline: "ci-cd",
15
+ rollback_enabled: true
16
+ }
17
+ }
18
+ ```
19
+
20
+ ### Option 2: Using NPX CLI (Fallback when MCP not available)
21
+ ```bash
22
+ # Use when running from terminal or MCP tools unavailable
23
+ npx claude-flow sparc run workflow-manager "automate deployment"
24
+
25
+ # For alpha features
26
+ npx claude-flow@alpha sparc run workflow-manager "automate deployment"
27
+ ```
28
+
29
+ ### Option 3: Local Installation
30
+ ```bash
31
+ # If claude-flow is installed locally
32
+ ./claude-flow sparc run workflow-manager "automate deployment"
33
+ ```
34
+
35
+ ## Core Capabilities
36
+ - Workflow design
37
+ - Process automation
38
+ - Pipeline creation
39
+ - Event handling
40
+ - State management
41
+
42
+ ## Workflow Patterns
43
+ - Sequential flows
44
+ - Parallel branches
45
+ - Conditional logic
46
+ - Loop iterations
47
+ - Error handling
48
+
49
+ ## Automation Features
50
+ - Trigger management
51
+ - Task scheduling
52
+ - Progress tracking
53
+ - Result validation
54
+ - Rollback capability
@@ -0,0 +1,168 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Claude Flow Hook Handler (Cross-Platform)
4
+ * Dispatches hook events to the appropriate helper modules.
5
+ */
6
+
7
+ const path = require('path');
8
+ const fs = require('fs');
9
+
10
+ const helpersDir = __dirname;
11
+
12
+ function safeRequire(modulePath) {
13
+ try {
14
+ if (fs.existsSync(modulePath)) {
15
+ const origLog = console.log;
16
+ const origError = console.error;
17
+ console.log = () => {};
18
+ console.error = () => {};
19
+ try {
20
+ const mod = require(modulePath);
21
+ return mod;
22
+ } finally {
23
+ console.log = origLog;
24
+ console.error = origError;
25
+ }
26
+ }
27
+ } catch (e) {
28
+ // silently fail
29
+ }
30
+ return null;
31
+ }
32
+
33
+ const router = safeRequire(path.join(helpersDir, 'router.js'));
34
+ const session = safeRequire(path.join(helpersDir, 'session.js'));
35
+ const memory = safeRequire(path.join(helpersDir, 'memory.js'));
36
+ const intelligence = safeRequire(path.join(helpersDir, 'intelligence.cjs'));
37
+
38
+ const [,, command, ...args] = process.argv;
39
+ const prompt = process.env.PROMPT || process.env.TOOL_INPUT_command || args.join(' ') || '';
40
+
41
+ const handlers = {
42
+ 'route': () => {
43
+ if (intelligence && intelligence.getContext) {
44
+ try {
45
+ const ctx = intelligence.getContext(prompt);
46
+ if (ctx) console.log(ctx);
47
+ } catch (e) { /* non-fatal */ }
48
+ }
49
+ if (router && router.routeTask) {
50
+ const result = router.routeTask(prompt);
51
+ var output = [];
52
+ output.push('[INFO] Routing task: ' + (prompt.substring(0, 80) || '(no prompt)'));
53
+ output.push('');
54
+ output.push('+------------------- Primary Recommendation -------------------+');
55
+ output.push('| Agent: ' + result.agent.padEnd(53) + '|');
56
+ output.push('| Confidence: ' + (result.confidence * 100).toFixed(1) + '%' + ' '.repeat(44) + '|');
57
+ output.push('| Reason: ' + result.reason.substring(0, 53).padEnd(53) + '|');
58
+ output.push('+--------------------------------------------------------------+');
59
+ console.log(output.join('\n'));
60
+ } else {
61
+ console.log('[INFO] Router not available, using default routing');
62
+ }
63
+ },
64
+
65
+ 'pre-bash': () => {
66
+ var cmd = prompt.toLowerCase();
67
+ var dangerous = ['rm -rf /', 'format c:', 'del /s /q c:\\', ':(){:|:&};:'];
68
+ for (var i = 0; i < dangerous.length; i++) {
69
+ if (cmd.includes(dangerous[i])) {
70
+ console.error('[BLOCKED] Dangerous command detected: ' + dangerous[i]);
71
+ process.exit(1);
72
+ }
73
+ }
74
+ console.log('[OK] Command validated');
75
+ },
76
+
77
+ 'post-edit': () => {
78
+ if (session && session.metric) {
79
+ try { session.metric('edits'); } catch (e) { /* no active session */ }
80
+ }
81
+ if (intelligence && intelligence.recordEdit) {
82
+ try {
83
+ var file = process.env.TOOL_INPUT_file_path || args[0] || '';
84
+ intelligence.recordEdit(file);
85
+ } catch (e) { /* non-fatal */ }
86
+ }
87
+ console.log('[OK] Edit recorded');
88
+ },
89
+
90
+ 'session-restore': () => {
91
+ if (session) {
92
+ var existing = session.restore && session.restore();
93
+ if (!existing) {
94
+ session.start && session.start();
95
+ }
96
+ } else {
97
+ console.log('[OK] Session restored: session-' + Date.now());
98
+ }
99
+ if (intelligence && intelligence.init) {
100
+ try {
101
+ var result = intelligence.init();
102
+ if (result && result.nodes > 0) {
103
+ console.log('[INTELLIGENCE] Loaded ' + result.nodes + ' patterns, ' + result.edges + ' edges');
104
+ }
105
+ } catch (e) { /* non-fatal */ }
106
+ }
107
+ },
108
+
109
+ 'session-end': () => {
110
+ if (intelligence && intelligence.consolidate) {
111
+ try {
112
+ var result = intelligence.consolidate();
113
+ if (result && result.entries > 0) {
114
+ var msg = '[INTELLIGENCE] Consolidated: ' + result.entries + ' entries, ' + result.edges + ' edges';
115
+ if (result.newEntries > 0) msg += ', ' + result.newEntries + ' new';
116
+ msg += ', PageRank recomputed';
117
+ console.log(msg);
118
+ }
119
+ } catch (e) { /* non-fatal */ }
120
+ }
121
+ if (session && session.end) {
122
+ session.end();
123
+ } else {
124
+ console.log('[OK] Session ended');
125
+ }
126
+ },
127
+
128
+ 'pre-task': () => {
129
+ if (session && session.metric) {
130
+ try { session.metric('tasks'); } catch (e) { /* no active session */ }
131
+ }
132
+ if (router && router.routeTask && prompt) {
133
+ var result = router.routeTask(prompt);
134
+ console.log('[INFO] Task routed to: ' + result.agent + ' (confidence: ' + result.confidence + ')');
135
+ } else {
136
+ console.log('[OK] Task started');
137
+ }
138
+ },
139
+
140
+ 'post-task': () => {
141
+ if (intelligence && intelligence.feedback) {
142
+ try {
143
+ intelligence.feedback(true);
144
+ } catch (e) { /* non-fatal */ }
145
+ }
146
+ console.log('[OK] Task completed');
147
+ },
148
+
149
+ 'stats': () => {
150
+ if (intelligence && intelligence.stats) {
151
+ intelligence.stats(args.includes('--json'));
152
+ } else {
153
+ console.log('[WARN] Intelligence module not available. Run session-restore first.');
154
+ }
155
+ },
156
+ };
157
+
158
+ if (command && handlers[command]) {
159
+ try {
160
+ handlers[command]();
161
+ } catch (e) {
162
+ console.log('[WARN] Hook ' + command + ' encountered an error: ' + e.message);
163
+ }
164
+ } else if (command) {
165
+ console.log('[OK] Hook: ' + command);
166
+ } else {
167
+ console.log('Usage: hook-handler.cjs <route|pre-bash|post-edit|session-restore|session-end|pre-task|post-task|stats>');
168
+ }
@@ -0,0 +1,197 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Intelligence Layer Stub (ADR-050)
4
+ * Minimal fallback — full version is copied from package source.
5
+ * Provides: init, getContext, recordEdit, feedback, consolidate
6
+ */
7
+ 'use strict';
8
+
9
+ const fs = require('fs');
10
+ const path = require('path');
11
+ const os = require('os');
12
+
13
+ const DATA_DIR = path.join(process.cwd(), '.claude-flow', 'data');
14
+ const STORE_PATH = path.join(DATA_DIR, 'auto-memory-store.json');
15
+ const RANKED_PATH = path.join(DATA_DIR, 'ranked-context.json');
16
+ const PENDING_PATH = path.join(DATA_DIR, 'pending-insights.jsonl');
17
+ const SESSION_DIR = path.join(process.cwd(), '.claude-flow', 'sessions');
18
+ const SESSION_FILE = path.join(SESSION_DIR, 'current.json');
19
+
20
+ function ensureDir(dir) {
21
+ if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
22
+ }
23
+
24
+ function readJSON(p) {
25
+ try { return fs.existsSync(p) ? JSON.parse(fs.readFileSync(p, "utf-8")) : null; }
26
+ catch { return null; }
27
+ }
28
+
29
+ function writeJSON(p, data) {
30
+ ensureDir(path.dirname(p));
31
+ fs.writeFileSync(p, JSON.stringify(data, null, 2), "utf-8");
32
+ }
33
+
34
+ // Read session context key
35
+ function sessionGet(key) {
36
+ var session = readJSON(SESSION_FILE);
37
+ if (!session) return null;
38
+ return key ? (session.context || {})[key] : session.context;
39
+ }
40
+
41
+ // Write session context key
42
+ function sessionSet(key, value) {
43
+ var session = readJSON(SESSION_FILE);
44
+ if (!session) return;
45
+ if (!session.context) session.context = {};
46
+ session.context[key] = value;
47
+ writeJSON(SESSION_FILE, session);
48
+ }
49
+
50
+ // Tokenize text into words
51
+ function tokenize(text) {
52
+ if (!text) return [];
53
+ return text.toLowerCase().replace(/[^a-z0-9\s]/g, " ").split(/\s+/).filter(function(w) { return w.length > 2; });
54
+ }
55
+
56
+ // Bootstrap entries from MEMORY.md files when store is empty
57
+ function bootstrapFromMemoryFiles() {
58
+ var entries = [];
59
+ var candidates = [
60
+ path.join(os.homedir(), ".claude", "projects"),
61
+ path.join(process.cwd(), ".claude-flow", "memory"),
62
+ path.join(process.cwd(), ".claude", "memory"),
63
+ ];
64
+ for (var i = 0; i < candidates.length; i++) {
65
+ try {
66
+ if (!fs.existsSync(candidates[i])) continue;
67
+ var files = [];
68
+ try {
69
+ var items = fs.readdirSync(candidates[i], { withFileTypes: true, recursive: true });
70
+ for (var j = 0; j < items.length; j++) {
71
+ if (items[j].name === "MEMORY.md") {
72
+ var fp = items[j].path ? path.join(items[j].path, items[j].name) : path.join(candidates[i], items[j].name);
73
+ files.push(fp);
74
+ }
75
+ }
76
+ } catch (e) { continue; }
77
+ for (var k = 0; k < files.length; k++) {
78
+ try {
79
+ var content = fs.readFileSync(files[k], "utf-8");
80
+ var sections = content.split(/^##\s+/m).filter(function(s) { return s.trim().length > 20; });
81
+ for (var s = 0; s < sections.length; s++) {
82
+ var lines2 = sections[s].split("\n");
83
+ var title = lines2[0] ? lines2[0].trim() : "section-" + s;
84
+ entries.push({
85
+ id: "mem-" + entries.length,
86
+ content: sections[s].substring(0, 500),
87
+ summary: title.substring(0, 100),
88
+ category: "memory",
89
+ confidence: 0.5,
90
+ sourceFile: files[k],
91
+ words: tokenize(sections[s].substring(0, 500)),
92
+ });
93
+ }
94
+ } catch (e) { /* skip */ }
95
+ }
96
+ } catch (e) { /* skip */ }
97
+ }
98
+ return entries;
99
+ }
100
+
101
+ // Load entries from auto-memory-store or bootstrap from MEMORY.md
102
+ function loadEntries() {
103
+ var store = readJSON(STORE_PATH);
104
+ if (store && store.entries && store.entries.length > 0) {
105
+ return store.entries.map(function(e, i) {
106
+ return {
107
+ id: e.id || ("entry-" + i),
108
+ content: e.content || e.value || "",
109
+ summary: e.summary || e.key || "",
110
+ category: e.category || e.namespace || "default",
111
+ confidence: e.confidence || 0.5,
112
+ sourceFile: e.sourceFile || "",
113
+ words: tokenize((e.content || e.value || "") + " " + (e.summary || e.key || "")),
114
+ };
115
+ });
116
+ }
117
+ return bootstrapFromMemoryFiles();
118
+ }
119
+
120
+ // Simple keyword match score
121
+ function matchScore(promptWords, entryWords) {
122
+ if (!promptWords.length || !entryWords.length) return 0;
123
+ var entrySet = {};
124
+ for (var i = 0; i < entryWords.length; i++) entrySet[entryWords[i]] = true;
125
+ var overlap = 0;
126
+ for (var j = 0; j < promptWords.length; j++) {
127
+ if (entrySet[promptWords[j]]) overlap++;
128
+ }
129
+ var union = Object.keys(entrySet).length + promptWords.length - overlap;
130
+ return union > 0 ? overlap / union : 0;
131
+ }
132
+
133
+ var cachedEntries = null;
134
+
135
+ module.exports = {
136
+ init: function() {
137
+ cachedEntries = loadEntries();
138
+ var ranked = cachedEntries.map(function(e) {
139
+ return { id: e.id, content: e.content, summary: e.summary, category: e.category, confidence: e.confidence, words: e.words };
140
+ });
141
+ writeJSON(RANKED_PATH, { version: 1, computedAt: Date.now(), entries: ranked });
142
+ return { nodes: cachedEntries.length, edges: 0 };
143
+ },
144
+
145
+ getContext: function(prompt) {
146
+ if (!prompt) return null;
147
+ var ranked = readJSON(RANKED_PATH);
148
+ var entries = (ranked && ranked.entries) || (cachedEntries || []);
149
+ if (!entries.length) return null;
150
+ var promptWords = tokenize(prompt);
151
+ if (!promptWords.length) return null;
152
+ var scored = entries.map(function(e) {
153
+ return { entry: e, score: matchScore(promptWords, e.words || tokenize(e.content + " " + e.summary)) };
154
+ }).filter(function(s) { return s.score > 0.05; });
155
+ scored.sort(function(a, b) { return b.score - a.score; });
156
+ var top = scored.slice(0, 5);
157
+ if (!top.length) return null;
158
+ var prevMatched = sessionGet("lastMatchedPatterns");
159
+ var matchedIds = top.map(function(s) { return s.entry.id; });
160
+ sessionSet("lastMatchedPatterns", matchedIds);
161
+ if (prevMatched && Array.isArray(prevMatched)) {
162
+ var newSet = {};
163
+ for (var i = 0; i < matchedIds.length; i++) newSet[matchedIds[i]] = true;
164
+ }
165
+ var lines2 = ["[INTELLIGENCE] Relevant patterns for this task:"];
166
+ for (var j = 0; j < top.length; j++) {
167
+ var e = top[j];
168
+ var conf = e.entry.confidence || 0.5;
169
+ var summary = (e.entry.summary || e.entry.content || "").substring(0, 80);
170
+ lines2.push(" * (" + conf.toFixed(2) + ") " + summary);
171
+ }
172
+ return lines2.join("\n");
173
+ },
174
+
175
+ recordEdit: function(file) {
176
+ if (!file) return;
177
+ ensureDir(DATA_DIR);
178
+ var line = JSON.stringify({ type: "edit", file: file, timestamp: Date.now() }) + "\n";
179
+ fs.appendFileSync(PENDING_PATH, line, "utf-8");
180
+ },
181
+
182
+ feedback: function(success) {
183
+ // Stub: no-op in minimal version
184
+ },
185
+
186
+ consolidate: function() {
187
+ var count = 0;
188
+ if (fs.existsSync(PENDING_PATH)) {
189
+ try {
190
+ var content = fs.readFileSync(PENDING_PATH, "utf-8").trim();
191
+ count = content ? content.split("\n").length : 0;
192
+ fs.writeFileSync(PENDING_PATH, "", "utf-8");
193
+ } catch (e) { /* skip */ }
194
+ }
195
+ return { entries: count, edges: 0, newEntries: 0 };
196
+ },
197
+ };