drive-pr
Skill8 starsChanged 6 months agoMITView on GitHub
Take a PR all the way through merge AND clean up the local artifacts it leaves behind. The "babysit-pr" sister skill that also tears down the worktree + docker volumes + temp branches — but ONLY after the merge actually lands. Use when the user says "drive PR N", "/drive-pr N", "merge and cleanup", "ship it then tear it down", or asks you to land a PR and not leave debris on disk.
- Reads credentials
2 other projects use a version of this.
Adopted by
Most recently taken up by
- 0xdeafcafe/skillstheir own version, first seen Nov 6, 2026
- drewdrewthis/claude-skillstheir own version, first seen Apr 22, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- drewdrewthis/claude-skills★ 2same name
- 0xdeafcafe/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 repository6 other files it gives its agents.
- babysit-prSkill
- explain-prSkill
- goated-reviewSkill
- junior-modeSkill
- understand-prSkill
- windows-docker-readySkill
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 5 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 10
If you only want "get it merged," use babysit-pr.
- Distinctive: line 14
Cleanup runs ONLY after the merge state is confirmed: Not after CI passes, not after the merge command returns, not after the queue accepts …
- Very specific: line 22
If state != MERGED, stop. Don't clean.
- Distinctive: line 34
Use whichever method the repo accepts:
- Very specific: line 42
Add --auto if the repo has branch-protection rules that require all checks.
- Very specific: line 65
If the worktree didn't run any compose stack (e.g.
- Distinctive: line 103
After cleanup, give the user a one-paragraph summary:
- Distinctive: line 126
If the user says "drive PR but keep the worktree, just stop docker" — honor that.
- Very specific: line 130
When the user invokes /drive-pr N (or asks to land + clean up):
- Distinctive: line 135
If MERGED → run cleanup Section 4.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
drive-pr
Driving a PR is more than getting it green. The local cost of a feature PR — a worktree on disk, per-worktree docker volumes (10s of GB), a feature branch — sticks around forever unless someone cleans up. This skill drives the PR through merge and then, and only then, tears down the local artifacts it created.
If you only want "get it merged," use babysit-pr. If you also want "no debris on disk afterward," use drive-pr.
The hard rule
Cleanup runs ONLY after the merge state is confirmed. Not after CI passes, not after the merge command returns, not after the queue accepts an auto-merge. The PR's actual state must read MERGED via gh pr view before a single docker volume rm or git worktree remove runs.
This protects against:
- Auto-merge that gets dequeued by a late failing check.
- Network blips that hang the merge mid-flight.
- A reviewer hitting "request changes" between the
gh pr mergecall and CI completion. - The user changing their mind during the gap.
If state != MERGED, stop. Don't clean. Report status and hand back.
Sequence
1. Drive the PR
Same as babysit-pr — get CI green, resolve conflicts, address review comments, run /review, etc. See that skill if the PR needs deep babysitting.
Resolve merge conflicts only with the user's standing authorization. For conflicts in auth / routes / feature-flag registries / migrations / security code, ask before guessing — wrong calls here are silent.
2. Merge
Use whichever method the repo accepts:
gh pr merge <N> --repo <owner>/<repo> --squash # most repos
gh pr merge <N> --repo <owner>/<repo> --rebase # if squash is blocked
gh pr merge <N> --repo <owner>/<repo> --merge # if merge commits allowedAdd --auto if the repo has branch-protection rules that require all checks; otherwise it errors with "Auto merge is not allowed for this repository". When --auto fails, drop the flag and re-run (immediate merge).
3. CONFIRM merged
gh pr view <N> --repo <owner>/<repo> --json state,mergedAt,mergeCommitBlock on state == "MERGED". If state == "OPEN" (merge queue, stuck CI, declined request), report and STOP. Do not proceed to cleanup.
4. Cleanup (ONLY after state == MERGED)
Cleanup happens in the worktree the PR was driven from. Steps:
4a. Stop the local dev stack tied to this worktree
# Use the same VOLUME_PREFIX the user originally launched with so we
# target this worktree's containers, not a sibling worktree's stack.
VOLUME_PREFIX="$(basename "$PWD")" \
docker compose -f compose.dev.yml --profile full downIf the worktree didn't run any compose stack (e.g. the PR was tooling-only), docker compose down is a no-op — safe.
4b. Remove per-worktree docker volumes
# Worktree-isolated volumes (declared with ${VOLUME_PREFIX:-langwatch}-* names
# in compose.dev.yml). Removing these reclaims the GBs of node_modules,
# bullboard deps, and goose binaries that this worktree alone used.
for v in app-modules bullboard-modules goose-bin; do
docker volume rm "${PWD##*/}-${v}" 2>/dev/null || true
doneDo NOT remove the SHARED stateful volumes (langwatch-db-data, langwatch-clickhouse-data, langwatch-redis-data) — other worktrees use them, and they hold the user's signed-up account + project data. The shared volumes survive across worktrees by design.
4c. Remove the git worktree
# From the *parent* repo's directory, not the worktree itself.
# `git worktree remove` refuses to nuke the worktree you're standing in.
cd "$(git rev-parse --git-common-dir)/.." 2>/dev/null || cd ..
git worktree remove <worktree-path> --force--force because the .env, .env.dev-up overlay, and other locally-created files are intentional artifacts you want gone.
4d. Delete the merged feature branch
gh api -X DELETE "repos/<owner>/<repo>/git/refs/heads/<branch-name>" 2>/dev/null || true
# Local copy:
git branch -D <branch-name> 2>/dev/null || trueSkip this step for stacked PRs whose head branch is the BASE of another open PR.
5. Report
After cleanup, give the user a one-paragraph summary:
PR #N merged at <timestamp>. Local cleanup:
✓ docker compose --profile full down
✓ removed volumes: <worktree>-app-modules, <worktree>-bullboard-modules, <worktree>-goose-bin
✓ git worktree remove <path>
✓ branch <name> deleted (origin + local)
Shared stateful volumes preserved: langwatch-db-data,
langwatch-clickhouse-data, langwatch-redis-data.What this skill does NOT do
- It does not clean if the merge didn't happen. Ever. The check at step 3 is non-negotiable.
- It does not touch the shared stateful db/redis/clickhouse volumes — those hold the user's data across worktrees.
- It does not delete the SOURCE repo (the parent clone), only the worktree.
- It does not stop or remove containers belonging to OTHER worktrees. The
VOLUME_PREFIXscoping ensures we only touch this PR's stack. - It does not delete the head branch when the PR is stacked and its head is some other PR's base. Check before deleting.
When the user wants partial cleanup
If the user says "drive PR but keep the worktree, just stop docker" — honor that. The standard sequence is the default, not a mandate. The hard rule (no cleanup before merge) still applies regardless.
Activating
When the user invokes /drive-pr N (or asks to land + clean up):
- Confirm the PR number and base/target.
- Drive it to merge per Section 1–2 (delegating to
babysit-prbehaviors as needed). - Block on
state == MERGEDper Section 3. - If MERGED → run cleanup Section 4. If not → stop and report.
- Summarize per Section 5.
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.

