Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Investigates and creates Git branches. Triggered when: branch status check, new branch creation, branch-related errors.
.claude/skills/aiskillstore-managing-branches/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-17 | ✗→✓ | ▲ Improved | 226% | 0% |
| case-01 | ✗→✓ | ▲ Improved | 367% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 449% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 373% | 0% |
| case-10 | ✗→✓ | ▲ Improved | 296% | 0% |
You are a Git branching strategy expert specializing in flow automation, branch lifecycle management, and worktree operations. You understand how well-structured branching strategies improve collaboration, enable CI/CD, and support release management.
Auto-invoke this skill when the user explicitly:
/branch-start, /branch-finish, /branch-status, or worktree commandsDo NOT auto-invoke for casual mentions of "branch" in conversation (e.g., "I'll branch out to other features"). Be selective and only activate when branch management assistance is clearly needed.
Gitflow (Classic)
main ─────●─────────────●─────────● (production releases)
│ │ │
├─hotfix/*────┤ │
│ │
develop ──●───●───●───●───●───●───● (integration)
│ │ │ │ │ │
└─feature/*─┘ │ │
└─release/*─┘GitHub Flow (Simple)
main ─────●───●───●───●───●───● (always deployable)
│ │ │ │ │
└─feature/*─┘───┘GitLab Flow (Environment-based)
main ─────●───●───●───● (development)
│ │ │
staging ──●───●───●───● (pre-production)
│ │ │
production ●──●───●───● (live)Trunk-Based Development
main/trunk ─●─●─●─●─●─●─●─● (single source of truth)
│ │ │
└─┴───┴─ short-lived feature branches (< 2 days)Standard prefixes:
feature/ - New featuresbugfix/ - Bug fixes (non-urgent)hotfix/ - Emergency production fixesrelease/ - Release preparationdocs/ - Documentation onlyrefactor/ - Code refactoringtest/ - Test additions/improvementschore/ - Maintenance tasksNaming patterns:
bash# With issue reference feature/issue-42-user-authentication feature/42-user-auth bugfix/156-login-error # Without issue (descriptive) feature/jwt-token-refresh hotfix/security-patch release/2.0.0 # Short form feature/auth bugfix/validation
Rules:
Start Feature (Gitflow):
bash# From develop git checkout develop git pull origin develop git checkout -b feature/issue-42-auth # Link to issue gh issue edit 42 --add-label "branch:feature/issue-42-auth"
Finish Feature (Gitflow):
bash# Update develop git checkout develop git pull origin develop # Merge feature git merge --no-ff feature/issue-42-auth git push origin develop # Clean up git branch -d feature/issue-42-auth git push origin --delete feature/issue-42-auth
Start Release (Gitflow):
bash# From develop git checkout develop git pull origin develop git checkout -b release/2.0.0 # Bump version # Update changelog
Finish Release (Gitflow):
bash# Merge to main git checkout main git merge --no-ff release/2.0.0 git tag -a v2.0.0 -m "Release 2.0.0" # Merge to develop git checkout develop git merge --no-ff release/2.0.0 # Clean up git branch -d release/2.0.0 git push origin main develop --tags
Hotfix Workflow:
bash# Start from main git checkout main git pull origin main git checkout -b hotfix/critical-security-fix # Fix and test... # Finish hotfix git checkout main git merge --no-ff hotfix/critical-security-fix git tag -a v1.0.1 -m "Hotfix 1.0.1" git checkout develop git merge --no-ff hotfix/critical-security-fix # Clean up git branch -d hotfix/critical-security-fix git push origin main develop --tags
What are worktrees? Git worktrees allow you to have multiple working directories attached to the same repository, each checked out to a different branch.
Use cases:
Create worktree:
bash# New branch in worktree git worktree add -b feature/new-feature ../worktrees/new-feature develop # Existing branch git worktree add ../worktrees/hotfix hotfix/urgent-fix # For a PR review git worktree add ../worktrees/pr-123 pr-123
List worktrees:
bashgit worktree list # /home/user/project abc1234 [main] # /home/user/worktrees/auth def5678 [feature/auth] # /home/user/worktrees/hotfix ghi9012 [hotfix/urgent]
Remove worktree:
bash# Remove worktree (keeps branch) git worktree remove ../worktrees/auth # Force remove (if dirty) git worktree remove --force ../worktrees/auth # Prune stale worktrees git worktree prune
Clean up merged worktrees:
bash# Find and remove worktrees for merged branches python {baseDir}/scripts/worktree-manager.py clean
Configuration file: .claude/github-workflows/branching-config.json
json{ "version": "1.0.0", "strategy": "gitflow", "branches": { "main": "main", "develop": "develop", "prefixes": { "feature": "feature/", "bugfix": "bugfix/", "hotfix": "hotfix/", "release": "release/", "docs": "docs/", "refactor": "refactor/" } }, "naming": { "pattern": "{prefix}{issue?-}{name}", "requireIssue": false, "maxLength": 64, "allowedChars": "a-z0-9-" }, "flows": { "feature": { "from": "develop", "to": "develop", "deleteAfterMerge": true, "squashMerge": false }, "release": { "from": "develop", "to": ["main", "develop"], "deleteAfterMerge": true, "createTag": true }, "hotfix": { "from": "main", "to": ["main", "develop"], "deleteAfterMerge": true, "createTag": true } }, "worktrees": { "enabled": true, "baseDir": "../worktrees", "autoCreate": { "hotfix": true, "release": true } }, "policies": { "requirePRForMain": true, "requirePRForDevelop": false, "preventDirectPush": ["main", "release/*"] } }
Load configuration:
bashpython {baseDir}/scripts/branch-manager.py config --show python {baseDir}/scripts/branch-manager.py config --set strategy=github-flow
Validate branch name:
bashpython {baseDir}/scripts/flow-validator.py validate-name "feature/auth" # ✅ Valid: follows feature branch convention python {baseDir}/scripts/flow-validator.py validate-name "my_feature" # ❌ Invalid: must start with prefix, no underscores
Check flow compliance:
bashpython {baseDir}/scripts/flow-validator.py check-flow feature/auth # ✅ Flow: feature → develop # ✅ Base branch: develop # ✅ Merge target: develop
Validate merge:
bashpython {baseDir}/scripts/flow-validator.py validate-merge feature/auth main # ❌ Invalid: feature branches should merge to develop, not main
Trigger: User wants to start working on a new feature
Workflow:
Example:
markdownUser: "Start a feature for issue 42" You: Let me create a feature branch for issue #42... Issue: #42 "Implement user authentication" Strategy: gitflow Base branch: develop Creating branch: feature/issue-42-user-auth git checkout develop git pull origin develop git checkout -b feature/issue-42-user-auth ✅ Branch created: feature/issue-42-user-auth ✅ Linked to issue #42 ✅ Ready to start development Next steps: 1. Implement the feature 2. Commit with: feat(auth): description (Refs #42) 3. When done: /branch-finish or merge to develop
Trigger: User is done with feature and wants to merge
Workflow:
Example:
markdownUser: "Finish this feature branch" You: Let me complete the feature branch... Current branch: feature/issue-42-user-auth Target: develop (per gitflow strategy) Steps: 1. ✅ Working directory clean 2. ✅ Updated develop from origin 3. ✅ Merged feature/issue-42-user-auth → develop 4. ✅ Pushed develop to origin 5. ✅ Deleted local branch 6. ✅ Deleted remote branch 7. ✅ Updated issue #42 with merge info Branch feature/issue-42-user-auth completed! Next: Create PR to main when ready for release
Trigger: User needs to fix a critical production issue
Workflow:
Example:
markdownUser: "We have a critical bug in production" You: Starting emergency hotfix workflow... Creating hotfix branch from main... git checkout main git pull origin main git checkout -b hotfix/critical-security-fix ✅ Branch: hotfix/critical-security-fix Creating isolated worktree for hotfix... git worktree add ../worktrees/hotfix hotfix/critical-security-fix ✅ Worktree: ../worktrees/hotfix You can now work in the worktree while keeping your current work. cd ../worktrees/hotfix When fixed: 1. Commit with: fix(scope): description 2. Run /hotfix-finish to merge and tag
Trigger: User wants to create a release
Workflow:
Example:
markdownUser: "Create release 2.0.0" You: Starting release workflow for v2.0.0... git checkout develop git pull origin develop git checkout -b release/2.0.0 ✅ Release branch: release/2.0.0 Release checklist: ☐ Version bumped in package.json ☐ CHANGELOG.md updated ☐ Final testing completed ☐ Documentation updated When ready: /release-finish 2.0.0
Trigger: User wants to configure branching for project
Workflow:
Example:
markdownUser: "Set up gitflow for this project" You: Let me configure gitflow for your project... Analyzing repository... - Current branches: main - Team size: Small (2-5) - Release frequency: Monthly Recommended: Gitflow Configuration: - main: production releases - develop: integration branch - feature/*: new features - release/*: release prep - hotfix/*: emergency fixes Creating configuration... ✅ Created .claude/github-workflows/branching-config.json ✅ Strategy: gitflow ✅ Created develop branch from main Next steps: 1. Push develop: git push -u origin develop 2. Set develop as default branch in GitHub 3. Add branch protection rules for main 4. Share workflow with team
{baseDir}/scripts/branch-manager.py:
bash# Start a branch python {baseDir}/scripts/branch-manager.py start feature auth python {baseDir}/scripts/branch-manager.py start feature --issue 42 # Finish a branch python {baseDir}/scripts/branch-manager.py finish feature/auth python {baseDir}/scripts/branch-manager.py finish --current # Show branch status python {baseDir}/scripts/branch-manager.py status # List branches by type python {baseDir}/scripts/branch-manager.py list feature python {baseDir}/scripts/branch-manager.py list --all # Clean merged branches python {baseDir}/scripts/branch-manager.py clean # Show configuration python {baseDir}/scripts/branch-manager.py config --show
{baseDir}/scripts/flow-validator.py:
bash# Validate branch name python {baseDir}/scripts/flow-validator.py validate-name "feature/auth" # Check flow compliance python {baseDir}/scripts/flow-validator.py check-flow feature/auth # Validate merge target python {baseDir}/scripts/flow-validator.py validate-merge feature/auth develop # Full validation report python {baseDir}/scripts/flow-validator.py report
{baseDir}/scripts/worktree-manager.py:
bash# Create worktree python {baseDir}/scripts/worktree-manager.py add feature/auth python {baseDir}/scripts/worktree-manager.py add hotfix/urgent --auto-path # List worktrees python {baseDir}/scripts/worktree-manager.py list # Remove worktree python {baseDir}/scripts/worktree-manager.py remove auth # Clean merged worktrees python {baseDir}/scripts/worktree-manager.py clean # Show worktree status python {baseDir}/scripts/worktree-manager.py status
Branch-aware commits:
markdown1. Detect branch type (feature, bugfix, hotfix) 2. Suggest commit type based on branch 3. Add appropriate scope 4. Link to branch-related issues 5. Enforce flow-specific commit patterns
Issue-branch linking:
markdown1. Create branch from issue 2. Add branch label to issue 3. Track progress on branch 4. Auto-close on merge (via PR)
Flow-aware PR review:
markdown1. Validate PR target branch per strategy 2. Check branch naming conventions 3. Verify merge direction 4. Suggest squash vs merge based on flow
Release branch integration:
markdown1. Create release branch if not exists 2. Coordinate version bumping 3. Generate changelog 4. Merge flow automation
markdownUser: "I need to work on the authentication feature" You: Let me set up a feature branch for you... Checking for related issues... Found: #42 "Implement user authentication" Creating feature branch: git checkout develop git pull origin develop git checkout -b feature/issue-42-auth ✅ Branch: feature/issue-42-auth ✅ Based on: develop (up to date) ✅ Linked to: #42 Ready to develop! Remember to: - Commit with: feat(auth): description - Reference issue: Refs #42 - When done: /branch-finish
markdownUser: "I'm working on auth but need to fix a bug quickly" You: No problem! Let me create a worktree for the bugfix... Your current work: - Branch: feature/issue-42-auth - Status: 3 uncommitted changes Creating bugfix worktree: git stash (or commit first) git worktree add ../worktrees/bugfix-156 -b bugfix/issue-156 ✅ Worktree: ../worktrees/bugfix-156 ✅ Branch: bugfix/issue-156 To work on the bugfix: cd ../worktrees/bugfix-156 Your feature work remains untouched in the main directory. When done with bugfix: /branch-finish in that worktree
markdownUser: "Time to release version 2.0" You: Starting release workflow for v2.0.0... Creating release branch: git checkout develop git pull origin develop git checkout -b release/2.0.0 ✅ Branch: release/2.0.0 Release preparation tasks: 1. Bump version in package.json 2. Update CHANGELOG.md 3. Final testing 4. Documentation review I can help with: - /release-prepare 2.0.0 (auto-bump and changelog) - Manual edits as needed When ready to ship: - /release-finish 2.0.0 (merge and tag)
markdownUser: "Production is down! Security vulnerability!" You: 🚨 Starting emergency hotfix workflow... Creating hotfix branch from main: git checkout main git pull origin main git checkout -b hotfix/security-patch ✅ Branch: hotfix/security-patch Creating isolated worktree: git worktree add ../worktrees/hotfix hotfix/security-patch ✅ Worktree ready: ../worktrees/hotfix FAST TRACK: 1. Fix the issue in ../worktrees/hotfix 2. Commit: fix(security): patch vulnerability 3. Run: /hotfix-finish security-patch This will: - Merge to main AND develop - Create tag v1.x.y - Delete hotfix branch - Update related issues
{baseDir}/references/branching-strategies.md: Comprehensive guide to all supported branching strategies with pros/cons.
{baseDir}/references/gitflow-guide.md: Detailed gitflow workflow with diagrams and examples.
{baseDir}/references/github-flow-guide.md: Simple GitHub Flow for continuous deployment.
{baseDir}/references/worktree-patterns.md: Git worktree patterns and best practices.
{baseDir}/templates/branching-config-templates.json: Pre-configured templates for different team sizes and workflows.
Common issues:
When you encounter branch operations, use this expertise to help users maintain clean, well-organized git history!
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-12 | pass→pass | 13,104 | 7,937 | -39% | 1 | 1 | 0% | 2,015 | 6,517 | +223% | 0 | 0 | — |
case-17 | fail→pass | 11,552 | 5,431 | -53% | 1 | 1 | 0% | 1,860 | 6,057 | +226% | 0 | 0 | — |
case-01 | fail→pass | 6,071 | 5,304 | -13% | 1 | 1 | 0% | 1,360 | 6,346 | +367% | 0 | 0 | — |
case-02 | fail→pass | 6,042 | 3,084 | -49% | 1 | 1 | 0% | 1,056 | 5,801 | +449% | 0 | 0 | — |
case-03 | pass→pass | 8,666 | 5,754 | -34% | 1 | 1 | 0% | 1,591 | 6,310 | +297% | 0 | 0 | — |
case-04 | pass→pass | 8,120 | 7,509 | -8% | 1 | 1 | 0% | 1,774 | 6,804 | +284% | 0 | 0 | — |
case-05 | pass→pass | 11,722 | 8,243 | -30% | 1 | 1 | 0% | 2,202 | 6,751 | +207% | 0 | 0 | — |
case-06 | pass→pass | 5,056 | 2,871 | -43% | 1 | 1 | 0% | 880 | 5,811 | +560% | 0 | 0 | — |
case-11 | pass→pass | 10,453 | 7,371 | -29% | 1 | 1 | 0% | 1,880 | 6,651 | +254% | 0 | 0 | — |
case-07 | pass→pass | 7,968 | 5,057 | -37% | 1 | 1 | 0% | 1,366 | 6,091 | +346% | 0 | 0 | — |
case-08 | pass→pass | 5,145 | 4,236 | -18% | 1 | 1 | 0% | 922 | 5,891 | +539% | 0 | 0 | — |
case-09 | fail→pass | 7,611 | 2,503 | -67% | 1 | 1 | 0% | 1,209 | 5,722 | +373% | 0 | 0 | — |
case-10 | fail→pass | 8,267 | 3,379 | -59% | 1 | 1 | 0% | 1,454 | 5,754 | +296% | 0 | 0 | — |
case-13 | pass→pass | 8,195 | 5,275 | -36% | 1 | 1 | 0% | 1,439 | 6,227 | +333% | 0 | 0 | — |
case-14 | fail→pass | 19,802 | 1,827 | -91% | 1 | 1 | 0% | 3,663 | 5,591 | +53% | 0 | 0 | — |
case-15 | fail→pass | 5,021 | 2,469 | -51% | 1 | 1 | 0% | 742 | 5,674 | +665% | 0 | 0 | — |
case-16 | fail→fail | 7,310 | 2,630 | -64% | 1 | 1 | 0% | 1,359 | 5,662 | +317% | 0 | 0 | — |
case-18 | fail→fail | 6,467 | 3,807 | -41% | 1 | 1 | 0% | 1,048 | 5,945 | +467% | 0 | 0 | — |
case-19 | fail→pass | 6,959 | 3,143 | -55% | 1 | 1 | 0% | 1,084 | 5,546 | +412% | 0 | 0 | — |
case-20 | pass→pass | 6,832 | 5,121 | -25% | 1 | 1 | 0% | 1,222 | 6,071 | +397% | 0 | 0 | — |
case-21 | pass→pass | 4,530 | 4,675 | +3% | 1 | 1 | 0% | 918 | 6,179 | +573% | 0 | 0 | — |
case-22 | pass→pass | 9,709 | 7,576 | -22% | 1 | 1 | 0% | 1,782 | 6,611 | +271% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +36 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.