Skip to content
Skills Library
Programming · Automation

dev-cleanup

/dev-cleanup

Use to tidy a repo. Triggers include "cleanup", "clean up", "update", "tidy worktrees", "sync main". Updates the default branch and removes worktrees and local branches that are fully merged. Asks no questions and only makes safe deletions.

Licence
MIT
Last repository change
10.11.2026

Assessment and security

90/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content25 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 10.11.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Use to tidy a repo. Triggers include "cleanup", "clean up", "update", "tidy worktrees", "sync main". Updates the default branch and removes worktrees and local branches that are fully merged. Asks no questions and only makes safe deletions.

Triggers from the description

cleanupclean upupdatetidy worktreessync main
Original author description

Use to tidy a repo. Triggers include "cleanup", "clean up", "update", "tidy worktrees", "sync main". Updates the default branch and removes worktrees and local branches that are fully merged. Asks no questions and only makes safe deletions.

How it works

  1. Merged means
  2. Steps
Original SKILL.md headings · 40 lines, 304 words
SKILL.md preview
---
name: dev-cleanup
description: Use to tidy a repo. Triggers include "cleanup", "clean up", "update", "tidy worktrees", "sync main". Updates the default branch and removes worktrees and local branches that are fully merged. Asks no questions and only makes safe deletions.
metadata:
  version: "0.1.0"
---

# dev-cleanup — Sync Main, Remove Merged Work

Before anything else, follow `../_shared/update-check.md`.

No questions. Safe deletions only. Never delete remote branches, never touch dirty
worktrees or unmerged branches.

## Merged means

Either of:
- the branch tip is an ancestor of `origin/<default-branch>`
  (`git merge-base --is-ancestor <branch> origin/<default-branch>`) and is not equal to it
  (a brand-new branch sitting at the default tip is fresh work, not merged), or
- a merged GitHub PR has a head SHA equal to the branch tip. This covers squash merges:
  `gh pr list --state merged --head <branch> --json headRefOid`.

Local-only branch (never pushed, no merged PR):
- tip equals `origin/<default-branch>`: fresh work, keep the branch and its worktree.
- tip is a strict ancestor of `origin/<default-branch>`: nothing to lose. Delete the
  branch, and remove its worktree too if clean, even though it was never pushed.
- otherwise: keep and report.

## Steps

1. Go to the primary checkout (the first entry of `git worktree list`).
2. `git fetch origin --prune`.
3. Update the default branch:
   - Primary checkout clean and on it: `git pull --ff-only origin <default>`.
   - Not checked out there: `git fetch origin <default>:<default>`.
   - Otherwise (dirty, or on another branch with a conflict): leave it and report.
4. `git worktree prune`.
5. For each linked worktree except the one this session started in (keep it, report as
   kept): remove it (`git worktree remove <path>`) only if it is clean and its branch is merged
   (per Merged means, including the local-only strict-ancestor case).
6. For each local non-default branch: `git branch -d <branch>` if merged. If it is merged
   only by the PR SHA match (so `-d` refuses), `git branch -D <branch>` is allowed, because
   the SHA match verified it. Never force otherwise.
7. Report: removed, kept with the reason for each, and `main at <sha>`.

Versions

The database has no other skills named dev-cleanup.

Database snapshot: 13.11.2026 · package version e0b50476a0ef (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100cleanup-work
    Clean up worktrees and local and remote branches whose PRs have merged. Use after a PR merges, or when the user asks to tidy up branches/worktrees. `/cleanup-work` with no argument sweeps all of the user's prefixed worktrees and branches; pass a branch or worktree name to target one.
  • 100cleanup-git
    Remove merged local branches and stale git worktrees. Use when the user says "cleanup branches", "prune worktrees", "tidy git", "remove merged branches", "delete merged branches", "gone branches", or wants to clean local git state. NOT for creating commits, creating worktrees,…
  • 90ai-git-cleanup
    Removes finished local git work in one automatic pass, with no question and no name to type: dead worktrees first (`git worktree remove`, then `git worktree prune`), then branches already merged into the local `main`, then the branches a squash-merged pull request left behind…
  • 95triage-repo-cleanup
    Triage and clean up a repo's leftovers — stale git worktrees, merged and abandoned local branches, stale remote-tracking refs, and old stashes — by classifying each one by whether deleting it would destroy work. Triggers on: clean up my branches, clean up leftover worktrees,…
  • 100repo-cleanup
    Manually invoke repo-cleanup to tidy a local Git repository: remove branches fully merged into main and their clean worktrees, inspect working directories, propose atomic commits, and review Git stash and IntelliJ IDEA shelves. Run only when the user explicitly invokes this…
  • 100branch-cleanup
    Prune stale git branches after a merge wave: delete closed/merged remote branches, remove local tracking branches that no longer exist on the remote, and optionally clean up local branches already merged to main. Use after running dependabot-triage, after a sprint wind-down, or…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.