Token导航 LogoToken导航TokenDH.com
研究检索执行命令github未标认证来源可访问clear审计提醒

github-swarm-prGitHub swarm PR 搜索

Agent Skill

用于围绕 GitHub 仓库、Issue、Pull Request、分支、提交和代码协作流程提供辅助能力。它适合让 Agent 查询项目状态、整理变更、辅助创建或检查协作事项,并把仓库中的信息转成可执行的下一步。使用时需要区分只读查询和写入操作;涉及创建 PR、修改 Issue、推送分支或访问私有仓库时,应确认 token 权限、目标仓库范围和用户授权。

总安装

485

周安装

20

GitHub Stars

8

下载量

158
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:github-swarm-pr(GitHub swarm PR 搜索)
来源仓库:https://github.com/vamseeachanta/workspace-hub
仓库路径:skills/github-swarm-pr
安装命令:
npx skills add https://github.com/vamseeachanta/workspace-hub --skill github-swarm-pr
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/vamseeachanta/workspace-hub --skill github-swarm-pr

简介

协同审查与合并 GitHub Pull Request 的平台。

  • 支持多人并行反馈与冲突解决。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。
  • 提升代码合并阶段的协作效率。
  • 需建立明确的审核规则防止误操作。
  • github-swarm-pr 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

GitHub Swarm PR Skill

Overview

This skill enables creation and management of AI swarms directly from GitHub Pull Requests, providing multi-agent code review, automated validation, and intelligent merge coordination. It transforms PRs into coordinated swarm workflows.

Key Capabilities:

  • PR-based swarm creation with automatic agent assignment
  • Multi-agent code review and validation
  • PR comment commands for swarm control
  • Automated PR lifecycle management
  • Intelligent merge coordination with consensus

Quick Start

# Get PR details for swarm initialization
gh pr view 123 --json title,body,labels,files,reviews

# Get PR diff for analysis
gh pr diff 123

# Check PR status
gh pr checks 123

# Review PR with swarm-generated feedback
gh pr review 123 --comment --body "## Swarm Analysis
- Code quality: PASS
- Test coverage: 85%
- Security: No issues found"

When to Use

  • Complex PRs: Large changes requiring multi-perspective review
  • Security Reviews: PRs touching sensitive code paths
  • Architecture Changes: Structural modifications needing architect review
  • Performance-Critical: Changes to performance-sensitive code
  • Cross-Team PRs: Changes affecting multiple team domains

Usage Examples

1. PR-Based Swarm Creation

# Get comprehensive PR data
PR_DATA=$(gh pr view 123 --json title,body,labels,files,additions,deletions,reviews)
PR_DIFF=$(gh pr diff 123)

# Analyze PR complexity for swarm topology
ADDITIONS=$(echo "$PR_DATA" | jq '.additions')
DELETIONS=$(echo "$PR_DATA" | jq '.deletions')
TOTAL_CHANGES=$((ADDITIONS + DELETIONS))

# Determine topology based on size
if [ $TOTAL_CHANGES -gt 500 ]; then
  TOPOLOGY="hierarchical"
  MAX_AGENTS=8
elif [ $TOTAL_CHANGES -gt 100 ]; then
  TOPOLOGY="mesh"
  MAX_AGENTS=5
else
  TOPOLOGY="ring"
  MAX_AGENTS=3
fi

echo "PR #123: $TOTAL_CHANGES changes, using $TOPOLOGY topology with $MAX_AGENTS agents"

2. Multi-Agent PR Review

# Get changed files by type
FILES=$(gh pr view 123 --json files --jq '.files[].path')

# Categorize files for agent assignment
JS_FILES=$(echo "$FILES" | grep -E '\.(js|ts|tsx)$' || true)
PY_FILES=$(echo "$FILES" | grep -E '\.py$' || true)
TEST_FILES=$(echo "$FILES" | grep -E '(test|spec)\.' || true)
CONFIG_FILES=$(echo "$FILES" | grep -E '\.(json|yaml|yml)$' || true)

# Generate comprehensive review
REVIEW_BODY="## Multi-Agent PR Review

### Code Review
$([ -n "$JS_FILES" ] && echo "**JavaScript/TypeScript**: Files reviewed")
$([ -n "$PY_FILES" ] && echo "**Python**: Files reviewed")

### Test Coverage
$([ -n "$TEST_FILES" ] && echo "Test files detected and validated" || echo "No test files found")

### Configuration Changes
$([ -n "$CONFIG_FILES" ] && echo "Configuration changes reviewed" || echo "No config changes")

### Summary
- Total files: $(echo "$FILES" | wc -l)
- Recommendation: Approve with minor suggestions

---
Generated by Swarm PR Agent"

gh pr review 123 --comment --body "$REVIEW_BODY"

3. PR Comment Commands

Use these commands in PR comments to control swarms:

<!-- Initialize swarm -->
/swarm init mesh 6

<!-- Spawn specific agents -->
/swarm spawn coder "Implement the authentication logic"
/swarm spawn tester "Write comprehensive tests"
/swarm spawn security "Review for vulnerabilities"

<!-- Check swarm status -->
/swarm status

<!-- Get analysis -->
/swarm analyze

<!-- Complete swarm work -->
/swarm complete

4. Automated PR Validation

# Run comprehensive PR validation
validate_pr() {
  local PR_NUM=$1

  # Get PR details
  PR=$(gh pr view $PR_NUM --json state,mergeable,reviews,statusCheckRollup)

  # Check merge status
  MERGEABLE=$(echo "$PR" | jq -r '.mergeable')

  # Check CI status
  CI_STATUS=$(echo "$PR" | jq -r '.statusCheckRollup[0].conclusion // "pending"')

  # Check review status
  APPROVALS=$(echo "$PR" | jq '[.reviews[] | select(.state == "APPROVED")] | length')

  # Validation report
  cat << EOF
## PR #$PR_NUM Validation Report

### Merge Status
- Mergeable: $MERGEABLE
- CI Status: $CI_STATUS
- Approvals: $APPROVALS

### Recommendations
$([ "$MERGEABLE" == "MERGEABLE" ] && echo "- Ready for merge" || echo "- Resolve conflicts first")
$([ "$CI_STATUS" == "SUCCESS" ] && echo "- CI passing" || echo "- Wait for CI to complete")
$([ $APPROVALS -ge 2 ] && echo "- Sufficient approvals" || echo "- Need more reviews")
EOF
}

validate_pr 123

5. Intelligent Merge Coordination

# Check if PR is ready to merge
check_merge_readiness() {
  local PR_NUM=$1

  # Get all checks
  CHECKS=$(gh pr checks $PR_NUM --json name,state,conclusion)

  # Count passed/failed/pending
  PASSED=$(echo "$CHECKS" | jq '[.[] | select(.conclusion == "success")] | length')
  FAILED=$(echo "$CHECKS" | jq '[.[] | select(.conclusion == "failure")] | length')
  PENDING=$(echo "$CHECKS" | jq '[.[] | select(.state == "pending")] | length')

  if [ $FAILED -gt 0 ]; then
    echo "Cannot merge: $FAILED checks failed"
    return 1
  elif [ $PENDING -gt 0 ]; then
    echo "Waiting: $PENDING checks still running"
    return 2
  else
    echo "Ready to merge: All $PASSED checks passed"
    return 0
  fi
}

# Merge with appropriate strategy
merge_pr() {
  local PR_NUM=$1

  # Get PR size
  SIZE=$(gh pr view $PR_NUM --json additions,deletions --jq '.additions + .deletions')

  # Choose merge strategy
  if [ $SIZE -lt 50 ]; then
    gh pr merge $PR_NUM --squash --delete-branch
  elif [ $SIZE -lt 200 ]; then
    gh pr merge $PR_NUM --merge --delete-branch
  else
    # Large PR - rebase to maintain history
    gh pr merge $PR_NUM --rebase --delete-branch
  fi
}

check_merge_readiness 123 && merge_pr 123

PR Label Integration

Automatic Agent Assignment

{
  "label-mapping": {
    "bug": ["debugger", "tester"],
    "feature": ["architect", "coder", "tester"],
    "refactor": ["analyst", "coder"],
    "docs": ["researcher", "writer"],
    "performance": ["analyst", "optimizer"],
    "security": ["security", "reviewer"]
  }
}

Label-Based Topology Selection

# Determine topology from PR labels
get_topology() {
  local PR_NUM=$1
  LABELS=$(gh pr view $PR_NUM --json labels --jq '.labels[].name')

  if echo "$LABELS" | grep -q "critical"; then
    echo "hierarchical"  # Most structured for critical changes
  elif echo "$LABELS" | grep -q "feature"; then
    echo "mesh"  # Collaborative for features
  else
    echo "ring"  # Simple for routine changes
  fi
}

MCP Tool Integration

Multi-Agent PR Coordination

// Initialize PR-specific swarm

// Store PR context in swarm memory
  action: "store",
  key: "pr/123/context",
  value: {
    pr_number: 123,
    files_changed: ["src/auth.js", "tests/auth.test.js"],
    complexity_score: 7.5,
    risk_assessment: "medium",
    agents_assigned: ["reviewer", "tester", "security"]
  }
}

// Orchestrate comprehensive PR review
  task: "Execute multi-agent PR review and validation",
  strategy: "parallel",
  priority: "high",
  dependencies: ["diff_analysis", "test_validation", "security_review"]
}

Swarm-Coordinated Merge

// Coordinate merge decision with swarm

// Analyze merge readiness
  task: "Evaluate PR merge readiness with comprehensive validation",
  strategy: "sequential",
  priority: "critical"
}

// Store merge decision
  action: "store",
  key: "pr/123/merge_decision",
  value: {
    ready_to_merge: true,
    all_checks_passed: true,
    agent_consensus: "approved",
    merge_strategy: "squash"
  }
}

GitHub Actions Integration

# .github/workflows/swarm-pr.yml
name: Swarm PR Handler
on:
  pull_request:
    types: [opened, labeled, synchronize]
  issue_comment:
    types: [created]

jobs:
  swarm-review:
    if: contains(github.event.pull_request.labels.*.name, 'swarm-review')
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Analyze PR
        id: analyze
        run: |
          CHANGES=$(git diff --stat HEAD~1 | tail -1)
          echo "changes=$CHANGES" >> $GITHUB_OUTPUT

      - name: Post Swarm Analysis
        env:
          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: |
          gh pr comment ${{ github.event.pull_request.number }} \
            --body "## Swarm Analysis

          Changes: ${{ steps.analyze.outputs.changes }}

          Swarm agents have been assigned to review this PR."

  handle-commands:
    if: github.event_name == 'issue_comment' && startsWith(github.event.comment.body, '/swarm')
    runs-on: ubuntu-latest
    steps:
      - name: Process Swarm Command
        run: |
          COMMAND="${{ github.event.comment.body }}"
          echo "Processing: $COMMAND"
          # Handle swarm commands

Best Practices

1. PR Templates for Swarm

<!-- .github/pull_request_template.md -->
## Summary
[Brief description of changes]

## Swarm Configuration
- **Topology**: [mesh/hierarchical/ring/star]
- **Max Agents**: [number]
- **Priority**: [critical/high/medium/low]

## Tasks for Swarm
- [ ] Code review
- [ ] Test validation
- [ ] Security scan
- [ ] Performance check

## Checklist
- [ ] Tests added/updated
- [ ] Documentation updated
- [ ] No breaking changes

2. Status Checks

# Require swarm completion before merge
required_status_checks:
  contexts:
    - "swarm/review-complete"
    - "swarm/tests-validated"
    - "swarm/security-approved"

3. Review Quality

  • Run security scan on all PRs touching auth code
  • Require architect review for structural changes
  • Auto-assign reviewers based on CODEOWNERS
  • Use swarm consensus for merge decisions

Metrics and Reporting

# Generate PR swarm report
generate_report() {
  local PR_NUM=$1

  gh pr view $PR_NUM --json \
    title,additions,deletions,reviews,comments,createdAt,updatedAt | \
  jq '{
    title: .title,
    size: (.additions + .deletions),
    reviews: (.reviews | length),
    comments: (.comments | length),
    age_hours: ((now - (.createdAt | fromdateiso8601)) / 3600 | floor)
  }'
}

generate_report 123

Related Skills


Version History

  • 1.0.0 (2026-01-02): Initial skill conversion from swarm-pr agent

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

34.07%
按下载量换算54

windsurf

23.67%
按下载量换算37

trae

16.83%
按下载量换算27

OpenCode

12.46%
按下载量换算20

Cursor

7.88%
按下载量换算12

Codex

3.44%
按下载量换算5

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/vamseeachanta/workspace-hub --skill github-swarm-pr;npx skills add vamseeachanta/workspace-hub --skill "github-swarm-pr" 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。

来源信息

继续浏览同类 Skills