shepherd-driver

A reusable workflow component for taking one existing pull request in the Microsoft APM project to a ready-to-merge state. A pull request is a proposed code change awaiting review; this component also handles conflicts and review-related follow-up comments.

In plain words
What is it for?
Use it inside an orchestrator after one pull request has been selected. It helps resolve merge conflicts, coordinate review feedback, produce pull-request advisories, and report whether the change is ready to land.
Why use it?
It gives larger issue-processing workflows a single, consistent way to finish an already selected pull request. It prevents this component from taking on unrelated jobs such as choosing issues, selecting batches, or opening new pull requests.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/microsoft/apm/shepherd-driver
Any agent
npx skills add microsoft/apm --skill shepherd-driver
Clone the repo
git clone --depth 1 https://github.com/microsoft/apm

Made for: Claude Code, Codex.

Per session 193 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,696 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00193 $0.02696
Opus 5 $0.00097 $0.01348
Sonnet 5 $0.00039 $0.00539
Haiku 4.5 $0.00019 $0.00270

Measured 2d ago against content hash 71773e1ad047, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

shepherd-driver 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 2d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/owner_touch_gate.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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/skills/shepherd-driver/SKILL.md · 220 lines

How it starts

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

shepherd-driver - per-PR drive-to-merge convergence loop

This SKILL.md is the natural-language module derived from a genesis design packet; refactors re-run the genesis skill from that packet.

This skill is a COMPOSED BUILDING BLOCK, not a user-facing entrypoint. It was extracted (genesis R3 EXTRACT) from batch-bug-shepherd when a second consumer (apm-issue-autopilot) needed the same per-PR convergence loop. Both orchestrators COMPOSE this skill; neither re-implements the loop. It in turn COMPOSES the apm-review-panel skill for the review pass -- it does NOT re-implement panel review.

Boundary (what this skill does and does NOT do)

DOES: take ONE PR that already exists and drive it to a terminal landing-ready state; resolve cross-PR merge conflicts; emit the PR-facing advisory and supersede comments; return a schema-valid completion_return.

Does NOT: triage issues, decide which issues are worth fixing, open the first PR for an issue, choose the batch, or maintain the orchestrator's ground-truth table. Those are the parent orchestrator's responsibility. If you find yourself triaging or opening greenfield PRs, you are in the wrong skill.

How an orchestrator composes this skill

The parent orchestrator, for each PR in its batch, spawns ONE shepherd-driver subagent with the spawn body in assets/shepherd-driver-prompt.md. The orchestrator passes the inputs that prompt declares (PR_NUMBER, ISSUE_NUMBER, AUTHOR, HEAD_REPO, HEAD_BRANCH, MAINTAINER_CAN_MODIFY, REPO_ROOT, ORIGIN, optional PANEL_PRIOR). The subagent owns the whole convergence loop end-to-end and returns a completion_return.

After every shepherded PR returns ready-to-merge, the orchestrator runs the conflict-resolution phase: probe mergeability and, on DIRTY / BEHIND / CONFLICTING, spawn one conflict-resolution subagent per assets/conflict-resolution-prompt.md. The step-by-step gate procedure is in references/mergeability-gate.md (load it when entering that phase).

Read the full file on GitHub · 220 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. 2d ago First seen · 220 lines · 193 tokens per session scan A 71773e1ad047

Subscribe to this mod's changes

shepherd-driver is a skill published in the GitHub repository microsoft/apm (3,687 stars, last pushed today), licensed MIT. It adds 193 tokens to every session and 2,696 once invoked, about $0.0010 per session on Opus 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

Other skills, from other repositories

review

Review a proposed change before applying it.

narumiruna/aru · 10 tokens

create-skill-sample

This skill should be used when the user asks to "create a new skill sample", "add a skill", "scaffold a new skill", "contribute a skill", "create a GitHub Copilot skill", "build a custom skill", or needs to create a new GitHub Copilot custom skill sample with proper folder structure, SKILL.md, README, and sample.json…

pnp/copilot-prompts · 102 tokens

create-system-prompt

This skill should be used when the user asks to "create an agent instruction", "add agent instructions", "scaffold an agent sample", "create a system prompt sample", "add a system prompt", "create a new agent", "build an agent", or needs to create a new agent instruction sample with proper folder structure, README…

pnp/copilot-prompts · 99 tokens

mcp-server-review

Review a Model Context Protocol (MCP) server implementation against the 2026-07-28 protocol revision, which removed the initialize handshake and Mcp-Session-Id and made the protocol stateless. Use when the user asks to review, audit, upgrade or migrate an MCP server, asks whether their MCP server is spec compliant…

pnp/copilot-prompts · 93 tokens

code-review-csharp

Perform structured code reviews of C# source code covering naming conventions, performance, security, readability, and .NET best practices. Trigger phrases include "review this C# code", "check my C# for best practices", "analyze this C# class", "find issues in my C# code".

pnp/copilot-prompts · 66 tokens

prompt-of-the-week

Generates a weekly PowerPoint slide from a PnP copilot-prompts GitHub sample URL (for example, samples/agent-instructions/creator-agent), derives the correct weekly title from the sample folder, and produces a styled .pptx file that matches the Prompt-K template layout.

pnp/copilot-prompts · 64 tokens