git-cleanup
БесплатноБез исполняемых скриптовНе проверенUse when a git worktree is dirty or another local branch or worktree exists. Ask before cleanup unless the session is unattended.
от iTestFlow★ 32 звезды на GitHubОб этом скилле
Git cleanup
One checkout on the configured default branch. HEAD equals that remote tip. git status is clean.
When
The worktree is dirty, or another local branch or linked worktree exists.
Attended: ask first, and explain this procedure before changing anything. Unattended: decide and run it.
Procedure
Name the configured default branch from the remote HEAD or the selected profile. Do not hardcode a repository branch name. This is the repository-scope recipe in cleanup-scopes. Do not fork a second policy.
- Fetch and prune the configured upstream. Inventory dirty and untracked paths, extra local branches, linked worktrees, locks, and unique commits before mutation.
- Classify each dirty or untracked path as land (commit, push, pull request, merge), delete, or gitignore. Halt on a locked or concurrently owned worktree.
- Check out the configured default branch in the primary checkout and fast-forward it so
HEADequals the remote tip andgit statusis clean. - Remove extra linked worktrees only after that classification, and only when they are clean, unlocked, and not concurrently owned. Then remove a recreated local branch only when
git branch -r --containsshows that exact tip on an origin ref. Also remove extra local branches that are fully merged into the remote tip, or whose unique commits were explicitly authorized for discard. - Check out the configured default branch and fast-forward it. Write the verification transcript in the same process, after that fast-forward. Do not check out another branch afterward.
Done
One checkout, only the configured default branch, HEAD equals that remote tip, and git status is clean.
Limits
Do not stash. Do not reset --hard. Do not force-push. Do not use --force-with-lease. Do not delete remote branches. Do not rewrite remote history. Do not discard unique commits without explicit authorization. Do not commit generated plugin directories.
Установить git-cleanup в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл git-cleanup?
Use when a git worktree is dirty or another local branch or worktree exists. Ask before cleanup unless the session is unattended.
Как установить скилл git-cleanup?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл git-cleanup запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic