重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
github-workflow-automation by proffesor-for-testing/agentic-qe
npx skills add https://github.com/proffesor-for-testing/agentic-qe --skill github-workflow-automation此技能提供全面的 GitHub Actions 自动化与 AI 群体协调功能。它集成了智能 CI/CD 流水线、工作流编排和仓库管理,以创建自组织、自适应的 GitHub 工作流。
# 从一个简单的工作流开始
npx ruv-swarm actions generate-workflow \
--analyze-codebase \
--detect-languages \
--create-optimal-pipeline
# 优化现有工作流
npx ruv-swarm actions optimize \
--workflow ".github/workflows/ci.yml" \
--suggest-parallelization
# 分析失败的运行
gh run view <run-id> --json jobs,conclusion | \
npx ruv-swarm actions analyze-failure \
--suggest-fixes
GitHub 工作流编排与协调
协调模式 : 分层式
最大并行操作数 : 10
批量优化 : 是
最佳适用场景 : 复杂的 GitHub 工作流、多仓库协调
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
npx claude-flow@alpha github gh-coordinator
"跨 5 个仓库协调多仓库发布"
拉取请求管理与审查协调
审查模式 : 自动化
多审查者 : 是
冲突解决 : 智能
gh pr create --title "功能:新能力"
--body "带有群体审查的自动化 PR" |
npx ruv-swarm actions pr-validate
--spawn-agents "linter,tester,security,docs"
问题管理与项目协调
问题工作流 : 自动化
标签管理 : 智能
进度跟踪 : 实时
npx claude-flow@alpha github issue-tracker
"使用自动化跟踪管理冲刺问题"
发布协调与部署
发布流水线 : 自动化
版本控制 : 语义化
部署 : 多阶段
npx claude-flow@alpha github release-manager
"创建带有变更日志和部署的 v2.0.0 版本"
仓库结构与组织
结构优化 : 是
多仓库支持 : 是
模板管理 : 高级
npx claude-flow@alpha github repo-architect
"以最优组织方式重构单体仓库"
自动化代码审查与质量保证
审查质量 : 深度
安全分析 : 是
性能检查 : 自动化
gh pr view 123 --json files |
npx ruv-swarm actions pr-validate
--deep-review
--security-scan
CI/CD 流水线协调
流水线管理 : 高级
测试协调 : 并行
部署 : 自动化
npx claude-flow@alpha github ci-orchestrator
"设置带有智能缓存的并行测试执行"
安全与合规管理
安全扫描 : 自动化
合规检查 : 持续
漏洞管理 : 主动
npx ruv-swarm actions security
--deep-scan
--compliance-check
--create-issues
# .github/workflows/swarm-ci.yml
name: 使用群体的智能 CI
on: [push, pull_request]
jobs:
swarm-analysis:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: 初始化群体
uses: ruvnet/swarm-action@v1
with:
topology: mesh
max-agents: 6
- name: 分析变更
run: |
npx ruv-swarm actions analyze \
--commit ${{ github.sha }} \
--suggest-tests \
--optimize-pipeline
# .github/workflows/polyglot-swarm.yml
name: 多语言项目处理器
on: push
jobs:
detect-and-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: 检测语言
id: detect
run: |
npx ruv-swarm actions detect-stack \
--output json > stack.json
- name: 动态构建矩阵
run: |
npx ruv-swarm actions create-matrix \
--from stack.json \
--parallel-builds
# .github/workflows/security-swarm.yml
name: 智能安全扫描
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
jobs:
security-swarm:
runs-on: ubuntu-latest
steps:
- name: 安全分析群体
run: |
SECURITY_ISSUES=$(npx ruv-swarm actions security \
--deep-scan \
--format json)
echo "$SECURITY_ISSUES" | jq -r '.issues[]? | @base64' | while read -r issue; do
_jq() {
echo ${issue} | base64 --decode | jq -r ${1}
}
gh issue create \
--title "$(_jq '.title')" \
--body "$(_jq '.body')" \
--label "security,critical"
done
# .github/workflows/self-healing.yml
name: 自修复流水线
on: workflow_run
jobs:
heal-pipeline:
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
runs-on: ubuntu-latest
steps:
- name: 诊断与修复
run: |
npx ruv-swarm actions self-heal \
--run-id ${{ github.event.workflow_run.id }} \
--auto-fix-common \
--create-pr-complex
# .github/workflows/smart-deployment.yml
name: 智能部署
on:
push:
branches: [main]
jobs:
progressive-deploy:
runs-on: ubuntu-latest
steps:
- name: 分析风险
id: risk
run: |
npx ruv-swarm actions deploy-risk \
--changes ${{ github.sha }} \
--history 30d
- name: 选择策略
run: |
npx ruv-swarm actions deploy-strategy \
--risk ${{ steps.risk.outputs.level }} \
--auto-execute
# .github/workflows/performance-guard.yml
name: 性能守卫
on: pull_request
jobs:
perf-swarm:
runs-on: ubuntu-latest
steps:
- name: 性能分析
run: |
npx ruv-swarm actions perf-test \
--baseline main \
--threshold 10% \
--auto-profile-regression
# .github/workflows/pr-validation.yml
name: PR 验证群体
on: pull_request
jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: 多代理验证
run: |
PR_DATA=$(gh pr view ${{ github.event.pull_request.number }} --json files,labels)
RESULTS=$(npx ruv-swarm actions pr-validate \
--spawn-agents "linter,tester,security,docs" \
--parallel \
--pr-data "$PR_DATA")
gh pr comment ${{ github.event.pull_request.number }} \
--body "$RESULTS"
# .github/workflows/intelligent-release.yml
name: 智能发布
on:
push:
tags: ['v*']
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: 发布群体
run: |
npx ruv-swarm actions release \
--analyze-changes \
--generate-notes \
--create-artifacts \
--publish-smart
# 分析工作流性能
npx ruv-swarm actions analytics \
--workflow "ci.yml" \
--period 30d \
--identify-bottlenecks \
--suggest-improvements
# 优化 GitHub Actions 成本
npx ruv-swarm actions cost-optimize \
--analyze-usage \
--suggest-caching \
--recommend-self-hosted
# 识别失败模式
npx ruv-swarm actions failure-patterns \
--period 90d \
--classify-failures \
--suggest-preventions
# 优化资源使用
npx ruv-swarm actions resources \
--analyze-usage \
--suggest-runners \
--cost-optimize
# 自动选择相关测试
- name: 群体测试选择
run: |
npx ruv-swarm actions smart-test \
--changed-files ${{ steps.files.outputs.all }} \
--impact-analysis \
--parallel-safe
# 从代码分析生成测试矩阵
jobs:
generate-matrix:
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- id: set-matrix
run: |
MATRIX=$(npx ruv-swarm actions test-matrix \
--detect-frameworks \
--optimize-coverage)
echo "matrix=${MATRIX}" >> $GITHUB_OUTPUT
test:
needs: generate-matrix
strategy:
matrix: ${{fromJson(needs.generate-matrix.outputs.matrix)}}
# 确定最优并行化策略
npx ruv-swarm actions parallel-strategy \
--analyze-dependencies \
--time-estimates \
--cost-aware
# 预测潜在失败
npx ruv-swarm actions predict \
--analyze-history \
--identify-risks \
--suggest-preventive
# 获取工作流推荐
npx ruv-swarm actions recommend \
--analyze-repo \
--suggest-workflows \
--industry-best-practices
# 持续优化工作流
npx ruv-swarm actions auto-optimize \
--monitor-performance \
--apply-improvements \
--track-savings
// action.yml
name: 'Swarm Custom Action'
description: 'Custom swarm-powered action'
inputs:
task:
description: 'Task for swarm'
required: true
runs:
using: 'node16'
main: 'dist/index.js'
// index.js
const { SwarmAction } = require('ruv-swarm');
async function run() {
const swarm = new SwarmAction({
topology: 'mesh',
agents: ['analyzer', 'optimizer']
});
await swarm.execute(core.getInput('task'));
}
run().catch(error => core.setFailed(error.message));
// 步骤 1:初始化群体协调
mcp__claude-flow__swarm_init {
topology: "hierarchical",
maxAgents: 8
}
// 步骤 2:生成专用代理
mcp__claude-flow__agent_spawn { type: "coordinator", name: "GitHub Coordinator" }
mcp__claude-flow__agent_spawn { type: "reviewer", name: "Code Reviewer" }
mcp__claude-flow__agent_spawn { type: "tester", name: "QA Agent" }
mcp__claude-flow__agent_spawn { type: "analyst", name: "Security Analyst" }
// 步骤 3:编排 GitHub 工作流
mcp__claude-flow__task_orchestrate {
task: "Complete PR review and merge workflow",
strategy: "parallel",
priority: "high"
}
# 任务前:设置 GitHub 上下文
npx claude-flow@alpha hooks pre-task \
--description "PR review workflow" \
--context "pr-123"
# 任务中:跟踪进度
npx claude-flow@alpha hooks notify \
--message "Completed security scan" \
--type "github-action"
# 任务后:导出结果
npx claude-flow@alpha hooks post-task \
--task-id "pr-review-123" \
--export-github-summary
// 包含所有 GitHub 操作的单个消息
[Concurrent Execution]:
Bash("gh issue create --title 'Feature A' --body 'Description A' --label 'enhancement'")
Bash("gh issue create --title 'Feature B' --body 'Description B' --label 'enhancement'")
Bash("gh pr create --title 'PR 1' --head 'feature-a' --base 'main'")
Bash("gh pr create --title 'PR 2' --head 'feature-b' --base 'main'")
Bash("gh pr checks 123 --watch")
TodoWrite { todos: [
{content: "Review security scan results", status: "pending"},
{content: "Merge approved PRs", status: "pending"},
{content: "Update changelog", status: "pending"}
]}
# .github/workflows/reusable-swarm.yml
name: 可重用群体工作流
on:
workflow_call:
inputs:
topology:
required: true
type: string
jobs:
swarm-task:
runs-on: ubuntu-latest
steps:
- name: 初始化群体
run: |
npx ruv-swarm init --topology ${{ inputs.topology }}
- name: 缓存群体依赖项
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-swarm-${{ hashFiles('**/package-lock.json') }}
jobs:
swarm-task:
timeout-minutes: 30
steps:
- name: 群体操作
timeout-minutes: 10
jobs:
setup:
runs-on: ubuntu-latest
test:
needs: setup
runs-on: ubuntu-latest
deploy:
needs: [setup, test]
runs-on: ubuntu-latest
- name: 设置群体
env:
SWARM_CONFIG: ${{ secrets.SWARM_CONFIG }}
API_KEY: ${{ secrets.API_KEY }}
run: |
npx ruv-swarm init --config "$SWARM_CONFIG"
permissions:
id-token: write
contents: read
- name: 配置 AWS 凭证
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: arn:aws:iam::123456789012:role/GitHubAction
aws-region: us-east-1
permissions:
contents: read
pull-requests: write
issues: write
- name: 审计群体操作
run: |
npx ruv-swarm actions audit \
--export-logs \
--compliance-report
- uses: actions/cache@v3
with:
path: |
~/.npm
node_modules
key: ${{ runner.os }}-swarm-${{ hashFiles('**/package-lock.json') }}
jobs:
heavy-task:
runs-on: ubuntu-latest-4-cores
steps:
- name: 密集型群体操作
- name: 快速失败检查
run: |
if ! npx ruv-swarm actions pre-check; then
echo "Pre-check failed, terminating early"
exit 1
fi
strategy:
matrix:
include:
- runner: ubuntu-latest
task: test
- runner: ubuntu-latest
task: lint
- runner: ubuntu-latest
task: security
max-parallel: 3
- name: 调试群体
run: |
npx ruv-swarm actions debug \
--verbose \
--trace-agents \
--export-logs
env:
ACTIONS_STEP_DEBUG: true
# 分析工作流性能
npx ruv-swarm actions profile \
--workflow "ci.yml" \
--identify-slow-steps \
--suggest-optimizations
# 分析失败的运行
gh run view <run-id> --json jobs,conclusion | \
npx ruv-swarm actions analyze-failure \
--suggest-fixes \
--auto-retry-flaky
# 下载并分析日志
gh run download <run-id>
npx ruv-swarm actions analyze-logs \
--directory ./logs \
--identify-errors
name: 使用群体的全栈 CI/CD
on:
push:
branches: [main, develop]
pull_request:
jobs:
initialize:
runs-on: ubuntu-latest
outputs:
swarm-id: ${{ steps.init.outputs.swarm-id }}
steps:
- id: init
run: |
SWARM_ID=$(npx ruv-swarm init --topology mesh --output json | jq -r '.id')
echo "swarm-id=${SWARM_ID}" >> $GITHUB_OUTPUT
backend:
needs: initialize
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: 后端测试
run: |
npx ruv-swarm agents spawn --type tester \
--task "Run backend test suite" \
--swarm-id ${{ needs.initialize.outputs.swarm-id }}
frontend:
needs: initialize
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: 前端测试
run: |
npx ruv-swarm agents spawn --type tester \
--task "Run frontend test suite" \
--swarm-id ${{ needs.initialize.outputs.swarm-id }}
security:
needs: initialize
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: 安全扫描
run: |
npx ruv-swarm agents spawn --type security \
--task "Security audit" \
--swarm-id ${{ needs.initialize.outputs.swarm-id }}
deploy:
needs: [backend, frontend, security]
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: 部署
run: |
npx ruv-swarm actions deploy \
--strategy progressive \
--swarm-id ${{ needs.initialize.outputs.swarm-id }}
name: 单体仓库协调
on: push
jobs:
detect-changes:
runs-on: ubuntu-latest
outputs:
packages: ${{ steps.detect.outputs.packages }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- id: detect
run: |
PACKAGES=$(npx ruv-swarm actions detect-changes \
--monorepo \
--output json)
echo "packages=${PACKAGES}" >> $GITHUB_OUTPUT
build-packages:
needs: detect-changes
runs-on: ubuntu-latest
strategy:
matrix:
package: ${{ fromJson(needs.detect-changes.outputs.packages) }}
steps:
- name: 构建包
run: |
npx ruv-swarm actions build \
--package ${{ matrix.package }} \
--parallel-deps
# 同步多个仓库
npx claude-flow@alpha github sync-coordinator \
"跨以下仓库同步版本更新:
- github.com/org/repo-a
- github.com/org/repo-b
- github.com/org/repo-c
更新依赖项,对齐版本,创建 PR"
npx ruv-swarm actions generate-workflow [options]
--analyze-codebase 分析仓库结构
--detect-languages 检测编程语言
--create-optimal-pipeline 生成优化的工作流
npx ruv-swarm actions optimize [options]
--workflow <path> 工作流文件路径
--suggest-parallelization 建议并行执行
--reduce-redundancy 移除冗余步骤
--estimate-savings 估算时间/成本节省
npx ruv-swarm actions analyze [options]
--commit <sha> 分析特定提交
--suggest-tests 建议测试改进
--optimize-pipeline 优化流水线结构
npx ruv-swarm actions smart-test [options]
--changed-files <files> 已更改的文件
--impact-analysis 分析测试影响
--parallel-safe 仅并行安全的测试
npx ruv-swarm actions security [options]
--deep-scan 深度安全分析
--format <format> 输出格式 (json/text)
--create-issues 自动创建 GitHub 问题
npx ruv-swarm actions deploy [options]
--strategy <type> 部署策略
--risk <level> 风险评估级别
--auto-execute 自动执行
npx ruv-swarm actions analytics [options]
--workflow <name> 要分析的工作流
--period <duration> 分析周期
--identify-bottlenecks 发现瓶颈
--suggest-improvements 改进建议
gh) 已安装并完成身份验证claude-flow@alpha 包可用.github/workflows 目录#!/bin/bash
# setup-github-automation.sh
# 安装依赖项
npm install -g claude-flow@alpha
# 验证 GitHub CLI
gh auth status || gh auth login
# 创建工作流目录
mkdir -p .github/workflows
# 生成初始工作流
npx ruv-swarm actions generate-workflow \
--analyze-codebase \
--create-optimal-pipeline > .github/workflows/ci.yml
echo "✅ GitHub 工作流自动化设置完成"
github-pr-enhancement - 高级 PR 管理release-coordination - 发布自动化swarm-coordination - 多代理编排ci-cd-optimization - 流水线优化技能状态 : ✅ 生产就绪 最后更新 : 2025-01-19 维护者 : claude-flow 团队
每周安装数
72
仓库
GitHub 星标数
292
首次出现
Jan 24, 2026
安全审计
已安装于
opencode66
gemini-cli66
github-copilot66
codex66
cursor65
amp63
This skill provides comprehensive GitHub Actions automation with AI swarm coordination. It integrates intelligent CI/CD pipelines, workflow orchestration, and repository management to create self-organizing, adaptive GitHub workflows.
# Start with a simple workflow
npx ruv-swarm actions generate-workflow \
--analyze-codebase \
--detect-languages \
--create-optimal-pipeline
# Optimize existing workflow
npx ruv-swarm actions optimize \
--workflow ".github/workflows/ci.yml" \
--suggest-parallelization
# Analyze failed runs
gh run view <run-id> --json jobs,conclusion | \
npx ruv-swarm actions analyze-failure \
--suggest-fixes
GitHub workflow orchestration and coordination
Coordination Mode : Hierarchical
Max Parallel Operations : 10
Batch Optimized : Yes
Best For : Complex GitHub workflows, multi-repo coordination
npx claude-flow@alpha github gh-coordinator
"Coordinate multi-repo release across 5 repositories"
Pull request management and review coordination
Review Mode : Automated
Multi-reviewer : Yes
Conflict Resolution : Intelligent
gh pr create --title "Feature: New capability"
--body "Automated PR with swarm review" |
npx ruv-swarm actions pr-validate
--spawn-agents "linter,tester,security,docs"
Issue management and project coordination
Issue Workflow : Automated
Label Management : Smart
Progress Tracking : Real-time
npx claude-flow@alpha github issue-tracker
"Manage sprint issues with automated tracking"
Release coordination and deployment
Release Pipeline : Automated
Versioning : Semantic
Deployment : Multi-stage
npx claude-flow@alpha github release-manager
"Create v2.0.0 release with changelog and deployment"
Repository structure and organization
Structure Optimization : Yes
Multi-repo Support : Yes
Template Management : Advanced
npx claude-flow@alpha github repo-architect
"Restructure monorepo with optimal organization"
Automated code review and quality assurance
Review Quality : Deep
Security Analysis : Yes
Performance Check : Automated
gh pr view 123 --json files |
npx ruv-swarm actions pr-validate
--deep-review
--security-scan
CI/CD pipeline coordination
Pipeline Management : Advanced
Test Coordination : Parallel
Deployment : Automated
npx claude-flow@alpha github ci-orchestrator
"Setup parallel test execution with smart caching"
Security and compliance management
Security Scan : Automated
Compliance Check : Continuous
Vulnerability Management : Proactive
npx ruv-swarm actions security
--deep-scan
--compliance-check
--create-issues
# .github/workflows/swarm-ci.yml
name: Intelligent CI with Swarms
on: [push, pull_request]
jobs:
swarm-analysis:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Initialize Swarm
uses: ruvnet/swarm-action@v1
with:
topology: mesh
max-agents: 6
- name: Analyze Changes
run: |
npx ruv-swarm actions analyze \
--commit ${{ github.sha }} \
--suggest-tests \
--optimize-pipeline
# .github/workflows/polyglot-swarm.yml
name: Polyglot Project Handler
on: push
jobs:
detect-and-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Detect Languages
id: detect
run: |
npx ruv-swarm actions detect-stack \
--output json > stack.json
- name: Dynamic Build Matrix
run: |
npx ruv-swarm actions create-matrix \
--from stack.json \
--parallel-builds
# .github/workflows/security-swarm.yml
name: Intelligent Security Scan
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
jobs:
security-swarm:
runs-on: ubuntu-latest
steps:
- name: Security Analysis Swarm
run: |
SECURITY_ISSUES=$(npx ruv-swarm actions security \
--deep-scan \
--format json)
echo "$SECURITY_ISSUES" | jq -r '.issues[]? | @base64' | while read -r issue; do
_jq() {
echo ${issue} | base64 --decode | jq -r ${1}
}
gh issue create \
--title "$(_jq '.title')" \
--body "$(_jq '.body')" \
--label "security,critical"
done
# .github/workflows/self-healing.yml
name: Self-Healing Pipeline
on: workflow_run
jobs:
heal-pipeline:
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
runs-on: ubuntu-latest
steps:
- name: Diagnose and Fix
run: |
npx ruv-swarm actions self-heal \
--run-id ${{ github.event.workflow_run.id }} \
--auto-fix-common \
--create-pr-complex
# .github/workflows/smart-deployment.yml
name: Smart Deployment
on:
push:
branches: [main]
jobs:
progressive-deploy:
runs-on: ubuntu-latest
steps:
- name: Analyze Risk
id: risk
run: |
npx ruv-swarm actions deploy-risk \
--changes ${{ github.sha }} \
--history 30d
- name: Choose Strategy
run: |
npx ruv-swarm actions deploy-strategy \
--risk ${{ steps.risk.outputs.level }} \
--auto-execute
# .github/workflows/performance-guard.yml
name: Performance Guard
on: pull_request
jobs:
perf-swarm:
runs-on: ubuntu-latest
steps:
- name: Performance Analysis
run: |
npx ruv-swarm actions perf-test \
--baseline main \
--threshold 10% \
--auto-profile-regression
# .github/workflows/pr-validation.yml
name: PR Validation Swarm
on: pull_request
jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: Multi-Agent Validation
run: |
PR_DATA=$(gh pr view ${{ github.event.pull_request.number }} --json files,labels)
RESULTS=$(npx ruv-swarm actions pr-validate \
--spawn-agents "linter,tester,security,docs" \
--parallel \
--pr-data "$PR_DATA")
gh pr comment ${{ github.event.pull_request.number }} \
--body "$RESULTS"
# .github/workflows/intelligent-release.yml
name: Intelligent Release
on:
push:
tags: ['v*']
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Release Swarm
run: |
npx ruv-swarm actions release \
--analyze-changes \
--generate-notes \
--create-artifacts \
--publish-smart
# Analyze workflow performance
npx ruv-swarm actions analytics \
--workflow "ci.yml" \
--period 30d \
--identify-bottlenecks \
--suggest-improvements
# Optimize GitHub Actions costs
npx ruv-swarm actions cost-optimize \
--analyze-usage \
--suggest-caching \
--recommend-self-hosted
# Identify failure patterns
npx ruv-swarm actions failure-patterns \
--period 90d \
--classify-failures \
--suggest-preventions
# Optimize resource usage
npx ruv-swarm actions resources \
--analyze-usage \
--suggest-runners \
--cost-optimize
# Automatically select relevant tests
- name: Swarm Test Selection
run: |
npx ruv-swarm actions smart-test \
--changed-files ${{ steps.files.outputs.all }} \
--impact-analysis \
--parallel-safe
# Generate test matrix from code analysis
jobs:
generate-matrix:
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- id: set-matrix
run: |
MATRIX=$(npx ruv-swarm actions test-matrix \
--detect-frameworks \
--optimize-coverage)
echo "matrix=${MATRIX}" >> $GITHUB_OUTPUT
test:
needs: generate-matrix
strategy:
matrix: ${{fromJson(needs.generate-matrix.outputs.matrix)}}
# Determine optimal parallelization
npx ruv-swarm actions parallel-strategy \
--analyze-dependencies \
--time-estimates \
--cost-aware
# Predict potential failures
npx ruv-swarm actions predict \
--analyze-history \
--identify-risks \
--suggest-preventive
# Get workflow recommendations
npx ruv-swarm actions recommend \
--analyze-repo \
--suggest-workflows \
--industry-best-practices
# Continuously optimize workflows
npx ruv-swarm actions auto-optimize \
--monitor-performance \
--apply-improvements \
--track-savings
// action.yml
name: 'Swarm Custom Action'
description: 'Custom swarm-powered action'
inputs:
task:
description: 'Task for swarm'
required: true
runs:
using: 'node16'
main: 'dist/index.js'
// index.js
const { SwarmAction } = require('ruv-swarm');
async function run() {
const swarm = new SwarmAction({
topology: 'mesh',
agents: ['analyzer', 'optimizer']
});
await swarm.execute(core.getInput('task'));
}
run().catch(error => core.setFailed(error.message));
// Step 1: Initialize swarm coordination
mcp__claude-flow__swarm_init {
topology: "hierarchical",
maxAgents: 8
}
// Step 2: Spawn specialized agents
mcp__claude-flow__agent_spawn { type: "coordinator", name: "GitHub Coordinator" }
mcp__claude-flow__agent_spawn { type: "reviewer", name: "Code Reviewer" }
mcp__claude-flow__agent_spawn { type: "tester", name: "QA Agent" }
mcp__claude-flow__agent_spawn { type: "analyst", name: "Security Analyst" }
// Step 3: Orchestrate GitHub workflow
mcp__claude-flow__task_orchestrate {
task: "Complete PR review and merge workflow",
strategy: "parallel",
priority: "high"
}
# Pre-task: Setup GitHub context
npx claude-flow@alpha hooks pre-task \
--description "PR review workflow" \
--context "pr-123"
# During task: Track progress
npx claude-flow@alpha hooks notify \
--message "Completed security scan" \
--type "github-action"
# Post-task: Export results
npx claude-flow@alpha hooks post-task \
--task-id "pr-review-123" \
--export-github-summary
// Single message with all GitHub operations
[Concurrent Execution]:
Bash("gh issue create --title 'Feature A' --body 'Description A' --label 'enhancement'")
Bash("gh issue create --title 'Feature B' --body 'Description B' --label 'enhancement'")
Bash("gh pr create --title 'PR 1' --head 'feature-a' --base 'main'")
Bash("gh pr create --title 'PR 2' --head 'feature-b' --base 'main'")
Bash("gh pr checks 123 --watch")
TodoWrite { todos: [
{content: "Review security scan results", status: "pending"},
{content: "Merge approved PRs", status: "pending"},
{content: "Update changelog", status: "pending"}
]}
# .github/workflows/reusable-swarm.yml
name: Reusable Swarm Workflow
on:
workflow_call:
inputs:
topology:
required: true
type: string
jobs:
swarm-task:
runs-on: ubuntu-latest
steps:
- name: Initialize Swarm
run: |
npx ruv-swarm init --topology ${{ inputs.topology }}
- name: Cache Swarm Dependencies
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-swarm-${{ hashFiles('**/package-lock.json') }}
jobs:
swarm-task:
timeout-minutes: 30
steps:
- name: Swarm Operation
timeout-minutes: 10
jobs:
setup:
runs-on: ubuntu-latest
test:
needs: setup
runs-on: ubuntu-latest
deploy:
needs: [setup, test]
runs-on: ubuntu-latest
- name: Setup Swarm
env:
SWARM_CONFIG: ${{ secrets.SWARM_CONFIG }}
API_KEY: ${{ secrets.API_KEY }}
run: |
npx ruv-swarm init --config "$SWARM_CONFIG"
permissions:
id-token: write
contents: read
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: arn:aws:iam::123456789012:role/GitHubAction
aws-region: us-east-1
permissions:
contents: read
pull-requests: write
issues: write
- name: Audit Swarm Actions
run: |
npx ruv-swarm actions audit \
--export-logs \
--compliance-report
- uses: actions/cache@v3
with:
path: |
~/.npm
node_modules
key: ${{ runner.os }}-swarm-${{ hashFiles('**/package-lock.json') }}
jobs:
heavy-task:
runs-on: ubuntu-latest-4-cores
steps:
- name: Intensive Swarm Operation
- name: Quick Fail Check
run: |
if ! npx ruv-swarm actions pre-check; then
echo "Pre-check failed, terminating early"
exit 1
fi
strategy:
matrix:
include:
- runner: ubuntu-latest
task: test
- runner: ubuntu-latest
task: lint
- runner: ubuntu-latest
task: security
max-parallel: 3
- name: Debug Swarm
run: |
npx ruv-swarm actions debug \
--verbose \
--trace-agents \
--export-logs
env:
ACTIONS_STEP_DEBUG: true
# Profile workflow performance
npx ruv-swarm actions profile \
--workflow "ci.yml" \
--identify-slow-steps \
--suggest-optimizations
# Analyze failed runs
gh run view <run-id> --json jobs,conclusion | \
npx ruv-swarm actions analyze-failure \
--suggest-fixes \
--auto-retry-flaky
# Download and analyze logs
gh run download <run-id>
npx ruv-swarm actions analyze-logs \
--directory ./logs \
--identify-errors
name: Full-Stack CI/CD with Swarms
on:
push:
branches: [main, develop]
pull_request:
jobs:
initialize:
runs-on: ubuntu-latest
outputs:
swarm-id: ${{ steps.init.outputs.swarm-id }}
steps:
- id: init
run: |
SWARM_ID=$(npx ruv-swarm init --topology mesh --output json | jq -r '.id')
echo "swarm-id=${SWARM_ID}" >> $GITHUB_OUTPUT
backend:
needs: initialize
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Backend Tests
run: |
npx ruv-swarm agents spawn --type tester \
--task "Run backend test suite" \
--swarm-id ${{ needs.initialize.outputs.swarm-id }}
frontend:
needs: initialize
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Frontend Tests
run: |
npx ruv-swarm agents spawn --type tester \
--task "Run frontend test suite" \
--swarm-id ${{ needs.initialize.outputs.swarm-id }}
security:
needs: initialize
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Security Scan
run: |
npx ruv-swarm agents spawn --type security \
--task "Security audit" \
--swarm-id ${{ needs.initialize.outputs.swarm-id }}
deploy:
needs: [backend, frontend, security]
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Deploy
run: |
npx ruv-swarm actions deploy \
--strategy progressive \
--swarm-id ${{ needs.initialize.outputs.swarm-id }}
name: Monorepo Coordination
on: push
jobs:
detect-changes:
runs-on: ubuntu-latest
outputs:
packages: ${{ steps.detect.outputs.packages }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- id: detect
run: |
PACKAGES=$(npx ruv-swarm actions detect-changes \
--monorepo \
--output json)
echo "packages=${PACKAGES}" >> $GITHUB_OUTPUT
build-packages:
needs: detect-changes
runs-on: ubuntu-latest
strategy:
matrix:
package: ${{ fromJson(needs.detect-changes.outputs.packages) }}
steps:
- name: Build Package
run: |
npx ruv-swarm actions build \
--package ${{ matrix.package }} \
--parallel-deps
# Synchronize multiple repositories
npx claude-flow@alpha github sync-coordinator \
"Synchronize version updates across:
- github.com/org/repo-a
- github.com/org/repo-b
- github.com/org/repo-c
Update dependencies, align versions, create PRs"
npx ruv-swarm actions generate-workflow [options]
--analyze-codebase Analyze repository structure
--detect-languages Detect programming languages
--create-optimal-pipeline Generate optimized workflow
npx ruv-swarm actions optimize [options]
--workflow <path> Path to workflow file
--suggest-parallelization Suggest parallel execution
--reduce-redundancy Remove redundant steps
--estimate-savings Estimate time/cost savings
npx ruv-swarm actions analyze [options]
--commit <sha> Analyze specific commit
--suggest-tests Suggest test improvements
--optimize-pipeline Optimize pipeline structure
npx ruv-swarm actions smart-test [options]
--changed-files <files> Files that changed
--impact-analysis Analyze test impact
--parallel-safe Only parallel-safe tests
npx ruv-swarm actions security [options]
--deep-scan Deep security analysis
--format <format> Output format (json/text)
--create-issues Auto-create GitHub issues
npx ruv-swarm actions deploy [options]
--strategy <type> Deployment strategy
--risk <level> Risk assessment level
--auto-execute Execute automatically
npx ruv-swarm actions analytics [options]
--workflow <name> Workflow to analyze
--period <duration> Analysis period
--identify-bottlenecks Find bottlenecks
--suggest-improvements Improvement suggestions
gh) installed and authenticatedclaude-flow@alpha package available.github/workflows directory#!/bin/bash
# setup-github-automation.sh
# Install dependencies
npm install -g claude-flow@alpha
# Verify GitHub CLI
gh auth status || gh auth login
# Create workflow directory
mkdir -p .github/workflows
# Generate initial workflow
npx ruv-swarm actions generate-workflow \
--analyze-codebase \
--create-optimal-pipeline > .github/workflows/ci.yml
echo "✅ GitHub workflow automation setup complete"
github-pr-enhancement - Advanced PR managementrelease-coordination - Release automationswarm-coordination - Multi-agent orchestrationci-cd-optimization - Pipeline optimizationSkill Status : ✅ Production Ready Last Updated : 2025-01-19 Maintainer : claude-flow team
Weekly Installs
72
Repository
GitHub Stars
292
First Seen
Jan 24, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
opencode66
gemini-cli66
github-copilot66
codex66
cursor65
amp63
Azure Data Explorer (Kusto) 查询技能:KQL数据分析、日志遥测与时间序列处理
145,500 周安装