Skip to content
Agent Orchestration
Command

/pr-shepherd

Monitor a PR through to merge - handles CI failures, reviews, and thread resolution

From plugin
metaswarm
43716 skills23 agents16 commands2 hooks
$ npx -y skills add dsifry/metaswarm --agent claude-code

Command definition

pr-shepherd.md
description: Monitor a PR through to merge - handles CI failures, reviews, and thread resolution

PR Shepherd

Monitor a PR from creation through merge, handling CI failures, review comments, and thread resolution automatically.

Usage

/pr-shepherd [pr-number]

If no PR number is provided, uses the PR associated with the current branch.

What This Does

1. **Monitors CI/CD** - Polls every 60 seconds for status changes 2. **Monitors Reviews** - Watches for new comments and unresolved threads 3. **Auto-fixes simple issues** - Lint, prettier, type errors 4. **Asks before complex fixes** - Presents options with pros/cons for approval 5. **Handles review comments** - Delegates to `handling-pr-comments` skill 6. **Checkpoints at 4 hours** - Asks if you want to continue or handoff

Steps

1. **Get PR information**:

   PR_NUMBER=${1:-$(gh pr view --json number -q .number 2>/dev/null)}
   if [ -z "$PR_NUMBER" ]; then
     echo "No PR found. Provide PR number: /pr-shepherd 123"
     exit 1
   fi

2. **Activate the pr-shepherd skill**: Load and follow the pr-shepherd skill definition.

3. **Begin monitoring loop** (background, every 60s):

  • Check CI status
  • Check for new review comments
  • Check unresolved thread count
  • Take action based on state machine

4. **Handle issues as they arise**:

  • Simple CI failures -> auto-fix with TDD
  • Complex failures -> present options, wait for approval
  • New comments -> invoke `handling-pr-comments` skill

5. **Exit when done**:

  • All CI green AND all threads resolved -> report success
  • 4-hour timeout -> checkpoint with user

Example

/pr-shepherd 695

> I'm using the pr-shepherd skill to monitor PR #695 through to merge.
> I'll watch CI/CD, handle review comments, and fix issues as they arise.
>
> Current status:
> - CI: Running (2/5 checks complete)
> - Threads: 0 unresolved
>
> Monitoring... (will check every 60 seconds)

Notes

  • The agent stays active until the PR is ready to merge or you stop it
  • All code changes use TDD process
  • Complex issues always get user approval before fixing
  • Uses `handling-pr-comments` skill for review comment handling
Read more
@dsifry
Ships withmetaswarm

A self-improving multi-agent orchestration framework for Claude Code, Gemini CLI, and Codex CLI.

43714 skills23 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
437
Star history of dsifry/metaswarm on GitHub, a chart by star-history.com

Other commands on metaswarm.

brainstorm

brainstorm

Command

Refine an idea into a design with brainstorming, then run the design review gate for project-sized designs

@dsifry@dsifryInstall Command
create-issue

create-issue

Command

Create a well-structured GitHub issue with acceptance criteria and agent instructions

@dsifry@dsifryInstall Command
handoff

handoff

Command

Analyze the session and write a self-contained handoff document so a fresh agent can resume the work — outputs a single "Read…

@dsifry@dsifryInstall Command
prime

prime

Command

Load relevant knowledge base facts into context before starting work

@dsifry@dsifryInstall Command

More commands from other plugins.

COMMAND_COMPLIANCE_REPORT

COMMAND_COMPLIANCE_REP…

Command

Reviewed all command files in `.claude/commands/analysis/` directory to ensure proper usage of: - `mcp__claude-flow__*` tools…

@ruvnet@ruvnetInstall Command
ask

ask

Command

This compatibility command keeps `/oh-my-claudecode:ask` available without loading the full `ask` skill description in every…

@yeachan-heo@yeachan-heoInstall Command