feature
Skill8 starsChanged 7 days agoMITView on GitHub
Start a new branch safely from main. Handles uncommitted changes, stashing, unfinished merges, and branch naming conventions automatically.
- Deletes or force-pushes
71 other projects use a version of this.
Adopted by
Most recently taken up by
- paulocsb/worldcup-fifa-pooltheir own version, first seen Nov 8, 2026
- vocion/vocion-coretheir own version, first seen Nov 8, 2026
- jisuzzzz/haechitheir own version, first seen Nov 8, 2026
- yicheng47/runnertheir own version, first seen Nov 7, 2026
- crbnos/carbontheir own version, first seen Nov 7, 2026
- hex/claude-sessionstheir own version, first seen Nov 3, 2026
Used with
Projects with it also use bug, bugfix and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
paulocsbSkillbug
Investigation playbook for fixing a bug. Walks through 5 phases: reproduce → isolate → root cause → propose fix → validate. Forces concrete reasoning with code reads, log inspection, and git blame instead of pattern-matching guesses. Use for any non-trivial defect.
Also in 8 projects that use this
team-attentionSkillbugfix
Root cause based one-shot bug fix. debugger diagnosis → requirements.md generation → /execute. /bugfix "error description" Full investigation pipeline: debugger + gap-analyzer + standard verify. QA suggestion after successful fix.
Also in 7 projects that use this
codebycoreySkilladopt
Adopt an existing plan from conversation context into delta-spec format. Use when importing a plan, adopting planning that already happened, capturing plan mode output, or bringing in prior design work.
Also in 4 projects that use this
Google CloudSkillfix
Plan a remediation strategy after a test failure.
Also in 10 projects that use this
marylinSkillrecover
Recover work from a crashed or interrupted session. Use when Claude crashed mid-task, after an unexpected exit, when you see 'stale sessions detected', or when you lost context and need to figure out what was happening.
Also in 3 projects that use this
aegiswizardSkillcontext
Also in 4 projects that use this
Other versions71 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 71
- crbnos/carbon★ 2.8ksame name
- aaronjmars/aeon★ 789same name
- aeonfun/aeon★ 789same name
- astashov/liftosaur★ 775same name
- me2resh/apexyard★ 542same name
- yicheng47/runner★ 490same name
- bradtraversy/coding-with-ai-course-resources★ 344same name
- garagon/nanostack★ 206same name
- DeL-TaiseiOzaki/claude-code-orchestra★ 199same name
- vide/matedroid★ 86same name
61 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository20 other files it gives its agents.
- AGENTS.mdAGENTS.md
- app/AGENTS.mdAGENTS.md
- backend/AGENTS.mdAGENTS.md
- desktop/AGENTS.mdAGENTS.md
- site/AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- .cursor/rules/landing-pages.mdcCursor rule
- site/llms.txtllms.txt
- add-blog-postSkill
- add-changelog-entrySkill
- add-connectorSkill
- component-previewSkill
- launch-readiness-auditSkill
- mosaic-panelSkill
- new-pageSkill
- prioritizeSkill
- security-auditSkill
- session-auditSkill
- working-backwardsSkill
- duct-sprint-refreshSkill
The file
We split this skill into the rules it gives an agent
10 rules. 0 are common, 6 are distinctive, and 4 are very specific to this project.
0
Common
Most of the 65 edited versions we read keep these.
6
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
If no argument was provided, ask the user:
- Distinctive: line 19
Run these commands to understand current state:
- Distinctive: line 72
Remove special characters (keep letters, numbers, hyphens)
- Distinctive: line 111
If branch has unpushed commits: Do NOT offer to delete.
- Very specific: line 112
If branch is fully pushed (or remote doesn't exist): Ask user "You're currently on {previous-branch}.
- Very specific: line 127
If deleted: "Created {prefix}/{branch-name} from latest main.
- Very specific: line 128
If preserved (unpushed): "Created {prefix}/{branch-name} from latest main.
- Very specific: line 129
If preserved (user choice): "Created {prefix}/{branch-name} from latest main.
- Distinctive: line 143
If changes were stashed in Step 3:
- Distinctive: line 149
If stash pop fails due to conflicts:
“Common” is measured: kept by at least 6 in 10 of the 65 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Start New Branch
Safely creates a new branch from main, handling all edge cases automatically. Uses proper branch naming conventions based on the type of work.
Step 1: Get Work Description
If no argument was provided, ask the user:
- "What are you working on? (e.g., 'add user authentication', 'fix login bug', 'update docs')"
Step 2: Check Git State
Run these commands to understand current state:
git status
git branch --show-current
git fetch origin main
git rev-list --count origin/main..HEAD 2>/dev/null || echo "0"Check for:
- Unfinished merge: Look for "You have unmerged paths" or check if
.git/MERGE_HEADexists - Unfinished rebase: Check if
.git/rebase-mergeor.git/rebase-applyexists - Uncommitted changes: Look for "Changes not staged" or "Changes to be committed"
- Current branch name
- Commits ahead of origin/main (the count from rev-list)
Step 3: Handle Edge Cases (All Automatic)
If unfinished merge detected:
git merge --abortTell user: "Aborted unfinished merge to start fresh."
If unfinished rebase detected:
git rebase --abortTell user: "Aborted unfinished rebase to start fresh."
If uncommitted changes exist:
git stash push -m "WIP: before {prefix}/{branch-name}"Remember to restore these at the end. Tell user: "Stashed your uncommitted changes."
Step 4: Determine Branch Type and Generate Name
First, determine the branch type based on keywords in the description:
| Keywords | Branch Prefix |
| fix, bug, issue, error, broken, crash, patch | bugfix/ |
| hotfix, urgent, critical, emergency | hotfix/ |
| docs, documentation, readme, comment | docs/ |
| refactor, cleanup, restructure, reorganize | refactor/ |
| test, testing, spec, coverage | test/ |
| chore, config, ci, build, dependency, deps | chore/ |
| (default - new functionality) | feat/ |
Then convert the description to a branch name:
- Lowercase everything
- Replace spaces with hyphens
- Remove special characters (keep letters, numbers, hyphens)
- Apply the appropriate prefix
Examples:
- "add user authentication" →
feat/add-user-authentication - "fix the login bug" →
bugfix/fix-the-login-bug - "hotfix payment crash" →
hotfix/payment-crash - "update API docs" →
docs/update-api-docs - "refactor database layer" →
refactor/database-layer - "add unit tests for auth" →
test/add-unit-tests-for-auth - "update CI pipeline" →
chore/update-ci-pipeline
Step 5: Create Branch Based on Situation
Situation A: On main with commits ahead of origin/main
This means user accidentally committed to main. Move those commits to the new branch:
# Create branch from current HEAD (keeps the commits)
git checkout -b {prefix}/{branch-name}
# Now reset main back to origin/main so it's clean
git checkout main
git reset --hard origin/main
# Switch back to the feature branch
git checkout {prefix}/{branch-name}Tell user: "Moved your commits from main to {prefix}/{branch-name}. Main is now clean."
Situation B: On a different branch (not main)
First, check if the previous branch has unpushed commits:
git log origin/{previous-branch}..HEAD --oneline 2>/dev/null | wc -l- If branch has unpushed commits: Do NOT offer to delete. Inform user the branch is preserved.
- If branch is fully pushed (or remote doesn't exist): Ask user "You're currently on
{previous-branch}. Do you want to delete this branch after switching? (y/n)"
# Switch to main and pull latest
git checkout main
git pull origin main
# Create the new branch
git checkout -b {prefix}/{branch-name}
# If user chose to delete AND branch had no unpushed commits
git branch -D {previous-branch}Tell user:
- If deleted: "Created
{prefix}/{branch-name}from latest main. Deleted{previous-branch}." - If preserved (unpushed): "Created
{prefix}/{branch-name}from latest main. Preserved{previous-branch}(has unpushed commits)." - If preserved (user choice): "Created
{prefix}/{branch-name}from latest main. (You were on{previous-branch})."
Situation C: On main, clean and up-to-date
git checkout main
git pull origin main
git checkout -b {prefix}/{branch-name}Tell user: "Created {prefix}/{branch-name} from latest main."
Step 6: Restore Stashed Changes
If changes were stashed in Step 3:
git stash popTell user: "Restored your uncommitted changes."
If stash pop fails due to conflicts:
git stash show -pTell user: "Your stashed changes had conflicts. Run git stash show -p to see them, then git stash drop after manually applying."
Step 7: Confirm Success
Run and display:
git status
git log --oneline -3Summary for user:
- Created branch
{prefix}/{branch-name} - [If applicable] Moved commits from main
- [If applicable] Restored uncommitted changes
- [If applicable] Aborted unfinished merge/rebase
- Ready to start working!
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

