troykelly/claude-skills/branch-discipline
Claude Code and agent skill by troykelly/claude-skills
- community
Checking that the SKILL.md file is still in the repository.
Use before any code changes - hard gate ensuring work never happens on main branch, with proper feature branch creation from correct base
Install
npx vskill@latest install troykelly/claude-skills/branch-disciplineSKILL.md
Branch Discipline
Overview
Never work on main. Create feature branches for all work.
Core principle: The main branch is sacred. All work happens in feature branches.
This is a HARD GATE. Do not proceed with code changes if on main.
The Gate
Check Current Branch
Branch Naming Convention
Format
Types
| Type | Use For | |
|---|---|---|
feature | New functionality | |
fix | Bug fixes | |
chore | Maintenance, dependencies | |
docs | Documentation only | |
refactor | Code restructuring | |
test | Test additions/fixes |
Examples
Creating a Feature Branch
From Main (Default)
From Existing Feature Branch
When building on in-progress work:
Document the dependency in the issue.
Branch Lifecycle
After Merge
Handling Stale Branches
If main has moved ahead:
Protected Branches
Main should be protected. Never:
- Push directly to main
- Force push to main
- Delete main
If you accidentally commit to main:
Multiple Issues, Same Branch?
Generally NO. Each issue gets its own branch.
Exception: Tightly coupled sub-issues from issue-decomposition MAY share a branch if:
- They are sequential dependencies
- They will be merged together
- They are part of the same PR
Document this in the issues if doing so.
Verification
Before making any code change:
Common Mistakes
| Mistake | Prevention | |
|---|---|---|
| Committing to main | Check branch before every commit | |
| Pushing to main | Branch protection rules | |
| Wrong base branch | Verify before creating branch | |
| Outdated branch | Rebase/merge before PR | |
| Branch name typos | Use consistent naming |
Checklist
Before writing any code:
- [ ] Current branch is NOT main
- [ ] Branch name follows convention
- [ ] Branch is from correct base
- [ ] Branch is pushed to remote
- [ ] Issue number is in branch name
Integration
This skill is called by:
issue-driven-development- Step 6
This skill enables:
- Clean separation of work
- Easy PR creation
- Safe experimentation
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/branch-discipline/SKILL.md
Popularity
- Repository stars
- 7
- 7-day trend score
- 10
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 6 May 2026, 6 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/troykelly/claude-skills/branch-discipline)