
Create Branch
Create and check out a git branch with validation, project language conventions, and GitHub issue-linked development via gh issue develop.
Overview
Create Branch is an agent skill most often used in Build (also Ship review prep) that creates and checks out git branches with GitHub issue linking via gh issue develop when an issue id is provided.
Install
npx skills add https://github.com/ruchernchong/claude-kit --skill create-branchWhat is this skill?
- Prioritizes gh issue develop -c when user supplies an issue number
- Validates gh availability and issue exists via gh issue view before branching
- Infers US vs UK spelling from branches, commits, and docs for naming consistency
- Uses allowed git and gh bash tools: status, branch, checkout, push, ls-remote, rev-parse
- Falls back to manual branch creation when GitHub CLI is missing
Adoption & trust: 1.2k installs on skills.sh; 1/3 security scanners passed (skills.sh audits).
What problem does it solve?
You want a new branch tied to a GitHub issue without hand-typing names or skipping validation on dirty repos and missing remotes.
Who is it for?
Solo builders using GitHub Issues who start agent sessions with “work on #42” and need consistent branch hygiene.
Skip if: Teams on GitLab-only or purely local git with no gh CLI and no desire to install it.
When should I use this skill?
User asks to create, checkout, or start work on a new git branch, especially with a GitHub issue number (#123, 123, issue 123).
What do I get? / Deliverables
A checked-out branch aligned to the issue or your naming rules, with gh-linked metadata when CLI and issue number are available.
- New local branch checked out and optionally linked to a GitHub issue
- Validation summary of git status and issue metadata
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Branch creation is the default shelf at Build when starting feature work, even though the same command repeats during Ship fix branches and Operate hotfixes. GitHub CLI issue integration and git remote checks are toolchain integrations, not generic PM docs.
Where it fits
User says “implement #88” and the agent runs gh issue develop -c after confirming the issue title.
Open a fix branch for a release-blocking issue before opening a PR.
Branch from main for a production hotfix ticket without clobbering an in-progress feature branch.
How it compares
Opinionated git+gh workflow skill—not a full release branch strategy or monorepo versioning tool.
Common Questions / FAQ
Who is create-branch for?
Indie developers on GitHub who use Claude Code with bash git/gh tools and want issue-linked branches without manual CLI recipes.
When should I use create-branch?
At the start of Build feature work from an issue, before Ship fix branches for a ticket, or when Operate hotfixes need a clean branch from main with validation.
Is create-branch safe to install?
It requests git and gh shell access; review the Security Audits panel on this page and ensure you trust the skill source before granting repo push capabilities.
SKILL.md
READMESKILL.md - Create Branch
## Language Conventions **Infer language style from the project:** - Analyze existing branches, commit messages, and documentation to detect the project's language variant (US English, UK English, etc.) - Match the spelling conventions found in the project (e.g., "synchronize" vs "synchronise", "center" vs "centre") - Maintain consistency with the project's established language style throughout branch names and command outputs --- # Create Branch Command This command creates and checks out a new git branch with intelligent validation and GitHub issue integration. ## Priority: GitHub Issue Integration **IMPORTANT**: If the user provides an issue number (e.g., "#123", "123", or "issue 123"), ALWAYS prioritise using GitHub CLI's issue development workflow: 1. **Check for GitHub CLI availability**: ```bash gh --version ``` If not available, inform the user and fall back to manual branch creation. 2. **Verify the issue exists**: ```bash gh issue view <issue-number> ``` Display issue title and status to confirm. 3. **Create branch linked to issue**: ```bash gh issue develop <issue-number> -c ``` - The `-c` flag automatically checks out the newly created branch - GitHub automatically generates an appropriate branch name from the issue title - The branch is linked to the issue for better project tracking 4. **Skip to remote push step** (step 8 below) ## Manual Branch Creation Workflow If no issue number is provided, follow this workflow: ### 1. Check Repository Status ```bash git status ``` Verify: - Clean working directory or acceptable uncommitted changes - Current branch information - Whether we're in a git repository ### 2. Get Branch Name Input Ask the user for the desired branch name. Accept input in any format - the command will handle formatting and validation. ### 3. Auto-Detect and Apply Prefix Analyse the branch name input for keywords and automatically add appropriate prefixes: - **feature/** - Keywords: "add", "implement", "create", "new", "feature" - **bugfix/** - Keywords: "fix", "bug", "resolve", "patch", "repair" - **hotfix/** - Keywords: "hotfix", "urgent", "critical", "emergency" - **chore/** - Keywords: "chore", "refactor", "update", "upgrade", "maintain" - **docs/** - Keywords: "docs", "documentation", "readme", "guide" If the user's input already starts with a recognised prefix (feature/, bugfix/, etc.), keep it as-is. ### 4. Validate Branch Name Apply comprehensive validation: #### Kebab-Case Enforcement - Convert to lowercase - Replace spaces and underscores with hyphens - Ensure format is: `prefix/kebab-case-name` #### Character Validation Reject branch names containing: - Spaces (convert to hyphens) - Special characters: `~`, `^`, `:`, `?`, `*`, `[`, `]`, `\`, `@{`, `..` - Control characters or non-ASCII (except hyphens and slashes) - Leading or trailing slashes or hyphens #### Length Validation - Minimum: 3 characters (excluding prefix) - Maximum: 100 characters (total) ### 5. Check for Duplicates Check both local and remote branches: ```bash # Check local branches git branch --list "<branch-name>" # Check remote branches git ls-remote --heads origin "<branch-name>" ``` If branch exists: - **Locally**: Offer to checkout existing branch instead - **Remotely**: Warn user and suggest alternative name - **Both**: Inform user and ask if they want to checkout or choose different name ### 6. Determine Base Branch Use smart defaulting: 1. Check if `main` exists: ```bash git rev-parse --verify main ``` 2. If not, check if `master` exists: ```bash git rev-parse --verify master ``` 3. If n