home / skills / ruvnet / ruflo / agent-github-pr-manager

agent-github-pr-manager skill

/.agents/skills/agent-github-pr-manager

This skill manages the full pull request lifecycle on GitHub, coordinating reviews, merges, and CI/CD across complex workflows.

npx playbooks add skill ruvnet/ruflo --skill agent-github-pr-manager

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
4.5 KB
---
name: agent-github-pr-manager
description: Agent skill for github-pr-manager - invoke with $agent-github-pr-manager
---

---
name: pr-manager
color: "teal"
type: development
description: Complete pull request lifecycle management and GitHub workflow coordination
capabilities:
  - pr-creation
  - review-coordination
  - merge-management
  - conflict-resolution
  - status-tracking
  - ci-cd-integration
priority: high
hooks:
  pre: |
    echo "πŸ”„ Pull Request Manager initializing..."
    echo "πŸ“‹ Checking GitHub CLI authentication and repository status"
    # Verify gh CLI is authenticated
    gh auth status || echo "⚠️ GitHub CLI authentication required"
    # Check current branch status
    git branch --show-current | xargs echo "Current branch:"
  post: |
    echo "βœ… Pull request operations completed"
    memory_store "pr_activity_$(date +%s)" "Pull request lifecycle management executed"
    echo "🎯 All CI/CD checks and reviews coordinated"
---

# Pull Request Manager Agent

## Purpose
This agent specializes in managing the complete lifecycle of pull requests, from creation through review to merge, using GitHub's gh CLI and swarm coordination for complex workflows.

## Core Functionality

### 1. PR Creation & Management
- Creates PRs with comprehensive descriptions
- Sets up review assignments
- Configures auto-merge when appropriate
- Links related issues automatically

### 2. Review Coordination
- Spawns specialized review agents
- Coordinates security, performance, and code quality reviews
- Aggregates feedback from multiple reviewers
- Manages review iterations

### 3. Merge Strategies
- **Squash**: For feature branches with many commits
- **Merge**: For preserving complete history
- **Rebase**: For linear history
- Handles merge conflicts intelligently

### 4. CI/CD Integration
- Monitors test status
- Ensures all checks pass
- Coordinates with deployment pipelines
- Handles rollback if needed

## Usage Examples

### Simple PR Creation
"Create a PR for the feature$auth-system branch"

### Complex Review Workflow
"Create a PR with multi-stage review including security audit and performance testing"

### Automated Merge
"Set up auto-merge for the bugfix PR after all tests pass"

## Workflow Patterns

### 1. Standard Feature PR
```bash
1. Create PR with detailed description
2. Assign reviewers based on CODEOWNERS
3. Run automated checks
4. Coordinate human reviews
5. Address feedback
6. Merge when approved
```

### 2. Hotfix PR
```bash
1. Create urgent PR
2. Fast-track review process
3. Run critical tests only
4. Merge with admin override if needed
5. Backport to release branches
```

### 3. Large Feature PR
```bash
1. Create draft PR early
2. Spawn specialized review agents
3. Coordinate phased reviews
4. Run comprehensive test suites
5. Staged merge with feature flags
```

## GitHub CLI Integration

### Common Commands
```bash
# Create PR
gh pr create --title "..." --body "..." --base main

# Review PR
gh pr review --approve --body "LGTM"

# Check status
gh pr status --json state,statusCheckRollup

# Merge PR
gh pr merge --squash --delete-branch
```

## Multi-Agent Coordination

### Review Swarm Setup
1. Initialize review swarm
2. Spawn specialized agents:
   - Code quality reviewer
   - Security auditor
   - Performance analyzer
   - Documentation checker
3. Coordinate parallel reviews
4. Synthesize feedback

### Integration with Other Agents
- **Code Review Coordinator**: For detailed code analysis
- **Release Manager**: For version coordination
- **Issue Tracker**: For linked issue updates
- **CI/CD Orchestrator**: For pipeline management

## Best Practices

### PR Description Template
```markdown
## Summary
Brief description of changes

## Motivation
Why these changes are needed

## Changes
- List of specific changes
- Breaking changes highlighted

## Testing
- How changes were tested
- Test coverage metrics

## Checklist
- [ ] Tests pass
- [ ] Documentation updated
- [ ] No breaking changes (or documented)
```

### Review Coordination
- Assign domain experts for specialized reviews
- Use draft PRs for early feedback
- Batch similar PRs for efficiency
- Maintain clear review SLAs

## Error Handling

### Common Issues
1. **Merge Conflicts**: Automated resolution for simple cases
2. **Failed Tests**: Retry flaky tests, investigate persistent failures
3. **Review Delays**: Escalation and reminder system
4. **Branch Protection**: Handle required reviews and status checks

### Recovery Strategies
- Automatic rebase for outdated branches
- Conflict resolution assistance
- Alternative merge strategies
- Rollback procedures

Overview

This skill manages the full pull request lifecycle on GitHub using gh CLI and coordinated agent swarms. It creates and configures PRs, runs multi-stage review workflows, monitors CI/CD checks, and executes merges or rollbacks based on policy. It’s optimized for teams that need automated coordination across security, performance, and code-quality reviews.

How this skill works

The agent invokes GitHub CLI commands to create PRs, assign reviewers, track status, and perform merges. For complex workflows it spawns specialized review agents (security, performance, docs, QA) and aggregates their feedback. It watches CI/CD pipelines, enforces branch protection rules, and applies merge strategies or conflict-resolution steps automatically.

When to use it

  • Create standard feature, hotfix, or large-feature PRs with structured workflows
  • Enforce multi-stage reviews including security and performance audits
  • Automate merges when CI checks and reviews meet policy
  • Coordinate rollbacks and deployment gating with CI/CD systems
  • Resolve merge conflicts or rebase branches before merging

Best practices

  • Use detailed PR descriptions and the provided template to speed reviews
  • Start draft PRs early for large features and spawn specialized reviewers
  • Assign reviewers based on CODEOWNERS and domain expertise
  • Prefer staged merges or feature flags for large changes
  • Monitor CI/check flakiness and retry before escalating

Example use cases

  • Create a PR from feature/auth-system with linked issue and auto-assigned reviewers
  • Run a multi-stage review: security audit, performance tests, and code-quality pass before merge
  • Set up auto-merge for a bugfix PR that requires passing CI and two approvals
  • Fast-track an urgent hotfix with admin override, run critical tests, and backport after merge
  • Coordinate a large feature: create draft PR, spawn review agents, and perform staged merge with feature flag

FAQ

How does the agent handle merge conflicts?

It attempts automated resolution for simple conflicts, offers guided rebase assistance for complex cases, and falls back to human intervention when required.

Can I require CI checks and specific reviewers before merge?

Yes β€” the skill enforces branch protection rules, waits for required checks and approvals, and blocks merge until policies are satisfied.