claw-advisor
This skill should be used when the user asks about OpenClaw configuration, troubleshooting, setup, architecture, or any OpenClaw…
This skill should be used when the user says "clean up branches", "delete merged branches", or "prune stale branches". Use whenever the user mentions branch cleanup, pruning, or stale branch deletion — even if they don't say "clean-branches" explicitly.
$ npx -y skills add gupsammy/Claudest --skill clean-branches --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/clean-branchesContext preview
The summary Claude sees to decide when to auto-load this skill.
This skill should be used when the user says "clean up branches", "delete merged branches", or "prune stale branches". Use whenever the user mentions branch cleanup, pruning, or stale branch deletion — even if they don't say "clean-branches" explicitly.
name: clean-branches description: > This skill should be used when the user says "clean up branches", "delete merged branches", or "prune stale branches". Use whenever the user mentions branch cleanup, pruning, or stale branch deletion — even if they don't say "clean-branches" explicitly. argument-hint: "[branch-pattern]" allowed-tools: - Bash - AskUserQuestion
Safely remove merged and stale git branches with confirmation.
If `$ARGUMENTS` is provided, treat it as a glob pattern to filter branch candidates (e.g., `feature/*`) and pass it to the candidate script in Step 1.
**1. Fetch latest state**
git fetch --all --prune
If fetch fails (no remotes configured), note remote data is unavailable and continue with local analysis only.
**2. Identify candidates**
Run the candidate detection script, passing the optional pattern filter:
bash ${CLAUDE_PLUGIN_ROOT}/skills/clean-branches/scripts/find-candidates.sh "$PATTERN"The script outputs two labeled sections (`=== MERGED ===` and `=== STALE ===`), one branch per line. Branches carry two optional annotations:
Parse each section into its own list, preserving both annotations.
After parsing, apply these worktree rules before building the candidate lists. Process the MERGED list first, then the STALE list — a branch that appears in both (merged AND older than 30 days) is governed by the MERGED rule only; skip it when processing STALE.
git -C /path/to/wt status --porcelain
If the command returns any output (uncommitted changes), move to the **blocked** list. If clean, keep in the merged candidate list with the worktree annotation.
**3. Present results**
Display branches in four groups:
Do NOT say "will be removed" for worktrees — removal is gated on confirmation in Step 4. If both the merged and stale candidate lists are empty, report "No branches to clean" and stop.
**4. Confirm before deletion**
Use AskUserQuestion. For merged branches that carry a worktree annotation, the confirmation option must name both the branch and its worktree path — the user is authorizing removal of both in one selection.
Structure:
The user selecting a branch-with-worktree option is explicit authorization to remove both. Never remove a worktree that was not explicitly included in a confirmed selection.
**5. Execute deletion**
Delete only what the user confirmed. For each confirmed branch:
1. If the branch has a `[worktree:/path]` annotation, remove the worktree first:
git worktree remove /path/to/wt
If the command fails (the worktree acquired changes in the window between Step 2 and now), report the error and skip that branch — do not force-remove.
2. Then delete the branch:
`-D` is required for squash/rebase-merged branches because git does not recognise their commits as merged into base — using `-d` will fail. The `[squash-merged]` annotation on a confirmed selection is explicit user authorisation to force-delete.
3. After local deletions are complete, offer remote cleanup:
Use AskUserQuestion with multiSelect:true listing every branch that was successfully deleted locally and has a known remote (`git ls-remote --heads origin <branch-name>` to verify). Let the user select which remotes to also delete. If none have a remote, skip this step.
For each selected remote:
git push origin --delete <branch-name>
Summary of actions taken:
A highly opinionated plugin marketplace for augmenting your Claude Code. Battle-tested skills and tools that actually work.
This skill should be used when the user asks about OpenClaw configuration, troubleshooting, setup, architecture, or any OpenClaw…
This skill should be used when the user asks to "create an OpenClaw skill", "make a claw skill", "build a skill for OpenClaw",…
This skill should be used when the user says "commit my changes", "commit this", "create a commit", "git commit", "save my work",…
This skill should be used when the user says "get PR comments", "show PR feedback", "what comments on my PR", "PR review…
This skill should be used when the user asks to "create a changelog", "generate a changelog", "update my changelog", "fill in the…