/compass:pr-shepherd runs instead · from compass
Automates PR review and fix loop: diagnoses failing checks, classifies defects, fixes mechanical issues on the PR branch, and gates merges until human authority is granted.
This skill never runs in Claude Code
It ships in compass at skills/, but /compass:pr-shepherd (a command, or a skill Claude Code finds first) has the same name: typing it, or Claude choosing it, runs that one instead.
A loop has five moves: discovery → handoff → verification → persistence → scheduling
(see docs/20-loops.md). morning-triage is discovery — it finds
work. This skill is what happens after a PR exists: no PR sits red waiting for a human to
diagnose a check that a machine can read. It shepherds each open PR to exactly one of three
outcomes: merged (gate satisfied + authority granted), ready-to-merge (reported), or
inbox (needs a human, with the diagnosis already written).
gh pr list --state open --json number,title,author,isDraft,isCrossRepository,headRefName,statusCheckRollup
Skip drafts. Fail closed on forks: if isCrossRepository is true — or the field is
missing from the response — the PR is read-only: diagnose and comment, never check out into a
pushable worktree, never push.
For each red check, read the actual failing step (gh run view <run-id> --log-failed) and
classify it. The class decides the action — this is the judgment step, don't skip it:
| class | signature | action |
|---|---|---|
| environmental | missing secrets (Dependabot actor), runner flake, quota | note it; if it recurs, fix the workflow (root cause), not the PR |
| mechanical | drift/sync gates, lint, format, lockfile, generated files | fix it on the PR branch |
| real defect | failing tests on changed logic, security finding | never auto-fix silently — comment the diagnosis on the PR, mark inbox |
A failure that pattern-matches "flake" still gets its log read once. Silence is not success: a check that never ran (skipped, stuck queue) is a finding, not a pass.
Work in a scratch worktree (git worktree add … origin/<branch>), never in the main checkout:
run: cp sdlc/workflows/X .github/workflows/ — run that).inbox with what
was tried. A non-converging loop must stop spending
(the resource-ceiling principle).Merge requires all of:
Without authority: report the PR as ready-to-merge with a one-line verdict per check. The merge button is the human's; the shepherd's job is to make pressing it trivial.
Append one row per touched PR to state/shepherd.md (create if absent) so the next run
resumes instead of re-diagnosing. The agent forgets; the repo does not.
| pr | class | action | status |
|---|---|---|---|
| #71 | mechanical (mirror drift) | synced templates, pushed | merged |
| #74 | real defect (auth test) | diagnosis commented | inbox |
/pr-shepherd./loop 15m /pr-shepherd — each firing re-reads state, handles
what changed.compass schedule add pr-shepherd --twice-daily
— a bounded headless run (turn + budget + timeout capped, spend ledgered) at 09:07 and
17:07 while the laptop is awake, with merge authority and the same rails
(sdlc/routines/prompts/pr-shepherd.md). Crontab skips missed slots; it doesn't catch up.state/shepherd.md first; a PR already inbox stays with the human
until they act — don't re-litigate it every run.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
9 skills in this plugin
/bootstrap-agent-configGenerate a high-quality project CLAUDE.md and AGENTS.md by inspecting the current repository. Use when a repo has no agent config, when onboarding a new project, or when the user asks to "set up Claude/Codex for this repo" or "write a CLAUDE.md". Detects languages, build/test commands, and structure, then drafts config grounded in what's actually there./cost-sentinelSpend/cache watchdog — reads the Anthropic Admin API usage report for the last 24h and flags per-key spend over a limit, always-on keys (active 7 of 7 days), low cache-read ratio, and keys not in an allowlist of known consumers. Use weekly on a schedule or on demand when spend looks off. Read-only; the deterministic script decides, you only summarize./hardenRun the toolkit's security commands in order to surface secrets, MCP supply-chain issues, install drift, release provenance gaps, and untrusted-code risks before shipping. Use before opening a PR, after adding a dependency, or whenever the security posture needs a fresh check./morning-triageDiscovery for an autonomous loop — find this turn's work instead of being handed it. Reads what changed since the last run (failed CI, new issues, merged commits), judges what's actually worth acting on, writes findings to a durable state file, and hands each off to the SDLC loop with a stop-condition. Use as the first move of a scheduled loop, or by hand to plan a session. Read-only on code; never edits, opens PRs, or merges./routeDetect the work type of a task or diff and dispatch the right specialist review/agent. Use when you're about to review or implement and want the correct domain reviewer (UI/design, API/devex, infra, docs, core) instead of a generic pass. The local mirror of the SDLC Classifier + domain-routed reviewers./systematic-debuggingUse when something is broken — a failing test, panic, stack trace, error log, or wrong behavior whose cause isn't obvious. Reproduce it, form a hypothesis, PROVE the cause before changing code, then make the minimal root-cause fix and guard it with a test. For deep cases, hand off to the debugger subagent.npx claudepluginhub dshakes/compass --plugin compassOther plugins' skills for the same job