skills/using-git-branches/SKILL.md
Use when starting feature work that needs git isolation or before writing committed spec, plan, or code artifacts
npx skillsauth add BubbleBuffer/superpawers using-git-branchesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Create ordinary git branches in the current checkout for isolated feature work.
Core principle: Clean baseline + normal branch = trackable, understandable isolation.
Announce at start: "I'm using the using-git-branches skill to set up an isolated git branch."
git branch --show-current
git status --short
If the working tree is dirty, classify the changes before branching:
| Dirty state | Action | |-------------|--------| | User changes related to this feature | Ask whether to carry them onto the new branch | | Unrelated user changes | Stop and ask how to handle them | | Generated or dependency noise | Ask before cleaning or committing | | Clean | Continue |
Never stash, reset, checkout, or delete user changes without explicit approval.
Prefer the user's stated base branch. If none was given:
git merge-base HEAD main 2>/dev/null && echo main || echo master
Ask if ambiguous, if the current branch is not main/master, or if the feature depends on unmerged work:
Which branch should this feature start from?
1. Current branch (<current-branch>)
2. main
3. master
4. Other (specify)
Use a descriptive branch name such as feature/<name> or fix/<name>:
git switch -c feature/<name>
If already on the correct branch, do not create another one. Report that the branch is already isolated and continue to baseline verification.
Run the project-appropriate baseline command before producing committed artifacts:
npm test
cargo test
pytest
go test ./...
If dependencies are missing, run the project's normal install command first. Do not run package installs just because a new branch was created.
If tests fail: Report failures and ask whether to investigate or proceed with a known-bad baseline.
If tests pass: Report ready.
Branch ready: <branch-name>
Base branch: <base-branch>
Working tree: clean
Baseline: <command> passed (<summary>)
Ready to implement <feature-name>
| Situation | Action |
|-----------|--------|
| On main/master and clean | git switch -c feature/<name> |
| On a prerequisite branch | Ask whether to branch from current branch |
| Dirty unrelated changes | Stop and ask |
| Already on correct feature branch | Verify baseline, do not create another branch |
| Tests fail during baseline | Report failures and ask |
In those cases, verify the baseline instead of creating a new branch.
git status --short and ask before moving, stashing, deleting, or committing existing changes.Never:
main/master without explicit user consentAlways:
Use after:
Prerequisite for:
Pairs with:
data-ai
Use when a request involves multiple steps or files, or when an approved design must be turned into a detailed implementation plan
development
Use when deciding which SuperPawers skill should govern a new task or workflow step, before taking any other action
development
Use when a task list exists or is being created for multi-step implementation work, whether from a formal plan or an ad-hoc breakdown
development
Use when implementation is complete and you need to handle branch completion - merge, PR, keep, or discard