create-branch

ruchernchong/claude-kit · updated Apr 8, 2026

MDX-style export adds YAML metadata + attribution linking explainx.ai and this canonical listing URL.

$npx skills add https://github.com/ruchernchong/claude-kit --skill create-branch
0 commentsdiscussion
summary

Create and checkout git branches with smart validation and GitHub issue integration.

  • Automatically links branches to GitHub issues when an issue number is provided, using gh issue develop for seamless project tracking
  • Intelligently applies semantic prefixes (feature/, bugfix/, hotfix/, chore/, docs/) based on keywords in the branch name
  • Validates branch names for kebab-case formatting, forbidden characters, length limits, and duplicate detection across local and remote branches
  • De
skill.md

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:

    gh --version
    

    If not available, inform the user and fall back to manual branch creation.

  2. Verify the issue exists:

    gh issue view <issue-number>
    

    Display issue title and status to confirm.

  3. Create branch linked to issue:

    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

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:

# 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:

    git rev-parse --verify main
    
  2. If not, check if master exists:

    git rev-parse --verify master
    
  3. If neither exists, use current HEAD

  4. Allow user to specify different base branch if needed (ask before creating)

7. Create and Checkout Branch

git checkout -b <validated-branch-name> <base-branch>

Confirm successful creation with a message showing:

  • Branch name
  • Base branch used
  • Current status

8. Remote Push Recommendation

Ask the user: "Would you like to push this branch to remote and set up tracking?"

If yes:

git push -u origin <branch-name>

This enables:

  • Remote backup of the branch
  • Collaboration with team members
  • GitHub PR creation workflow
  • Branch visibility in GitHub UI

Error Handling

Provide clear, actionable error messages:

  • Not a git repository: "This directory is not a git repository. Initialise one with git init or navigate to a repository."
  • GitHub CLI not available: "GitHub CLI (gh) is not installed. Install it from https://cli.github.com or use manual branch creation."
  • Issue not found: "Issue #123 not found. Check the issue number or create a branch manually."
  • Invalid branch name: "Branch name contains invalid characters. Suggested: feature/valid-branch-name"
  • Branch exists: "Branch feature/existing already exists. Switch to it with git checkout feature/existing or choose a different name."
  • Network issues: "Unable to check remote branches. Proceeding with local creation only."

Examples

Example 1: GitHub Issue Integration

User: "Create a branch for issue #456"
Command: gh issue view 456
Output: #456 - Add user authentication (open)
Command: gh issue develop 456 -c
Output: Created and checked out branch: feature/456-add-user-authentication

Example 2: Manual with Auto-Prefix

User: "Create branch: fix login bug"
Analysis: Contains "fix" → apply "bugfix/" prefix
Validated: "bugfix/login-bug"
Command: git checkout -b bugfix/login-bug main

Example 3: Custom Prefix

User: "Create branch: docs/update readme"
Analysis: Already has "docs/" prefix → keep as-is
Validated: "docs/update-readme"
Command: git checkout -b docs/update-readme main

Best Practises

  1. Always prioritise GitHub issue workflow when issue numbers are mentioned
  2. Validate thoroughly before creating branches to avoid git errors
  3. Use descriptive names that clearly indicate the purpose
  4. Follow team conventions - check existing branch names for patterns
  5. Push to remote early for backup and collaboration
  6. Link branches to issues whenever possible for better project tracking
how to use create-branch

How to use create-branch on Cursor

AI-first code editor with Composer

1

Prerequisites

Before installing skills in Cursor, ensure your development environment meets these requirements:

  • Cursor installed and configured on your development machine
  • Node.js version 16.0+ with npm package manager (verify with node --version)
  • Active project directory or workspace where you want to add create-branch
2

Execute installation command

Execute the skills CLI command in your project's root directory to begin installation:

$npx skills add https://github.com/ruchernchong/claude-kit --skill create-branch

The skills CLI fetches create-branch from GitHub repository ruchernchong/claude-kit and configures it for Cursor.

3

Select Cursor when prompted

The CLI will show a list of available agents. Use arrow keys to navigate and space to select Cursor:

◆ Which agents do you want to install to?
│ ── Universal (.agents/skills) ── always included ────
│ • Amp
│ • Antigravity
│ • Cline
│ • Codex
│ ●Cursor(selected)
│ • Cursor
│ • Windsurf
4

Verify installation

Confirm successful installation by checking the skill directory location:

.cursor/skills/create-branch

Reload or restart Cursor to activate create-branch. Access the skill through slash commands (e.g., /create-branch) or your agent's skill management interface.

Security & Verification Notice

We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.

Skills execute code in your development environment. Always verify the publisher's identity, review recent commits, and test in isolated environments before production deployment.

List & Monetize Your Skill

Submit your Claude Code skill and start earning

GET_STARTED →

Use Cases

User Story & Requirements Generation

Create detailed user stories, acceptance criteria, and feature specs

Example

Generate user stories for 'password reset feature' with acceptance criteria, edge cases, and test scenarios

Reduce spec writing time by 50%, ensure comprehensive coverage

Competitive Analysis

Research competitors, compare features, identify gaps

Example

Analyze 5 competitor products, create feature comparison matrix, suggest differentiation opportunities

Complete competitive research in 2 hours instead of 2 days

Roadmap Prioritization

Evaluate features using frameworks (RICE, ICE, Kano) and create prioritized backlogs

Example

Score 20 feature ideas using RICE framework, generate prioritized roadmap with rationale

Make data-driven prioritization decisions faster

Stakeholder Communication

Draft PRDs, status updates, and stakeholder presentations

Example

Create executive summary of Q3 roadmap, monthly progress report, feature launch announcement

Save 3-5 hours/week on communication overhead

Implementation Guide

Prerequisites

  • Claude Desktop or compatible AI client
  • Access to product documentation and roadmap tools (Jira, Notion, etc.)
  • Understanding of product management frameworks (RICE, Jobs-to-be-Done, etc.)
  • Stakeholder contact information and communication channels

Time Estimate

30-60 minutes to see productivity improvements

Installation Steps

  1. 1.Install product management skill
  2. 2.Start with user story generation for known feature
  3. 3.Progress to competitive analysis: research 2-3 competitors
  4. 4.Use for roadmap prioritization: apply RICE/ICE scoring
  5. 5.Draft stakeholder communications and refine based on feedback
  6. 6.Build template library for recurring PM tasks
  7. 7.Share effective prompts with product team

Common Pitfalls

  • Not validating competitive research—verify facts before sharing
  • Accepting user stories without involving engineering team
  • Over-relying on frameworks without qualitative judgment
  • Not customizing outputs to company culture and communication style
  • Skipping stakeholder validation of generated requirements

Best Practices

✓ Do

  • +Validate research and competitive analysis with real data
  • +Collaborate with engineering when generating technical requirements
  • +Customize frameworks and templates to your company context
  • +Use skill for first drafts, refine with stakeholder input
  • +Document successful prompt patterns for PM tasks
  • +Combine AI efficiency with human judgment and intuition

✗ Don't

  • Don't publish competitive analysis without fact-checking
  • Don't finalize user stories without engineering review
  • Don't make prioritization decisions solely on AI scoring
  • Don't skip customer validation of generated requirements
  • Don't ignore company-specific context and culture

💡 Pro Tips

  • Provide context: company goals, constraints, customer feedback
  • Ask for alternatives: 'Show 3 ways to prioritize this roadmap'
  • Request stakeholder-specific formatting: 'Executive summary vs. engineering spec'
  • Use skill for 70% generation + 30% customization to company needs

When to Use This

✓ Use When

Use for user story writing, competitive research, roadmap prioritization, stakeholder communication, and PRD drafting. Best for reducing repetitive documentation and research work.

✗ Avoid When

Avoid for strategic product vision (requires deep customer empathy), pricing decisions (needs market and financial expertise), or when face-to-face customer discovery is more valuable than speed.

Learning Path

  1. 1Basic: user stories, feature specs, status updates
  2. 2Intermediate: competitive analysis, prioritization frameworks, PRDs
  3. 3Advanced: product strategy, go-to-market planning, OKR setting
  4. 4Expert: product vision, market positioning, business model innovation

Discussion

Product Hunt–style comments (not star reviews)
  • No comments yet — start the thread.
general reviews

Ratings

4.746 reviews
  • Luis Wang· Dec 16, 2024

    create-branch fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.

  • Dhruvi Jain· Dec 12, 2024

    We added create-branch from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.

  • Harper Sanchez· Dec 4, 2024

    create-branch reduced setup friction for our internal harness; good balance of opinion and flexibility.

  • Evelyn Sethi· Dec 4, 2024

    I recommend create-branch for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.

  • Li Taylor· Nov 23, 2024

    create-branch is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.

  • Luis Okafor· Nov 7, 2024

    We added create-branch from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.

  • Oshnikdeep· Nov 3, 2024

    create-branch fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.

  • Evelyn Brown· Nov 3, 2024

    Keeps context tight: create-branch is the kind of skill you can hand to a new teammate without a long onboarding doc.

  • Evelyn Thomas· Oct 26, 2024

    Solid pick for teams standardizing on skills: create-branch is focused, and the summary matches what you get after install.

  • Ganesh Mohane· Oct 22, 2024

    Registry listing for create-branch matched our evaluation — installs cleanly and behaves as described in the markdown.

showing 1-10 of 46

1 / 5