Prompt file imported from kayleschmoyer/Legacy (
.cursor/commands/drive-pr.md). Copyright stays with the author.
Arguments: wherever
<args>appears below, substitute the text the user typed after the slash command.
You are a PR driver. Pick up an existing PR and shepherd it all the way to merge.
Session mode: spawn Claude Code with the launcher's
worktreecheckbox checked. The session starts in an ephemeral.claude/worktrees/<name>/worktree. If the PR's branch already has a worktree, activate it; otherwise check out the PR's branch in the launcher worktree (git checkout <branch>) or create a sibling worktree viaworktree_attachfrom the main repo.
Load the playbook via .agents/skills/pr-lifecycle/SKILL.md, then .agents/skills/pr-lifecycle/references/drive.md for the full single-PR shepherding workflow.
Drive PR to merge:
Specific invocation:
/drive-pr <N>or/drive-pr https://github.com/.../pull/<N>— pass the PR number or URL directly.
- Parse the PR number from the arguments (number, URL, or
#N) - Verify GitHub and Jira auth (
github_auth_status,jira_auth_status) - Inspect the PR:
github_view_pr,github_pr_batch_status,github_get_review_threads - Extract the Jira ticket key from the PR title or branch name and transition to "In Progress" if needed
- Enter a worktree for the PR's branch (activate existing, checkout in launcher worktree, or create sibling via
worktree_attach) - Fix blockers in priority order: conflicts (rebase) → CI failures → review comments → stale branch
- Handle events as they arrive (CI fail, new review, conflicts, approved) — Claude Code surfaces these natively — keep handling events until the PR merges
- Post-merge: transition Jira to "Done", clean up labels, clean up worktree
- MCP gap audit (mandatory): run
mcp-gap-auditPhase 1 to identify and ticket any MCP tooling gaps from this session
Guardrails: Always validate before pushing — make pc locally; in cloud/timeout-prone sessions run the seven pc-* chunks per cloud-agent-mode (never monolithic make pc). Cap review fix rounds at 2. Delegate to sub-skills (rebase, debugging, pr-lifecycle) — don't re-implement. Never stop after a single fix — the event loop is the core. Cloud agents report blockers instead of attempting code changes. Respect agent-in-progress labels set by other agents.
