From claude-dotfiles
Git branching strategies and workflows. Use when setting up a project's branching model, discussing Git workflow, or deciding between trunk-based and Git Flow approaches.
How this skill is triggered — by the user, by Claude, or both
Slash command
/claude-dotfiles:branch-strategyThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Choose and implement the right Git branching strategy.
Choose and implement the right Git branching strategy.
| Strategy | Best For | Team Size | Release Frequency |
|---|---|---|---|
| Trunk-Based | Continuous deployment | Any | Daily/Hourly |
| GitHub Flow | Web apps, SaaS | Small-Medium | Daily/Weekly |
| Git Flow | Versioned releases | Medium-Large | Scheduled |
main ─────●─────●─────●─────●─────●─────●───→
│ │ │ │ │
└─●───┘ └─────●─────┘ └─●
(short-lived feature branches)
main or trunk)# Start feature
git checkout main
git pull
git checkout -b feat/add-login
# Work in small increments
git commit -m "feat: add login form"
git push -u origin feat/add-login
# Create PR same day
gh pr create --title "feat: add login form"
# Merge quickly (after review)
gh pr merge --squash
main ─────●─────────────●─────────────●───→
│ │ │
└──●──●──●────┘ │
feature/login │
└──●──●──●────┘
feature/dashboard
main is always deployablemain after merge# Start feature
git checkout main
git pull
git checkout -b feature/user-dashboard
# Develop with multiple commits
git commit -m "feat: add dashboard layout"
git commit -m "feat: add metrics widgets"
git commit -m "test: add dashboard tests"
git push -u origin feature/user-dashboard
# Create PR
gh pr create --title "feat: add user dashboard"
# After review, merge
gh pr merge --squash
# Deploy main
feature/description # New features
fix/description # Bug fixes
docs/description # Documentation
refactor/description # Refactoring
test/description # Test additions
main ─────●───────────────────●───────→
│ │
develop ──●───●───●───●───●───●───●───●───→
│ │ │ │
└─●─●───┘ │ │
feature/a │ │
└─●─●───┘
release/1.0
| Branch | Purpose | Lifetime |
|---|---|---|
main | Production code | Permanent |
develop | Integration branch | Permanent |
feature/* | New features | Temporary |
release/* | Release preparation | Temporary |
hotfix/* | Production fixes | Temporary |
# Start feature
git checkout develop
git checkout -b feature/payment-system
# Develop
git commit -m "feat: add payment form"
git push -u origin feature/payment-system
# Merge to develop (via PR)
gh pr create --base develop
# Start release
git checkout develop
git checkout -b release/1.0.0
# Finalize release
git checkout main
git merge release/1.0.0
git tag v1.0.0
git checkout develop
git merge release/1.0.0
# Hotfix
git checkout main
git checkout -b hotfix/security-patch
# ... fix ...
git checkout main
git merge hotfix/security-patch
git tag v1.0.1
git checkout develop
git merge hotfix/security-patch
<type>/<ticket>-<description>
feature/AUTH-123-oauth-login
fix/BUG-456-cart-calculation
hotfix/SEC-789-xss-vulnerability
release/1.2.0
docs/update-api-reference
main → Production
staging → Staging environment
develop → Development environment
feature/* → develop → staging → main
↓ ↓ ↓
Dev Stage Prod
# Deploy on merge to specific branches
on:
push:
branches:
- main # Deploy to production
- staging # Deploy to staging
- develop # Deploy to development
gh pr merge --squash
gh pr merge --merge
gh pr merge --rebase
# main branch
- Require PR reviews: 1-2 reviewers
- Require status checks: CI must pass
- Require up-to-date branch
- No force pushes
- No deletions
# develop branch
- Require PR reviews: 1 reviewer
- Require status checks: CI must pass
develop branchmainmain branchChoose Trunk-Based if:
Choose GitHub Flow if:
Choose Git Flow if:
npx claudepluginhub peopleforrester/claude-dotfilesGuides collaborative design exploration before implementation: explores context, asks clarifying questions, proposes approaches, and writes a design doc for user approval.
Creates structured, bite-sized implementation plans from specs or requirements before writing code. Useful for breaking down multi-step tasks into testable steps with file structure and task boundaries.
Resolves in-progress git merge or rebase conflicts by analyzing history, understanding intent, and preserving both changes where possible. Runs automated checks after resolution.