Labsco
tldraw logo

shepherd-pr

48,500

by tldraw · part of tldraw/tldraw

shepherd-pr — an installable skill for AI agents, published by tldraw/tldraw.

🔥🔥FreeQuick setup
🧰 Not standalone. This skill ships with tldraw/tldraw and only works together with that tool — install the tool first, then add this skill.

shepherd-pr — an installable skill for AI agents, published by tldraw/tldraw.

Inspect the full instructions your agent will receiveExpand

This is the exact playbook injected into your agent when the skill activates — shown here so you can audit it before installing. You don't need to read it to use the skill.

by tldraw

shepherd-pr — an installable skill for AI agents, published by tldraw/tldraw. npx skills add https://github.com/tldraw/tldraw --skill shepherd-pr Download ZIPGitHub48.5k

Review PR

Autonomously review PR comments and build status, resolving what can be done with high confidence (>=80%) and flagging the rest for human review.

Workflow

Note: this repository requires that you be using node 24. Use nvm to switch to node 24 before running any commands:

Copy & paste — that's it
nvm use 24

1. Gather context

Copy & paste — that's it
# 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.

2. Triage each unresolved comment

Read the referenced code and investigate. Classify into:

A. False positive / already resolved — The issue no longer exists in current code.

  • Reply explaining why, citing specific code or commit.

  • Resolve the thread.

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.

  • Make the fix.

  • Reply describing what was changed.

  • Resolve the thread.

C. Needs human input (<80% confidence) — Design question, significant refactor, or ambiguous fix.

  • Do NOT resolve.

  • Add to end-of-session summary.

3. Reply and resolve threads

Reply to a comment:

Copy & paste — that's it
gh api repos/{owner}/{repo}/pulls/{number}/comments/{comment_id}/replies \
 -f body=" "

Resolve a thread:

Copy & paste — that's it
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).

4. Check build status

Copy & paste — that's it
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:

  • If yes (UI changes, style updates): add the update-snapshots label to trigger the automated update workflow:
Copy & paste — that's it
gh pr edit --add-label "update-snapshots"
  • If no: flag as unintended regression for human review.

Mysterious/unexpected failures — Do not attempt to fix. Flag for human review with error output.

5. Commit and push fixes

Copy & paste — that's it
git add 
git commit -m "Address PR review feedback

- "
git push

Stage specific files only. Never force push. Never use git add -A.

6. End-of-session summary

Always end with:

Copy & paste — that's it

## PR review summary

### Resolved
- : 

### Fixed
- 

### Needs your input
- : 

### Build status
- 

Omit empty sections.

Guidelines

  • Conservative threshold: only act when >=80% confident the fix is correct and uncontroversial.

  • Never resolve comments raising design questions or matters of opinion.

  • Never resolve without replying first.

  • Read actual code before concluding a comment is a false positive.

  • Verify fixes don't break types (yarn typecheck) or lint (yarn lint-current).

  • Do not modify test expectations unless change is clearly intentional.