batch-bug-shepherd

Orchestrates parallel triage, fixing, and merge-driving of batched GitHub bug issues.

3.7k|344|Updated Sep 18, 2025
One-click install
npx skills add https://github.com/microsoft/apm --skill batch-bug-shepherd
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: batch-bug-shepherd
Source: https://github.com/microsoft/apm/tree/main/.agents/skills/batch-bug-shepherd
Command: npx skills add https://github.com/microsoft/apm --skill batch-bug-shepherd

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

Maintainers of active repositories face bug queues that mix real defects, already-fixed issues, and duplicate community PRs, and processing them one at a time wastes review effort and risks duplicating contributor work. This Skill automates the entire outer loop from raw issue list to mergeable PR queue.

Core Features & Use Cases

  • Parallel triage fan-out: Spawns one subagent per issue to reproduce each bug on HEAD, returning LEGIT, UNCLEAR, FIXED-AT-HEAD, or NOT-A-BUG verdicts validated against a JSON schema.
  • Strategic-alignment gate: Runs an apm-ceo persona pass per legit bug against PRINCIPLES.md before any fix work, demoting out-of-scope or wrong-direction bugs with cited principles.
  • PR-in-flight cross-reference and drive-to-merge: Checks every legit issue for open community PRs, then delegates each PR to a composed shepherd-driver subagent that runs review panels, folds recommendations, pushes with lint gates, and watches CI to green.
  • Use Case: A maintainer asks to sweep the bug queue for the week; the Skill triages 14 open issues in parallel, finds 8 legit bugs, detects 3 already have community PRs, opens TDD fix PRs for the other 5, drives all 8 PRs to mergeable state, resolves merge conflicts, and renders a final report.

Quick Start

Ask the agent to sweep the bug queue and drive every legit bug and in-flight community PR to a mergeable state.

Frequently Asked Questions about batch-bug-shepherd

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I triage a batch of GitHub bug issues automatically?

Provide an explicit issue list or use the sweep-all flag, which expands to all open bug-labeled issues plus unlabeled issues matching suspicion keywords. The Skill spawns one triage subagent per issue to reproduce the bug on HEAD and returns structured LEGIT, UNCLEAR, FIXED-AT-HEAD, or NOT-A-BUG verdicts.

How does the skill avoid duplicating community PR work?

Before dispatching any fix, Phase 2 runs gh pr list searches and inspects linked PRs for every legit issue. Issues with an in-flight PR are routed to the drive wave instead of the fix wave, so community contributions are shepherded rather than duplicated.

Does batch-bug-shepherd depend on other skills?

Yes, it composes the shepherd-driver sibling skill for the per-PR drive-to-merge loop and transitively uses apm-review-panel. It probes for shepherd-driver's prompt, schema, and owner-gate script before the drive wave and stops with an operator prompt if the sibling is missing.

What is the strategic-alignment gate in bug triage?

Phase 1.5 spawns one apm-ceo persona subagent per legit bug to check it against PRINCIPLES.md before any fix work. Bugs judged out-of-scope or wrong-direction are demoted and skipped by later phases; the gate fails open to aligned on infrastructure errors so real defects are never silently dropped.

When should I use apm-review-panel instead of batch-bug-shepherd?

Use apm-review-panel directly for reviewing a single PR, and shepherd-driver for driving one PR to merge. batch-bug-shepherd is only for batch operations across multiple issues or PRs, such as queue sweeps and weekly community reviews.

What safety gates run before a fix PR is opened?

Fix subagents follow TDD with a failing regression test first, then a mutation-break gate that deletes the new guard to confirm the test fails. Pushes are blocked until ruff check and ruff format --check are both silent, and authority-affecting fixes need a static architecture boundary guard.