moflo 4.9.20 → 4.9.22

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 (240) hide show
  1. package/.claude/agents/analysis/analyze-code-quality.md +0 -121
  2. package/.claude/agents/analysis/code-analyzer.md +5 -26
  3. package/.claude/agents/architecture/system-design/arch-system-design.md +0 -119
  4. package/.claude/agents/base-template-generator.md +0 -1
  5. package/.claude/agents/core/coder.md +0 -22
  6. package/.claude/agents/core/planner.md +0 -16
  7. package/.claude/agents/core/researcher.md +0 -16
  8. package/.claude/agents/core/reviewer.md +0 -17
  9. package/.claude/agents/core/tester.md +0 -19
  10. package/.claude/agents/custom/test-long-runner.md +0 -2
  11. package/.claude/agents/development/dev-backend-api.md +0 -167
  12. package/.claude/agents/development/dev-database.md +43 -0
  13. package/.claude/agents/development/dev-frontend.md +42 -0
  14. package/.claude/agents/devops/ci-cd/ops-cicd-github.md +0 -112
  15. package/.claude/agents/documentation/api-docs/docs-api-openapi.md +0 -111
  16. package/.claude/agents/security/security-auditor.md +45 -0
  17. package/.claude/guidance/shipped/moflo-agent-rules.md +172 -0
  18. package/.claude/guidance/shipped/moflo-claude-swarm-cohesion.md +73 -265
  19. package/.claude/guidance/shipped/moflo-cli-reference.md +6 -6
  20. package/.claude/guidance/shipped/moflo-core-guidance.md +66 -184
  21. package/.claude/guidance/shipped/moflo-cross-platform.md +1 -1
  22. package/.claude/guidance/shipped/moflo-error-handling.md +3 -3
  23. package/.claude/guidance/shipped/moflo-guidance-rules.md +17 -7
  24. package/.claude/guidance/shipped/moflo-memory-strategy.md +76 -182
  25. package/.claude/guidance/shipped/moflo-memorydb-maintenance.md +6 -8
  26. package/.claude/guidance/shipped/moflo-settings-injection.md +7 -9
  27. package/.claude/guidance/shipped/moflo-source-hygiene.md +5 -5
  28. package/.claude/guidance/shipped/moflo-spell-connectors.md +3 -4
  29. package/.claude/guidance/shipped/moflo-spell-custom-steps.md +3 -4
  30. package/.claude/guidance/shipped/moflo-spell-engine.md +40 -162
  31. package/.claude/guidance/shipped/moflo-spell-runner.md +134 -0
  32. package/.claude/guidance/shipped/moflo-spell-sandboxing.md +10 -57
  33. package/.claude/guidance/shipped/moflo-spell-troubleshooting.md +149 -0
  34. package/.claude/guidance/shipped/moflo-subagents.md +43 -114
  35. package/.claude/guidance/shipped/moflo-task-icons.md +4 -4
  36. package/.claude/guidance/shipped/moflo-user-facing-language.md +3 -3
  37. package/.claude/guidance/shipped/moflo-verbose-command-filtering.md +3 -3
  38. package/.claude/guidance/shipped/moflo-yaml-reference.md +4 -5
  39. package/.claude/helpers/gate.cjs +192 -15
  40. package/.claude/helpers/prompt-hook.mjs +4 -38
  41. package/.claude/helpers/simplify-classify.cjs +32 -11
  42. package/.claude/helpers/subagent-bootstrap.json +1 -1
  43. package/.claude/helpers/subagent-start.cjs +1 -1
  44. package/.claude/skills/connector-builder/SKILL.md +42 -429
  45. package/.claude/skills/connector-builder/templates/connector.md +189 -0
  46. package/.claude/skills/connector-builder/templates/step-command.md +176 -0
  47. package/.claude/skills/eldar/SKILL.md +7 -7
  48. package/.claude/skills/fl/SKILL.md +3 -3
  49. package/.claude/skills/fl/execution-modes.md +39 -16
  50. package/.claude/skills/fl/phases.md +3 -3
  51. package/.claude/skills/{simplify → flo-simplify}/SKILL.md +11 -11
  52. package/.claude/skills/guidance/SKILL.md +17 -9
  53. package/.claude/skills/memory-patterns/SKILL.md +1 -1
  54. package/.claude/skills/publish/SKILL.md +121 -36
  55. package/.claude/skills/reset-epic/SKILL.md +2 -2
  56. package/.claude/skills/spell-builder/SKILL.md +39 -226
  57. package/.claude/skills/spell-builder/architecture.md +1 -1
  58. package/.claude/skills/spell-builder/permissions.md +107 -0
  59. package/.claude/skills/spell-builder/preflight.md +101 -0
  60. package/.claude/skills/spell-schedule/SKILL.md +2 -3
  61. package/bin/gate.cjs +192 -15
  62. package/bin/lib/retired-files.mjs +146 -0
  63. package/bin/prompt-hook.mjs +4 -38
  64. package/bin/session-start-launcher.mjs +120 -1
  65. package/bin/setup-project.mjs +63 -69
  66. package/bin/simplify-classify.cjs +32 -11
  67. package/dist/src/cli/appliance/rvfa-builder.js +1 -1
  68. package/dist/src/cli/commands/agent.js +3 -9
  69. package/dist/src/cli/commands/doctor-checks-deep.js +4 -0
  70. package/dist/src/cli/commands/hooks.js +1 -3
  71. package/dist/src/cli/commands/index.js +2 -0
  72. package/dist/src/cli/commands/retire.js +111 -0
  73. package/dist/src/cli/hooks/reasoningbank/index.js +7 -7
  74. package/dist/src/cli/init/claudemd-generator.js +30 -33
  75. package/dist/src/cli/init/executor.js +53 -69
  76. package/dist/src/cli/init/helpers-generator.js +165 -52
  77. package/dist/src/cli/init/moflo-init.js +41 -114
  78. package/dist/src/cli/init/settings-generator.js +44 -14
  79. package/dist/src/cli/mcp-tools/agent-tools.js +9 -27
  80. package/dist/src/cli/mcp-tools/hooks-tools.js +23 -21
  81. package/dist/src/cli/memory/controllers/semantic-router.js +18 -12
  82. package/dist/src/cli/memory/sona-optimizer.js +6 -6
  83. package/dist/src/cli/neural/domain/services/learning-service.js +3 -3
  84. package/dist/src/cli/services/agent-router.js +2 -5
  85. package/dist/src/cli/services/hook-block-hash.js +11 -2
  86. package/dist/src/cli/services/hook-wiring.js +86 -3
  87. package/dist/src/cli/services/subagent-bootstrap.js +1 -1
  88. package/dist/src/cli/shared/events/example-usage.js +6 -6
  89. package/dist/src/cli/shared/hooks/task-hooks.js +8 -8
  90. package/dist/src/cli/version.js +1 -1
  91. package/package.json +3 -2
  92. package/retired-files.json +1989 -0
  93. package/scripts/post-install-bootstrap.mjs +19 -0
  94. package/src/cli/data/model-registry.json +2 -2
  95. package/.claude/agents/consensus/byzantine-coordinator.md +0 -63
  96. package/.claude/agents/consensus/crdt-synchronizer.md +0 -997
  97. package/.claude/agents/consensus/gossip-coordinator.md +0 -63
  98. package/.claude/agents/consensus/performance-benchmarker.md +0 -851
  99. package/.claude/agents/consensus/quorum-manager.md +0 -823
  100. package/.claude/agents/consensus/raft-manager.md +0 -63
  101. package/.claude/agents/consensus/security-manager.md +0 -622
  102. package/.claude/agents/data/ml/data-ml-model.md +0 -193
  103. package/.claude/agents/github/code-review-swarm.md +0 -538
  104. package/.claude/agents/github/github-modes.md +0 -172
  105. package/.claude/agents/github/issue-tracker.md +0 -311
  106. package/.claude/agents/github/multi-repo-swarm.md +0 -551
  107. package/.claude/agents/github/pr-manager.md +0 -183
  108. package/.claude/agents/github/project-board-sync.md +0 -508
  109. package/.claude/agents/github/release-manager.md +0 -360
  110. package/.claude/agents/github/release-swarm.md +0 -580
  111. package/.claude/agents/github/repo-architect.md +0 -391
  112. package/.claude/agents/github/swarm-issue.md +0 -566
  113. package/.claude/agents/github/swarm-pr.md +0 -414
  114. package/.claude/agents/github/sync-coordinator.md +0 -426
  115. package/.claude/agents/github/workflow-automation.md +0 -606
  116. package/.claude/agents/goal/code-goal-planner.md +0 -440
  117. package/.claude/agents/goal/goal-planner.md +0 -168
  118. package/.claude/agents/hive-mind/collective-intelligence-coordinator.md +0 -127
  119. package/.claude/agents/hive-mind/queen-coordinator.md +0 -198
  120. package/.claude/agents/hive-mind/scout-explorer.md +0 -233
  121. package/.claude/agents/hive-mind/swarm-memory-manager.md +0 -184
  122. package/.claude/agents/hive-mind/worker-specialist.md +0 -208
  123. package/.claude/agents/neural/safla-neural.md +0 -73
  124. package/.claude/agents/optimization/benchmark-suite.md +0 -665
  125. package/.claude/agents/optimization/load-balancer.md +0 -431
  126. package/.claude/agents/optimization/performance-monitor.md +0 -672
  127. package/.claude/agents/optimization/resource-allocator.md +0 -674
  128. package/.claude/agents/optimization/topology-optimizer.md +0 -808
  129. package/.claude/agents/reasoning/goal-planner.md +0 -67
  130. package/.claude/agents/sona/sona-learning-optimizer.md +0 -74
  131. package/.claude/agents/sparc/architecture.md +0 -472
  132. package/.claude/agents/sparc/pseudocode.md +0 -318
  133. package/.claude/agents/sparc/refinement.md +0 -525
  134. package/.claude/agents/sparc/specification.md +0 -276
  135. package/.claude/agents/specialized/mobile/spec-mobile-react-native.md +0 -225
  136. package/.claude/agents/swarm/adaptive-coordinator.md +0 -391
  137. package/.claude/agents/swarm/hierarchical-coordinator.md +0 -321
  138. package/.claude/agents/swarm/mesh-coordinator.md +0 -383
  139. package/.claude/agents/testing/production-validator.md +0 -395
  140. package/.claude/agents/testing/tdd-london-swarm.md +0 -244
  141. package/.claude/agents/v3/adr-architect.md +0 -184
  142. package/.claude/agents/v3/aidefence-guardian.md +0 -277
  143. package/.claude/agents/v3/claims-authorizer.md +0 -208
  144. package/.claude/agents/v3/collective-intelligence-coordinator.md +0 -988
  145. package/.claude/agents/v3/ddd-domain-expert.md +0 -220
  146. package/.claude/agents/v3/injection-analyst.md +0 -232
  147. package/.claude/agents/v3/memory-specialist.md +0 -987
  148. package/.claude/agents/v3/performance-engineer.md +0 -1225
  149. package/.claude/agents/v3/pii-detector.md +0 -146
  150. package/.claude/agents/v3/reasoningbank-learner.md +0 -213
  151. package/.claude/agents/v3/security-architect-aidefence.md +0 -405
  152. package/.claude/agents/v3/security-architect.md +0 -865
  153. package/.claude/agents/v3/security-auditor.md +0 -771
  154. package/.claude/agents/v3/sparc-orchestrator.md +0 -182
  155. package/.claude/agents/v3/swarm-memory-manager.md +0 -142
  156. package/.claude/agents/v3/v3-integration-architect.md +0 -205
  157. package/.claude/commands/claude-flow-help.md +0 -103
  158. package/.claude/commands/claude-flow-memory.md +0 -107
  159. package/.claude/commands/claude-flow-swarm.md +0 -205
  160. package/.claude/commands/github/README.md +0 -11
  161. package/.claude/commands/github/code-review-swarm.md +0 -514
  162. package/.claude/commands/github/code-review.md +0 -25
  163. package/.claude/commands/github/github-modes.md +0 -146
  164. package/.claude/commands/github/github-swarm.md +0 -113
  165. package/.claude/commands/github/issue-tracker.md +0 -284
  166. package/.claude/commands/github/issue-triage.md +0 -25
  167. package/.claude/commands/github/multi-repo-swarm.md +0 -519
  168. package/.claude/commands/github/pr-enhance.md +0 -26
  169. package/.claude/commands/github/pr-manager.md +0 -164
  170. package/.claude/commands/github/project-board-sync.md +0 -471
  171. package/.claude/commands/github/release-manager.md +0 -332
  172. package/.claude/commands/github/release-swarm.md +0 -544
  173. package/.claude/commands/github/repo-analyze.md +0 -25
  174. package/.claude/commands/github/repo-architect.md +0 -361
  175. package/.claude/commands/github/swarm-issue.md +0 -482
  176. package/.claude/commands/github/swarm-pr.md +0 -285
  177. package/.claude/commands/github/sync-coordinator.md +0 -294
  178. package/.claude/commands/github/workflow-automation.md +0 -442
  179. package/.claude/commands/hooks/README.md +0 -11
  180. package/.claude/commands/hooks/overview.md +0 -58
  181. package/.claude/commands/hooks/post-edit.md +0 -117
  182. package/.claude/commands/hooks/post-task.md +0 -112
  183. package/.claude/commands/hooks/pre-edit.md +0 -113
  184. package/.claude/commands/hooks/pre-task.md +0 -111
  185. package/.claude/commands/hooks/session-end.md +0 -118
  186. package/.claude/commands/hooks/setup.md +0 -103
  187. package/.claude/commands/simplify.md +0 -101
  188. package/.claude/commands/sparc/analyzer.md +0 -42
  189. package/.claude/commands/sparc/architect.md +0 -43
  190. package/.claude/commands/sparc/ask.md +0 -86
  191. package/.claude/commands/sparc/batch-executor.md +0 -44
  192. package/.claude/commands/sparc/code.md +0 -78
  193. package/.claude/commands/sparc/coder.md +0 -44
  194. package/.claude/commands/sparc/debug.md +0 -72
  195. package/.claude/commands/sparc/debugger.md +0 -44
  196. package/.claude/commands/sparc/designer.md +0 -43
  197. package/.claude/commands/sparc/devops.md +0 -98
  198. package/.claude/commands/sparc/docs-writer.md +0 -69
  199. package/.claude/commands/sparc/documenter.md +0 -44
  200. package/.claude/commands/sparc/innovator.md +0 -44
  201. package/.claude/commands/sparc/integration.md +0 -72
  202. package/.claude/commands/sparc/mcp.md +0 -106
  203. package/.claude/commands/sparc/memory-manager.md +0 -44
  204. package/.claude/commands/sparc/optimizer.md +0 -44
  205. package/.claude/commands/sparc/orchestrator.md +0 -116
  206. package/.claude/commands/sparc/post-deployment-monitoring-mode.md +0 -72
  207. package/.claude/commands/sparc/refinement-optimization-mode.md +0 -72
  208. package/.claude/commands/sparc/researcher.md +0 -44
  209. package/.claude/commands/sparc/reviewer.md +0 -44
  210. package/.claude/commands/sparc/security-review.md +0 -69
  211. package/.claude/commands/sparc/sparc-modes.md +0 -139
  212. package/.claude/commands/sparc/sparc.md +0 -99
  213. package/.claude/commands/sparc/spec-pseudocode.md +0 -69
  214. package/.claude/commands/sparc/spell-manager.md +0 -44
  215. package/.claude/commands/sparc/supabase-admin.md +0 -337
  216. package/.claude/commands/sparc/swarm-coordinator.md +0 -44
  217. package/.claude/commands/sparc/tdd.md +0 -44
  218. package/.claude/commands/sparc/tester.md +0 -44
  219. package/.claude/commands/sparc/tutorial.md +0 -68
  220. package/.claude/commands/sparc.md +0 -151
  221. package/.claude/guidance/shipped/moflo-session-start.md +0 -154
  222. package/.claude/guidance/shipped/moflo-spell-engine-architecture.md +0 -145
  223. package/.claude/skills/browser/SKILL.md +0 -204
  224. package/.claude/skills/github-code-review/SKILL.md +0 -1140
  225. package/.claude/skills/github-multi-repo/SKILL.md +0 -866
  226. package/.claude/skills/github-project-management/SKILL.md +0 -1272
  227. package/.claude/skills/github-release-management/SKILL.md +0 -1074
  228. package/.claude/skills/github-workflow-automation/SKILL.md +0 -1060
  229. package/.claude/skills/hive-mind-advanced/SKILL.md +0 -712
  230. package/.claude/skills/hooks-automation/SKILL.md +0 -1193
  231. package/.claude/skills/pair-programming/SKILL.md +0 -1202
  232. package/.claude/skills/performance-analysis/SKILL.md +0 -563
  233. package/.claude/skills/skill-builder/SKILL.md +0 -910
  234. package/.claude/skills/sparc-methodology/SKILL.md +0 -904
  235. package/.claude/skills/stream-chain/SKILL.md +0 -563
  236. package/.claude/skills/swarm-advanced/SKILL.md +0 -811
  237. package/.claude/skills/swarm-orchestration/SKILL.md +0 -179
  238. package/.claude/skills/verification-quality/SKILL.md +0 -649
  239. package/.claude/skills/worker-benchmarks/skill.md +0 -135
  240. package/.claude/skills/worker-integration/skill.md +0 -154
@@ -1,193 +0,0 @@
1
- ---
2
- name: "ml-developer"
3
- description: "Specialized agent for machine learning model development, training, and deployment"
4
- color: "purple"
5
- type: "data"
6
- version: "1.0.0"
7
- created: "2025-07-25"
8
- author: "Claude Code"
9
- metadata:
10
- specialization: "ML model creation, data preprocessing, model evaluation, deployment"
11
- complexity: "complex"
12
- autonomous: false # Requires approval for model deployment
13
- triggers:
14
- keywords:
15
- - "machine learning"
16
- - "ml model"
17
- - "train model"
18
- - "predict"
19
- - "classification"
20
- - "regression"
21
- - "neural network"
22
- file_patterns:
23
- - "**/*.ipynb"
24
- - "**/model.py"
25
- - "**/train.py"
26
- - "**/*.pkl"
27
- - "**/*.h5"
28
- task_patterns:
29
- - "create * model"
30
- - "train * classifier"
31
- - "build ml pipeline"
32
- domains:
33
- - "data"
34
- - "ml"
35
- - "ai"
36
- capabilities:
37
- allowed_tools:
38
- - Read
39
- - Write
40
- - Edit
41
- - MultiEdit
42
- - Bash
43
- - NotebookRead
44
- - NotebookEdit
45
- restricted_tools:
46
- - Task # Focus on implementation
47
- - WebSearch # Use local data
48
- max_file_operations: 100
49
- max_execution_time: 1800 # 30 minutes for training
50
- memory_access: "both"
51
- constraints:
52
- allowed_paths:
53
- - "data/**"
54
- - "models/**"
55
- - "notebooks/**"
56
- - "src/ml/**"
57
- - "experiments/**"
58
- - "*.ipynb"
59
- forbidden_paths:
60
- - ".git/**"
61
- - "secrets/**"
62
- - "credentials/**"
63
- max_file_size: 104857600 # 100MB for datasets
64
- allowed_file_types:
65
- - ".py"
66
- - ".ipynb"
67
- - ".csv"
68
- - ".json"
69
- - ".pkl"
70
- - ".h5"
71
- - ".joblib"
72
- behavior:
73
- error_handling: "adaptive"
74
- confirmation_required:
75
- - "model deployment"
76
- - "large-scale training"
77
- - "data deletion"
78
- auto_rollback: true
79
- logging_level: "verbose"
80
- communication:
81
- style: "technical"
82
- update_frequency: "batch"
83
- include_code_snippets: true
84
- emoji_usage: "minimal"
85
- integration:
86
- can_spawn: []
87
- can_delegate_to:
88
- - "data-etl"
89
- - "analyze-performance"
90
- requires_approval_from:
91
- - "human" # For production models
92
- shares_context_with:
93
- - "data-analytics"
94
- - "data-visualization"
95
- optimization:
96
- parallel_operations: true
97
- batch_size: 32 # For batch processing
98
- cache_results: true
99
- memory_limit: "2GB"
100
- hooks:
101
- pre_execution: |
102
- echo "🤖 ML Model Developer initializing..."
103
- echo "📁 Checking for datasets..."
104
- find . -name "*.csv" -o -name "*.parquet" | grep -E "(data|dataset)" | head -5
105
- echo "📦 Checking ML libraries..."
106
- python -c "import sklearn, pandas, numpy; print('Core ML libraries available')" 2>/dev/null || echo "ML libraries not installed"
107
- post_execution: |
108
- echo "✅ ML model development completed"
109
- echo "📊 Model artifacts:"
110
- find . -name "*.pkl" -o -name "*.h5" -o -name "*.joblib" | grep -v __pycache__ | head -5
111
- echo "📋 Remember to version and document your model"
112
- on_error: |
113
- echo "❌ ML pipeline error: {{error_message}}"
114
- echo "🔍 Check data quality and feature compatibility"
115
- echo "💡 Consider simpler models or more data preprocessing"
116
- examples:
117
- - trigger: "create a classification model for customer churn prediction"
118
- response: "I'll develop a machine learning pipeline for customer churn prediction, including data preprocessing, model selection, training, and evaluation..."
119
- - trigger: "build neural network for image classification"
120
- response: "I'll create a neural network architecture for image classification, including data augmentation, model training, and performance evaluation..."
121
- ---
122
-
123
- # Machine Learning Model Developer
124
-
125
- You are a Machine Learning Model Developer specializing in end-to-end ML workflows.
126
-
127
- ## Key responsibilities:
128
- 1. Data preprocessing and feature engineering
129
- 2. Model selection and architecture design
130
- 3. Training and hyperparameter tuning
131
- 4. Model evaluation and validation
132
- 5. Deployment preparation and monitoring
133
-
134
- ## ML workflow:
135
- 1. **Data Analysis**
136
- - Exploratory data analysis
137
- - Feature statistics
138
- - Data quality checks
139
-
140
- 2. **Preprocessing**
141
- - Handle missing values
142
- - Feature scaling/normalization
143
- - Encoding categorical variables
144
- - Feature selection
145
-
146
- 3. **Model Development**
147
- - Algorithm selection
148
- - Cross-validation setup
149
- - Hyperparameter tuning
150
- - Ensemble methods
151
-
152
- 4. **Evaluation**
153
- - Performance metrics
154
- - Confusion matrices
155
- - ROC/AUC curves
156
- - Feature importance
157
-
158
- 5. **Deployment Prep**
159
- - Model serialization
160
- - API endpoint creation
161
- - Monitoring setup
162
-
163
- ## Code patterns:
164
- ```python
165
- # Standard ML pipeline structure
166
- from sklearn.pipeline import Pipeline
167
- from sklearn.preprocessing import StandardScaler
168
- from sklearn.model_selection import train_test_split
169
-
170
- # Data preprocessing
171
- X_train, X_test, y_train, y_test = train_test_split(
172
- X, y, test_size=0.2, random_state=42
173
- )
174
-
175
- # Pipeline creation
176
- pipeline = Pipeline([
177
- ('scaler', StandardScaler()),
178
- ('model', ModelClass())
179
- ])
180
-
181
- # Training
182
- pipeline.fit(X_train, y_train)
183
-
184
- # Evaluation
185
- score = pipeline.score(X_test, y_test)
186
- ```
187
-
188
- ## Best practices:
189
- - Always split data before preprocessing
190
- - Use cross-validation for robust evaluation
191
- - Log all experiments and parameters
192
- - Version control models and data
193
- - Document model assumptions and limitations
@@ -1,538 +0,0 @@
1
- ---
2
- name: code-review-swarm
3
- description: Deploy specialized AI agents to perform comprehensive, intelligent code reviews that go beyond traditional static analysis
4
- tools: mcp__moflo__swarm_init, mcp__moflo__agent_spawn, Bash, Read, Write, TodoWrite
5
- color: blue
6
- type: development
7
- capabilities:
8
- - Automated multi-agent code review
9
- - Security vulnerability analysis
10
- - Performance bottleneck detection
11
- - Architecture pattern validation
12
- - Style and convention enforcement
13
- priority: high
14
- hooks:
15
- pre: |
16
- echo "Starting code-review-swarm..."
17
- echo "Initializing multi-agent review system"
18
- gh auth status || (echo "GitHub CLI not authenticated" && exit 1)
19
- post: |
20
- echo "Completed code-review-swarm"
21
- echo "Review results posted to GitHub"
22
- echo "Quality gates evaluated"
23
- ---
24
-
25
- # Code Review Swarm - Automated Code Review with AI Agents
26
-
27
- ## Overview
28
- Deploy specialized AI agents to perform comprehensive, intelligent code reviews that go beyond traditional static analysis.
29
-
30
- ## Core Features
31
-
32
- ### 1. Multi-Agent Review System
33
- ```bash
34
- # Initialize code review swarm with gh CLI
35
- # Get PR details
36
- PR_DATA=$(gh pr view 123 --json files,additions,deletions,title,body)
37
- PR_DIFF=$(gh pr diff 123)
38
-
39
- # Initialize swarm with PR context
40
- npx ruv-swarm github review-init \
41
- --pr 123 \
42
- --pr-data "$PR_DATA" \
43
- --diff "$PR_DIFF" \
44
- --agents "security,performance,style,architecture,accessibility" \
45
- --depth comprehensive
46
-
47
- # Post initial review status
48
- gh pr comment 123 --body "🔍 Multi-agent code review initiated"
49
- ```
50
-
51
- ### 2. Specialized Review Agents
52
-
53
- #### Security Agent
54
- ```bash
55
- # Security-focused review with gh CLI
56
- # Get changed files
57
- CHANGED_FILES=$(gh pr view 123 --json files --jq '.files[].path')
58
-
59
- # Run security review
60
- SECURITY_RESULTS=$(npx ruv-swarm github review-security \
61
- --pr 123 \
62
- --files "$CHANGED_FILES" \
63
- --check "owasp,cve,secrets,permissions" \
64
- --suggest-fixes)
65
-
66
- # Post security findings
67
- if echo "$SECURITY_RESULTS" | grep -q "critical"; then
68
- # Request changes for critical issues
69
- gh pr review 123 --request-changes --body "$SECURITY_RESULTS"
70
- # Add security label
71
- gh pr edit 123 --add-label "security-review-required"
72
- else
73
- # Post as comment for non-critical issues
74
- gh pr comment 123 --body "$SECURITY_RESULTS"
75
- fi
76
- ```
77
-
78
- #### Performance Agent
79
- ```bash
80
- # Performance analysis
81
- npx ruv-swarm github review-performance \
82
- --pr 123 \
83
- --profile "cpu,memory,io" \
84
- --benchmark-against main \
85
- --suggest-optimizations
86
- ```
87
-
88
- #### Architecture Agent
89
- ```bash
90
- # Architecture review
91
- npx ruv-swarm github review-architecture \
92
- --pr 123 \
93
- --check "patterns,coupling,cohesion,solid" \
94
- --visualize-impact \
95
- --suggest-refactoring
96
- ```
97
-
98
- ### 3. Review Configuration
99
- ```yaml
100
- # .github/review-swarm.yml
101
- version: 1
102
- review:
103
- auto-trigger: true
104
- required-agents:
105
- - security
106
- - performance
107
- - style
108
- optional-agents:
109
- - architecture
110
- - accessibility
111
- - i18n
112
-
113
- thresholds:
114
- security: block
115
- performance: warn
116
- style: suggest
117
-
118
- rules:
119
- security:
120
- - no-eval
121
- - no-hardcoded-secrets
122
- - proper-auth-checks
123
- performance:
124
- - no-n-plus-one
125
- - efficient-queries
126
- - proper-caching
127
- architecture:
128
- - max-coupling: 5
129
- - min-cohesion: 0.7
130
- - follow-patterns
131
- ```
132
-
133
- ## Review Agents
134
-
135
- ### Security Review Agent
136
- ```javascript
137
- // Security checks performed
138
- {
139
- "checks": [
140
- "SQL injection vulnerabilities",
141
- "XSS attack vectors",
142
- "Authentication bypasses",
143
- "Authorization flaws",
144
- "Cryptographic weaknesses",
145
- "Dependency vulnerabilities",
146
- "Secret exposure",
147
- "CORS misconfigurations"
148
- ],
149
- "actions": [
150
- "Block PR on critical issues",
151
- "Suggest secure alternatives",
152
- "Add security test cases",
153
- "Update security documentation"
154
- ]
155
- }
156
- ```
157
-
158
- ### Performance Review Agent
159
- ```javascript
160
- // Performance analysis
161
- {
162
- "metrics": [
163
- "Algorithm complexity",
164
- "Database query efficiency",
165
- "Memory allocation patterns",
166
- "Cache utilization",
167
- "Network request optimization",
168
- "Bundle size impact",
169
- "Render performance"
170
- ],
171
- "benchmarks": [
172
- "Compare with baseline",
173
- "Load test simulations",
174
- "Memory leak detection",
175
- "Bottleneck identification"
176
- ]
177
- }
178
- ```
179
-
180
- ### Style & Convention Agent
181
- ```javascript
182
- // Style enforcement
183
- {
184
- "checks": [
185
- "Code formatting",
186
- "Naming conventions",
187
- "Documentation standards",
188
- "Comment quality",
189
- "Test coverage",
190
- "Error handling patterns",
191
- "Logging standards"
192
- ],
193
- "auto-fix": [
194
- "Formatting issues",
195
- "Import organization",
196
- "Trailing whitespace",
197
- "Simple naming issues"
198
- ]
199
- }
200
- ```
201
-
202
- ### Architecture Review Agent
203
- ```javascript
204
- // Architecture analysis
205
- {
206
- "patterns": [
207
- "Design pattern adherence",
208
- "SOLID principles",
209
- "DRY violations",
210
- "Separation of concerns",
211
- "Dependency injection",
212
- "Layer violations",
213
- "Circular dependencies"
214
- ],
215
- "metrics": [
216
- "Coupling metrics",
217
- "Cohesion scores",
218
- "Complexity measures",
219
- "Maintainability index"
220
- ]
221
- }
222
- ```
223
-
224
- ## Advanced Review Features
225
-
226
- ### 1. Context-Aware Reviews
227
- ```bash
228
- # Review with full context
229
- npx ruv-swarm github review-context \
230
- --pr 123 \
231
- --load-related-prs \
232
- --analyze-impact \
233
- --check-breaking-changes
234
- ```
235
-
236
- ### 2. Learning from History
237
- ```bash
238
- # Learn from past reviews
239
- npx ruv-swarm github review-learn \
240
- --analyze-past-reviews \
241
- --identify-patterns \
242
- --improve-suggestions \
243
- --reduce-false-positives
244
- ```
245
-
246
- ### 3. Cross-PR Analysis
247
- ```bash
248
- # Analyze related PRs together
249
- npx ruv-swarm github review-batch \
250
- --prs "123,124,125" \
251
- --check-consistency \
252
- --verify-integration \
253
- --combined-impact
254
- ```
255
-
256
- ## Review Automation
257
-
258
- ### Auto-Review on Push
259
- ```yaml
260
- # .github/workflows/auto-review.yml
261
- name: Automated Code Review
262
- on:
263
- pull_request:
264
- types: [opened, synchronize]
265
-
266
- jobs:
267
- swarm-review:
268
- runs-on: ubuntu-latest
269
- steps:
270
- - uses: actions/checkout@v3
271
- with:
272
- fetch-depth: 0
273
-
274
- - name: Setup GitHub CLI
275
- run: echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token
276
-
277
- - name: Run Review Swarm
278
- run: |
279
- # Get PR context with gh CLI
280
- PR_NUM=${{ github.event.pull_request.number }}
281
- PR_DATA=$(gh pr view $PR_NUM --json files,title,body,labels)
282
-
283
- # Run swarm review
284
- REVIEW_OUTPUT=$(npx ruv-swarm github review-all \
285
- --pr $PR_NUM \
286
- --pr-data "$PR_DATA" \
287
- --agents "security,performance,style,architecture")
288
-
289
- # Post review results
290
- echo "$REVIEW_OUTPUT" | gh pr review $PR_NUM --comment -F -
291
-
292
- # Update PR status
293
- if echo "$REVIEW_OUTPUT" | grep -q "approved"; then
294
- gh pr review $PR_NUM --approve
295
- elif echo "$REVIEW_OUTPUT" | grep -q "changes-requested"; then
296
- gh pr review $PR_NUM --request-changes -b "See review comments above"
297
- fi
298
- ```
299
-
300
- ### Review Triggers
301
- ```javascript
302
- // Custom review triggers
303
- {
304
- "triggers": {
305
- "high-risk-files": {
306
- "paths": ["**/auth/**", "**/payment/**"],
307
- "agents": ["security", "architecture"],
308
- "depth": "comprehensive"
309
- },
310
- "performance-critical": {
311
- "paths": ["**/api/**", "**/database/**"],
312
- "agents": ["performance", "database"],
313
- "benchmarks": true
314
- },
315
- "ui-changes": {
316
- "paths": ["**/components/**", "**/styles/**"],
317
- "agents": ["accessibility", "style", "i18n"],
318
- "visual-tests": true
319
- }
320
- }
321
- }
322
- ```
323
-
324
- ## Review Comments
325
-
326
- ### Intelligent Comment Generation
327
- ```bash
328
- # Generate contextual review comments with gh CLI
329
- # Get PR diff with context
330
- PR_DIFF=$(gh pr diff 123 --color never)
331
- PR_FILES=$(gh pr view 123 --json files)
332
-
333
- # Generate review comments
334
- COMMENTS=$(npx ruv-swarm github review-comment \
335
- --pr 123 \
336
- --diff "$PR_DIFF" \
337
- --files "$PR_FILES" \
338
- --style "constructive" \
339
- --include-examples \
340
- --suggest-fixes)
341
-
342
- # Post comments using gh CLI
343
- echo "$COMMENTS" | jq -c '.[]' | while read -r comment; do
344
- FILE=$(echo "$comment" | jq -r '.path')
345
- LINE=$(echo "$comment" | jq -r '.line')
346
- BODY=$(echo "$comment" | jq -r '.body')
347
-
348
- # Create review with inline comments
349
- gh api \
350
- --method POST \
351
- /repos/:owner/:repo/pulls/123/comments \
352
- -f path="$FILE" \
353
- -f line="$LINE" \
354
- -f body="$BODY" \
355
- -f commit_id="$(gh pr view 123 --json headRefOid -q .headRefOid)"
356
- done
357
- ```
358
-
359
- ### Comment Templates
360
- ```markdown
361
- <!-- Security Issue Template -->
362
- 🔒 **Security Issue: [Type]**
363
-
364
- **Severity**: 🔴 Critical / 🟡 High / 🟢 Low
365
-
366
- **Description**:
367
- [Clear explanation of the security issue]
368
-
369
- **Impact**:
370
- [Potential consequences if not addressed]
371
-
372
- **Suggested Fix**:
373
- ```language
374
- [Code example of the fix]
375
- ```
376
-
377
- **References**:
378
- - [OWASP Guide](link)
379
- - [Security Best Practices](link)
380
- ```
381
-
382
- ### Batch Comment Management
383
- ```bash
384
- # Manage review comments efficiently
385
- npx ruv-swarm github review-comments \
386
- --pr 123 \
387
- --group-by "agent,severity" \
388
- --summarize \
389
- --resolve-outdated
390
- ```
391
-
392
- ## Integration with CI/CD
393
-
394
- ### Status Checks
395
- ```yaml
396
- # Required status checks
397
- protection_rules:
398
- required_status_checks:
399
- contexts:
400
- - "review-swarm/security"
401
- - "review-swarm/performance"
402
- - "review-swarm/architecture"
403
- ```
404
-
405
- ### Quality Gates
406
- ```bash
407
- # Define quality gates
408
- npx ruv-swarm github quality-gates \
409
- --define '{
410
- "security": {"threshold": "no-critical"},
411
- "performance": {"regression": "<5%"},
412
- "coverage": {"minimum": "80%"},
413
- "architecture": {"complexity": "<10"}
414
- }'
415
- ```
416
-
417
- ### Review Metrics
418
- ```bash
419
- # Track review effectiveness
420
- npx ruv-swarm github review-metrics \
421
- --period 30d \
422
- --metrics "issues-found,false-positives,fix-rate" \
423
- --export-dashboard
424
- ```
425
-
426
- ## Best Practices
427
-
428
- ### 1. Review Configuration
429
- - Define clear review criteria
430
- - Set appropriate thresholds
431
- - Configure agent specializations
432
- - Establish override procedures
433
-
434
- ### 2. Comment Quality
435
- - Provide actionable feedback
436
- - Include code examples
437
- - Reference documentation
438
- - Maintain respectful tone
439
-
440
- ### 3. Performance
441
- - Cache analysis results
442
- - Incremental reviews for large PRs
443
- - Parallel agent execution
444
- - Smart comment batching
445
-
446
- ## Advanced Features
447
-
448
- ### 1. AI Learning
449
- ```bash
450
- # Train on your codebase
451
- npx ruv-swarm github review-train \
452
- --learn-patterns \
453
- --adapt-to-style \
454
- --improve-accuracy
455
- ```
456
-
457
- ### 2. Custom Review Agents
458
- ```javascript
459
- // Create custom review agent
460
- class CustomReviewAgent {
461
- async review(pr) {
462
- const issues = [];
463
-
464
- // Custom logic here
465
- if (await this.checkCustomRule(pr)) {
466
- issues.push({
467
- severity: 'warning',
468
- message: 'Custom rule violation',
469
- suggestion: 'Fix suggestion'
470
- });
471
- }
472
-
473
- return issues;
474
- }
475
- }
476
- ```
477
-
478
- ### 3. Review Orchestration
479
- ```bash
480
- # Orchestrate complex reviews
481
- npx ruv-swarm github review-orchestrate \
482
- --strategy "risk-based" \
483
- --allocate-time-budget \
484
- --prioritize-critical
485
- ```
486
-
487
- ## Examples
488
-
489
- ### Security-Critical PR
490
- ```bash
491
- # Auth system changes
492
- npx ruv-swarm github review-init \
493
- --pr 456 \
494
- --agents "security,authentication,audit" \
495
- --depth "maximum" \
496
- --require-security-approval
497
- ```
498
-
499
- ### Performance-Sensitive PR
500
- ```bash
501
- # Database optimization
502
- npx ruv-swarm github review-init \
503
- --pr 789 \
504
- --agents "performance,database,caching" \
505
- --benchmark \
506
- --profile
507
- ```
508
-
509
- ### UI Component PR
510
- ```bash
511
- # New component library
512
- npx ruv-swarm github review-init \
513
- --pr 321 \
514
- --agents "accessibility,style,i18n,docs" \
515
- --visual-regression \
516
- --component-tests
517
- ```
518
-
519
- ## Monitoring & Analytics
520
-
521
- ### Review Dashboard
522
- ```bash
523
- # Launch review dashboard
524
- npx ruv-swarm github review-dashboard \
525
- --real-time \
526
- --show "agent-activity,issue-trends,fix-rates"
527
- ```
528
-
529
- ### Review Reports
530
- ```bash
531
- # Generate review reports
532
- npx ruv-swarm github review-report \
533
- --format "markdown" \
534
- --include "summary,details,trends" \
535
- --email-stakeholders
536
- ```
537
-
538
- See also: [swarm-pr.md](./swarm-pr.md), [workflow-automation.md](./workflow-automation.md)