-
Notifications
You must be signed in to change notification settings - Fork 1.9k
GitHub Integration
Claude Flow provides comprehensive GitHub integration through 13 specialized agents that automate repository management, code review, release coordination, and workflow orchestration.
The GitHub integration suite transforms repository management from manual processes to automated workflows, enabling teams to focus on code quality while the swarm handles operational tasks.
Claude Flow v2.0.0 introduces automatic GitHub releases for every checkpoint in your development workflow:
# Standard init (local checkpoints only)
npx claude-flow@alpha init
# GitHub-enhanced init (automatic releases)
npx claude-flow@alpha github init- 📝 Automatic Releases: Every file edit creates a GitHub release
- 🎯 Task Checkpoints: Releases with full task context
- 📊 Session Summaries: Comprehensive end-of-session releases
- 🤝 Team Sharing: Share checkpoints via GitHub releases
- Never lose work with automatic checkpointing
- Easy rollback to any previous state
- Team collaboration through shared checkpoints
- Complete audit trail of all changes
📚 Full Documentation: See GitHub Hooks for complete setup and usage guide
The master coordinator for all GitHub operations, providing unified access to repository management features.
npx claude-flow agent spawn github-modes \
--task "Analyze repository health and suggest improvements" \
--repo "owner/repo"Automates PR lifecycle management including review assignment, status tracking, and merge coordination.
npx claude-flow agent spawn pr-manager \
--task "Review and merge ready PRs" \
--criteria "approved, passing-tests, no-conflicts"Deploys multiple specialized reviewers for comprehensive code analysis.
npx claude-flow agent spawn code-review-swarm \
--task "Perform security, performance, and style review" \
--pr-number 123Creates and manages GitHub Actions workflows dynamically.
npx claude-flow agent spawn workflow-automation \
--task "Create deployment workflow for staging environment" \
--trigger "push to staging branch"Orchestrates the entire release process from changelog generation to deployment.
npx claude-flow agent spawn release-manager \
--task "Prepare v2.0.0 release" \
--include-changelog \
--auto-tagIntelligent issue triage, labeling, and assignment based on content analysis.
npx claude-flow agent spawn issue-tracker \
--task "Triage and label new issues" \
--assign-by-expertiseAnalyzes and optimizes repository structure, dependencies, and configuration.
npx claude-flow agent spawn repo-architect \
--task "Optimize monorepo structure" \
--analyze-dependenciesManages operations across multiple repositories simultaneously.
npx claude-flow agent spawn multi-repo-swarm \
--task "Synchronize API changes across microservices" \
--repos "api-gateway,user-service,auth-service"Synchronizes GitHub Projects with repository activity.
npx claude-flow agent spawn project-board-sync \
--task "Update sprint board with PR status" \
--board "Sprint-23"Provides detailed metrics and insights about repository health.
npx claude-flow agent spawn github-metrics \
--task "Generate monthly activity report" \
--include "commits,prs,issues,contributors"Performs security scans and vulnerability assessments.
npx claude-flow agent spawn security-scanner \
--task "Scan for security vulnerabilities" \
--fix-criticalManages and updates project dependencies safely.
npx claude-flow agent spawn dependency-manager \
--task "Update dependencies with breaking change analysis" \
--strategy "conservative"Keeps documentation synchronized with code changes.
npx claude-flow agent spawn documentation-sync \
--task "Update API docs from code comments" \
--format "openapi"Deploy a complete PR review pipeline:
# Spawn review swarm
npx claude-flow swarm init github-review \
--topology mesh \
--agents "pr-manager,code-review-swarm,security-scanner"
# Configure review criteria
npx claude-flow task orchestrate \
--task "Review PR #456 with security focus" \
--parallel \
--memory-syncCoordinate a full release cycle:
# Initialize release swarm
npx claude-flow agent spawn release-manager \
--task "Prepare release v1.5.0"
npx claude-flow agent spawn github-metrics \
--task "Generate release metrics"
npx claude-flow agent spawn documentation-sync \
--task "Update release documentation"
# Execute release
npx claude-flow task orchestrate \
--task "Execute release pipeline" \
--strategy sequentialManage changes across multiple repositories:
# Deploy multi-repo coordinator
npx claude-flow agent spawn multi-repo-swarm \
--task "Update shared dependencies across all services" \
--repos "service-a,service-b,service-c" \
--create-prs \
--branch "dependency-update-2024"review_pipeline:
stages:
- security_scan:
agent: security-scanner
blocking: true
- code_review:
agent: code-review-swarm
parallel: true
- performance_check:
agent: performance-analyzer
threshold: 95const releaseConfig = {
preRelease: ['test', 'build', 'security-scan'],
release: ['tag', 'changelog', 'publish'],
postRelease: ['announce', 'update-docs', 'notify-teams']
};const triageRules = {
bug: {
assignTo: 'bug-fix-team',
priority: 'high',
labels: ['bug', 'needs-triage']
},
feature: {
assignTo: 'product-team',
milestone: 'next-release',
labels: ['enhancement']
}
};# Setup CI workflow automation
npx claude-flow agent spawn workflow-automation \
--task "Create matrix testing workflow" \
--matrix "os:[ubuntu,macos,windows],node:[18,20,22]"# Deploy security enforcement
npx claude-flow swarm init security-enforcement \
--agents "security-scanner,code-review-swarm,dependency-manager" \
--policy "block-on-critical"# Automated documentation updates
npx claude-flow agent spawn documentation-sync \
--task "Generate docs from TypeScript interfaces" \
--watch \
--auto-commit- name: Claude Flow Analysis
uses: claude-flow/github-action@v1
with:
agents: 'code-review-swarm,security-scanner'
task: 'Comprehensive PR analysis'
token: ${{ secrets.GITHUB_TOKEN }}// Webhook handler for automatic agent deployment
app.post('/github-webhook', async (req, res) => {
const { action, pull_request } = req.body;
if (action === 'opened') {
await claudeFlow.agent.spawn('pr-manager', {
task: `Review PR #${pull_request.number}`,
autoAssign: true
});
}
});# Parallel PR processing
npx claude-flow task orchestrate \
--task "Process 50 pending PRs" \
--strategy parallel \
--max-concurrent 10 \
--memory-pool shared# Set GitHub token for API access
export GITHUB_TOKEN=your_github_token
# Or use Claude Flow config
npx claude-flow config set github.token your_github_token{
"github": {
"defaultBranch": "main",
"protectedBranches": ["main", "production"],
"requiredReviews": 2,
"autoMerge": {
"enabled": true,
"strategy": "squash"
}
}
}# Generate comprehensive metrics
npx claude-flow agent spawn github-metrics \
--task "Create monthly dashboard" \
--export-format "html" \
--include-visualizationsconst metrics = await claudeFlow.github.getMetrics({
repo: 'owner/repo',
period: '30d',
metrics: ['commits', 'prs', 'issues', 'contributors']
});- Rate Limiting: Implement exponential backoff
- Token Permissions: Ensure proper scopes
- Webhook Failures: Use retry logic
- Merge Conflicts: Automated resolution strategies
const retryConfig = {
maxRetries: 3,
backoff: 'exponential',
onError: (error) => {
if (error.status === 403) {
// Rate limit - wait longer
return { wait: 60000 };
}
}
};- Explore Workflow Orchestration for complex task coordination
- Learn about Development Patterns for best practices
- Review API Reference for detailed command documentation