core-plugin/skills/babysit-pr/SKILL.md
Autonomous PR babysitter — fix merge conflicts, address review feedback, and resolve build failures with built-in recurring loop
npx skillsauth add bernatmv/ai-rules core-plugin/skills/babysit-prInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Fully autonomous PR maintenance with a built-in recurring loop. Checks all three health dimensions (merge conflicts, review feedback, build failures), fixes everything it can in a single pass, commits, pushes, and resolves comments — no user prompts. Self-schedules via CronCreate so no separate /loop invocation is needed.
/babysit-pr [PR_NUMBER] [INTERVAL]
gh pr view5)
5 = every 5 minutes, 10 = every 10 minutes, 15 = every 15 minutes/loop/babysit-pr — sets up the loop and runs the first check immediatelyThis skill operates without user confirmation. It must:
If something cannot be fixed autonomously (e.g., reviewer is asking a design question that requires human judgment), skip it and note it in the summary.
On the first invocation only, use CronCreate to schedule this skill to re-run automatically.
Use CronList to check if a babysit-pr job already exists. If one is already running, skip scheduling and proceed directly to Step 1 (this is a recurring invocation).
If no existing job is found, create one:
CronCreate:
cron: "*/${INTERVAL:-5} * * * *" # e.g., "*/5 * * * *" for every 5 minutes
prompt: "/babysit-pr ${PR_NUMBER}"
recurring: true
Pick an off-minute if the interval allows (e.g., 3,8,13,... instead of 0,5,10,...) to avoid congestion.
On the first invocation, inform the user:
Babysitter activated for PR #1234. Running every 5 minutes.
First check starting now...
To stop: /babysit-pr stop (or use CronDelete with the job ID)
Note: Auto-expires after 3 days per session limits.
If during any check the PR state is MERGED or CLOSED:
CronDelete to remove the recurring jobIf the user runs /babysit-pr stop:
CronList to find the babysit jobCronDelete to remove it# Auto-detect or use provided PR number
gh pr view ${PR_NUMBER:---json number,title,url,headRefName,baseRefName,state,mergeable,mergeStateStatus}
Extract:
mergeable status (MERGEABLE, CONFLICTING, UNKNOWN)mergeStateStatus (CLEAN, DIRTY, HAS_HOOKS, UNSTABLE, BEHIND, BLOCKED)If PR is MERGED or CLOSED:
CronList + CronDelete to cancel the recurring babysit jobEnsure we're on the correct branch and up to date:
PR_BRANCH=$(gh pr view "${PR_NUMBER}" --json headRefName --jq '.headRefName')
git fetch origin
git checkout "${PR_BRANCH}"
git pull origin "${PR_BRANCH}"
Check mergeable from Step 1. If CONFLICTING:
# Attempt to merge the base branch to surface conflicts
git fetch origin main
git merge origin/main --no-edit
If merge produces conflicts:
git diff --name-only --diff-filter=U to list conflicted filesgit add <resolved_files>git commit --no-editgit push origin "${PR_BRANCH}"If a conflict is too complex (e.g., both sides changed the same logic in incompatible ways):
git merge --abortOWNER_REPO=$(gh repo view --json owner,name --jq '.owner.login + "/" + .name')
OWNER=$(echo "$OWNER_REPO" | cut -d/ -f1)
REPO=$(echo "$OWNER_REPO" | cut -d/ -f2)
gh api graphql -f query='query($owner: String!, $repo: String!, $pr: Int!) {
repository(owner: $owner, name: $repo) {
pullRequest(number: $pr) {
reviewThreads(first: 100) {
totalCount
edges {
node {
id
isResolved
isOutdated
path
line
startLine
comments(first: 10) {
edges {
node {
id
body
author { login }
createdAt
}
}
}
}
}
}
}
}
}' -f owner="${OWNER}" -f repo="${REPO}" -F pr=${PR_NUMBER}
Filter to unresolved, non-outdated threads.
If zero unresolved threads, skip to Step 4.
For each unresolved thread, categorize:
For each actionable thread:
For questions where the answer is clear from the code:
gh api graphql -f query='mutation($threadId: ID!, $body: String!) {
addPullRequestReviewThreadReply(input: {
pullRequestReviewThreadId: $threadId
body: $body
}) {
comment { id }
}
}' -f threadId='{THREAD_ID}' -f body='{REPLY}'
Every thread that has been addressed — whether by a code fix or a reply — MUST be resolved. Do not leave addressed threads open. This is critical for signaling progress to reviewers.
For each addressed thread, call the resolveReviewThread mutation:
gh api graphql -f query='mutation($threadId: ID!) {
resolveReviewThread(input: {threadId: $threadId}) {
thread { id isResolved }
}
}' -f threadId='{THREAD_ID}'
Only skip resolving a thread if it was categorized as "design discussion" and left for human input.
If any code changes were made:
git add <changed_files>
git commit -m "fix: address PR review feedback
- [summary of each change per thread]
Co-Authored-By: Claude <[email protected]>"
git push origin "${PR_BRANCH}"
gh pr checks "${PR_NUMBER}"
Parse for failing Screwdriver checks. If all checks pass or are pending, skip to Step 5.
Priority order:
build-pr (compilation) — blocks everythingtest — test failureslint — style violationsExtract the build ID from the failing check URL.
./scripts/screwdriver/sd-investigate-build.sh "${BUILD_ID}"
Fallback if script fails:
sd4 build logs -b "${BUILD_ID}" 2>&1 | tail -200
Analyze logs to identify root cause. Common patterns:
./scripts/screwdriver/sd-clear-cache.sh be-replay and re-trigger build — no code fix neededFor code fixes:
Apply the fix using Edit tool
Verify locally:
# For compilation
./gradlew compileJava compileTestJava
# For test failures
./gradlew test --tests "*FailingTestClass*"
# For style
./gradlew spotlessApply
Commit and push:
git add <changed_files>
git commit -m "fix: resolve ${FAILURE_TYPE} in ${COMPONENT}
Build: ${BUILD_ID}
PR: #${PR_NUMBER}
Co-Authored-By: Claude <[email protected]>"
git push origin "${PR_BRANCH}"
If the root cause is unclear or requires architectural changes:
/troubleshoot-pipeline ${PR_NUMBER} ${BUILD_ID} for deeper investigationAfter completing all steps, present a concise summary:
## PR Babysitter Report
**PR:** #1234 — feat: add agent tracking
**Branch:** feature/agent-tracking -> main
**Time:** 2026-03-24 14:30 UTC
### Merge Conflicts
- Status: No conflicts / Resolved 3 conflicts / 1 conflict needs manual resolution
### Review Feedback
- Threads addressed: 4 of 5
- Threads resolved: 4
- Threads skipped: 1 (design question — needs human input)
- @reviewer on FooService.java:42: "Should we use a different pattern here?"
- Commit: `abc1234` fix: address PR review feedback
### Build Status
- Previous: FAIL (build #127658225 — test failure)
- Fix applied: resolved NPE in AgentServiceTest
- Commit: `def5678` fix: resolve test NPE in AgentServiceTest
- New build: triggered (check in ~10-15 min)
### Items Needing Human Attention
1. Design question from @reviewer on FooService.java:42
2. (none / list any unresolvable items)
### Next Check
Scheduled to re-run in ${INTERVAL} minutes (cron job active).
To stop: `/babysit-pr stop`
Report and stop: "No open PR found for this branch. Run with PR number: /babysit-pr 1234"
Cancel the cron job via CronDelete, report and stop: "PR #{number} is {state}. Babysitter stopped."
/babysit-pr stopFind and cancel the cron job, confirm, and stop. Do not run Steps 1-5.
PR #1234 is healthy. No conflicts, no unresolved feedback, all checks passing.
Next check in ${INTERVAL} minutes.
Note "build pending" in summary. Don't treat as failure. Will be re-checked on the next scheduled run.
Fall back to browser URL for logs. Note in summary that build diagnosis was skipped.
Apply all fixes to the file before committing. Don't create separate commits per thread if they touch the same file.
If GitHub API returns 403/rate limit, back off and note in summary.
If addressing review feedback creates new conflicts with main, resolve them in the same commit.
| Command | Relationship |
| ------------------------ | -------------------------------------------------------------- |
| /monitor-pr | Read-only health check; this skill is the autonomous fixer |
| /address-pr-feedback | Interactive version of Step 3; this skill does it autonomously |
| /address-build-failure | Interactive version of Step 4; this skill does it autonomously |
| /create-pr | Creates the PR; this skill maintains it afterward |
| /babysit-pr stop | Cancels the built-in recurring loop |
isResolved == false threadsresolveReviewThread to mark the thread resolveddevelopment
Comprehensive guide for developing WebGPU-enabled Three.js applications using TSL (Three.js Shading Language). Covers WebGPU renderer setup, TSL syntax and node materials, compute shaders, post-processing effects, and WGSL integration. Use this skill when working with Three.js WebGPU, TSL shaders, node materials, or GPU compute in Three.js.
content-media
Three.js textures - texture types, UV mapping, environment maps, texture settings. Use when working with images, UV coordinates, cubemaps, HDR environments, or texture optimization.
data-ai
Three.js shaders - GLSL, ShaderMaterial, uniforms, custom effects. Use when creating custom visual effects, modifying vertices, writing fragment shaders, or extending built-in materials.
tools
Three.js post-processing - EffectComposer, bloom, DOF, screen effects. Use when adding visual effects, color grading, blur, glow, or creating custom screen-space shaders.