Keep an eye on this PR. Review and resolve pull request comments and fix build failures autonomously. Use when asked to review PR feedback, address reviewer comments, fix CI failures, resolve PR threads, or handle PR maintenance tasks like "review PR comments", "fix the build", "address PR feedback", "clean up PR", or "resolve comments". Handles comment triage (resolve false positives, fix trivial issues, flag complex ones), build/lint/type errors, and e2e snapshot updates.
npx skills add https://github.com/tldraw/tldraw --skill shepherd-pr
Autonomously review PR comments and build status, resolving what can be done with high confidence (>=80%) and flagging the rest for human review.
Note: this repository requires that you be using node 24. Use nvm to switch to node 24 before running any commands:
nvm use 24
# Get PR number for current branch
gh pr view --json number,headRefName,url
# Get review threads with resolution status
gh api graphql -f query='
query($owner: String!, $repo: String!, $number: Int!) {
repository(owner: $owner, name: $repo) {
pullRequest(number: $number) {
reviewThreads(first: 100) {
nodes {
id
isResolved
comments(first: 50) {
nodes {
body
path
line
author { login }
createdAt
databaseId
}
}
}
}
}
}
}
'
Filter to unresolved threads only.
Read the referenced code and investigate. Classify into:
A. False positive / already resolved — The issue no longer exists in current code.
B. Trivial fix (>=80% confidence) — Obvious, mechanical fix. No design decisions or matters of opinion. Examples: typos, missing null checks, wrong variable names, off-by-one, missing imports.
C. Needs human input (<80% confidence) — Design question, significant refactor, or ambiguous fix.
Reply to a comment:
gh api repos/{owner}/{repo}/pulls/{number}/comments/{comment_id}/replies \
-f body="<your reply>"
Resolve a thread:
gh api graphql -f query='
mutation($threadId: ID!) {
resolveReviewThread(input: {threadId: $threadId}) {
thread { isResolved }
}
}
' -f threadId="$THREAD_ID"
Always push fixes, then reply, then resolve related threads (in that order).
gh pr checks --json name,status,conclusion
Investigate failures by category:
Lint errors — Run yarn lint-current. Fix if mechanical (formatting, import order, unused vars). Flag if the lint rule itself is questionable.
Type errors — Run yarn typecheck from repo root. Fix straightforward type mismatches. Flag if fix requires architectural decisions.
Unit test failures — Run yarn test run in relevant workspace. Fix if test expectation is clearly outdated due to intentional code changes. Flag if failure reveals actual bug or design concern.
E2E snapshot failures — Determine whether the PR's code changes _should_ cause visual differences:
update-snapshots label to trigger the automated update workflow: gh pr edit --add-label "update-snapshots"
Mysterious/unexpected failures — Do not attempt to fix. Flag for human review with error output.
git add <specific files>
git commit -m "Address PR review feedback
- <summary of changes>"
git push
Stage specific files only. Never force push. Never use git add -A.
Always end with:
## PR review summary
### Resolved
- <thread>: <what was done>
### Fixed
- <description of fix>
### Needs your input
- <thread>: <why it needs human judgment>
### Build status
- <status of each check, any actions taken>
Omit empty sections.
yarn typecheck) or lint (yarn lint-current).Use when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation
Use when completing tasks, implementing major features, or before merging to verify work meets requirements
Execute git commit with conventional commit message analysis, intelligent staging, and message generation. Use when user asks to commit changes, create a git commit, or mentions "/commit". Supports: (1) Auto-detecting type and scope from changes, (2) Generating conventional commit messages from diff, (3) Interactive commit with optional type/scope/description overrides, (4) Intelligent file staging for logical grouping
Comprehensive GitHub code review with AI-powered swarm coordination
Behavioral guidelines to reduce common LLM coding mistakes. Use when writing, reviewing, or refactoring code to avoid overcomplication, make surgical changes, surface assumptions, and define verifiable success criteria.
Use this skill to review code. It supports both local changes (staged or working tree) and remote Pull Requests (by ID or URL). It focuses on correctness, maintainability, and adherence to project standards.
Refactor bloated AGENTS.md, CLAUDE.md, or similar agent instruction files to follow progressive disclosure principles. Splits monolithic files into organized, linked documentation.
Create high-quality git commits: review/stage intended changes, split into logical commits, and write clear commit messages (including Conventional Commits). Use when the user asks to commit, craft a commit message, stage changes, or split work into multiple commits.
Take tldraw/shepherd-pr from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.