branch-preflight
БесплатноБез исполняемых скриптовНе проверенSanity-check the working tree before starting plan execution or new branch work. Catches inherited damage that silently breaks verification later — merge…
от vscarpenter★ 41 звезда на GitHubОб этом скилле
branch-preflight — Catch inherited working-tree damage early
When to invoke
Trigger this skill BEFORE any of:
- Starting plan execution (
superpowers:executing-plans,superpowers:subagent-driven-development) - Creating a new feature branch off
main(git switch -c feat/...) - Investigating a verification failure on files you do not recognize as yours
You should also volunteer to run it if the user mentions:
- "let's start implementing"
- "execute the plan"
- "kick off the work"
Why it exists
Damage inherited from main (conflict markers committed to a tracked file, a forgotten autostash, stray uncommitted edits) surfaces later as an unrelated parse or test failure partway through a plan, forcing an out-of-plan fix. This script catches that class of damage in under a second, before any plan step depends on a clean tree.
What it checks
- Merge conflict markers in tracked files. Greps
git ls-filesfor<<<<<<<,=======, or>>>>>>>line prefixes. Tracked-files-only avoids false positives on.Codex/scratch notes. - Stash entries. A non-empty
git stash listis a yellow flag — most users don't realize an autostash is sitting there. - Uncommitted changes. Surfaces both unstaged (
git diff) and staged (git diff --cached) work.
How to use
Just run it:
bash scripts/branch-preflight.sh
Exit code:
0— clean, safe to proceed1— at least one finding; review the output before starting
What to do with findings
| Finding | Suggested action |
|---|---|
| Merge conflict markers | Resolve them in a separate fix(...) commit on the current branch BEFORE starting plan execution. Do not stack feature work on top of broken files. |
| Stash entries | Run git stash list to inspect. If it's stale or unrelated, drop it (git stash drop). If it's intentional in-progress work, acknowledge and proceed. |
| Uncommitted changes | Either commit them, stash them deliberately, or revert. Don't start a plan with mystery diff in the working tree. |
Out of scope
This script does NOT check:
- Whether the branch is up to date with
main(usegit fetch && git status) - Whether dependencies are installed (use
bun install) - Whether tests currently pass (use
bun run test) - Whether CI is green for the branch (use
gh pr checks)
These are different problems with different feedback loops. This skill is the cheapest possible "is the working tree sane?" check.
Gotchas
- The merge-marker grep uses
^<<<<<<</^>>>>>>>/^={7}$regex anchored at line start, so it won't false-positive on documentation that mentions conflict markers in prose. - The stash check counts ALL stash entries, including ones from other tools (autostash from
git pull --rebase, IDE auto-stashes). It's a yellow flag, not a red one — the script exits non-zero but the message says "acknowledge before starting", not "fix immediately".
Установить branch-preflight в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл branch-preflight?
Sanity-check the working tree before starting plan execution or new branch work. Catches inherited damage that silently breaks verification later — merge conflict markers committed to tracked files, outstanding stash entries that may bleed into your work, uncommitted changes you may not realize you have. Runs in ~1 second. Trigger BEFORE invoking superpowers:executing-plans or superpowers:subagent-driven-development, BEFORE creating a new feature branch off main, or when verification mysteriously fails on files you did not touch.
Как установить скилл branch-preflight?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл branch-preflight запускает скрипты?
Нет, скилл состоит только из инструкций (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