claude-flow 2.0.0-alpha.62 → 2.0.0-alpha.64
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.
- package/.claude/commands/analysis/COMMAND_COMPLIANCE_REPORT.md +54 -0
- package/.claude/commands/analysis/token-efficiency.md +2 -1
- package/.claude/commands/automation/self-healing.md +47 -2
- package/.claude/commands/automation/session-memory.md +39 -10
- package/.claude/commands/automation/smart-agents.md +36 -8
- package/.claude/commands/github/code-review-swarm.md +80 -15
- package/.claude/commands/github/github-modes.md +14 -14
- package/.claude/commands/github/issue-tracker.md +19 -16
- package/.claude/commands/github/multi-repo-swarm.md +114 -16
- package/.claude/commands/github/pr-manager.md +5 -4
- package/.claude/commands/github/project-board-sync.md +38 -5
- package/.claude/commands/github/release-manager.md +19 -19
- package/.claude/commands/github/release-swarm.md +102 -13
- package/.claude/commands/github/repo-architect.md +6 -6
- package/.claude/commands/github/swarm-issue.md +139 -17
- package/.claude/commands/github/swarm-pr.md +49 -15
- package/.claude/commands/github/sync-coordinator.md +33 -33
- package/.claude/commands/github/workflow-automation.md +37 -10
- package/.claude/commands/hooks/overview.md +2 -2
- package/.claude/commands/hooks/setup.md +7 -7
- package/.claude/commands/memory/neural.md +10 -5
- package/.claude/commands/memory/usage.md +9 -5
- package/.claude/commands/monitoring/agents.md +7 -5
- package/.claude/commands/monitoring/status.md +8 -5
- package/.claude/commands/optimization/auto-topology.md +13 -1
- package/.claude/commands/optimization/parallel-execution.md +7 -1
- package/.claude/commands/sparc/analyzer.md +28 -2
- package/.claude/commands/sparc/architect.md +27 -1
- package/.claude/commands/sparc/batch-executor.md +27 -1
- package/.claude/commands/sparc/coder.md +27 -1
- package/.claude/commands/sparc/debugger.md +27 -1
- package/.claude/commands/sparc/designer.md +27 -1
- package/.claude/commands/sparc/documenter.md +27 -1
- package/.claude/commands/sparc/innovator.md +27 -1
- package/.claude/commands/sparc/memory-manager.md +27 -1
- package/.claude/commands/sparc/optimizer.md +27 -1
- package/.claude/commands/sparc/orchestrator.md +106 -2
- package/.claude/commands/sparc/researcher.md +27 -1
- package/.claude/commands/sparc/reviewer.md +27 -1
- package/.claude/commands/sparc/sparc-modes.md +137 -5
- package/.claude/commands/sparc/swarm-coordinator.md +27 -1
- package/.claude/commands/sparc/tdd.md +27 -1
- package/.claude/commands/sparc/tester.md +27 -1
- package/.claude/commands/sparc/workflow-manager.md +27 -1
- package/.claude/commands/swarm/analysis.md +82 -5
- package/.claude/commands/swarm/development.md +83 -6
- package/.claude/commands/swarm/examples.md +141 -3
- package/.claude/commands/swarm/maintenance.md +92 -8
- package/.claude/commands/swarm/optimization.md +107 -9
- package/.claude/commands/swarm/research.md +126 -8
- package/.claude/commands/swarm/testing.md +121 -9
- package/.claude/commands/training/neural-patterns.md +27 -2
- package/.claude/commands/training/specialization.md +13 -3
- package/.claude/commands/workflows/development.md +43 -4
- package/.claude/commands/workflows/research.md +26 -2
- package/CHANGELOG.md +34 -0
- package/README.md +8 -0
- package/bin/claude-flow +1 -1
- package/dist/cli/simple-commands/hive-mind/mcp-wrapper.d.ts +66 -0
- package/dist/cli/simple-commands/hive-mind/mcp-wrapper.d.ts.map +1 -1
- package/dist/cli/simple-commands/hive-mind/mcp-wrapper.js +220 -2
- package/dist/cli/simple-commands/hive-mind/mcp-wrapper.js.map +1 -1
- package/dist/cli/simple-commands/hive-mind.d.ts.map +1 -1
- package/dist/cli/simple-commands/hive-mind.js +83 -5
- package/dist/cli/simple-commands/hive-mind.js.map +1 -1
- package/dist/memory/fallback-store.d.ts +1 -0
- package/dist/memory/fallback-store.d.ts.map +1 -1
- package/dist/memory/fallback-store.js +25 -3
- package/dist/memory/fallback-store.js.map +1 -1
- package/dist/memory/sqlite-store.d.ts +34 -0
- package/dist/memory/sqlite-store.d.ts.map +1 -0
- package/dist/memory/sqlite-store.js +2 -3
- package/dist/memory/sqlite-store.js.map +1 -1
- package/dist/memory/sqlite-wrapper.d.ts +38 -0
- package/dist/memory/sqlite-wrapper.d.ts.map +1 -0
- package/dist/memory/sqlite-wrapper.js +157 -0
- package/dist/memory/sqlite-wrapper.js.map +1 -0
- package/package.json +1 -1
- package/src/api/claude-api-errors.ts +248 -0
- package/src/api/claude-client-enhanced.ts +616 -0
- package/src/api/claude-client.ts +282 -14
- package/src/cli/help-text.js +4 -3
- package/src/cli/simple-cli.js +1 -1
- package/src/cli/simple-commands/coordination.js +73 -49
- package/src/cli/simple-commands/hive-mind/auto-save-middleware.js +6 -6
- package/src/cli/simple-commands/hive-mind/mcp-wrapper.js +327 -8
- package/src/cli/simple-commands/hive-mind/session-manager.js +330 -108
- package/src/cli/simple-commands/hive-mind.js +192 -11
- package/src/cli/simple-commands/init/claude-commands/optimized-slash-commands.js +53 -28
- package/src/cli/simple-commands/init/claude-commands/slash-commands.js +36 -14
- package/src/cli/simple-commands/init/claude-commands/sparc-commands.js +107 -30
- package/src/cli/simple-commands/init/copy-revised-templates.js +175 -0
- package/src/cli/simple-commands/init/index.js +156 -235
- package/src/cli/simple-commands/init/template-copier.js +583 -0
- package/src/cli/simple-commands/init/templates/claude-flow-universal +1 -1
- package/src/cli/simple-commands/init/templates/coordination.md +16 -0
- package/src/cli/simple-commands/init/templates/memory-bank.md +16 -0
- package/src/cli/simple-commands/init/templates/settings.json.enhanced +35 -0
- package/src/cli/simple-commands/init/templates/sparc-modes.js +634 -23
- package/src/hive-mind/core/DatabaseManager.ts +75 -16
- package/src/memory/backends/sqlite.ts +21 -3
- package/src/memory/fallback-store.js +35 -3
- package/src/memory/sqlite-store.js +2 -3
- package/src/memory/sqlite-wrapper.js +173 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Analysis Commands Compliance Report
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
Reviewed all command files in `.claude/commands/analysis/` directory to ensure proper usage of:
|
|
5
|
+
- `mcp__claude-flow__*` tools (preferred)
|
|
6
|
+
- `npx claude-flow` commands (as fallback)
|
|
7
|
+
- No direct implementation calls
|
|
8
|
+
|
|
9
|
+
## Files Reviewed
|
|
10
|
+
|
|
11
|
+
### 1. token-efficiency.md
|
|
12
|
+
**Status**: ✅ Updated
|
|
13
|
+
**Changes Made**:
|
|
14
|
+
- Replaced `npx ruv-swarm hook session-end --export-metrics` with proper MCP tool call
|
|
15
|
+
- Updated to: `Tool: mcp__claude-flow__token_usage` with appropriate parameters
|
|
16
|
+
- Maintained result format and context
|
|
17
|
+
|
|
18
|
+
**Before**:
|
|
19
|
+
```bash
|
|
20
|
+
npx ruv-swarm hook session-end --export-metrics
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
**After**:
|
|
24
|
+
```
|
|
25
|
+
Tool: mcp__claude-flow__token_usage
|
|
26
|
+
Parameters: {"operation": "session", "timeframe": "24h"}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### 2. performance-bottlenecks.md
|
|
30
|
+
**Status**: ✅ Compliant (No changes needed)
|
|
31
|
+
**Reason**: Already uses proper `mcp__claude-flow__task_results` tool format
|
|
32
|
+
|
|
33
|
+
## Summary
|
|
34
|
+
|
|
35
|
+
- **Total files reviewed**: 2
|
|
36
|
+
- **Files updated**: 1
|
|
37
|
+
- **Files already compliant**: 1
|
|
38
|
+
- **Compliance rate after updates**: 100%
|
|
39
|
+
|
|
40
|
+
## Compliance Patterns Enforced
|
|
41
|
+
|
|
42
|
+
1. **MCP Tool Usage**: All direct tool calls now use `mcp__claude-flow__*` format
|
|
43
|
+
2. **Parameter Format**: JSON parameters properly structured
|
|
44
|
+
3. **Command Context**: Preserved original functionality and expected results
|
|
45
|
+
4. **Documentation**: Maintained clarity and examples
|
|
46
|
+
|
|
47
|
+
## Recommendations
|
|
48
|
+
|
|
49
|
+
1. All analysis commands now follow the proper pattern
|
|
50
|
+
2. No direct bash commands or implementation calls remain
|
|
51
|
+
3. Token usage analysis properly integrated with MCP tools
|
|
52
|
+
4. Performance analysis already using correct tool format
|
|
53
|
+
|
|
54
|
+
The analysis directory is now fully compliant with the Claude Flow command standards.
|
|
@@ -19,7 +19,8 @@ Reduce token consumption while maintaining quality through intelligent coordinat
|
|
|
19
19
|
|
|
20
20
|
```bash
|
|
21
21
|
# Check token savings after session
|
|
22
|
-
|
|
22
|
+
Tool: mcp__claude-flow__token_usage
|
|
23
|
+
Parameters: {"operation": "session", "timeframe": "24h"}
|
|
23
24
|
|
|
24
25
|
# Result shows:
|
|
25
26
|
{
|
|
@@ -44,12 +44,57 @@ Each recovery improves future prevention:
|
|
|
44
44
|
- Similar errors prevented proactively
|
|
45
45
|
- Recovery strategies optimized
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
**Pattern Storage:**
|
|
48
|
+
```javascript
|
|
49
|
+
// Store error patterns
|
|
50
|
+
mcp__claude-flow__memory_usage({
|
|
51
|
+
"action": "store",
|
|
52
|
+
"key": "error-pattern-" + Date.now(),
|
|
53
|
+
"value": JSON.stringify(errorData),
|
|
54
|
+
"namespace": "error-patterns",
|
|
55
|
+
"ttl": 2592000 // 30 days
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
// Analyze patterns
|
|
59
|
+
mcp__claude-flow__neural_patterns({
|
|
60
|
+
"action": "analyze",
|
|
61
|
+
"operation": "error-recovery",
|
|
62
|
+
"outcome": "success"
|
|
63
|
+
})
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Self-Healing Integration
|
|
67
|
+
|
|
68
|
+
### MCP Tool Coordination
|
|
69
|
+
```javascript
|
|
70
|
+
// Initialize self-healing swarm
|
|
71
|
+
mcp__claude-flow__swarm_init({
|
|
72
|
+
"topology": "star",
|
|
73
|
+
"maxAgents": 4,
|
|
74
|
+
"strategy": "adaptive"
|
|
75
|
+
})
|
|
76
|
+
|
|
77
|
+
// Spawn recovery agents
|
|
78
|
+
mcp__claude-flow__agent_spawn({
|
|
79
|
+
"type": "monitor",
|
|
80
|
+
"name": "Error Monitor",
|
|
81
|
+
"capabilities": ["error-detection", "recovery"]
|
|
82
|
+
})
|
|
83
|
+
|
|
84
|
+
// Orchestrate recovery
|
|
85
|
+
mcp__claude-flow__task_orchestrate({
|
|
86
|
+
"task": "recover from error",
|
|
87
|
+
"strategy": "sequential",
|
|
88
|
+
"priority": "critical"
|
|
89
|
+
})
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Fallback Hook Configuration
|
|
48
93
|
```json
|
|
49
94
|
{
|
|
50
95
|
"PostToolUse": [{
|
|
51
96
|
"matcher": "^Bash$",
|
|
52
|
-
"command": "npx
|
|
97
|
+
"command": "npx claude-flow hook post-bash --exit-code '${tool.result.exitCode}' --auto-recover"
|
|
53
98
|
}]
|
|
54
99
|
}
|
|
55
100
|
```
|
|
@@ -14,12 +14,23 @@ At session end, automatically saves:
|
|
|
14
14
|
- Knowledge base updates
|
|
15
15
|
|
|
16
16
|
### 2. Session Restoration
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
```javascript
|
|
18
|
+
// Using MCP tools for memory operations
|
|
19
|
+
mcp__claude-flow__memory_usage({
|
|
20
|
+
"action": "retrieve",
|
|
21
|
+
"key": "session-state",
|
|
22
|
+
"namespace": "sessions"
|
|
23
|
+
})
|
|
20
24
|
|
|
21
|
-
|
|
22
|
-
|
|
25
|
+
// Restore swarm state
|
|
26
|
+
mcp__claude-flow__context_restore({
|
|
27
|
+
"snapshotId": "sess-123"
|
|
28
|
+
})
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
**Fallback with npx:**
|
|
32
|
+
```bash
|
|
33
|
+
npx claude-flow hook session-restore --session-id "sess-123"
|
|
23
34
|
```
|
|
24
35
|
|
|
25
36
|
### 3. Memory Types
|
|
@@ -43,15 +54,33 @@ npx ruv-swarm hook session-restore --session-id "sess-123"
|
|
|
43
54
|
- Efficiency trends
|
|
44
55
|
|
|
45
56
|
### 4. Privacy & Control
|
|
57
|
+
```javascript
|
|
58
|
+
// List memory contents
|
|
59
|
+
mcp__claude-flow__memory_usage({
|
|
60
|
+
"action": "list",
|
|
61
|
+
"namespace": "sessions"
|
|
62
|
+
})
|
|
63
|
+
|
|
64
|
+
// Delete specific memory
|
|
65
|
+
mcp__claude-flow__memory_usage({
|
|
66
|
+
"action": "delete",
|
|
67
|
+
"key": "session-123",
|
|
68
|
+
"namespace": "sessions"
|
|
69
|
+
})
|
|
70
|
+
|
|
71
|
+
// Backup memory
|
|
72
|
+
mcp__claude-flow__memory_backup({
|
|
73
|
+
"path": "./backups/memory-backup.json"
|
|
74
|
+
})
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
**Manual control:**
|
|
46
78
|
```bash
|
|
47
79
|
# View stored memory
|
|
48
|
-
ls .
|
|
49
|
-
|
|
50
|
-
# Clear specific memory
|
|
51
|
-
rm .ruv-swarm/session-*.json
|
|
80
|
+
ls .claude-flow/memory/
|
|
52
81
|
|
|
53
82
|
# Disable memory
|
|
54
|
-
export
|
|
83
|
+
export CLAUDE_FLOW_MEMORY_PERSIST=false
|
|
55
84
|
```
|
|
56
85
|
|
|
57
86
|
## Benefits
|
|
@@ -27,15 +27,43 @@ The system monitors workload and spawns additional agents when:
|
|
|
27
27
|
- Complexity increases
|
|
28
28
|
- Parallel opportunities exist
|
|
29
29
|
|
|
30
|
+
**Status Monitoring:**
|
|
31
|
+
```javascript
|
|
32
|
+
// Check swarm health
|
|
33
|
+
mcp__claude-flow__swarm_status({
|
|
34
|
+
"swarmId": "current"
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
// Monitor agent performance
|
|
38
|
+
mcp__claude-flow__agent_metrics({
|
|
39
|
+
"agentId": "agent-123"
|
|
40
|
+
})
|
|
41
|
+
```
|
|
42
|
+
|
|
30
43
|
## Configuration
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
44
|
+
|
|
45
|
+
### MCP Tool Integration
|
|
46
|
+
Uses Claude Flow MCP tools for agent coordination:
|
|
47
|
+
```javascript
|
|
48
|
+
// Initialize swarm with appropriate topology
|
|
49
|
+
mcp__claude-flow__swarm_init({
|
|
50
|
+
"topology": "mesh",
|
|
51
|
+
"maxAgents": 8,
|
|
52
|
+
"strategy": "auto"
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
// Spawn agents based on file type
|
|
56
|
+
mcp__claude-flow__agent_spawn({
|
|
57
|
+
"type": "coder",
|
|
58
|
+
"name": "JavaScript Handler",
|
|
59
|
+
"capabilities": ["javascript", "typescript"]
|
|
60
|
+
})
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Fallback Configuration
|
|
64
|
+
If MCP tools are unavailable:
|
|
65
|
+
```bash
|
|
66
|
+
npx claude-flow hook pre-task --auto-spawn-agents
|
|
39
67
|
```
|
|
40
68
|
|
|
41
69
|
## Benefits
|
|
@@ -7,24 +7,48 @@ Deploy specialized AI agents to perform comprehensive, intelligent code reviews
|
|
|
7
7
|
|
|
8
8
|
### 1. Multi-Agent Review System
|
|
9
9
|
```bash
|
|
10
|
-
# Initialize code review swarm
|
|
10
|
+
# Initialize code review swarm with gh CLI
|
|
11
|
+
# Get PR details
|
|
12
|
+
PR_DATA=$(gh pr view 123 --json files,additions,deletions,title,body)
|
|
13
|
+
PR_DIFF=$(gh pr diff 123)
|
|
14
|
+
|
|
15
|
+
# Initialize swarm with PR context
|
|
11
16
|
npx ruv-swarm github review-init \
|
|
12
17
|
--pr 123 \
|
|
18
|
+
--pr-data "$PR_DATA" \
|
|
19
|
+
--diff "$PR_DIFF" \
|
|
13
20
|
--agents "security,performance,style,architecture,accessibility" \
|
|
14
|
-
--depth comprehensive
|
|
15
|
-
|
|
21
|
+
--depth comprehensive
|
|
22
|
+
|
|
23
|
+
# Post initial review status
|
|
24
|
+
gh pr comment 123 --body "🔍 Multi-agent code review initiated"
|
|
16
25
|
```
|
|
17
26
|
|
|
18
27
|
### 2. Specialized Review Agents
|
|
19
28
|
|
|
20
29
|
#### Security Agent
|
|
21
30
|
```bash
|
|
22
|
-
# Security-focused review
|
|
23
|
-
|
|
31
|
+
# Security-focused review with gh CLI
|
|
32
|
+
# Get changed files
|
|
33
|
+
CHANGED_FILES=$(gh pr view 123 --json files --jq '.files[].path')
|
|
34
|
+
|
|
35
|
+
# Run security review
|
|
36
|
+
SECURITY_RESULTS=$(npx ruv-swarm github review-security \
|
|
24
37
|
--pr 123 \
|
|
38
|
+
--files "$CHANGED_FILES" \
|
|
25
39
|
--check "owasp,cve,secrets,permissions" \
|
|
26
|
-
--suggest-fixes
|
|
27
|
-
|
|
40
|
+
--suggest-fixes)
|
|
41
|
+
|
|
42
|
+
# Post security findings
|
|
43
|
+
if echo "$SECURITY_RESULTS" | grep -q "critical"; then
|
|
44
|
+
# Request changes for critical issues
|
|
45
|
+
gh pr review 123 --request-changes --body "$SECURITY_RESULTS"
|
|
46
|
+
# Add security label
|
|
47
|
+
gh pr edit 123 --add-label "security-review-required"
|
|
48
|
+
else
|
|
49
|
+
# Post as comment for non-critical issues
|
|
50
|
+
gh pr comment 123 --body "$SECURITY_RESULTS"
|
|
51
|
+
fi
|
|
28
52
|
```
|
|
29
53
|
|
|
30
54
|
#### Performance Agent
|
|
@@ -223,12 +247,30 @@ jobs:
|
|
|
223
247
|
with:
|
|
224
248
|
fetch-depth: 0
|
|
225
249
|
|
|
250
|
+
- name: Setup GitHub CLI
|
|
251
|
+
run: echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token
|
|
252
|
+
|
|
226
253
|
- name: Run Review Swarm
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
254
|
+
run: |
|
|
255
|
+
# Get PR context with gh CLI
|
|
256
|
+
PR_NUM=${{ github.event.pull_request.number }}
|
|
257
|
+
PR_DATA=$(gh pr view $PR_NUM --json files,title,body,labels)
|
|
258
|
+
|
|
259
|
+
# Run swarm review
|
|
260
|
+
REVIEW_OUTPUT=$(npx ruv-swarm github review-all \
|
|
261
|
+
--pr $PR_NUM \
|
|
262
|
+
--pr-data "$PR_DATA" \
|
|
263
|
+
--agents "security,performance,style,architecture")
|
|
264
|
+
|
|
265
|
+
# Post review results
|
|
266
|
+
echo "$REVIEW_OUTPUT" | gh pr review $PR_NUM --comment -F -
|
|
267
|
+
|
|
268
|
+
# Update PR status
|
|
269
|
+
if echo "$REVIEW_OUTPUT" | grep -q "approved"; then
|
|
270
|
+
gh pr review $PR_NUM --approve
|
|
271
|
+
elif echo "$REVIEW_OUTPUT" | grep -q "changes-requested"; then
|
|
272
|
+
gh pr review $PR_NUM --request-changes -b "See review comments above"
|
|
273
|
+
fi
|
|
232
274
|
```
|
|
233
275
|
|
|
234
276
|
### Review Triggers
|
|
@@ -259,12 +301,35 @@ jobs:
|
|
|
259
301
|
|
|
260
302
|
### Intelligent Comment Generation
|
|
261
303
|
```bash
|
|
262
|
-
# Generate contextual review comments
|
|
263
|
-
|
|
304
|
+
# Generate contextual review comments with gh CLI
|
|
305
|
+
# Get PR diff with context
|
|
306
|
+
PR_DIFF=$(gh pr diff 123 --color never)
|
|
307
|
+
PR_FILES=$(gh pr view 123 --json files)
|
|
308
|
+
|
|
309
|
+
# Generate review comments
|
|
310
|
+
COMMENTS=$(npx ruv-swarm github review-comment \
|
|
264
311
|
--pr 123 \
|
|
312
|
+
--diff "$PR_DIFF" \
|
|
313
|
+
--files "$PR_FILES" \
|
|
265
314
|
--style "constructive" \
|
|
266
315
|
--include-examples \
|
|
267
|
-
--suggest-fixes
|
|
316
|
+
--suggest-fixes)
|
|
317
|
+
|
|
318
|
+
# Post comments using gh CLI
|
|
319
|
+
echo "$COMMENTS" | jq -c '.[]' | while read -r comment; do
|
|
320
|
+
FILE=$(echo "$comment" | jq -r '.path')
|
|
321
|
+
LINE=$(echo "$comment" | jq -r '.line')
|
|
322
|
+
BODY=$(echo "$comment" | jq -r '.body')
|
|
323
|
+
|
|
324
|
+
# Create review with inline comments
|
|
325
|
+
gh api \
|
|
326
|
+
--method POST \
|
|
327
|
+
/repos/:owner/:repo/pulls/123/comments \
|
|
328
|
+
-f path="$FILE" \
|
|
329
|
+
-f line="$LINE" \
|
|
330
|
+
-f body="$BODY" \
|
|
331
|
+
-f commit_id="$(gh pr view 123 --json headRefOid -q .headRefOid)"
|
|
332
|
+
done
|
|
268
333
|
```
|
|
269
334
|
|
|
270
335
|
### Comment Templates
|
|
@@ -10,7 +10,7 @@ This document describes all GitHub integration modes available in Claude-Flow wi
|
|
|
10
10
|
- **Coordination Mode**: Hierarchical
|
|
11
11
|
- **Max Parallel Operations**: 10
|
|
12
12
|
- **Batch Optimized**: Yes
|
|
13
|
-
- **Tools**:
|
|
13
|
+
- **Tools**: gh CLI commands, TodoWrite, TodoRead, Task, Memory, Bash
|
|
14
14
|
- **Usage**: `/github gh-coordinator <GitHub workflow description>`
|
|
15
15
|
- **Best For**: Complex GitHub workflows, multi-repo coordination
|
|
16
16
|
|
|
@@ -19,7 +19,7 @@ This document describes all GitHub integration modes available in Claude-Flow wi
|
|
|
19
19
|
- **Review Mode**: Automated
|
|
20
20
|
- **Multi-reviewer**: Yes
|
|
21
21
|
- **Conflict Resolution**: Intelligent
|
|
22
|
-
- **Tools**:
|
|
22
|
+
- **Tools**: gh pr create, gh pr view, gh pr review, gh pr merge, TodoWrite, Task
|
|
23
23
|
- **Usage**: `/github pr-manager <PR management task>`
|
|
24
24
|
- **Best For**: PR reviews, merge coordination, conflict resolution
|
|
25
25
|
|
|
@@ -28,7 +28,7 @@ This document describes all GitHub integration modes available in Claude-Flow wi
|
|
|
28
28
|
- **Issue Workflow**: Automated
|
|
29
29
|
- **Label Management**: Smart
|
|
30
30
|
- **Progress Tracking**: Real-time
|
|
31
|
-
- **Tools**:
|
|
31
|
+
- **Tools**: gh issue create, gh issue edit, gh issue comment, gh issue list, TodoWrite
|
|
32
32
|
- **Usage**: `/github issue-tracker <issue management task>`
|
|
33
33
|
- **Best For**: Project management, issue coordination, progress tracking
|
|
34
34
|
|
|
@@ -37,7 +37,7 @@ This document describes all GitHub integration modes available in Claude-Flow wi
|
|
|
37
37
|
- **Release Pipeline**: Automated
|
|
38
38
|
- **Versioning**: Semantic
|
|
39
39
|
- **Deployment**: Multi-stage
|
|
40
|
-
- **Tools**:
|
|
40
|
+
- **Tools**: gh pr create, gh pr merge, gh release create, Bash, TodoWrite
|
|
41
41
|
- **Usage**: `/github release-manager <release task>`
|
|
42
42
|
- **Best For**: Release management, version coordination, deployment pipelines
|
|
43
43
|
|
|
@@ -48,7 +48,7 @@ This document describes all GitHub integration modes available in Claude-Flow wi
|
|
|
48
48
|
- **Structure Optimization**: Yes
|
|
49
49
|
- **Multi-repo**: Support
|
|
50
50
|
- **Template Management**: Advanced
|
|
51
|
-
- **Tools**:
|
|
51
|
+
- **Tools**: gh repo create, gh repo clone, git commands, Write, Read, Bash
|
|
52
52
|
- **Usage**: `/github repo-architect <repository management task>`
|
|
53
53
|
- **Best For**: Repository setup, structure optimization, multi-repo management
|
|
54
54
|
|
|
@@ -57,7 +57,7 @@ This document describes all GitHub integration modes available in Claude-Flow wi
|
|
|
57
57
|
- **Review Quality**: Deep
|
|
58
58
|
- **Security Analysis**: Yes
|
|
59
59
|
- **Performance Check**: Automated
|
|
60
|
-
- **Tools**:
|
|
60
|
+
- **Tools**: gh pr view --json files, gh pr review, gh pr comment, Read, Write
|
|
61
61
|
- **Usage**: `/github code-reviewer <review task>`
|
|
62
62
|
- **Best For**: Code quality, security reviews, performance analysis
|
|
63
63
|
|
|
@@ -66,7 +66,7 @@ This document describes all GitHub integration modes available in Claude-Flow wi
|
|
|
66
66
|
- **Branch Strategy**: GitFlow
|
|
67
67
|
- **Merge Strategy**: Intelligent
|
|
68
68
|
- **Conflict Prevention**: Proactive
|
|
69
|
-
- **Tools**:
|
|
69
|
+
- **Tools**: gh api (for branch operations), git commands, Bash
|
|
70
70
|
- **Usage**: `/github branch-manager <branch management task>`
|
|
71
71
|
- **Best For**: Branch coordination, merge strategies, workflow management
|
|
72
72
|
|
|
@@ -77,7 +77,7 @@ This document describes all GitHub integration modes available in Claude-Flow wi
|
|
|
77
77
|
- **Package Sync**: Intelligent
|
|
78
78
|
- **Version Alignment**: Automatic
|
|
79
79
|
- **Dependency Resolution**: Advanced
|
|
80
|
-
- **Tools**:
|
|
80
|
+
- **Tools**: git commands, gh pr create, Read, Write, Bash
|
|
81
81
|
- **Usage**: `/github sync-coordinator <sync task>`
|
|
82
82
|
- **Best For**: Package synchronization, version management, dependency updates
|
|
83
83
|
|
|
@@ -86,7 +86,7 @@ This document describes all GitHub integration modes available in Claude-Flow wi
|
|
|
86
86
|
- **Pipeline Management**: Advanced
|
|
87
87
|
- **Test Coordination**: Parallel
|
|
88
88
|
- **Deployment**: Automated
|
|
89
|
-
- **Tools**:
|
|
89
|
+
- **Tools**: gh pr checks, gh workflow list, gh run list, Bash, TodoWrite, Task
|
|
90
90
|
- **Usage**: `/github ci-orchestrator <CI/CD task>`
|
|
91
91
|
- **Best For**: CI/CD coordination, test management, deployment automation
|
|
92
92
|
|
|
@@ -95,7 +95,7 @@ This document describes all GitHub integration modes available in Claude-Flow wi
|
|
|
95
95
|
- **Security Scan**: Automated
|
|
96
96
|
- **Compliance Check**: Continuous
|
|
97
97
|
- **Vulnerability Management**: Proactive
|
|
98
|
-
- **Tools**:
|
|
98
|
+
- **Tools**: gh search code, gh issue create, gh secret list, Read, Write
|
|
99
99
|
- **Usage**: `/github security-guardian <security task>`
|
|
100
100
|
- **Best For**: Security audits, compliance checks, vulnerability management
|
|
101
101
|
|
|
@@ -123,10 +123,10 @@ All GitHub modes support batch operations for maximum efficiency:
|
|
|
123
123
|
### Parallel GitHub Operations Example:
|
|
124
124
|
```javascript
|
|
125
125
|
[Single Message with BatchTool]:
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
126
|
+
Bash("gh issue create --title 'Feature A' --body '...'")
|
|
127
|
+
Bash("gh issue create --title 'Feature B' --body '...'")
|
|
128
|
+
Bash("gh pr create --title 'PR 1' --head 'feature-a' --base 'main'")
|
|
129
|
+
Bash("gh pr create --title 'PR 2' --head 'feature-b' --base 'main'")
|
|
130
130
|
TodoWrite { todos: [todo1, todo2, todo3] }
|
|
131
131
|
Bash("git checkout main && git pull")
|
|
132
132
|
```
|
|
@@ -130,22 +130,25 @@ mcp__github__update_issue {
|
|
|
130
130
|
mcp__claude-flow__agent_spawn { type: "analyst", name: "Progress Tracker" }
|
|
131
131
|
mcp__claude-flow__agent_spawn { type: "researcher", name: "Context Gatherer" }
|
|
132
132
|
|
|
133
|
-
// Create multiple related issues
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
133
|
+
// Create multiple related issues using gh CLI
|
|
134
|
+
Bash(`gh issue create \
|
|
135
|
+
--repo :owner/:repo \
|
|
136
|
+
--title "Feature: Advanced GitHub Integration" \
|
|
137
|
+
--body "Implement comprehensive GitHub workflow automation..." \
|
|
138
|
+
--label "feature,github,high-priority"`)
|
|
139
|
+
|
|
140
|
+
Bash(`gh issue create \
|
|
141
|
+
--repo :owner/:repo \
|
|
142
|
+
--title "Bug: PR merge conflicts in integration branch" \
|
|
143
|
+
--body "Resolve merge conflicts in integration/claude-code-flow-ruv-swarm..." \
|
|
144
|
+
--label "bug,integration,urgent"`)
|
|
145
|
+
|
|
146
|
+
Bash(`gh issue create \
|
|
147
|
+
--repo :owner/:repo \
|
|
148
|
+
--title "Documentation: Update integration guides" \
|
|
149
|
+
--body "Update all documentation to reflect new GitHub workflows..." \
|
|
150
|
+
--label "documentation,integration"`)
|
|
151
|
+
|
|
149
152
|
|
|
150
153
|
// Set up coordinated tracking
|
|
151
154
|
TodoWrite { todos: [
|
|
@@ -7,8 +7,19 @@ Coordinate AI swarms across multiple repositories, enabling organization-wide au
|
|
|
7
7
|
|
|
8
8
|
### 1. Cross-Repo Initialization
|
|
9
9
|
```bash
|
|
10
|
-
# Initialize multi-repo swarm
|
|
10
|
+
# Initialize multi-repo swarm with gh CLI
|
|
11
|
+
# List organization repositories
|
|
12
|
+
REPOS=$(gh repo list org --limit 100 --json name,description,languages \
|
|
13
|
+
--jq '.[] | select(.name | test("frontend|backend|shared"))')
|
|
14
|
+
|
|
15
|
+
# Get repository details
|
|
16
|
+
REPO_DETAILS=$(echo "$REPOS" | jq -r '.name' | while read -r repo; do
|
|
17
|
+
gh api repos/org/$repo --jq '{name, default_branch, languages, topics}'
|
|
18
|
+
done | jq -s '.')
|
|
19
|
+
|
|
20
|
+
# Initialize swarm with repository context
|
|
11
21
|
npx ruv-swarm github multi-repo-init \
|
|
22
|
+
--repo-details "$REPO_DETAILS" \
|
|
12
23
|
--repos "org/frontend,org/backend,org/shared" \
|
|
13
24
|
--topology hierarchical \
|
|
14
25
|
--shared-memory \
|
|
@@ -17,22 +28,68 @@ npx ruv-swarm github multi-repo-init \
|
|
|
17
28
|
|
|
18
29
|
### 2. Repository Discovery
|
|
19
30
|
```bash
|
|
20
|
-
# Auto-discover related repositories
|
|
31
|
+
# Auto-discover related repositories with gh CLI
|
|
32
|
+
# Search organization repositories
|
|
33
|
+
REPOS=$(gh repo list my-organization --limit 100 \
|
|
34
|
+
--json name,description,languages,topics \
|
|
35
|
+
--jq '.[] | select(.languages | keys | contains(["TypeScript"]))')
|
|
36
|
+
|
|
37
|
+
# Analyze repository dependencies
|
|
38
|
+
DEPS=$(echo "$REPOS" | jq -r '.name' | while read -r repo; do
|
|
39
|
+
# Get package.json if it exists
|
|
40
|
+
if gh api repos/my-organization/$repo/contents/package.json --jq '.content' 2>/dev/null; then
|
|
41
|
+
gh api repos/my-organization/$repo/contents/package.json \
|
|
42
|
+
--jq '.content' | base64 -d | jq '{name, dependencies, devDependencies}'
|
|
43
|
+
fi
|
|
44
|
+
done | jq -s '.')
|
|
45
|
+
|
|
46
|
+
# Discover and analyze
|
|
21
47
|
npx ruv-swarm github discover-repos \
|
|
22
|
-
--
|
|
23
|
-
--
|
|
48
|
+
--repos "$REPOS" \
|
|
49
|
+
--dependencies "$DEPS" \
|
|
24
50
|
--analyze-dependencies \
|
|
25
51
|
--suggest-swarm-topology
|
|
26
52
|
```
|
|
27
53
|
|
|
28
54
|
### 3. Synchronized Operations
|
|
29
55
|
```bash
|
|
30
|
-
# Execute synchronized changes across repos
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
--
|
|
34
|
-
|
|
35
|
-
|
|
56
|
+
# Execute synchronized changes across repos with gh CLI
|
|
57
|
+
# Get matching repositories
|
|
58
|
+
MATCHING_REPOS=$(gh repo list org --limit 100 --json name \
|
|
59
|
+
--jq '.[] | select(.name | test("-service$")) | .name')
|
|
60
|
+
|
|
61
|
+
# Execute task and create PRs
|
|
62
|
+
echo "$MATCHING_REPOS" | while read -r repo; do
|
|
63
|
+
# Clone repo
|
|
64
|
+
gh repo clone org/$repo /tmp/$repo -- --depth=1
|
|
65
|
+
|
|
66
|
+
# Execute task
|
|
67
|
+
cd /tmp/$repo
|
|
68
|
+
npx ruv-swarm github task-execute \
|
|
69
|
+
--task "update-dependencies" \
|
|
70
|
+
--repo "org/$repo"
|
|
71
|
+
|
|
72
|
+
# Create PR if changes exist
|
|
73
|
+
if [[ -n $(git status --porcelain) ]]; then
|
|
74
|
+
git checkout -b update-dependencies-$(date +%Y%m%d)
|
|
75
|
+
git add -A
|
|
76
|
+
git commit -m "chore: Update dependencies"
|
|
77
|
+
|
|
78
|
+
# Push and create PR
|
|
79
|
+
git push origin HEAD
|
|
80
|
+
PR_URL=$(gh pr create \
|
|
81
|
+
--title "Update dependencies" \
|
|
82
|
+
--body "Automated dependency update across services" \
|
|
83
|
+
--label "dependencies,automated")
|
|
84
|
+
|
|
85
|
+
echo "$PR_URL" >> /tmp/created-prs.txt
|
|
86
|
+
fi
|
|
87
|
+
cd -
|
|
88
|
+
done
|
|
89
|
+
|
|
90
|
+
# Link related PRs
|
|
91
|
+
PR_URLS=$(cat /tmp/created-prs.txt)
|
|
92
|
+
npx ruv-swarm github link-prs --urls "$PR_URLS"
|
|
36
93
|
```
|
|
37
94
|
|
|
38
95
|
## Configuration
|
|
@@ -95,12 +152,53 @@ dependencies:
|
|
|
95
152
|
|
|
96
153
|
### Dependency Management
|
|
97
154
|
```bash
|
|
98
|
-
# Update dependencies across all repos
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
--
|
|
102
|
-
--
|
|
103
|
-
--
|
|
155
|
+
# Update dependencies across all repos with gh CLI
|
|
156
|
+
# Create tracking issue first
|
|
157
|
+
TRACKING_ISSUE=$(gh issue create \
|
|
158
|
+
--title "Dependency Update: typescript@5.0.0" \
|
|
159
|
+
--body "Tracking issue for updating TypeScript across all repositories" \
|
|
160
|
+
--label "dependencies,tracking" \
|
|
161
|
+
--json number -q .number)
|
|
162
|
+
|
|
163
|
+
# Get all repos with TypeScript
|
|
164
|
+
TS_REPOS=$(gh repo list org --limit 100 --json name | jq -r '.[].name' | \
|
|
165
|
+
while read -r repo; do
|
|
166
|
+
if gh api repos/org/$repo/contents/package.json 2>/dev/null | \
|
|
167
|
+
jq -r '.content' | base64 -d | grep -q '"typescript"'; then
|
|
168
|
+
echo "$repo"
|
|
169
|
+
fi
|
|
170
|
+
done)
|
|
171
|
+
|
|
172
|
+
# Update each repository
|
|
173
|
+
echo "$TS_REPOS" | while read -r repo; do
|
|
174
|
+
# Clone and update
|
|
175
|
+
gh repo clone org/$repo /tmp/$repo -- --depth=1
|
|
176
|
+
cd /tmp/$repo
|
|
177
|
+
|
|
178
|
+
# Update dependency
|
|
179
|
+
npm install --save-dev typescript@5.0.0
|
|
180
|
+
|
|
181
|
+
# Test changes
|
|
182
|
+
if npm test; then
|
|
183
|
+
# Create PR
|
|
184
|
+
git checkout -b update-typescript-5
|
|
185
|
+
git add package.json package-lock.json
|
|
186
|
+
git commit -m "chore: Update TypeScript to 5.0.0
|
|
187
|
+
|
|
188
|
+
Part of #$TRACKING_ISSUE"
|
|
189
|
+
|
|
190
|
+
git push origin HEAD
|
|
191
|
+
gh pr create \
|
|
192
|
+
--title "Update TypeScript to 5.0.0" \
|
|
193
|
+
--body "Updates TypeScript to version 5.0.0\n\nTracking: #$TRACKING_ISSUE" \
|
|
194
|
+
--label "dependencies"
|
|
195
|
+
else
|
|
196
|
+
# Report failure
|
|
197
|
+
gh issue comment $TRACKING_ISSUE \
|
|
198
|
+
--body "❌ Failed to update $repo - tests failing"
|
|
199
|
+
fi
|
|
200
|
+
cd -
|
|
201
|
+
done
|
|
104
202
|
```
|
|
105
203
|
|
|
106
204
|
### Refactoring Operations
|