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.
npx agentmods add skills/microsoft/apm/batch-bug-shepherdnpx skills add microsoft/apm --skill batch-bug-shepherdgit clone --depth 1 https://github.com/microsoft/apmWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00227 | $0.05631 |
| Opus 5 | $0.00113 | $0.02815 |
| Sonnet 5 | $0.00045 | $0.01126 |
| Haiku 4.5 | $0.00023 | $0.00563 |
Grade A, and why
batch-bug-shepherd 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.
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.
How it starts
The opening of the file, as written. The whole thing — 446 lines — stays where its author put it; the contents beside it link to each section on GitHub.
batch-bug-shepherd - Outer-loop bug-queue orchestrator
This skill is an A10 ORCHESTRATOR-SAGA over fan-out waves (triage,
strategic-alignment, PR-cross-reference, fix, drive-to-merge,
conflict-resolution) with a persisted ground-truth table between
phases. It COMPOSES the
shepherd-driver skill as the per-PR
drive-to-merge engine -- it does NOT re-implement the review +
fold + push + CI loop. shepherd-driver transitively COMPOSES
apm-review-panel; this skill inherits
that edge and never reaches into panel internals directly. It also
COMPOSES the apm-ceo persona (host-repo agent at
.apm/agents/apm-ceo.agent.md) for the strategic-alignment gate,
which checks every LEGIT bug against PRINCIPLES.md before allowing
fix / drive work to proceed. Per-PR shepherding is delegated to
shepherd-driver; per-issue verification, strategic alignment,
PR-in-flight branching, greenfield fix dispatch, post-wave
mergeability re-probe, and the cross-session table are owned here.
The skill is ADVISORY at the panel layer and EXECUTIVE at the
orchestrator layer: it WILL push commits, open PRs, post comments,
close superseded PRs. Every consequential write goes through a
deterministic CLI (gh, git, uv run ruff) wrapped in plan +
execute + verify (A9 SUPERVISED EXECUTION).
Architecture invariants
These 18 rules bind every wave. The one-line essence is below; the
FULL binding text (rationale, edge cases, inherited-from-driver
detail) lives in references/invariants.md. Load
references/invariants.md before planning Phase 0 -- the summaries
here are dispatch anchors, not the complete contract.
- Fan-out, not serial. Triage / alignment / fix / drive run as parallel child threads; single-loop is an anti-pattern.
- Verify before fix. No fix dispatched until the bug reproduces
on HEAD (
LEGIT);UNCLEAR-> human,FIXED-AT-HEAD-> close. - PR-in-flight detection is mandatory.
gh pr listevery legit issue before any fix; duplicating community work is the worst failure mode this skill defends against. - Drive, do not split shepherd from complete. ONE shepherd-driver subagent owns the whole per-PR loop; no separate panel + completion waves.
- Mutation-break gate. A regression trap is real only if deleting the production guard makes the test FAIL.
- Canonical-owner gate (driver-enforced). Every fix gets one
architecture classification vs
.github/instructions/architecture.instructions.md; a new owner, centralization, or split-authority repair needs the full dual guardrail (behavioral + static +test_architecture_*+ mutation break) beforeready-to-merge. shepherd-driver enforces and returns it; the orchestrator only records the evidence. - Superseding-PR fallback (inherited). On contributor-fork push
failure the driver opens an authorship-preserving PR under
microsoft/apmand returnssuperseded. - Single-writer interlock. One idempotent panel comment + one driver advisory per PR; the orchestrator never posts to a PR.
- ASCII only. Printable ASCII in every artifact (cp1252 safety).
- Lint contract is the push gate (inherited).
ruff check+ruff format --checksilent before anygit push. - Ground-truth table is the single source of truth. One plan.md table, rewritten on every return, re-read at each wave start (B4 PLAN MEMENTO + B8 ATTENTION ANCHOR).
- Cross-session message reports only on green. Failures stay in the subagent session until resolved or escalated to a human.
- Operator visibility is a contract. Progress mermaid + live
table at every boundary; dispatch table before every fan-out
(
assets/progress-diagram.md). - Mergeability is post-wave truth. Re-probe
mergeStateStatusbefore claiming ready; Phase 5 resolves conflicts with--force-with-lease(bare--forceprohibited). - Two-comment-per-PR cap. Driver advisory + resolution confirmation only; the in-loop panel comment is idempotent and does not add to the count. No third comment, ever.
- Bias toward folding (inherited). The driver folds in-scope follow-ups into the PR; only genuinely separable work becomes a tracking issue.
- Strategic-alignment gate before drive. Phase 1.5 runs one
apm-ceosubagent per LEGIT row; demoted rows skip Phase 2-5; the gate fails open toaligned, aborts only if the persona /PRINCIPLES.mdis missing. - Worktree isolation. Every fix and drive child runs in its OWN
git worktree (one per issue/PR); never fan out mutating children
against a shared
REPO_ROOT(they would race on.git/indexand the checked-out branch). Triage is read-only and may share one.
What ships with it
20 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- assets/final-report-template.md 4.5 KB
- assets/fix-prompt.md 4.1 KB
- assets/ground-truth-table.md 2.4 KB
- assets/progress-diagram.md 7.4 KB
- assets/strategic-alignment-prompt.md 4.5 KB
- assets/triage-prompt.md 1.8 KB
- assets/verdict-schema.json 3.4 KB
- evals/.gitignore 9 B
- evals/content/sweep-bug-queue.json 7.1 KB
- evals/content/three-issues-mixed.json 6.9 KB
- evals/evals.json 2.2 KB
- evals/fixtures/sweep-bug-queue.with_skill.md 19 KB
- evals/fixtures/sweep-bug-queue.without_skill.md 1.6 KB
- evals/fixtures/three-issues-mixed.with_skill.md 18 KB
- evals/fixtures/three-issues-mixed.without_skill.md 1.5 KB
- evals/README.md 2.3 KB
- evals/triggers.json 7.0 KB
- references/invariants.md 9.8 KB
- references/strategic-alignment-gate.md 7.7 KB
- scripts/run_evals.py 11 KB runs code
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.
- 2d ago First seen · 446 lines · 227 tokens per session scan A c5b0f8752e72
batch-bug-shepherd is a skill published in the GitHub repository microsoft/apm (3,668 stars, last pushed 2d ago), licensed MIT. It adds 227 tokens to every session and 5,631 once invoked, about $0.0011 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.
Other skills, from other repositories
review
Review a proposed change before applying it.
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…
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…
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…
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".
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.