Sub-skill of github-swarm-pr: 1. PR-Based Swarm Creation (+7).
Scanned 9/9/2026
Install to Claude Code
npx -y skills add vamseeachanta/workspace-hub --skill 1-pr-based-swarm-creation --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of 1 Pr Based Swarm Creation?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/vamseeachanta-1-pr-based-swarm-creation)More formats (shields.io, HTML) on the badges page.
---
name: github-swarm-pr-1-pr-based-swarm-creation
description: 'Sub-skill of github-swarm-pr: 1. PR-Based Swarm Creation (+7).'
version: 1.0.0
category: development
type: reference
scripts_exempt: true
---
# 1. PR-Based Swarm Creation (+7)
## 1. PR-Based Swarm Creation
```bash
# 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
```bash
# 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:
```markdown
<!-- 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
```bash
# 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
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!