ClaudeForge uses a Standard Branching Strategy with protected branches and automated quality gates.
feature/*, fix/*, hotfix/* → dev → main
↓ ↓ ↓
Development Testing Production
Three permanent branches:
main- Production-ready code, always deployabledev- Integration branch for features- (temporary) - Feature, fix, and hotfix branches
Branch protection:
- ✅ No direct commits to main or dev
- ✅ All changes via pull requests
- ✅ Automated quality gates required
- ✅ Conventional Commits enforced
- ✅ Linear history (squash merges)
Purpose: Production-ready releases only
Protection Rules:
- ✅ Require pull request before merging
- ✅ Require status checks to pass:
quality-gates,production-build - ✅ Require linear history (squash merges only)
- ✅ No force pushes
- ✅ No deletions
- ✅ Require review from CODEOWNERS
Who can merge:
- Only
dev,release/*, ordependabot/*branches - After passing dev-to-main.yml workflow
Triggers:
- dev-to-main.yml workflow on PR
- release.yml workflow for GitHub releases
Typical state:
- Always matches latest GitHub release
- Only updated when releasing new version
- Every commit corresponds to a version tag (v1.0.0, v1.1.0, etc.)
Purpose: Integration branch for all features
Protection Rules:
- ✅ Require pull request before merging
- ✅ Require status checks to pass:
quality-gates,validate-pr - ✅ Require linear history (squash merges only)
- ✅ No force pushes
- ✅ No deletions
Who can merge:
- Feature branches (
feature/*) - Fix branches (
fix/*) - Hotfix branches (
hotfix/*) - Test branches (
test/*) - Refactor branches (
refactor/*) - Docs branches (
docs/*)
Triggers:
- pr-into-dev.yml workflow on PR
Typical state:
- Contains completed features awaiting release
- Ahead of main by several commits
- Reset to main only after release (via merge)
Naming Convention: feature/<description>
Purpose: New features or enhancements
Examples:
feature/add-rust-templatesfeature/vscode-extensionfeature/ai-suggestions
Lifecycle:
- Create from latest
dev:git checkout dev && git pull && git checkout -b feature/my-feature - Make changes, commit with Conventional Commits
- Push to origin:
git push -u origin feature/my-feature - Create PR to
dev - Pass quality gates and code review
- Squash merge to
dev - Delete feature branch
PR Requirements:
- ✅ Title must follow Conventional Commits:
feat(scope): description - ✅ At least one linked issue (recommended)
- ✅ All quality gates pass
- ✅ Code review approved (if CODEOWNERS configured)
Naming Convention: fix/<description>
Purpose: Bug fixes
Examples:
fix/installer-windows-pathfix/python-syntax-validationfix/broken-markdown-links
Lifecycle: Same as feature branches, but:
- PR title prefix:
fix(scope): description - Link to bug issue with
Fixes #123orCloses #123
PR Requirements:
- ✅ Title:
fix(scope): description - ✅ Linked to bug issue
- ✅ Quality gates pass
- ✅ Test fix if applicable
Naming Convention: hotfix/<description>
Purpose: Urgent fixes for production issues
Examples:
hotfix/critical-installer-bughotfix/security-patch
Lifecycle:
- Create from
dev:git checkout dev && git pull && git checkout -b hotfix/issue-name - Make minimal fix
- Create PR to
dev - After merge to dev, immediately create PR dev → main
- Fast-track review and merge
PR Requirements:
- ✅ Title:
fix(scope): descriptionorhotfix(scope): description - ✅ Link to critical issue
- ✅ Quality gates pass (can be expedited)
- ✅ Fast-track review
Special considerations:
- Prioritize speed over perfection
- Minimal changes only
- Document reason for hotfix in PR description
Naming Convention: test/<description>
Purpose: Testing experiments or validations
Examples:
test/new-quality-gatetest/workflow-validation
Lifecycle:
- Same as feature branches
- PR title:
test(scope): description - May not require linked issue
Naming Convention: refactor/<description>
Purpose: Code improvements without changing functionality
Examples:
refactor/simplify-analyzerrefactor/improve-error-handling
Lifecycle:
- Same as feature branches
- PR title:
refactor(scope): description - Should not change external behavior
Naming Convention: docs/<description>
Purpose: Documentation-only changes
Examples:
docs/update-installation-guidedocs/add-troubleshooting-section
Lifecycle:
- Same as feature branches
- PR title:
docs: descriptionordocs(scope): description - Can skip some quality gates (Python, Bash)
Developer's machine:
git checkout dev
git pull origin dev
git checkout -b feature/add-templates
# Make changes
git add .
git commit -m "feat(skill): add Rust template support"
git push -u origin feature/add-templates
GitHub:
Create PR: feature/add-templates → dev
↓
pr-into-dev.yml runs:
├─ Branch name validation ✅
├─ PR title validation ✅
├─ Linked issue check ⚠️
├─ Quality gates ✅
└─ Ready for review
Code review + approval
↓
Squash and merge to dev
↓
Delete feature branch
Dev branch ready for release:
├─ All features merged
├─ CHANGELOG.md updated
└─ Version bumped
GitHub:
Create PR: dev → main
↓
dev-to-main.yml runs:
├─ Source branch validation ✅ (dev allowed)
├─ CHANGELOG.md check ✅
├─ Version consistency ✅
├─ Quality gates ✅
├─ Production build validation ✅
└─ Ready for production
Approval + merge to main
↓
Run release.yml workflow:
├─ Input version: 1.1.0
├─ Validate version format ✅
├─ Extract CHANGELOG notes ✅
├─ Create GitHub release ✅
└─ Tag created: v1.1.0
Result:
├─ main branch updated
├─ GitHub release published
├─ Installable via one-line command
└─ Ready for announcements
Critical production bug discovered:
Developer's machine:
git checkout dev
git pull origin dev
git checkout -b hotfix/critical-installer-bug
# Make minimal fix
git commit -m "fix(installer): resolve critical Windows path issue"
git push -u origin hotfix/critical-installer-bug
GitHub:
Create PR: hotfix/critical-installer-bug → dev
↓
pr-into-dev.yml runs (expedited review)
↓
Merge to dev
↓
Immediately create PR: dev → main
↓
dev-to-main.yml runs (fast-track)
↓
Merge to main
↓
Create hotfix release: v1.0.1
- Go to Settings → Branches → Add rule
- Branch name pattern:
main - Enable:
- ✅ Require a pull request before merging
- ✅ Require approvals: 1 (if team)
- ✅ Dismiss stale reviews
- ✅ Require review from Code Owners
- ✅ Require status checks to pass before merging
- ✅ Require branches to be up to date
- Add required checks:
quality-gatesproduction-buildvalidate-release-pr
- ✅ Require conversation resolution before merging
- ✅ Require linear history
- ✅ Do not allow bypassing the above settings
- ✅ Require a pull request before merging
- Under "Rules applied to everyone including administrators":
- ✅ Restrict deletions
- ✅ Block force pushes
- Save changes
- Go to Settings → Branches → Add rule
- Branch name pattern:
dev - Enable:
- ✅ Require a pull request before merging
- Require approvals: 0 (can be 1 if team)
- ✅ Require status checks to pass before merging
- Add required checks:
quality-gatesvalidate-pr
- Add required checks:
- ✅ Require linear history
- ✅ Do not allow bypassing the above settings
- ✅ Require a pull request before merging
- Under "Rules applied to everyone including administrators":
- ✅ Restrict deletions
- ✅ Block force pushes
- Save changes
ClaudeForge uses Conventional Commits format.
<type>(<scope>): <subject>
<body>
<footer>
feat- New featurefix- Bug fixdocs- Documentation onlystyle- Code style (formatting, semicolons)refactor- Code change (neither fix nor feature)perf- Performance improvementtest- Add/update testsbuild- Build system or dependenciesci- CI/CD configurationchore- Other changes (no src/test changes)revert- Revert previous commit
installer- Installation scriptsskill- Python skill modulescommand- Slash commandsagent- Guardian agentdocs- Documentationci- CI/CD workflowsworkflows- GitHub Actions
- Use imperative mood: "add" not "added" or "adds"
- Don't capitalize first letter
- No period at the end
- Maximum 50 characters
- Explain what and why vs. how
- Wrap at 72 characters
- Separate from subject with blank line
- Reference issues:
Closes #123,Fixes #456 - Breaking changes:
BREAKING CHANGE: description
Good:
feat(installer): add Windows PowerShell support
Add install.ps1 script for Windows users with equivalent
functionality to install.sh bash script.
Closes #42
Good:
fix(skill): correct template selection logic
Fix bug where wrong template was selected for TypeScript
projects. The analyzer was not correctly detecting tsconfig.json.
Fixes #156
Good:
docs: update installation troubleshooting guide
Add common installation issues based on user feedback
from issues #78, #82, and #91.
Bad:
Added new feature
- Missing type and scope
- Wrong tense (should be "add")
- Vague subject
Bad:
fix: Fixed the bug
- Capitalized subject
- Unnecessary word "the"
- No details on what bug
PR titles MUST follow Conventional Commits format.
Valid examples:
feat(installer): add Windows PowerShell supportfix(skill): correct Python syntax validationdocs: update installation guiderefactor(analyzer): simplify project detectionci: add Python dependency updates to dependabot
Invalid examples:
Add new feature❌ Missing type/scopeFixed bug❌ Wrong tense, no scopeUpdate docs❌ Missing colonFEAT: Add feature❌ Uppercase typefeat: Add feature.❌ Period at end
Validation:
- pr-into-dev.yml workflow validates PR title format
- Fails if format is incorrect
- Auto-comments with fix instructions
ClaudeForge uses Squash and Merge exclusively.
✅ Linear history - Easy to understand and navigate ✅ Clean log - One commit per feature/fix ✅ Easy revert - Revert entire feature with one command ✅ Better releases - Clear association between features and versions
When merging PR with multiple commits:
Before merge (feature branch):
feat: add template A
fix: correct typo
feat: add template B
refactor: simplify code
test: add unit tests
After merge (dev branch):
feat(skill): add Rust templates (#42)
- Add Rust template A
- Add Rust template B
- Simplify template selection
- Add unit tests
Co-authored-by: Developer <dev@example.com>
Automatically generated:
- Title: From PR title (Conventional Commits format)
- Body: From PR description
- Footer: PR number, co-authors
# Update dev
git checkout dev
git pull origin dev
# Create feature branch
git checkout -b feature/my-feature
# Make changes and commit
git add .
git commit -m "feat(scope): add feature"
# Push to GitHub
git push -u origin feature/my-feature# While on feature branch
git checkout dev
git pull origin dev
git checkout feature/my-feature
git rebase dev
# If conflicts, resolve and continue
git rebase --continue
# Force push (rebase rewrites history)
git push --force-with-lease origin feature/my-feature# Add upstream remote (once)
git remote add upstream https://github.com/alirezarezvani/ClaudeForge.git
# Update from upstream
git fetch upstream
git checkout dev
git merge upstream/dev
git push origin dev# Rename current branch
git branch -m new-branch-name
# Push with new name
git push -u origin new-branch-name
# Delete old branch on remote
git push origin --delete old-branch-name# Delete local branch after merge
git branch -d feature/my-feature
# Delete remote branch
git push origin --delete feature/my-feature
# Prune deleted remote branches
git fetch --pruneProblem: PR validation fails with "Invalid branch name"
Solution:
# Rename branch
git branch -m feature/correct-name
# Force push
git push --force-with-lease origin feature/correct-name
# Update PR with new branchProblem: PR title doesn't follow Conventional Commits
Solution:
- Go to PR page on GitHub
- Click "Edit" next to PR title
- Update to format:
type(scope): description - Save
- Workflow re-runs automatically
Problem: dev-to-main warns CHANGELOG.md not updated
Solution:
# On dev branch
git checkout dev
git pull origin dev
# Edit CHANGELOG.md
# Add version entry under [Unreleased] or create new [1.1.0] section
git add CHANGELOG.md
git commit -m "docs: update CHANGELOG for v1.1.0"
git push origin dev
# PR to main will now pass CHANGELOG checkProblem: Critical bug in production (main)
Solution:
# Create hotfix from dev (not main)
git checkout dev
git pull origin dev
git checkout -b hotfix/critical-bug
# Make minimal fix
git add .
git commit -m "fix(installer): resolve critical security issue"
git push -u origin hotfix/critical-bug
# Create PR to dev, get fast-track approval
# After merge to dev, immediately create PR dev → main
# After merge to main, create hotfix release v1.0.1Problem: Need to work on feature B while feature A is in review
Solution:
# Feature A already in PR
git checkout dev
git pull origin dev
# Start feature B from latest dev
git checkout -b feature/feature-b
# Work independently
# Both PRs can be reviewed in parallel
# Merge order doesn't matter (both target dev)- ✅ Create descriptive branch names
- ✅ Follow Conventional Commits format
- ✅ Link issues in PR description
- ✅ Update CHANGELOG.md for releases
- ✅ Keep feature branches short-lived (< 1 week)
- ✅ Sync with dev frequently
- ✅ Write clear commit messages
- ✅ Test locally before pushing
- ✅ Respond to review comments
- ✅ Delete merged branches
- ❌ Commit directly to main or dev
- ❌ Force push to main or dev
- ❌ Merge without quality gates passing
- ❌ Use vague commit messages
- ❌ Include unrelated changes in PR
- ❌ Commit secrets or sensitive data
- ❌ Leave stale branches unmerged
- ❌ Skip code review
- ❌ Bypass branch protection (even admins)
- ❌ Merge without linked issue (for features/fixes)
- GITHUB_WORKFLOWS.md - Workflow details and automation
- CONTRIBUTING.md - How to contribute
- CHANGELOG.md - Version history
Issues: Report at GitHub Issues
Discussions: Ask in GitHub Discussions