Install
$ agentstack add skill-aryansharma28-skills-aryan-drive-pr ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ● Environment & secrets Used
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
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 --repo / --squash # most repos
gh pr merge --repo / --rebase # if squash is blocked
gh pr merge --repo / --merge # if merge commits allowed
Add --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 --repo / --json state,mergedAt,mergeCommit
Block 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 down
If 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
done
Do 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 --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///git/refs/heads/" 2>/dev/null || true
# Local copy:
git branch -D 2>/dev/null || true
Skip 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 . Local cleanup:
✓ docker compose --profile full down
✓ removed volumes: -app-modules, -bullboard-modules, -goose-bin
✓ git worktree remove
✓ branch 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.
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: Aryansharma28
- Source: Aryansharma28/skills-aryan
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.