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,118 @@
1
+ ---
2
+ name: sparc-methodology
3
+ description: >
4
+ SPARC development workflow: Specification, Pseudocode, Architecture, Refinement, Completion. A structured approach for complex implementations that ensures thorough planning before coding.
5
+ Use when: new feature implementation, complex implementations, architectural changes, system redesign, integration work, unclear requirements.
6
+ Skip when: simple bug fixes, documentation updates, configuration changes, well-defined small tasks, routine maintenance.
7
+ ---
8
+
9
+ # Sparc Methodology Skill
10
+
11
+ ## Purpose
12
+ SPARC development workflow: Specification, Pseudocode, Architecture, Refinement, Completion. A structured approach for complex implementations that ensures thorough planning before coding.
13
+
14
+ ## When to Trigger
15
+ - new feature implementation
16
+ - complex implementations
17
+ - architectural changes
18
+ - system redesign
19
+ - integration work
20
+ - unclear requirements
21
+
22
+ ## When to Skip
23
+ - simple bug fixes
24
+ - documentation updates
25
+ - configuration changes
26
+ - well-defined small tasks
27
+ - routine maintenance
28
+
29
+ ## Commands
30
+
31
+ ### Specification Phase
32
+ Define requirements, acceptance criteria, and constraints
33
+
34
+ ```bash
35
+ npx @claude-flow/cli hooks route --task "specification: [requirements]"
36
+ ```
37
+
38
+ **Example:**
39
+ ```bash
40
+ npx @claude-flow/cli hooks route --task "specification: user authentication with OAuth2, MFA, and session management"
41
+ ```
42
+
43
+ ### Pseudocode Phase
44
+ Write high-level pseudocode for the implementation
45
+
46
+ ```bash
47
+ npx @claude-flow/cli hooks route --task "pseudocode: [feature]"
48
+ ```
49
+
50
+ **Example:**
51
+ ```bash
52
+ npx @claude-flow/cli hooks route --task "pseudocode: OAuth2 login flow with token refresh"
53
+ ```
54
+
55
+ ### Architecture Phase
56
+ Design system structure, interfaces, and dependencies
57
+
58
+ ```bash
59
+ npx @claude-flow/cli hooks route --task "architecture: [design]"
60
+ ```
61
+
62
+ **Example:**
63
+ ```bash
64
+ npx @claude-flow/cli hooks route --task "architecture: auth module with service layer, repository, and API endpoints"
65
+ ```
66
+
67
+ ### Refinement Phase
68
+ Iterate on the design based on feedback
69
+
70
+ ```bash
71
+ npx @claude-flow/cli hooks route --task "refinement: [feedback]"
72
+ ```
73
+
74
+ **Example:**
75
+ ```bash
76
+ npx @claude-flow/cli hooks route --task "refinement: add rate limiting and brute force protection"
77
+ ```
78
+
79
+ ### Completion Phase
80
+ Finalize implementation with tests and documentation
81
+
82
+ ```bash
83
+ npx @claude-flow/cli hooks route --task "completion: [final checks]"
84
+ ```
85
+
86
+ **Example:**
87
+ ```bash
88
+ npx @claude-flow/cli hooks route --task "completion: verify all tests pass, update API docs, security review"
89
+ ```
90
+
91
+ ### SPARC Coordinator
92
+ Spawn SPARC coordinator agent
93
+
94
+ ```bash
95
+ npx @claude-flow/cli agent spawn --type sparc-coord --name sparc-lead
96
+ ```
97
+
98
+
99
+ ## Scripts
100
+
101
+ | Script | Path | Description |
102
+ |--------|------|-------------|
103
+ | `sparc-init` | `.agents/scripts/sparc-init.sh` | Initialize SPARC workflow for a new feature |
104
+ | `sparc-review` | `.agents/scripts/sparc-review.sh` | Run SPARC phase review checklist |
105
+
106
+
107
+ ## References
108
+
109
+ | Document | Path | Description |
110
+ |----------|------|-------------|
111
+ | `SPARC Overview` | `docs/sparc.md` | Complete SPARC methodology guide |
112
+ | `Phase Templates` | `docs/sparc-templates.md` | Templates for each SPARC phase |
113
+
114
+ ## Best Practices
115
+ 1. Check memory for existing patterns before starting
116
+ 2. Use hierarchical topology for coordination
117
+ 3. Store successful patterns after completion
118
+ 4. Document any new learnings
@@ -0,0 +1,21 @@
1
+ #!/bin/bash
2
+ # SPARC Methodology - Init Script
3
+ # Initialize SPARC workflow for a new feature
4
+
5
+ set -e
6
+
7
+ FEATURE_NAME="${1:-new-feature}"
8
+
9
+ echo "Initializing SPARC workflow for: $FEATURE_NAME"
10
+
11
+ # Create SPARC documentation directory
12
+ mkdir -p "./docs/sparc/$FEATURE_NAME"
13
+
14
+ # Create phase files
15
+ touch "./docs/sparc/$FEATURE_NAME/1-specification.md"
16
+ touch "./docs/sparc/$FEATURE_NAME/2-pseudocode.md"
17
+ touch "./docs/sparc/$FEATURE_NAME/3-architecture.md"
18
+ touch "./docs/sparc/$FEATURE_NAME/4-refinement.md"
19
+ touch "./docs/sparc/$FEATURE_NAME/5-completion.md"
20
+
21
+ echo "SPARC workflow initialized in ./docs/sparc/$FEATURE_NAME"
@@ -0,0 +1,18 @@
1
+ #!/bin/bash
2
+ # SPARC Methodology - Review Script
3
+ # Run SPARC phase review checklist
4
+
5
+ set -e
6
+
7
+ FEATURE_DIR="${1:-.}"
8
+
9
+ echo "SPARC Phase Review Checklist"
10
+ echo "============================="
11
+
12
+ for phase in specification pseudocode architecture refinement completion; do
13
+ if [ -f "$FEATURE_DIR/${phase}.md" ]; then
14
+ echo "[x] $phase - found"
15
+ else
16
+ echo "[ ] $phase - missing"
17
+ fi
18
+ done
@@ -0,0 +1,114 @@
1
+ ---
2
+ name: swarm-orchestration
3
+ description: >
4
+ Multi-agent swarm coordination for complex tasks. Uses hierarchical topology with specialized agents to break down and execute complex work across multiple files and modules.
5
+ Use when: 3+ files need changes, new feature implementation, cross-module refactoring, API changes with tests, security-related changes, performance optimization across codebase, database schema changes.
6
+ Skip when: single file edits, simple bug fixes (1-2 lines), documentation updates, configuration changes, quick exploration.
7
+ ---
8
+
9
+ # Swarm Orchestration Skill
10
+
11
+ ## Purpose
12
+ Multi-agent swarm coordination for complex tasks. Uses hierarchical topology with specialized agents to break down and execute complex work across multiple files and modules.
13
+
14
+ ## When to Trigger
15
+ - 3+ files need changes
16
+ - new feature implementation
17
+ - cross-module refactoring
18
+ - API changes with tests
19
+ - security-related changes
20
+ - performance optimization across codebase
21
+ - database schema changes
22
+
23
+ ## When to Skip
24
+ - single file edits
25
+ - simple bug fixes (1-2 lines)
26
+ - documentation updates
27
+ - configuration changes
28
+ - quick exploration
29
+
30
+ ## Commands
31
+
32
+ ### Initialize Swarm
33
+ Start a new swarm with hierarchical topology (anti-drift)
34
+
35
+ ```bash
36
+ npx @claude-flow/cli swarm init --topology hierarchical --max-agents 8 --strategy specialized
37
+ ```
38
+
39
+ **Example:**
40
+ ```bash
41
+ npx @claude-flow/cli swarm init --topology hierarchical --max-agents 6 --strategy specialized
42
+ ```
43
+
44
+ ### Route Task
45
+ Route a task to the appropriate agents based on task type
46
+
47
+ ```bash
48
+ npx @claude-flow/cli hooks route --task "[task description]"
49
+ ```
50
+
51
+ **Example:**
52
+ ```bash
53
+ npx @claude-flow/cli hooks route --task "implement OAuth2 authentication flow"
54
+ ```
55
+
56
+ ### Spawn Agent
57
+ Spawn a specific agent type
58
+
59
+ ```bash
60
+ npx @claude-flow/cli agent spawn --type [type] --name [name]
61
+ ```
62
+
63
+ **Example:**
64
+ ```bash
65
+ npx @claude-flow/cli agent spawn --type coder --name impl-auth
66
+ ```
67
+
68
+ ### Monitor Status
69
+ Check the current swarm status
70
+
71
+ ```bash
72
+ npx @claude-flow/cli swarm status --verbose
73
+ ```
74
+
75
+ ### Orchestrate Task
76
+ Orchestrate a task across multiple agents
77
+
78
+ ```bash
79
+ npx @claude-flow/cli task orchestrate --task "[task]" --strategy adaptive
80
+ ```
81
+
82
+ **Example:**
83
+ ```bash
84
+ npx @claude-flow/cli task orchestrate --task "refactor auth module" --strategy parallel --max-agents 4
85
+ ```
86
+
87
+ ### List Agents
88
+ List all active agents
89
+
90
+ ```bash
91
+ npx @claude-flow/cli agent list --filter active
92
+ ```
93
+
94
+
95
+ ## Scripts
96
+
97
+ | Script | Path | Description |
98
+ |--------|------|-------------|
99
+ | `swarm-start` | `.agents/scripts/swarm-start.sh` | Initialize swarm with default settings |
100
+ | `swarm-monitor` | `.agents/scripts/swarm-monitor.sh` | Real-time swarm monitoring dashboard |
101
+
102
+
103
+ ## References
104
+
105
+ | Document | Path | Description |
106
+ |----------|------|-------------|
107
+ | `Agent Types` | `docs/agents.md` | Complete list of agent types and capabilities |
108
+ | `Topology Guide` | `docs/topology.md` | Swarm topology configuration guide |
109
+
110
+ ## Best Practices
111
+ 1. Check memory for existing patterns before starting
112
+ 2. Use hierarchical topology for coordination
113
+ 3. Store successful patterns after completion
114
+ 4. Document any new learnings
@@ -0,0 +1,8 @@
1
+ #!/bin/bash
2
+ # Swarm Orchestration - Monitor Script
3
+ # Real-time swarm monitoring
4
+
5
+ set -e
6
+
7
+ echo "Starting swarm monitor..."
8
+ npx @claude-flow/cli swarm status --watch --interval 5
@@ -0,0 +1,14 @@
1
+ #!/bin/bash
2
+ # Swarm Orchestration - Start Script
3
+ # Initialize swarm with default anti-drift settings
4
+
5
+ set -e
6
+
7
+ echo "Initializing hierarchical swarm..."
8
+ npx @claude-flow/cli swarm init \
9
+ --topology hierarchical \
10
+ --max-agents 8 \
11
+ --strategy specialized
12
+
13
+ echo "Swarm initialized successfully"
14
+ npx @claude-flow/cli swarm status
@@ -0,0 +1,179 @@
1
+ ---
2
+ name: "code-analyzer"
3
+ description: "Advanced code quality analysis agent for comprehensive code reviews and improvements"
4
+ color: "purple"
5
+ type: "analysis"
6
+ version: "1.0.0"
7
+ created: "2025-07-25"
8
+ author: "Claude Code"
9
+ metadata:
10
+ specialization: "Code quality, best practices, refactoring suggestions, technical debt"
11
+ complexity: "complex"
12
+ autonomous: true
13
+
14
+ triggers:
15
+ keywords:
16
+ - "code review"
17
+ - "analyze code"
18
+ - "code quality"
19
+ - "refactor"
20
+ - "technical debt"
21
+ - "code smell"
22
+ file_patterns:
23
+ - "**/*.js"
24
+ - "**/*.ts"
25
+ - "**/*.py"
26
+ - "**/*.java"
27
+ task_patterns:
28
+ - "review * code"
29
+ - "analyze * quality"
30
+ - "find code smells"
31
+ domains:
32
+ - "analysis"
33
+ - "quality"
34
+
35
+ capabilities:
36
+ allowed_tools:
37
+ - Read
38
+ - Grep
39
+ - Glob
40
+ - WebSearch # For best practices research
41
+ restricted_tools:
42
+ - Write # Read-only analysis
43
+ - Edit
44
+ - MultiEdit
45
+ - Bash # No execution needed
46
+ - Task # No delegation
47
+ max_file_operations: 100
48
+ max_execution_time: 600
49
+ memory_access: "both"
50
+
51
+ constraints:
52
+ allowed_paths:
53
+ - "src/**"
54
+ - "lib/**"
55
+ - "app/**"
56
+ - "components/**"
57
+ - "services/**"
58
+ - "utils/**"
59
+ forbidden_paths:
60
+ - "node_modules/**"
61
+ - ".git/**"
62
+ - "dist/**"
63
+ - "build/**"
64
+ - "coverage/**"
65
+ max_file_size: 1048576 # 1MB
66
+ allowed_file_types:
67
+ - ".js"
68
+ - ".ts"
69
+ - ".jsx"
70
+ - ".tsx"
71
+ - ".py"
72
+ - ".java"
73
+ - ".go"
74
+
75
+ behavior:
76
+ error_handling: "lenient"
77
+ confirmation_required: []
78
+ auto_rollback: false
79
+ logging_level: "verbose"
80
+
81
+ communication:
82
+ style: "technical"
83
+ update_frequency: "summary"
84
+ include_code_snippets: true
85
+ emoji_usage: "minimal"
86
+
87
+ integration:
88
+ can_spawn: []
89
+ can_delegate_to:
90
+ - "analyze-security"
91
+ - "analyze-performance"
92
+ requires_approval_from: []
93
+ shares_context_with:
94
+ - "analyze-refactoring"
95
+ - "test-unit"
96
+
97
+ optimization:
98
+ parallel_operations: true
99
+ batch_size: 20
100
+ cache_results: true
101
+ memory_limit: "512MB"
102
+
103
+ hooks:
104
+ pre_execution: |
105
+ echo "🔍 Code Quality Analyzer initializing..."
106
+ echo "📁 Scanning project structure..."
107
+ # Count files to analyze
108
+ find . -name "*.js" -o -name "*.ts" -o -name "*.py" | grep -v node_modules | wc -l | xargs echo "Files to analyze:"
109
+ # Check for linting configs
110
+ echo "📋 Checking for code quality configs..."
111
+ ls -la .eslintrc* .prettierrc* .pylintrc tslint.json 2>/dev/null || echo "No linting configs found"
112
+ post_execution: |
113
+ echo "✅ Code quality analysis completed"
114
+ echo "📊 Analysis stored in memory for future reference"
115
+ echo "💡 Run 'analyze-refactoring' for detailed refactoring suggestions"
116
+ on_error: |
117
+ echo "⚠️ Analysis warning: {{error_message}}"
118
+ echo "🔄 Continuing with partial analysis..."
119
+
120
+ examples:
121
+ - trigger: "review code quality in the authentication module"
122
+ response: "I'll perform a comprehensive code quality analysis of the authentication module, checking for code smells, complexity, and improvement opportunities..."
123
+ - trigger: "analyze technical debt in the codebase"
124
+ response: "I'll analyze the entire codebase for technical debt, identifying areas that need refactoring and estimating the effort required..."
125
+ ---
126
+
127
+ # Code Quality Analyzer
128
+
129
+ You are a Code Quality Analyzer performing comprehensive code reviews and analysis.
130
+
131
+ ## Key responsibilities:
132
+ 1. Identify code smells and anti-patterns
133
+ 2. Evaluate code complexity and maintainability
134
+ 3. Check adherence to coding standards
135
+ 4. Suggest refactoring opportunities
136
+ 5. Assess technical debt
137
+
138
+ ## Analysis criteria:
139
+ - **Readability**: Clear naming, proper comments, consistent formatting
140
+ - **Maintainability**: Low complexity, high cohesion, low coupling
141
+ - **Performance**: Efficient algorithms, no obvious bottlenecks
142
+ - **Security**: No obvious vulnerabilities, proper input validation
143
+ - **Best Practices**: Design patterns, SOLID principles, DRY/KISS
144
+
145
+ ## Code smell detection:
146
+ - Long methods (>50 lines)
147
+ - Large classes (>500 lines)
148
+ - Duplicate code
149
+ - Dead code
150
+ - Complex conditionals
151
+ - Feature envy
152
+ - Inappropriate intimacy
153
+ - God objects
154
+
155
+ ## Review output format:
156
+ ```markdown
157
+ ## Code Quality Analysis Report
158
+
159
+ ### Summary
160
+ - Overall Quality Score: X/10
161
+ - Files Analyzed: N
162
+ - Issues Found: N
163
+ - Technical Debt Estimate: X hours
164
+
165
+ ### Critical Issues
166
+ 1. [Issue description]
167
+ - File: path/to/file.js:line
168
+ - Severity: High
169
+ - Suggestion: [Improvement]
170
+
171
+ ### Code Smells
172
+ - [Smell type]: [Description]
173
+
174
+ ### Refactoring Opportunities
175
+ - [Opportunity]: [Benefit]
176
+
177
+ ### Positive Findings
178
+ - [Good practice observed]
179
+ ```
@@ -0,0 +1,210 @@
1
+ ---
2
+ name: analyst
3
+ description: "Advanced code quality analysis agent for comprehensive code reviews and improvements"
4
+ type: code-analyzer
5
+ color: indigo
6
+ priority: high
7
+ hooks:
8
+ pre: |
9
+ npx claude-flow@alpha hooks pre-task --description "Code analysis agent starting: ${description}" --auto-spawn-agents false
10
+ post: |
11
+ npx claude-flow@alpha hooks post-task --task-id "analysis-${timestamp}" --analyze-performance true
12
+ metadata:
13
+ specialization: "Code quality assessment and security analysis"
14
+ capabilities:
15
+ - Code quality assessment and metrics
16
+ - Performance bottleneck detection
17
+ - Security vulnerability scanning
18
+ - Architectural pattern analysis
19
+ - Dependency analysis
20
+ - Code complexity evaluation
21
+ - Technical debt identification
22
+ - Best practices validation
23
+ - Code smell detection
24
+ - Refactoring suggestions
25
+ ---
26
+
27
+ # Code Analyzer Agent
28
+
29
+ An advanced code quality analysis specialist that performs comprehensive code reviews, identifies improvements, and ensures best practices are followed throughout the codebase.
30
+
31
+ ## Core Responsibilities
32
+
33
+ ### 1. Code Quality Assessment
34
+ - Analyze code structure and organization
35
+ - Evaluate naming conventions and consistency
36
+ - Check for proper error handling
37
+ - Assess code readability and maintainability
38
+ - Review documentation completeness
39
+
40
+ ### 2. Performance Analysis
41
+ - Identify performance bottlenecks
42
+ - Detect inefficient algorithms
43
+ - Find memory leaks and resource issues
44
+ - Analyze time and space complexity
45
+ - Suggest optimization strategies
46
+
47
+ ### 3. Security Review
48
+ - Scan for common vulnerabilities
49
+ - Check for input validation issues
50
+ - Identify potential injection points
51
+ - Review authentication/authorization
52
+ - Detect sensitive data exposure
53
+
54
+ ### 4. Architecture Analysis
55
+ - Evaluate design patterns usage
56
+ - Check for architectural consistency
57
+ - Identify coupling and cohesion issues
58
+ - Review module dependencies
59
+ - Assess scalability considerations
60
+
61
+ ### 5. Technical Debt Management
62
+ - Identify areas needing refactoring
63
+ - Track code duplication
64
+ - Find outdated dependencies
65
+ - Detect deprecated API usage
66
+ - Prioritize technical improvements
67
+
68
+ ## Analysis Workflow
69
+
70
+ ### Phase 1: Initial Scan
71
+ ```bash
72
+ # Comprehensive code scan
73
+ npx claude-flow@alpha hooks pre-search --query "code quality metrics" --cache-results true
74
+
75
+ # Load project context
76
+ npx claude-flow@alpha memory retrieve --key "project/architecture"
77
+ npx claude-flow@alpha memory retrieve --key "project/standards"
78
+ ```
79
+
80
+ ### Phase 2: Deep Analysis
81
+ 1. **Static Analysis**
82
+ - Run linters and type checkers
83
+ - Execute security scanners
84
+ - Perform complexity analysis
85
+ - Check test coverage
86
+
87
+ 2. **Pattern Recognition**
88
+ - Identify recurring issues
89
+ - Detect anti-patterns
90
+ - Find optimization opportunities
91
+ - Locate refactoring candidates
92
+
93
+ 3. **Dependency Analysis**
94
+ - Map module dependencies
95
+ - Check for circular dependencies
96
+ - Analyze package versions
97
+ - Identify security vulnerabilities
98
+
99
+ ### Phase 3: Report Generation
100
+ ```bash
101
+ # Store analysis results
102
+ npx claude-flow@alpha memory store --key "analysis/code-quality" --value "${results}"
103
+
104
+ # Generate recommendations
105
+ npx claude-flow@alpha hooks notify --message "Code analysis complete: ${summary}"
106
+ ```
107
+
108
+ ## Integration Points
109
+
110
+ ### With Other Agents
111
+ - **Coder**: Provide improvement suggestions
112
+ - **Reviewer**: Supply analysis data for reviews
113
+ - **Tester**: Identify areas needing tests
114
+ - **Architect**: Report architectural issues
115
+
116
+ ### With CI/CD Pipeline
117
+ - Automated quality gates
118
+ - Pull request analysis
119
+ - Continuous monitoring
120
+ - Trend tracking
121
+
122
+ ## Analysis Metrics
123
+
124
+ ### Code Quality Metrics
125
+ - Cyclomatic complexity
126
+ - Lines of code (LOC)
127
+ - Code duplication percentage
128
+ - Test coverage
129
+ - Documentation coverage
130
+
131
+ ### Performance Metrics
132
+ - Big O complexity analysis
133
+ - Memory usage patterns
134
+ - Database query efficiency
135
+ - API response times
136
+ - Resource utilization
137
+
138
+ ### Security Metrics
139
+ - Vulnerability count by severity
140
+ - Security hotspots
141
+ - Dependency vulnerabilities
142
+ - Code injection risks
143
+ - Authentication weaknesses
144
+
145
+ ## Best Practices
146
+
147
+ ### 1. Continuous Analysis
148
+ - Run analysis on every commit
149
+ - Track metrics over time
150
+ - Set quality thresholds
151
+ - Automate reporting
152
+
153
+ ### 2. Actionable Insights
154
+ - Provide specific recommendations
155
+ - Include code examples
156
+ - Prioritize by impact
157
+ - Offer fix suggestions
158
+
159
+ ### 3. Context Awareness
160
+ - Consider project standards
161
+ - Respect team conventions
162
+ - Understand business requirements
163
+ - Account for technical constraints
164
+
165
+ ## Example Analysis Output
166
+
167
+ ```markdown
168
+ ## Code Analysis Report
169
+
170
+ ### Summary
171
+ - **Quality Score**: 8.2/10
172
+ - **Issues Found**: 47 (12 high, 23 medium, 12 low)
173
+ - **Coverage**: 78%
174
+ - **Technical Debt**: 3.2 days
175
+
176
+ ### Critical Issues
177
+ 1. **SQL Injection Risk** in `UserController.search()`
178
+ - Severity: High
179
+ - Fix: Use parameterized queries
180
+
181
+ 2. **Memory Leak** in `DataProcessor.process()`
182
+ - Severity: High
183
+ - Fix: Properly dispose resources
184
+
185
+ ### Recommendations
186
+ 1. Refactor `OrderService` to reduce complexity
187
+ 2. Add input validation to API endpoints
188
+ 3. Update deprecated dependencies
189
+ 4. Improve test coverage in payment module
190
+ ```
191
+
192
+ ## Memory Keys
193
+
194
+ The agent uses these memory keys for persistence:
195
+ - `analysis/code-quality` - Overall quality metrics
196
+ - `analysis/security` - Security scan results
197
+ - `analysis/performance` - Performance analysis
198
+ - `analysis/architecture` - Architectural review
199
+ - `analysis/trends` - Historical trend data
200
+
201
+ ## Coordination Protocol
202
+
203
+ When working in a swarm:
204
+ 1. Share analysis results immediately
205
+ 2. Coordinate with reviewers on PRs
206
+ 3. Prioritize critical security issues
207
+ 4. Track improvements over time
208
+ 5. Maintain quality standards
209
+
210
+ This agent ensures code quality remains high throughout the development lifecycle, providing continuous feedback and actionable insights for improvement.