Create, checkout, rebase, and manage git branches following Carbon ACX naming conventions and workflows.
This skill automates git branch management for Carbon ACX by:
Trigger Patterns:
Do NOT Use When:
git.commit.smart)git.pr.create)bash - Git commandsgrep - Search branch lists, commit messagesAccess Level: 2 (Git operations - can create/delete branches)
Tool Rationale:
bash: Required for all git branch operationsgrep: Filter branch lists and search patternsExplicitly Denied:
Input:
Example:
"Create a feature branch for dark mode"
"Switch to the UX improvements branch"
"Rebase my branch on main"
"Delete merged branches"
Output:
Validation:
Required:
Optional:
Naming Convention:
<type>/<description>
Types:
feat/ or feature/ - New featuresfix/ or bugfix/ - Bug fixeschore/ - Maintenance, tooling, dependenciesdocs/ - Documentation onlyrefactor/ - Code restructuringtest/ - Test additions/updatesperf/ - Performance improvementsDescription:
Examples:
feat/dark-mode-togglefix/aviation-calculation-errorchore/update-react-dependenciesdocs/update-api-documentationrefactor/component-structureAlternative naming (also accepted):
feature/descriptionbugfix/descriptiongit branch --list "feat/dark-mode-toggle"
git branch -r --list "*/feat/dark-mode-toggle"
If exists: Ask user if they want to:
# Check if main exists
git rev-parse --verify main 2>/dev/null
# Otherwise check for master
git rev-parse --verify master 2>/dev/null
Default: main (or master if main doesn't exist)
User can override: "Create branch from develop"
git fetch origin
Ensures base branch is up-to-date
git checkout -b feat/dark-mode-toggle origin/main
Alternative (two-step):
git branch feat/dark-mode-toggle origin/main
git checkout feat/dark-mode-toggle
git status
git log -1 --oneline
Report to user:
✅ Branch created: feat/dark-mode-toggle
Base: origin/main (abc1234)
Current HEAD: abc1234 chore: prepare release v1.3.0
Status: No commits yet, ready for work
git status --porcelain
If uncommitted changes:
git stash push -m "WIP: auto-stashed by git.branch.manage"Local branches:
git branch --list "*pattern*"
Remote branches:
git branch -r --list "origin/*pattern*"
If multiple matches: Present list to user for selection
If no matches: Suggest creating new branch
Local branch:
git checkout feat/dark-mode-toggle
Remote branch (first checkout):
git checkout -b feat/dark-mode-toggle origin/feat/dark-mode-toggle
git status
Report:
✅ Switched to branch: feat/dark-mode-toggle
Tracking: origin/feat/dark-mode-toggle
Status: Up to date with remote
git rev-parse --abbrev-ref HEAD
Safety check: Never rebase main/master directly
git status --porcelain
If uncommitted: Require commit or stash first
git fetch origin
git rebase origin/main
If conflicts:
⚠️ Rebase conflict detected
Conflicting files:
- apps/carbon-acx-web/src/components/Dashboard.tsx
- package.json
Options:
1. Resolve conflicts manually
2. Abort rebase: git rebase --abort
To continue after resolving:
- git add <resolved-files>
- git rebase --continue
Do NOT auto-resolve conflicts - require human judgment
git log --oneline -5
Report:
✅ Rebase successful
Your branch has been rebased on origin/main
Previous HEAD: abc1234
New HEAD: xyz9876
Commits on this branch: 3
- feat(web): add dark mode state management
- feat(web): create theme toggle component
- test(web): add theme switching tests
⚠️ Note: Branch history has been rewritten
If already pushed, you'll need to force-push: git push --force-with-lease
# Local branches merged to main
git branch --merged main | grep -v "main\|master\|\*"
# Remote merged branches
git branch -r --merged main | grep -v "main\|master"
Show user:
Merged branches (safe to delete):
Local:
- feat/dark-mode-toggle
- fix/aviation-calculation
Remote:
- origin/chore/update-dependencies
Delete these branches? (yes/no)
Local:
git branch -d feat/dark-mode-toggle
Remote:
git push origin --delete feat/dark-mode-toggle
Report:
✅ Deleted 2 local branches
✅ Deleted 1 remote branch
Remaining branches: 5
User: "Create a branch for dark mode feature"
Claude Process:
feat/dark-mode-toggleorigin/main:git fetch origin
git checkout -b feat/dark-mode-toggle origin/main
✅ Created branch: feat/dark-mode-toggle
Base: origin/main (abc1234)
Ready to start work on dark mode feature
User: "Switch to the UX improvements branch"
Claude Process:
git branch --list "*ux*"feat/ux-improvementsgit checkout feat/ux-improvements
✅ Switched to: feat/ux-improvements
Last commit: d4e5f6g refactor(web): improve dashboard layout
Status: 2 commits ahead of origin/main
User: "Rebase my branch on main"
Claude Process:
feat/dark-mode-togglegit fetch origingit rebase origin/main
✅ Rebase successful
Your branch is now up-to-date with origin/main
3 commits rebased
User: "Update my branch from main"
Claude Process:
feat/emission-chartgit rebase origin/main⚠️ Rebase stopped due to conflicts
Conflicting files:
- apps/carbon-acx-web/src/components/Chart.tsx
(both modified)
Conflict type: Content conflict
Your changes: Added EmissionChart component
Main changes: Refactored base Chart component
Resolution needed:
1. Open Chart.tsx and resolve conflict markers
2. Keep both changes if compatible
3. After fixing:
git add Chart.tsx
git rebase --continue
To abort: git rebase --abort
User: "Delete old branches"
Claude Process:
git branch --merged main
feat/dark-mode-toggle, fix/typo-readmeMerged branches (safe to delete):
- feat/dark-mode-toggle (merged in PR #42)
- fix/typo-readme (merged in PR #38)
Delete these? (yes/no)
git branch -d feat/dark-mode-toggle fix/typo-readme
✅ Deleted 2 local branches
Remaining: 3 active branches
User: "Create a hotfix branch from v1.2.3 tag"
Claude Process:
git rev-parse v1.2.3hotfix/urgent-security-fix (ask user for description)git checkout -b hotfix/urgent-security-fix v1.2.3
✅ Created branch: hotfix/urgent-security-fix
Base: v1.2.3 (tag)
⚠️ This branch is behind main - use for hotfix only
Scope Limitations:
Known Edge Cases:
git remote prunePerformance Constraints:
Security Boundaries:
Success Metrics:
Failure Modes:
Recovery:
Composes With:
git.commit.smart - Commit work before switching branchesgit.pr.create - Create PR after branch work completegit.release.prep - Create release branchDependencies:
Alternative Skills:
git.commit.smartgit.pr.createOwner: Workspace Team (shared skill) Review Cycle: Quarterly Last Updated: 2025-10-24 Version: 1.0.0
Maintenance Notes: