From git-workflows
Check PR merge readiness, sync local repo, and cleanup stale worktrees
npx claudepluginhub jacobpevans/claude-code-plugins --plugin git-workflowsThis skill uses the workspace's default tool permissions.
Check open PR merge-readiness status, sync the local repository, and cleanup stale worktrees.
Creates isolated Git worktrees for feature branches with prioritized directory selection, gitignore safety checks, auto project setup for Node/Python/Rust/Go, and baseline verification.
Executes implementation plans in current session by dispatching fresh subagents per independent task, with two-stage reviews: spec compliance then code quality.
Dispatches parallel agents to independently tackle 2+ tasks like separate test failures or subsystems without shared state or dependencies.
Check open PR merge-readiness status, sync the local repository, and cleanup stale worktrees. Note: Does not automatically merge PRs - only reports readiness status for each PR.
CRITICAL: Always check for open PRs, regardless of current branch.
# Check for PR from current branch
gh pr view --json state,number,title 2>/dev/null
# ALWAYS also check for any open PRs by the user
gh pr list --author @me --state open --json number,title,headRefName
For each open PR, DO NOT MERGE - only check and report:
gh pr view NUMBER --json state,mergeable,statusCheckRollup,reviewDecision
Merge-ready criteria: State OPEN, Mergeable MERGEABLE, All checks SUCCESS, All threads resolved, Review APPROVED or not required.
Only remove a worktree if it is confirmed stale.
Stale definition: The branch has a merged PR (gh pr list --state merged --head <branch>)
OR its remote tracking branch was deleted ([gone] in git branch -vv).
Branches with open PRs, local-only branches without PRs, and worktrees with uncommitted changes are NEVER stale.
For each worktree from git worktree list:
[gone] remote, or merged PR (gh pr list --state merged --head <branch>)
AND no commits ahead of default (git log origin/main..HEAD --oneline is empty)git worktree remove <path> — NEVER use --forcegit branch -d <branch>.
If this fails (squash-merged branch not reachable from local main), investigate before using git branch -DFinish with git worktree prune.
Report: PRs assessed as merge-ready (if any), branches cleaned up, worktrees removed, current branch and sync status.
DO NOT skip the PR check just because you're on main. The user may have multiple open PRs from different branches.
Always run gh pr list --author @me --state open to find work that needs merging.