/dev10x-coding:git-branch-prunefrom dev10x-coding
Classifies and prunes stale local branches with merge verification, designed for rebase-merge repos where `git branch --merged` misses most merged branches.
Ships in dev10x-coding. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Classify and prune stale local branches with merge verification.
Handles repos that rebase-merge (tip of merged branch is NOT an
ancestor of develop), where the naive git branch --merged + grep ': gone]' pipeline misses most stale branches.
Why the naive pipeline fails in rebase-merge repos:
gone tracking catches only branches whose remote was deleted on
merge — usually a minority of stale branches.git branch --merged develop misses rebased commits because the
tip is typically not an ancestor of develop after a rebase-merge.worktree-agent-*) have no
upstream at all, so they never appear as gone.This skill implements a validated 4-category classification that catches all three failure modes while surfacing branches with real unpublished work.
REQUIRED: Create tasks before ANY work. Execute these
TaskCreate calls at startup:
TaskCreate(subject="GH-464 Classify and prune stale branches", activeForm="Classifying branches")Mark completed when done:
TaskUpdate(taskId, status="completed")
Announce: "Using dev10x-coding:git-branch-prune to classify and prune stale local branches."
Call mcp__plugin_dev10x_cli__detect_base_branch to determine the
base branch (prefers develop/development, falls back to
main/master/trunk). Use this throughout — never hardcode
develop.
Run git fetch --prune to remove stale remote-tracking refs before
classification.
Run git worktree list --porcelain and extract the HEAD commit
SHA for each worktree path. A branch checked out in a live worktree
must never be deleted — skip any branch whose tip SHA matches a live
worktree HEAD.
Skip the following branches unconditionally:
main, master, develop, development, trunkFor each remaining branch, apply this decision tree in order:
Category A — gone upstream (safe -D):
git branch -vv shows : gone] — remote was deleted (typically
on merge via GitHub). Safe to delete with git branch -D.
Category B — no upstream, tip is ancestor of base (safe -d):
Branch has no upstream (git branch -vv shows no [...] tracking
info) AND git merge-base --is-ancestor <tip> origin/<base> returns
0. Zero unique commits — safe to delete with git branch -d.
Category C — no upstream, tip not ancestor, content-matched
(safe -D after verification):
Branch has no upstream AND the tip is NOT an ancestor of base.
Run rebase-merge content check:
git log origin/<base>..HEAD --oneline lists commits unique to
this branch. For each unique commit, check whether its title or a
TICKET-ID from the branch name appears in
git log origin/<base> --oneline --grep=<subject>. If all unique
commits are found (content landed on base), safe to delete with
git branch -D. If content check fails, move to Category D.
Category D — keep and surface:
All other branches: tracking a live upstream with ahead N
commits, or content-check failed (Category C fallback), or
undecidable state. Do NOT delete. Surface to user with reason.
REQUIRED: Call AskUserQuestion (do NOT use plain text).
Present the classified branch list and ask the user to approve
deletions per category:
Gate options (present all four options):
gone-upstream branches;
most conservativeInclude in the gate presentation:
Delete branches in the approved categories using the appropriate flag:
git branch -D <name> (force-delete)git branch -d <name> (safe-delete)Catch and report any deletion errors individually — do not abort the batch on a single failure.
Run git worktree prune to remove stale worktree administrative
files. It never removes a live checkout — branches still checked out
in merged worktrees stay protected in Step 4. Run
dev10x-coding:git-worktree-prune first to remove those checkouts, then
re-run this skill to delete their branches.
If git warned about unreachable loose objects during any of the
above steps, suggest the user run git prune separately (do not
run it automatically — it can be slow on large repos).
Print a summary:
Mark the task completed.
The dev10x-coding:fanout skill's worktree teardown step may delegate its per-session branch-deletion to this skill in a future iteration. This skill is designed for standalone invocation and does not require or import any fanout-specific state.
git branch -D on a Category D branch without explicit
user confirmation beyond the Step 5 gate.develop — always use the detected base branch.git prune automatically — suggest it only when gc
warns.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub dev10x-guru/dev10x-claude --plugin dev10x-coding40 skills in this plugin
/ci-reviewdev10x-coding:ci-reviewUse when a change to a Claude CI review prompt, args file, reviewer agent or CLI pin needs checking before it merges — so you read what the CI code review and PR hygiene check would post on a real PR, with nothing reaching GitHub unless you choose, after reading the report, to share it as one marked replica comment. TRIGGER when: "what would the CI review say", replaying the Claude CI review locally, verifying a review prompt or model change on a PR. DO NOT TRIGGER when: self-reviewing a branch with no PR (use dev10x-coding:review), or reviewing someone's PR and posting (use dev10x-coding:gh-pr-review).
/fanoutdev10x-coding:fanoutProcess multiple independent work items as a worktree-isolated swarm — each item runs the full dev10x-coding:work-on lifecycle inside its own background Agent with isolation="worktree" (under Herdr, its own Herdr workspace and agent). Honors dependencies, minimizes conflicts, auto-advances by default. TRIGGER when: 2+ independent work items need parallel processing (PRs, issues, tickets). DO NOT TRIGGER when: single task or sequential dependency chain (use dev10x-coding:work-on); already running as a swarm child (see recursive-fanout guard).