moflo 4.8.21 → 4.8.23

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 (178) hide show
  1. package/.claude/agents/browser/browser-agent.yaml +182 -182
  2. package/.claude/agents/core/coder.md +265 -265
  3. package/.claude/agents/core/planner.md +167 -167
  4. package/.claude/agents/core/researcher.md +189 -189
  5. package/.claude/agents/core/reviewer.md +325 -325
  6. package/.claude/agents/core/tester.md +318 -318
  7. package/.claude/agents/database-specialist.yaml +21 -21
  8. package/.claude/agents/dual-mode/codex-coordinator.md +224 -224
  9. package/.claude/agents/dual-mode/codex-worker.md +211 -211
  10. package/.claude/agents/dual-mode/dual-orchestrator.md +291 -291
  11. package/.claude/agents/github/code-review-swarm.md +537 -537
  12. package/.claude/agents/github/github-modes.md +172 -172
  13. package/.claude/agents/github/issue-tracker.md +318 -318
  14. package/.claude/agents/github/multi-repo-swarm.md +552 -552
  15. package/.claude/agents/github/pr-manager.md +190 -190
  16. package/.claude/agents/github/project-board-sync.md +508 -508
  17. package/.claude/agents/github/release-manager.md +366 -366
  18. package/.claude/agents/github/release-swarm.md +582 -582
  19. package/.claude/agents/github/repo-architect.md +397 -397
  20. package/.claude/agents/github/swarm-issue.md +572 -572
  21. package/.claude/agents/github/swarm-pr.md +427 -427
  22. package/.claude/agents/github/sync-coordinator.md +451 -451
  23. package/.claude/agents/github/workflow-automation.md +634 -634
  24. package/.claude/agents/goal/code-goal-planner.md +445 -445
  25. package/.claude/agents/hive-mind/collective-intelligence-coordinator.md +129 -129
  26. package/.claude/agents/hive-mind/queen-coordinator.md +202 -202
  27. package/.claude/agents/hive-mind/scout-explorer.md +241 -241
  28. package/.claude/agents/hive-mind/swarm-memory-manager.md +192 -192
  29. package/.claude/agents/hive-mind/worker-specialist.md +216 -216
  30. package/.claude/agents/index.yaml +17 -17
  31. package/.claude/agents/neural/safla-neural.md +73 -73
  32. package/.claude/agents/project-coordinator.yaml +15 -15
  33. package/.claude/agents/python-specialist.yaml +21 -21
  34. package/.claude/agents/reasoning/goal-planner.md +72 -72
  35. package/.claude/agents/security-auditor.yaml +20 -20
  36. package/.claude/agents/swarm/adaptive-coordinator.md +395 -395
  37. package/.claude/agents/swarm/hierarchical-coordinator.md +326 -326
  38. package/.claude/agents/swarm/mesh-coordinator.md +391 -391
  39. package/.claude/agents/templates/migration-plan.md +745 -745
  40. package/.claude/agents/typescript-specialist.yaml +21 -21
  41. package/.claude/checkpoints/1767754460.json +8 -8
  42. package/.claude/commands/agents/agent-spawning.md +28 -28
  43. package/.claude/commands/github/github-modes.md +146 -146
  44. package/.claude/commands/github/github-swarm.md +121 -121
  45. package/.claude/commands/github/issue-tracker.md +291 -291
  46. package/.claude/commands/github/pr-manager.md +169 -169
  47. package/.claude/commands/github/release-manager.md +337 -337
  48. package/.claude/commands/github/repo-architect.md +366 -366
  49. package/.claude/commands/github/sync-coordinator.md +300 -300
  50. package/.claude/commands/memory/neural.md +47 -47
  51. package/.claude/commands/sparc/analyzer.md +51 -51
  52. package/.claude/commands/sparc/architect.md +53 -53
  53. package/.claude/commands/sparc/ask.md +97 -97
  54. package/.claude/commands/sparc/batch-executor.md +54 -54
  55. package/.claude/commands/sparc/code.md +89 -89
  56. package/.claude/commands/sparc/coder.md +54 -54
  57. package/.claude/commands/sparc/debug.md +83 -83
  58. package/.claude/commands/sparc/debugger.md +54 -54
  59. package/.claude/commands/sparc/designer.md +53 -53
  60. package/.claude/commands/sparc/devops.md +109 -109
  61. package/.claude/commands/sparc/docs-writer.md +80 -80
  62. package/.claude/commands/sparc/documenter.md +54 -54
  63. package/.claude/commands/sparc/innovator.md +54 -54
  64. package/.claude/commands/sparc/integration.md +83 -83
  65. package/.claude/commands/sparc/mcp.md +117 -117
  66. package/.claude/commands/sparc/memory-manager.md +54 -54
  67. package/.claude/commands/sparc/optimizer.md +54 -54
  68. package/.claude/commands/sparc/orchestrator.md +131 -131
  69. package/.claude/commands/sparc/post-deployment-monitoring-mode.md +83 -83
  70. package/.claude/commands/sparc/refinement-optimization-mode.md +83 -83
  71. package/.claude/commands/sparc/researcher.md +54 -54
  72. package/.claude/commands/sparc/reviewer.md +54 -54
  73. package/.claude/commands/sparc/security-review.md +80 -80
  74. package/.claude/commands/sparc/sparc-modes.md +174 -174
  75. package/.claude/commands/sparc/sparc.md +111 -111
  76. package/.claude/commands/sparc/spec-pseudocode.md +80 -80
  77. package/.claude/commands/sparc/supabase-admin.md +348 -348
  78. package/.claude/commands/sparc/swarm-coordinator.md +54 -54
  79. package/.claude/commands/sparc/tdd.md +54 -54
  80. package/.claude/commands/sparc/tester.md +54 -54
  81. package/.claude/commands/sparc/tutorial.md +79 -79
  82. package/.claude/commands/sparc/workflow-manager.md +54 -54
  83. package/.claude/commands/sparc.md +166 -166
  84. package/.claude/commands/swarm/analysis.md +95 -95
  85. package/.claude/commands/swarm/development.md +96 -96
  86. package/.claude/commands/swarm/examples.md +168 -168
  87. package/.claude/commands/swarm/maintenance.md +102 -102
  88. package/.claude/commands/swarm/optimization.md +117 -117
  89. package/.claude/commands/swarm/research.md +136 -136
  90. package/.claude/commands/swarm/testing.md +131 -131
  91. package/.claude/commands/workflows/development.md +77 -77
  92. package/.claude/commands/workflows/research.md +62 -62
  93. package/.claude/guidance/moflo-bootstrap.md +126 -126
  94. package/.claude/guidance/shipped/agent-bootstrap.md +126 -126
  95. package/.claude/guidance/shipped/guidance-memory-strategy.md +262 -262
  96. package/.claude/guidance/shipped/memory-strategy.md +204 -204
  97. package/.claude/guidance/shipped/moflo.md +668 -653
  98. package/.claude/guidance/shipped/task-swarm-integration.md +441 -441
  99. package/.claude/helpers/intelligence.cjs +207 -207
  100. package/.claude/helpers/statusline.cjs +851 -851
  101. package/.claude/settings.local.json +18 -0
  102. package/.claude/skills/fl/SKILL.md +583 -583
  103. package/.claude/skills/flo/SKILL.md +583 -583
  104. package/.claude/skills/github-code-review/SKILL.md +1140 -1140
  105. package/.claude/skills/github-multi-repo/SKILL.md +874 -874
  106. package/.claude/skills/github-project-management/SKILL.md +1277 -1277
  107. package/.claude/skills/github-release-management/SKILL.md +1081 -1081
  108. package/.claude/skills/github-workflow-automation/SKILL.md +1065 -1065
  109. package/.claude/skills/hive-mind-advanced/SKILL.md +712 -712
  110. package/.claude/skills/hooks-automation/SKILL.md +1201 -1201
  111. package/.claude/skills/performance-analysis/SKILL.md +563 -563
  112. package/.claude/skills/sparc-methodology/SKILL.md +1115 -1115
  113. package/.claude/skills/swarm-advanced/SKILL.md +973 -973
  114. package/.claude/workflow-state.json +4 -4
  115. package/LICENSE +21 -21
  116. package/README.md +698 -685
  117. package/bin/cli.js +0 -0
  118. package/bin/gate-hook.mjs +50 -50
  119. package/bin/gate.cjs +138 -138
  120. package/bin/generate-code-map.mjs +775 -775
  121. package/bin/hook-handler.cjs +83 -83
  122. package/bin/hooks.mjs +656 -656
  123. package/bin/index-guidance.mjs +892 -892
  124. package/bin/index-tests.mjs +709 -709
  125. package/bin/lib/process-manager.mjs +243 -243
  126. package/bin/lib/registry-cleanup.cjs +41 -41
  127. package/bin/prompt-hook.mjs +72 -72
  128. package/bin/semantic-search.mjs +472 -472
  129. package/bin/session-start-launcher.mjs +238 -238
  130. package/bin/setup-project.mjs +250 -250
  131. package/package.json +123 -123
  132. package/src/@claude-flow/cli/README.md +452 -452
  133. package/src/@claude-flow/cli/bin/cli.js +180 -180
  134. package/src/@claude-flow/cli/bin/preinstall.cjs +2 -2
  135. package/src/@claude-flow/cli/dist/src/commands/completions.js +409 -409
  136. package/src/@claude-flow/cli/dist/src/commands/doctor.js +18 -2
  137. package/src/@claude-flow/cli/dist/src/commands/embeddings.js +25 -25
  138. package/src/@claude-flow/cli/dist/src/commands/github.js +61 -61
  139. package/src/@claude-flow/cli/dist/src/commands/hive-mind.js +90 -90
  140. package/src/@claude-flow/cli/dist/src/commands/hooks.js +9 -9
  141. package/src/@claude-flow/cli/dist/src/commands/init.js +3 -8
  142. package/src/@claude-flow/cli/dist/src/commands/ruvector/import.js +14 -14
  143. package/src/@claude-flow/cli/dist/src/commands/ruvector/setup.js +624 -624
  144. package/src/@claude-flow/cli/dist/src/config/moflo-config.d.ts +3 -0
  145. package/src/@claude-flow/cli/dist/src/config/moflo-config.js +101 -91
  146. package/src/@claude-flow/cli/dist/src/index.d.ts +5 -0
  147. package/src/@claude-flow/cli/dist/src/index.js +44 -0
  148. package/src/@claude-flow/cli/dist/src/init/claudemd-generator.d.ts +29 -29
  149. package/src/@claude-flow/cli/dist/src/init/claudemd-generator.js +43 -43
  150. package/src/@claude-flow/cli/dist/src/init/executor.js +453 -453
  151. package/src/@claude-flow/cli/dist/src/init/helpers-generator.js +482 -482
  152. package/src/@claude-flow/cli/dist/src/init/moflo-init.d.ts +30 -30
  153. package/src/@claude-flow/cli/dist/src/init/moflo-init.js +140 -140
  154. package/src/@claude-flow/cli/dist/src/init/statusline-generator.js +876 -876
  155. package/src/@claude-flow/cli/dist/src/memory/memory-initializer.js +371 -371
  156. package/src/@claude-flow/cli/dist/src/runtime/headless.js +28 -28
  157. package/src/@claude-flow/cli/dist/src/services/container-worker-pool.d.ts +197 -0
  158. package/src/@claude-flow/cli/dist/src/services/container-worker-pool.js +584 -0
  159. package/src/@claude-flow/cli/dist/src/services/daemon-lock.d.ts +14 -0
  160. package/src/@claude-flow/cli/dist/src/services/daemon-lock.js +1 -1
  161. package/src/@claude-flow/cli/dist/src/services/headless-worker-executor.js +84 -84
  162. package/src/@claude-flow/cli/package.json +1 -1
  163. package/src/@claude-flow/guidance/README.md +1195 -1195
  164. package/src/@claude-flow/guidance/package.json +198 -198
  165. package/src/@claude-flow/memory/README.md +587 -587
  166. package/src/@claude-flow/memory/dist/agentdb-backend.js +26 -26
  167. package/src/@claude-flow/memory/dist/auto-memory-bridge.test.js +27 -27
  168. package/src/@claude-flow/memory/dist/hybrid-backend.d.ts +245 -0
  169. package/src/@claude-flow/memory/dist/hybrid-backend.js +569 -0
  170. package/src/@claude-flow/memory/dist/hybrid-backend.test.d.ts +8 -0
  171. package/src/@claude-flow/memory/dist/hybrid-backend.test.js +320 -0
  172. package/src/@claude-flow/memory/dist/sqlite-backend.d.ts +121 -0
  173. package/src/@claude-flow/memory/dist/sqlite-backend.js +572 -0
  174. package/src/@claude-flow/memory/dist/sqljs-backend.js +26 -26
  175. package/src/@claude-flow/memory/package.json +44 -44
  176. package/src/@claude-flow/shared/README.md +323 -323
  177. package/src/@claude-flow/shared/dist/events/event-store.js +31 -31
  178. package/src/README.md +493 -493
@@ -1,553 +1,553 @@
1
- ---
2
- name: multi-repo-swarm
3
- description: Cross-repository swarm orchestration for organization-wide automation and intelligent collaboration
4
- type: coordination
5
- color: "#FF6B35"
6
- tools:
7
- - Bash
8
- - Read
9
- - Write
10
- - Edit
11
- - Glob
12
- - Grep
13
- - LS
14
- - TodoWrite
15
- - mcp__moflo__swarm_init
16
- - mcp__moflo__agent_spawn
17
- - mcp__moflo__task_orchestrate
18
- - mcp__moflo__swarm_status
19
- - mcp__moflo__memory_usage
20
- - mcp__moflo__github_repo_analyze
21
- - mcp__moflo__github_pr_manage
22
- - mcp__moflo__github_sync_coord
23
- - mcp__moflo__github_metrics
24
- hooks:
25
- pre:
26
- - "gh auth status || (echo 'GitHub CLI not authenticated' && exit 1)"
27
- - "git status --porcelain || echo 'Not in git repository'"
28
- - "gh repo list --limit 1 >/dev/null || (echo 'No repo access' && exit 1)"
29
- post:
30
- - "gh pr list --state open --limit 5 | grep -q . && echo 'Active PRs found'"
31
- - "git log --oneline -5 | head -3"
32
- - "gh repo view --json name,description,topics"
33
- ---
34
-
35
- # Multi-Repo Swarm - Cross-Repository Swarm Orchestration
36
-
37
- ## Overview
38
- Coordinate AI swarms across multiple repositories, enabling organization-wide automation and intelligent cross-project collaboration.
39
-
40
- ## Core Features
41
-
42
- ### 1. Cross-Repo Initialization
43
- ```bash
44
- # Initialize multi-repo swarm with gh CLI
45
- # List organization repositories
46
- REPOS=$(gh repo list org --limit 100 --json name,description,languages \
47
- --jq '.[] | select(.name | test("frontend|backend|shared"))')
48
-
49
- # Get repository details
50
- REPO_DETAILS=$(echo "$REPOS" | jq -r '.name' | while read -r repo; do
51
- gh api repos/org/$repo --jq '{name, default_branch, languages, topics}'
52
- done | jq -s '.')
53
-
54
- # Initialize swarm with repository context
55
- npx ruv-swarm github multi-repo-init \
56
- --repo-details "$REPO_DETAILS" \
57
- --repos "org/frontend,org/backend,org/shared" \
58
- --topology hierarchical \
59
- --shared-memory \
60
- --sync-strategy eventual
61
- ```
62
-
63
- ### 2. Repository Discovery
64
- ```bash
65
- # Auto-discover related repositories with gh CLI
66
- # Search organization repositories
67
- REPOS=$(gh repo list my-organization --limit 100 \
68
- --json name,description,languages,topics \
69
- --jq '.[] | select(.languages | keys | contains(["TypeScript"]))')
70
-
71
- # Analyze repository dependencies
72
- DEPS=$(echo "$REPOS" | jq -r '.name' | while read -r repo; do
73
- # Get package.json if it exists
74
- if gh api repos/my-organization/$repo/contents/package.json --jq '.content' 2>/dev/null; then
75
- gh api repos/my-organization/$repo/contents/package.json \
76
- --jq '.content' | base64 -d | jq '{name, dependencies, devDependencies}'
77
- fi
78
- done | jq -s '.')
79
-
80
- # Discover and analyze
81
- npx ruv-swarm github discover-repos \
82
- --repos "$REPOS" \
83
- --dependencies "$DEPS" \
84
- --analyze-dependencies \
85
- --suggest-swarm-topology
86
- ```
87
-
88
- ### 3. Synchronized Operations
89
- ```bash
90
- # Execute synchronized changes across repos with gh CLI
91
- # Get matching repositories
92
- MATCHING_REPOS=$(gh repo list org --limit 100 --json name \
93
- --jq '.[] | select(.name | test("-service$")) | .name')
94
-
95
- # Execute task and create PRs
96
- echo "$MATCHING_REPOS" | while read -r repo; do
97
- # Clone repo
98
- gh repo clone org/$repo /tmp/$repo -- --depth=1
99
-
100
- # Execute task
101
- cd /tmp/$repo
102
- npx ruv-swarm github task-execute \
103
- --task "update-dependencies" \
104
- --repo "org/$repo"
105
-
106
- # Create PR if changes exist
107
- if [[ -n $(git status --porcelain) ]]; then
108
- git checkout -b update-dependencies-$(date +%Y%m%d)
109
- git add -A
110
- git commit -m "chore: Update dependencies"
111
-
112
- # Push and create PR
113
- git push origin HEAD
114
- PR_URL=$(gh pr create \
115
- --title "Update dependencies" \
116
- --body "Automated dependency update across services" \
117
- --label "dependencies,automated")
118
-
119
- echo "$PR_URL" >> /tmp/created-prs.txt
120
- fi
121
- cd -
122
- done
123
-
124
- # Link related PRs
125
- PR_URLS=$(cat /tmp/created-prs.txt)
126
- npx ruv-swarm github link-prs --urls "$PR_URLS"
127
- ```
128
-
129
- ## Configuration
130
-
131
- ### Multi-Repo Config File
132
- ```yaml
133
- # .swarm/multi-repo.yml
134
- version: 1
135
- organization: my-org
136
- repositories:
137
- - name: frontend
138
- url: github.com/my-org/frontend
139
- role: ui
140
- agents: [coder, designer, tester]
141
-
142
- - name: backend
143
- url: github.com/my-org/backend
144
- role: api
145
- agents: [architect, coder, tester]
146
-
147
- - name: shared
148
- url: github.com/my-org/shared
149
- role: library
150
- agents: [analyst, coder]
151
-
152
- coordination:
153
- topology: hierarchical
154
- communication: webhook
155
- memory: redis://shared-memory
156
-
157
- dependencies:
158
- - from: frontend
159
- to: [backend, shared]
160
- - from: backend
161
- to: [shared]
162
- ```
163
-
164
- ### Repository Roles
165
- ```javascript
166
- // Define repository roles and responsibilities
167
- {
168
- "roles": {
169
- "ui": {
170
- "responsibilities": ["user-interface", "ux", "accessibility"],
171
- "default-agents": ["designer", "coder", "tester"]
172
- },
173
- "api": {
174
- "responsibilities": ["endpoints", "business-logic", "data"],
175
- "default-agents": ["architect", "coder", "security"]
176
- },
177
- "library": {
178
- "responsibilities": ["shared-code", "utilities", "types"],
179
- "default-agents": ["analyst", "coder", "documenter"]
180
- }
181
- }
182
- }
183
- ```
184
-
185
- ## Orchestration Commands
186
-
187
- ### Dependency Management
188
- ```bash
189
- # Update dependencies across all repos with gh CLI
190
- # Create tracking issue first
191
- TRACKING_ISSUE=$(gh issue create \
192
- --title "Dependency Update: typescript@5.0.0" \
193
- --body "Tracking issue for updating TypeScript across all repositories" \
194
- --label "dependencies,tracking" \
195
- --json number -q .number)
196
-
197
- # Get all repos with TypeScript
198
- TS_REPOS=$(gh repo list org --limit 100 --json name | jq -r '.[].name' | \
199
- while read -r repo; do
200
- if gh api repos/org/$repo/contents/package.json 2>/dev/null | \
201
- jq -r '.content' | base64 -d | grep -q '"typescript"'; then
202
- echo "$repo"
203
- fi
204
- done)
205
-
206
- # Update each repository
207
- echo "$TS_REPOS" | while read -r repo; do
208
- # Clone and update
209
- gh repo clone org/$repo /tmp/$repo -- --depth=1
210
- cd /tmp/$repo
211
-
212
- # Update dependency
213
- npm install --save-dev typescript@5.0.0
214
-
215
- # Test changes
216
- if npm test; then
217
- # Create PR
218
- git checkout -b update-typescript-5
219
- git add package.json package-lock.json
220
- git commit -m "chore: Update TypeScript to 5.0.0
221
-
222
- Part of #$TRACKING_ISSUE"
223
-
224
- git push origin HEAD
225
- gh pr create \
226
- --title "Update TypeScript to 5.0.0" \
227
- --body "Updates TypeScript to version 5.0.0\n\nTracking: #$TRACKING_ISSUE" \
228
- --label "dependencies"
229
- else
230
- # Report failure
231
- gh issue comment $TRACKING_ISSUE \
232
- --body "❌ Failed to update $repo - tests failing"
233
- fi
234
- cd -
235
- done
236
- ```
237
-
238
- ### Refactoring Operations
239
- ```bash
240
- # Coordinate large-scale refactoring
241
- npx ruv-swarm github multi-repo-refactor \
242
- --pattern "rename:OldAPI->NewAPI" \
243
- --analyze-impact \
244
- --create-migration-guide \
245
- --staged-rollout
246
- ```
247
-
248
- ### Security Updates
249
- ```bash
250
- # Coordinate security patches
251
- npx ruv-swarm github multi-repo-security \
252
- --scan-all \
253
- --patch-vulnerabilities \
254
- --verify-fixes \
255
- --compliance-report
256
- ```
257
-
258
- ## Communication Strategies
259
-
260
- ### 1. Webhook-Based Coordination
261
- ```javascript
262
- // webhook-coordinator.js
263
- const { MultiRepoSwarm } = require('ruv-swarm');
264
-
265
- const swarm = new MultiRepoSwarm({
266
- webhook: {
267
- url: 'https://swarm-coordinator.example.com',
268
- secret: process.env.WEBHOOK_SECRET
269
- }
270
- });
271
-
272
- // Handle cross-repo events
273
- swarm.on('repo:update', async (event) => {
274
- await swarm.propagate(event, {
275
- to: event.dependencies,
276
- strategy: 'eventual-consistency'
277
- });
278
- });
279
- ```
280
-
281
- ### 2. GraphQL Federation
282
- ```graphql
283
- # Federated schema for multi-repo queries
284
- type Repository @key(fields: "id") {
285
- id: ID!
286
- name: String!
287
- swarmStatus: SwarmStatus!
288
- dependencies: [Repository!]!
289
- agents: [Agent!]!
290
- }
291
-
292
- type SwarmStatus {
293
- active: Boolean!
294
- topology: Topology!
295
- tasks: [Task!]!
296
- memory: JSON!
297
- }
298
- ```
299
-
300
- ### 3. Event Streaming
301
- ```yaml
302
- # Kafka configuration for real-time coordination
303
- kafka:
304
- brokers: ['kafka1:9092', 'kafka2:9092']
305
- topics:
306
- swarm-events:
307
- partitions: 10
308
- replication: 3
309
- swarm-memory:
310
- partitions: 5
311
- replication: 3
312
- ```
313
-
314
- ## Advanced Features
315
-
316
- ### 1. Distributed Task Queue
317
- ```bash
318
- # Create distributed task queue
319
- npx ruv-swarm github multi-repo-queue \
320
- --backend redis \
321
- --workers 10 \
322
- --priority-routing \
323
- --dead-letter-queue
324
- ```
325
-
326
- ### 2. Cross-Repo Testing
327
- ```bash
328
- # Run integration tests across repos
329
- npx ruv-swarm github multi-repo-test \
330
- --setup-test-env \
331
- --link-services \
332
- --run-e2e \
333
- --tear-down
334
- ```
335
-
336
- ### 3. Monorepo Migration
337
- ```bash
338
- # Assist in monorepo migration
339
- npx ruv-swarm github to-monorepo \
340
- --analyze-repos \
341
- --suggest-structure \
342
- --preserve-history \
343
- --create-migration-prs
344
- ```
345
-
346
- ## Monitoring & Visualization
347
-
348
- ### Multi-Repo Dashboard
349
- ```bash
350
- # Launch monitoring dashboard
351
- npx ruv-swarm github multi-repo-dashboard \
352
- --port 3000 \
353
- --metrics "agent-activity,task-progress,memory-usage" \
354
- --real-time
355
- ```
356
-
357
- ### Dependency Graph
358
- ```bash
359
- # Visualize repo dependencies
360
- npx ruv-swarm github dep-graph \
361
- --format mermaid \
362
- --include-agents \
363
- --show-data-flow
364
- ```
365
-
366
- ### Health Monitoring
367
- ```bash
368
- # Monitor swarm health across repos
369
- npx ruv-swarm github health-check \
370
- --repos "org/*" \
371
- --check "connectivity,memory,agents" \
372
- --alert-on-issues
373
- ```
374
-
375
- ## Synchronization Patterns
376
-
377
- ### 1. Eventually Consistent
378
- ```javascript
379
- // Eventual consistency for non-critical updates
380
- {
381
- "sync": {
382
- "strategy": "eventual",
383
- "max-lag": "5m",
384
- "retry": {
385
- "attempts": 3,
386
- "backoff": "exponential"
387
- }
388
- }
389
- }
390
- ```
391
-
392
- ### 2. Strong Consistency
393
- ```javascript
394
- // Strong consistency for critical operations
395
- {
396
- "sync": {
397
- "strategy": "strong",
398
- "consensus": "raft",
399
- "quorum": 0.51,
400
- "timeout": "30s"
401
- }
402
- }
403
- ```
404
-
405
- ### 3. Hybrid Approach
406
- ```javascript
407
- // Mix of consistency levels
408
- {
409
- "sync": {
410
- "default": "eventual",
411
- "overrides": {
412
- "security-updates": "strong",
413
- "dependency-updates": "strong",
414
- "documentation": "eventual"
415
- }
416
- }
417
- }
418
- ```
419
-
420
- ## Use Cases
421
-
422
- ### 1. Microservices Coordination
423
- ```bash
424
- # Coordinate microservices development
425
- npx ruv-swarm github microservices \
426
- --services "auth,users,orders,payments" \
427
- --ensure-compatibility \
428
- --sync-contracts \
429
- --integration-tests
430
- ```
431
-
432
- ### 2. Library Updates
433
- ```bash
434
- # Update shared library across consumers
435
- npx ruv-swarm github lib-update \
436
- --library "org/shared-lib" \
437
- --version "2.0.0" \
438
- --find-consumers \
439
- --update-imports \
440
- --run-tests
441
- ```
442
-
443
- ### 3. Organization-Wide Changes
444
- ```bash
445
- # Apply org-wide policy changes
446
- npx ruv-swarm github org-policy \
447
- --policy "add-security-headers" \
448
- --repos "org/*" \
449
- --validate-compliance \
450
- --create-reports
451
- ```
452
-
453
- ## Best Practices
454
-
455
- ### 1. Repository Organization
456
- - Clear repository roles and boundaries
457
- - Consistent naming conventions
458
- - Documented dependencies
459
- - Shared configuration standards
460
-
461
- ### 2. Communication
462
- - Use appropriate sync strategies
463
- - Implement circuit breakers
464
- - Monitor latency and failures
465
- - Clear error propagation
466
-
467
- ### 3. Security
468
- - Secure cross-repo authentication
469
- - Encrypted communication channels
470
- - Audit trail for all operations
471
- - Principle of least privilege
472
-
473
- ## Performance Optimization
474
-
475
- ### Caching Strategy
476
- ```bash
477
- # Implement cross-repo caching
478
- npx ruv-swarm github cache-strategy \
479
- --analyze-patterns \
480
- --suggest-cache-layers \
481
- --implement-invalidation
482
- ```
483
-
484
- ### Parallel Execution
485
- ```bash
486
- # Optimize parallel operations
487
- npx ruv-swarm github parallel-optimize \
488
- --analyze-dependencies \
489
- --identify-parallelizable \
490
- --execute-optimal
491
- ```
492
-
493
- ### Resource Pooling
494
- ```bash
495
- # Pool resources across repos
496
- npx ruv-swarm github resource-pool \
497
- --share-agents \
498
- --distribute-load \
499
- --monitor-usage
500
- ```
501
-
502
- ## Troubleshooting
503
-
504
- ### Connectivity Issues
505
- ```bash
506
- # Diagnose connectivity problems
507
- npx ruv-swarm github diagnose-connectivity \
508
- --test-all-repos \
509
- --check-permissions \
510
- --verify-webhooks
511
- ```
512
-
513
- ### Memory Synchronization
514
- ```bash
515
- # Debug memory sync issues
516
- npx ruv-swarm github debug-memory \
517
- --check-consistency \
518
- --identify-conflicts \
519
- --repair-state
520
- ```
521
-
522
- ### Performance Bottlenecks
523
- ```bash
524
- # Identify performance issues
525
- npx ruv-swarm github perf-analysis \
526
- --profile-operations \
527
- --identify-bottlenecks \
528
- --suggest-optimizations
529
- ```
530
-
531
- ## Examples
532
-
533
- ### Full-Stack Application Update
534
- ```bash
535
- # Update full-stack application
536
- npx ruv-swarm github fullstack-update \
537
- --frontend "org/web-app" \
538
- --backend "org/api-server" \
539
- --database "org/db-migrations" \
540
- --coordinate-deployment
541
- ```
542
-
543
- ### Cross-Team Collaboration
544
- ```bash
545
- # Facilitate cross-team work
546
- npx ruv-swarm github cross-team \
547
- --teams "frontend,backend,devops" \
548
- --task "implement-feature-x" \
549
- --assign-by-expertise \
550
- --track-progress
551
- ```
552
-
1
+ ---
2
+ name: multi-repo-swarm
3
+ description: Cross-repository swarm orchestration for organization-wide automation and intelligent collaboration
4
+ type: coordination
5
+ color: "#FF6B35"
6
+ tools:
7
+ - Bash
8
+ - Read
9
+ - Write
10
+ - Edit
11
+ - Glob
12
+ - Grep
13
+ - LS
14
+ - TodoWrite
15
+ - mcp__moflo__swarm_init
16
+ - mcp__moflo__agent_spawn
17
+ - mcp__moflo__task_orchestrate
18
+ - mcp__moflo__swarm_status
19
+ - mcp__moflo__memory_usage
20
+ - mcp__moflo__github_repo_analyze
21
+ - mcp__moflo__github_pr_manage
22
+ - mcp__moflo__github_sync_coord
23
+ - mcp__moflo__github_metrics
24
+ hooks:
25
+ pre:
26
+ - "gh auth status || (echo 'GitHub CLI not authenticated' && exit 1)"
27
+ - "git status --porcelain || echo 'Not in git repository'"
28
+ - "gh repo list --limit 1 >/dev/null || (echo 'No repo access' && exit 1)"
29
+ post:
30
+ - "gh pr list --state open --limit 5 | grep -q . && echo 'Active PRs found'"
31
+ - "git log --oneline -5 | head -3"
32
+ - "gh repo view --json name,description,topics"
33
+ ---
34
+
35
+ # Multi-Repo Swarm - Cross-Repository Swarm Orchestration
36
+
37
+ ## Overview
38
+ Coordinate AI swarms across multiple repositories, enabling organization-wide automation and intelligent cross-project collaboration.
39
+
40
+ ## Core Features
41
+
42
+ ### 1. Cross-Repo Initialization
43
+ ```bash
44
+ # Initialize multi-repo swarm with gh CLI
45
+ # List organization repositories
46
+ REPOS=$(gh repo list org --limit 100 --json name,description,languages \
47
+ --jq '.[] | select(.name | test("frontend|backend|shared"))')
48
+
49
+ # Get repository details
50
+ REPO_DETAILS=$(echo "$REPOS" | jq -r '.name' | while read -r repo; do
51
+ gh api repos/org/$repo --jq '{name, default_branch, languages, topics}'
52
+ done | jq -s '.')
53
+
54
+ # Initialize swarm with repository context
55
+ npx ruv-swarm github multi-repo-init \
56
+ --repo-details "$REPO_DETAILS" \
57
+ --repos "org/frontend,org/backend,org/shared" \
58
+ --topology hierarchical \
59
+ --shared-memory \
60
+ --sync-strategy eventual
61
+ ```
62
+
63
+ ### 2. Repository Discovery
64
+ ```bash
65
+ # Auto-discover related repositories with gh CLI
66
+ # Search organization repositories
67
+ REPOS=$(gh repo list my-organization --limit 100 \
68
+ --json name,description,languages,topics \
69
+ --jq '.[] | select(.languages | keys | contains(["TypeScript"]))')
70
+
71
+ # Analyze repository dependencies
72
+ DEPS=$(echo "$REPOS" | jq -r '.name' | while read -r repo; do
73
+ # Get package.json if it exists
74
+ if gh api repos/my-organization/$repo/contents/package.json --jq '.content' 2>/dev/null; then
75
+ gh api repos/my-organization/$repo/contents/package.json \
76
+ --jq '.content' | base64 -d | jq '{name, dependencies, devDependencies}'
77
+ fi
78
+ done | jq -s '.')
79
+
80
+ # Discover and analyze
81
+ npx ruv-swarm github discover-repos \
82
+ --repos "$REPOS" \
83
+ --dependencies "$DEPS" \
84
+ --analyze-dependencies \
85
+ --suggest-swarm-topology
86
+ ```
87
+
88
+ ### 3. Synchronized Operations
89
+ ```bash
90
+ # Execute synchronized changes across repos with gh CLI
91
+ # Get matching repositories
92
+ MATCHING_REPOS=$(gh repo list org --limit 100 --json name \
93
+ --jq '.[] | select(.name | test("-service$")) | .name')
94
+
95
+ # Execute task and create PRs
96
+ echo "$MATCHING_REPOS" | while read -r repo; do
97
+ # Clone repo
98
+ gh repo clone org/$repo /tmp/$repo -- --depth=1
99
+
100
+ # Execute task
101
+ cd /tmp/$repo
102
+ npx ruv-swarm github task-execute \
103
+ --task "update-dependencies" \
104
+ --repo "org/$repo"
105
+
106
+ # Create PR if changes exist
107
+ if [[ -n $(git status --porcelain) ]]; then
108
+ git checkout -b update-dependencies-$(date +%Y%m%d)
109
+ git add -A
110
+ git commit -m "chore: Update dependencies"
111
+
112
+ # Push and create PR
113
+ git push origin HEAD
114
+ PR_URL=$(gh pr create \
115
+ --title "Update dependencies" \
116
+ --body "Automated dependency update across services" \
117
+ --label "dependencies,automated")
118
+
119
+ echo "$PR_URL" >> /tmp/created-prs.txt
120
+ fi
121
+ cd -
122
+ done
123
+
124
+ # Link related PRs
125
+ PR_URLS=$(cat /tmp/created-prs.txt)
126
+ npx ruv-swarm github link-prs --urls "$PR_URLS"
127
+ ```
128
+
129
+ ## Configuration
130
+
131
+ ### Multi-Repo Config File
132
+ ```yaml
133
+ # .swarm/multi-repo.yml
134
+ version: 1
135
+ organization: my-org
136
+ repositories:
137
+ - name: frontend
138
+ url: github.com/my-org/frontend
139
+ role: ui
140
+ agents: [coder, designer, tester]
141
+
142
+ - name: backend
143
+ url: github.com/my-org/backend
144
+ role: api
145
+ agents: [architect, coder, tester]
146
+
147
+ - name: shared
148
+ url: github.com/my-org/shared
149
+ role: library
150
+ agents: [analyst, coder]
151
+
152
+ coordination:
153
+ topology: hierarchical
154
+ communication: webhook
155
+ memory: redis://shared-memory
156
+
157
+ dependencies:
158
+ - from: frontend
159
+ to: [backend, shared]
160
+ - from: backend
161
+ to: [shared]
162
+ ```
163
+
164
+ ### Repository Roles
165
+ ```javascript
166
+ // Define repository roles and responsibilities
167
+ {
168
+ "roles": {
169
+ "ui": {
170
+ "responsibilities": ["user-interface", "ux", "accessibility"],
171
+ "default-agents": ["designer", "coder", "tester"]
172
+ },
173
+ "api": {
174
+ "responsibilities": ["endpoints", "business-logic", "data"],
175
+ "default-agents": ["architect", "coder", "security"]
176
+ },
177
+ "library": {
178
+ "responsibilities": ["shared-code", "utilities", "types"],
179
+ "default-agents": ["analyst", "coder", "documenter"]
180
+ }
181
+ }
182
+ }
183
+ ```
184
+
185
+ ## Orchestration Commands
186
+
187
+ ### Dependency Management
188
+ ```bash
189
+ # Update dependencies across all repos with gh CLI
190
+ # Create tracking issue first
191
+ TRACKING_ISSUE=$(gh issue create \
192
+ --title "Dependency Update: typescript@5.0.0" \
193
+ --body "Tracking issue for updating TypeScript across all repositories" \
194
+ --label "dependencies,tracking" \
195
+ --json number -q .number)
196
+
197
+ # Get all repos with TypeScript
198
+ TS_REPOS=$(gh repo list org --limit 100 --json name | jq -r '.[].name' | \
199
+ while read -r repo; do
200
+ if gh api repos/org/$repo/contents/package.json 2>/dev/null | \
201
+ jq -r '.content' | base64 -d | grep -q '"typescript"'; then
202
+ echo "$repo"
203
+ fi
204
+ done)
205
+
206
+ # Update each repository
207
+ echo "$TS_REPOS" | while read -r repo; do
208
+ # Clone and update
209
+ gh repo clone org/$repo /tmp/$repo -- --depth=1
210
+ cd /tmp/$repo
211
+
212
+ # Update dependency
213
+ npm install --save-dev typescript@5.0.0
214
+
215
+ # Test changes
216
+ if npm test; then
217
+ # Create PR
218
+ git checkout -b update-typescript-5
219
+ git add package.json package-lock.json
220
+ git commit -m "chore: Update TypeScript to 5.0.0
221
+
222
+ Part of #$TRACKING_ISSUE"
223
+
224
+ git push origin HEAD
225
+ gh pr create \
226
+ --title "Update TypeScript to 5.0.0" \
227
+ --body "Updates TypeScript to version 5.0.0\n\nTracking: #$TRACKING_ISSUE" \
228
+ --label "dependencies"
229
+ else
230
+ # Report failure
231
+ gh issue comment $TRACKING_ISSUE \
232
+ --body "❌ Failed to update $repo - tests failing"
233
+ fi
234
+ cd -
235
+ done
236
+ ```
237
+
238
+ ### Refactoring Operations
239
+ ```bash
240
+ # Coordinate large-scale refactoring
241
+ npx ruv-swarm github multi-repo-refactor \
242
+ --pattern "rename:OldAPI->NewAPI" \
243
+ --analyze-impact \
244
+ --create-migration-guide \
245
+ --staged-rollout
246
+ ```
247
+
248
+ ### Security Updates
249
+ ```bash
250
+ # Coordinate security patches
251
+ npx ruv-swarm github multi-repo-security \
252
+ --scan-all \
253
+ --patch-vulnerabilities \
254
+ --verify-fixes \
255
+ --compliance-report
256
+ ```
257
+
258
+ ## Communication Strategies
259
+
260
+ ### 1. Webhook-Based Coordination
261
+ ```javascript
262
+ // webhook-coordinator.js
263
+ const { MultiRepoSwarm } = require('ruv-swarm');
264
+
265
+ const swarm = new MultiRepoSwarm({
266
+ webhook: {
267
+ url: 'https://swarm-coordinator.example.com',
268
+ secret: process.env.WEBHOOK_SECRET
269
+ }
270
+ });
271
+
272
+ // Handle cross-repo events
273
+ swarm.on('repo:update', async (event) => {
274
+ await swarm.propagate(event, {
275
+ to: event.dependencies,
276
+ strategy: 'eventual-consistency'
277
+ });
278
+ });
279
+ ```
280
+
281
+ ### 2. GraphQL Federation
282
+ ```graphql
283
+ # Federated schema for multi-repo queries
284
+ type Repository @key(fields: "id") {
285
+ id: ID!
286
+ name: String!
287
+ swarmStatus: SwarmStatus!
288
+ dependencies: [Repository!]!
289
+ agents: [Agent!]!
290
+ }
291
+
292
+ type SwarmStatus {
293
+ active: Boolean!
294
+ topology: Topology!
295
+ tasks: [Task!]!
296
+ memory: JSON!
297
+ }
298
+ ```
299
+
300
+ ### 3. Event Streaming
301
+ ```yaml
302
+ # Kafka configuration for real-time coordination
303
+ kafka:
304
+ brokers: ['kafka1:9092', 'kafka2:9092']
305
+ topics:
306
+ swarm-events:
307
+ partitions: 10
308
+ replication: 3
309
+ swarm-memory:
310
+ partitions: 5
311
+ replication: 3
312
+ ```
313
+
314
+ ## Advanced Features
315
+
316
+ ### 1. Distributed Task Queue
317
+ ```bash
318
+ # Create distributed task queue
319
+ npx ruv-swarm github multi-repo-queue \
320
+ --backend redis \
321
+ --workers 10 \
322
+ --priority-routing \
323
+ --dead-letter-queue
324
+ ```
325
+
326
+ ### 2. Cross-Repo Testing
327
+ ```bash
328
+ # Run integration tests across repos
329
+ npx ruv-swarm github multi-repo-test \
330
+ --setup-test-env \
331
+ --link-services \
332
+ --run-e2e \
333
+ --tear-down
334
+ ```
335
+
336
+ ### 3. Monorepo Migration
337
+ ```bash
338
+ # Assist in monorepo migration
339
+ npx ruv-swarm github to-monorepo \
340
+ --analyze-repos \
341
+ --suggest-structure \
342
+ --preserve-history \
343
+ --create-migration-prs
344
+ ```
345
+
346
+ ## Monitoring & Visualization
347
+
348
+ ### Multi-Repo Dashboard
349
+ ```bash
350
+ # Launch monitoring dashboard
351
+ npx ruv-swarm github multi-repo-dashboard \
352
+ --port 3000 \
353
+ --metrics "agent-activity,task-progress,memory-usage" \
354
+ --real-time
355
+ ```
356
+
357
+ ### Dependency Graph
358
+ ```bash
359
+ # Visualize repo dependencies
360
+ npx ruv-swarm github dep-graph \
361
+ --format mermaid \
362
+ --include-agents \
363
+ --show-data-flow
364
+ ```
365
+
366
+ ### Health Monitoring
367
+ ```bash
368
+ # Monitor swarm health across repos
369
+ npx ruv-swarm github health-check \
370
+ --repos "org/*" \
371
+ --check "connectivity,memory,agents" \
372
+ --alert-on-issues
373
+ ```
374
+
375
+ ## Synchronization Patterns
376
+
377
+ ### 1. Eventually Consistent
378
+ ```javascript
379
+ // Eventual consistency for non-critical updates
380
+ {
381
+ "sync": {
382
+ "strategy": "eventual",
383
+ "max-lag": "5m",
384
+ "retry": {
385
+ "attempts": 3,
386
+ "backoff": "exponential"
387
+ }
388
+ }
389
+ }
390
+ ```
391
+
392
+ ### 2. Strong Consistency
393
+ ```javascript
394
+ // Strong consistency for critical operations
395
+ {
396
+ "sync": {
397
+ "strategy": "strong",
398
+ "consensus": "raft",
399
+ "quorum": 0.51,
400
+ "timeout": "30s"
401
+ }
402
+ }
403
+ ```
404
+
405
+ ### 3. Hybrid Approach
406
+ ```javascript
407
+ // Mix of consistency levels
408
+ {
409
+ "sync": {
410
+ "default": "eventual",
411
+ "overrides": {
412
+ "security-updates": "strong",
413
+ "dependency-updates": "strong",
414
+ "documentation": "eventual"
415
+ }
416
+ }
417
+ }
418
+ ```
419
+
420
+ ## Use Cases
421
+
422
+ ### 1. Microservices Coordination
423
+ ```bash
424
+ # Coordinate microservices development
425
+ npx ruv-swarm github microservices \
426
+ --services "auth,users,orders,payments" \
427
+ --ensure-compatibility \
428
+ --sync-contracts \
429
+ --integration-tests
430
+ ```
431
+
432
+ ### 2. Library Updates
433
+ ```bash
434
+ # Update shared library across consumers
435
+ npx ruv-swarm github lib-update \
436
+ --library "org/shared-lib" \
437
+ --version "2.0.0" \
438
+ --find-consumers \
439
+ --update-imports \
440
+ --run-tests
441
+ ```
442
+
443
+ ### 3. Organization-Wide Changes
444
+ ```bash
445
+ # Apply org-wide policy changes
446
+ npx ruv-swarm github org-policy \
447
+ --policy "add-security-headers" \
448
+ --repos "org/*" \
449
+ --validate-compliance \
450
+ --create-reports
451
+ ```
452
+
453
+ ## Best Practices
454
+
455
+ ### 1. Repository Organization
456
+ - Clear repository roles and boundaries
457
+ - Consistent naming conventions
458
+ - Documented dependencies
459
+ - Shared configuration standards
460
+
461
+ ### 2. Communication
462
+ - Use appropriate sync strategies
463
+ - Implement circuit breakers
464
+ - Monitor latency and failures
465
+ - Clear error propagation
466
+
467
+ ### 3. Security
468
+ - Secure cross-repo authentication
469
+ - Encrypted communication channels
470
+ - Audit trail for all operations
471
+ - Principle of least privilege
472
+
473
+ ## Performance Optimization
474
+
475
+ ### Caching Strategy
476
+ ```bash
477
+ # Implement cross-repo caching
478
+ npx ruv-swarm github cache-strategy \
479
+ --analyze-patterns \
480
+ --suggest-cache-layers \
481
+ --implement-invalidation
482
+ ```
483
+
484
+ ### Parallel Execution
485
+ ```bash
486
+ # Optimize parallel operations
487
+ npx ruv-swarm github parallel-optimize \
488
+ --analyze-dependencies \
489
+ --identify-parallelizable \
490
+ --execute-optimal
491
+ ```
492
+
493
+ ### Resource Pooling
494
+ ```bash
495
+ # Pool resources across repos
496
+ npx ruv-swarm github resource-pool \
497
+ --share-agents \
498
+ --distribute-load \
499
+ --monitor-usage
500
+ ```
501
+
502
+ ## Troubleshooting
503
+
504
+ ### Connectivity Issues
505
+ ```bash
506
+ # Diagnose connectivity problems
507
+ npx ruv-swarm github diagnose-connectivity \
508
+ --test-all-repos \
509
+ --check-permissions \
510
+ --verify-webhooks
511
+ ```
512
+
513
+ ### Memory Synchronization
514
+ ```bash
515
+ # Debug memory sync issues
516
+ npx ruv-swarm github debug-memory \
517
+ --check-consistency \
518
+ --identify-conflicts \
519
+ --repair-state
520
+ ```
521
+
522
+ ### Performance Bottlenecks
523
+ ```bash
524
+ # Identify performance issues
525
+ npx ruv-swarm github perf-analysis \
526
+ --profile-operations \
527
+ --identify-bottlenecks \
528
+ --suggest-optimizations
529
+ ```
530
+
531
+ ## Examples
532
+
533
+ ### Full-Stack Application Update
534
+ ```bash
535
+ # Update full-stack application
536
+ npx ruv-swarm github fullstack-update \
537
+ --frontend "org/web-app" \
538
+ --backend "org/api-server" \
539
+ --database "org/db-migrations" \
540
+ --coordinate-deployment
541
+ ```
542
+
543
+ ### Cross-Team Collaboration
544
+ ```bash
545
+ # Facilitate cross-team work
546
+ npx ruv-swarm github cross-team \
547
+ --teams "frontend,backend,devops" \
548
+ --task "implement-feature-x" \
549
+ --assign-by-expertise \
550
+ --track-progress
551
+ ```
552
+
553
553
  See also: [swarm-pr.md](./swarm-pr.md), [project-board-sync.md](./project-board-sync.md)