pr-shepherd
Skill45 starsChanged 8 months agoMITView on GitHub
Shepherd a PR through CI and review feedback until it's green and approved
- Deletes or force-pushes
- Commits and pushes
10 other projects use a version of this.
Adopted by
Most recently taken up by
- dsifry/metaswarmtheir own version, first seen Nov 8, 2026
- github/levertheir own version, first seen Nov 1, 2026
- vercel/evetheir own version, first seen Oct 20, 2026
- xdanger/skillstheir own version, first seen Oct 20, 2026
- malinskibeniamin/skillstheir own version, first seen Oct 17, 2026
- Sassy-Dog/skillstheir own version, first seen Oct 8, 2026
Used with
Projects with it also use skill-creator.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
SentrySkillskill-creator
Create new agent skills following the Agent Skills specification. Use when asked to "create a skill", "add a new skill", "write a skill", "make a skill", "build a skill", or scaffold a new skill with SKILL.md. Guides through requirements, writing, registration, and verification.
Also in 3 projects that use this
Other versions10 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 10
- vercel/eve★ 5.8ksame name
- dsifry/metaswarm★ 426same name
- github/lever★ 279same name
- DogaOztuzun/branchdeck★ 18same name
- malinskibeniamin/skills★ 4same name
- ankraio/agent-tools★ 1same name
- Sassy-Dog/skills★ 1same name
- tjespers/claude-skills★ 1same name
- krosdai/skills★ 0same name
- xdanger/skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository7 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- jetpack-compose-material3-expert-skillSkill
- landSkill
- orchestrateSkill
- swiftui-expert-skillSkill
- e2e-videoSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. 0 are common, 11 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 9 edited versions we read keep these.
11
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 23
Before entering the main loop, ensure the branch is up to date and builds cleanly.
- Distinctive: line 30
If there are conflicts, fix them, git rebase --continue, commit, and push.
- Very specific: line 37
Rust/shared scope: if the PR touches Cargo.toml, Cargo.lock, crates/, UniFFI/bindings generation, or anything else that changes shared Rust …
- Distinctive: line 41
Swift-only iOS scope: if the PR is iOS/Swift-only, run:
- Distinctive: line 50
Mixed scope: if multiple surfaces are touched, run each matching lane before entering the main loop.
- Distinctive: line 51
Docs/skills/workflow-only scope: no product build is required unless the changed workflow itself needs validation.
- Distinctive: line 58
Only proceed to the main loop once the required validation lane(s) are green.
- Very specific: line 95
If --watch isn't available, poll manually:
- Distinctive: line 105
If any check failed:
- Distinctive: line 126
After fixing, commit and push (Step 5), then go back to Step 2.
- Distinctive: line 128
Limit: If you've attempted the same CI failure 2 times without progress, escalate to the user.
- Distinctive: line 139
Human reviewers: always address; ask the user if the intent is unclear.
- Very specific: line 161
If any code changes were made during the loop, re-run git diff --name-only origin/master...HEAD and execute every validation lane that now …
- Distinctive: line 170
All CI checks pass AND no unaddressed review comments remain
“Common” is measured: kept by at least 6 in 10 of the 9 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
PR Shepherd
Shepherd a PR through CI checks and review feedback. Monitors CI, fixes build failures, addresses reviewer comments, and repeats until the PR is green with no unaddressed feedback.
Takes an optional PR number argument; defaults to the current branch's PR.
Overview
Pre-flight (once) → Main Loop (repeat) → Final Validation → Exit ReportPre-flight: Rebase and local build
Before entering the main loop, ensure the branch is up to date and builds cleanly.
- Rebase onto master:
git fetch origin
git rebase origin/masterIf there are conflicts, fix them, git rebase --continue, commit, and push.
- Run every validation lane that matches the touched surface:
git diff --name-only origin/master...HEAD- Rust/shared scope: if the PR touches
Cargo.toml,Cargo.lock,crates/**, UniFFI/bindings generation, or anything else that changes shared Rust artifacts, run:nix develop -c just qa - Swift-only iOS scope: if the PR is iOS/Swift-only, run:
For UI behavior changes, also preferjust ios-build-swift-simjust run-swift --simand manual QA. - Android-only scope: run:
just android-assemble - Mixed scope: if multiple surfaces are touched, run each matching lane before entering the main loop.
- Docs/skills/workflow-only scope: no product build is required unless the changed workflow itself needs validation.
- Fix any issues found in the required validation lane(s). Commit and force-push the rebased branch:
git push --force-with-leaseOnly proceed to the main loop once the required validation lane(s) are green.
Main Loop
Repeat until done:
- Check CI — poll checks until they finish
- Check review comments — delegate to subagent
- Fix everything — address CI failures and review feedback
- Push and repeat — commit, push, go back to step 1
Exit when: all CI checks pass AND no unaddressed review comments remain.
Escalate to the user when:
- Architectural decisions or breaking changes need human judgment
- Conflicting reviewer feedback that needs a tiebreak
- CI failure you can't reproduce or understand after 2 attempts
Step 1: Get PR context
PR=${1:-$(gh pr view --json number -q .number)}
gh pr view $PR --json number,title,body,headRefName,url,statusCheckRollupStep 2: Poll CI checks
Poll until all checks complete (no "pending" or "queued" statuses remain):
gh pr checks $PR --watchIf --watch isn't available, poll manually:
gh pr checks $PRRepeat every 30 seconds until all checks show a final state.
Step 3: Handle CI failures
If any check failed:
- Get the failed check's logs:
# List failed checks
gh pr checks $PR --json name,state,conclusion --jq '.[] | select(.conclusion == "FAILURE" or .conclusion == "failure")'
# Get the run ID and fetch logs
gh run list --branch $(gh pr view $PR --json headRefName -q .headRefName) --status failure --json databaseId,name -q '.[0].databaseId'
gh run view <run_id> --log-failed 2>/dev/null | tail -200- Classify the failure:
- Build error — compilation failures, missing imports, type mismatches. Read the error, locate the file, fix it.
- Test failure — run the failing test locally to reproduce, then fix.
- Lint/format — run
cargo fmt, fix clippy warnings. - Flaky/infra — if the error is clearly infrastructure (timeout, network, OOM), re-run the check:
gh run rerun <run_id> --failed
- After fixing, commit and push (Step 5), then go back to Step 2.
Limit: If you've attempted the same CI failure 2 times without progress, escalate to the user.
Step 4: Handle review comments
Delegate review handling to a subagent using the Agent tool so the main context stays clean:
Agent(subagent_type="general-purpose", prompt="Fetch all PR feedback for $PR: PR comments, inline review comments, and review verdicts. Prioritize human reviewers first, then Devin, then CodeRabbit. Skip resolved threads, status-only bot comments, and comments on code that no longer exists. Address actionable feedback, batch fixes when sensible, reply to addressed comments, and for disagreements reply with rationale signed 'claude'. Return a summary of what was fixed, what was skipped with rationale, and what needs the user's decision.")Priority rules for the subagent:
- Human reviewers: always address; ask the user if the intent is unclear.
- Devin (
devin-ai[bot]/devin-ai-integration[bot]): address unless it conflicts with human feedback. - CodeRabbit (
coderabbitai[bot]): address real bugs and clear improvements; skip churny nitpicks.
Step 5: Commit and push
# If Rust/shared code changed:
cargo fmt -p pikachat -p pika_core 2>/dev/null || true
git add <specific files>
git commit -m "fix: <description>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>"
git pushThen go back to Step 1.
Final Validation
If any code changes were made during the loop, re-run git diff --name-only origin/master...HEAD and execute every validation lane that now matches the touched surface before reporting success. Use nix develop -c just qa for Rust/shared scope, just ios-build-swift-sim for iOS/Swift changes, and just android-assemble for Android changes.
For visual verification of UI changes, record per-platform E2E test videos using the /e2e-video skill and upload them to blossom for the PR description.
Exit Conditions
Exit successfully when:
- All CI checks pass AND no unaddressed review comments remain
- Required validation lane(s) pass
- PR is merged
Exit without further action when:
- PR is closed without merge
Exit with escalation to user when:
- Issue requires human judgment (architecture decisions, breaking changes)
- Review feedback requires human decision (conflicting opinions, significant design changes)
- Same CI failure persists after 2 fix attempts
Exit with failure report when:
- Unable to reproduce issue locally
- External service issues (GitHub API down, CI infrastructure problems)
On exit, always report:
- Summary of what was fixed
- Number of CI fix rounds
- Any feedback that was intentionally skipped (with rationale)
- Link to the PR (e.g.,
https://github.com/sledtools/pika/pull/$PR) — always include this so the user can find it easily - If any items were "tracked for follow-up", list them and ask the user if they want GitHub issues opened for them. Use
gh issue createif they say yes.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

