pr-shepherd-agent

pr-shepherd-agent is an agent for Claude Code from dsifry/metaswarm. It costs 27 tokens per session (1,816 once invoked), scanned A, original, MIT.

An agent that manages a pull request from creation until it is ready to merge, including automated checks and reviewer feedback.

In plain words
What is it for?
It monitors CI and comments, fixes lint, type, and test failures, resolves review threads, updates BEADS tasks, and reports when the PR can be merged.
Why use it?
It keeps CI results, review conversations, fixes, and task status moving through one tracked process.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: model in frontmatter.

Part of the metaswarm plugin — 15 skills, 16 commands, 31 agents, 3 hooks shipped together

Good fit It monitors CI and comments, fixes lint, type, and test failures, resolves review threads, updates BEADS tasks, and reports when the PR can be merged.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/dsifry/metaswarm/pr-shepherd-agent
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/dsifry/metaswarm

Made for: Claude Code.

Or install metaswarm, the plugin that ships this one along with the rest of its 15 skills, 16 commands, 31 agents, 3 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for pr-shepherd-agent

README.md
[![agentmods](https://agentmods.dev/badge/agents/dsifry/metaswarm/pr-shepherd-agent/github.svg)](https://agentmods.dev/agents/dsifry/metaswarm/pr-shepherd-agent)
Your own site
<a href="https://agentmods.dev/agents/dsifry/metaswarm/pr-shepherd-agent"><img src="https://agentmods.dev/badge/agents/dsifry/metaswarm/pr-shepherd-agent/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for pr-shepherd-agent

Your own site · 80×15
<a href="https://agentmods.dev/agents/dsifry/metaswarm/pr-shepherd-agent"><img src="https://agentmods.dev/badge/agents/dsifry/metaswarm/pr-shepherd-agent.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 27 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,816 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00027 $0.01816
Opus 5.5 $0.00011 $0.00726
Sonnet 5.5 $0.00005 $0.00363
Haiku 4.5 $0.00003 $0.00182

Measured 3d ago against content hash 4438633ca58c, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

pr-shepherd-agent scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

agents/pr-shepherd-agent.md · 324 lines

How it starts

The opening of the file, as written. The whole thing — 324 lines — stays where its author put it; the contents beside it link to each section on GitHub.

PR Shepherd Agent

Type: pr-shepherd-agent Role: PR lifecycle management through to merge Spawned By: Issue Orchestrator Tools: GitHub CLI, metaswarm:pr-shepherd skill, BEADS CLI


Purpose

The PR Shepherd Agent monitors a PR from creation through merge. It handles CI failures, review comments, and thread resolution, updating BEADS tasks throughout the lifecycle.


Important

This agent leverages the existing metaswarm:pr-shepherd skill for the core PR monitoring logic. It adds BEADS integration for task tracking.

See: the metaswarm:pr-shepherd skill (skills/pr-shepherd/SKILL.md in the metaswarm plugin) for detailed PR monitoring behavior.


Responsibilities

  1. PR Monitoring: Watch CI status and review comments
  2. Issue Fixing: Auto-fix lint, type, and test failures
  3. Review Handling: Respond to and resolve review threads
  4. BEADS Tracking: Update task status as PR progresses
  5. Completion: Report when PR is ready to merge

Activation

Triggered when:

  • Issue Orchestrator creates a "PR shepherding" task
  • PR is created and linked to BEADS epic
  • Code review and security audit are complete

Workflow

Step 0: Knowledge Priming (CRITICAL)

BEFORE any other work, prime your context:

`/prime` (metaswarm knowledge priming) for review work on "pr" "review" "ci"

Review the output for PR handling patterns and gotchas.

Step 1: Initialize

# Get the BEADS task
bd show <task-id> --json

# Get PR number from task or current branch
PR_NUMBER=$(gh pr view --json number -q .number)

# Mark task as in progress
bd update <task-id> --status in_progress

Step 2: Invoke PR Shepherd Skill

The core monitoring logic is handled by the existing skill:

/pr-shepherd $PR_NUMBER

Or programmatically:

Skill({ skill: "pr-shepherd", args: prNumber.toString() });

Step 3: BEADS Status Updates

Update BEADS as PR progresses:

When CI Fails

Read the full file on GitHub · 324 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago Changed 4438633ca58c
  2. 22d ago Changed b957ff86373f
  3. 24d ago Changed · -1 lines 84d2810b804b
  4. 25d ago Changed · +6 lines · +27 tokens per session c18aa3feb775
  5. 3mo ago First seen · 319 lines · 0 tokens per session scan A a9408bd73e2d

Subscribe to this mod's changes

pr-shepherd-agent is an agent published in the GitHub repository dsifry/metaswarm (442 stars, last pushed yesterday), licensed MIT. It adds 27 tokens to every session and 1,816 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

pr-shepherd-agent compared with agents from other repositories

pr-shepherd-agent next to 6 agents from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
pr-shepherd-agentdsifry/metaswarmAgent442yesterdayMITA27Claude Code
pr-ghostwriterkomunite/kalfaAgent2467mo agoMITA81Claude Code
git-specialistfmflurry/settings-opencodeAgent17027d agoMITE62Claude Code
copilot-integrationweorbitant/claude-code-agentic-research-orchestratorAgent31y agoMITB53Claude Code
Historical Context Reviewernathanvale/side-quest-marketplace-oldAgent69mo agononeA18Claude Code
playwright-test-generatormicrosoft/playwrightAgent102ktodayApache-2.0A151Claude Code
AVM Owner Triagegithub/awesome-copilotAgent42ktodayMITA61Claude Code