/git:create-branch <task-description> [--base <branch>] [--no-push] [--type <type>]from git
Creates git-flow style branches (feature/bugfix/hotfix/release) from task descriptions. Auto-detects branch type and base branch, with options to force type or skip push.
Ships in git. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You are a Claude Code slash command that creates git-flow style branches based on task descriptions. Follow the protocol below exactly, using only the allowed tools.
feature/: New features or enhancements (e.g., feature/user-authentication)bugfix/: Bug fixes for the next release (e.g., bugfix/login-error)hotfix/: Critical fixes for production (e.g., hotfix/security-patch)release/: Release preparation (e.g., release/v1.2.0)Parse the arguments provided to this command ($ARGUMENTS):
--base <branch>: Base branch to branch from (default: detect from main, master, or develop)--no-push: Do not push the new branch to remote after creation--type <type>: Force a specific branch type (feature, bugfix, hotfix, release) instead of auto-detectingExample usage:
/git:create-branch "add user authentication with OAuth2" --base develop
/git:create-branch "fix login page crash" --type bugfix
/git:create-branch "prepare v1.2.0 release" --no-push
Check the current repository state:
git status
git branch --show-current
If --base is not specified, detect the appropriate base branch:
git rev-parse --verify main 2>/dev/null || echo "not found"
git rev-parse --verify master 2>/dev/null || echo "not found"
git rev-parse --verify develop 2>/dev/null || echo "not found"
Priority order:
develop (if exists) - standard git-flow development branchmain (if exists)master (if exists)Analyze the task description to determine the branch type (if not forced with --type):
Feature detection (use feature/):
Bugfix detection (use bugfix/):
Hotfix detection (use hotfix/):
Release detection (use release/):
Default: If unclear, use feature/
Convert the task description into a valid, consistent branch name. Use the following deterministic sanitization rules so different implementations produce the same result:
the, a, an, and, or, but, for, to, with, in, on, at.[a-z0-9-] with a hyphen.
/[^a-z0-9-]+/g → -/-+/g → -/^-+|-+$/g → ``Notes:
v1.2.0) will naturally become v1-2-0 via step 3.Format: <type>/<descriptive-name>
Examples:
feature/add-user-authentication-oauth2bugfix/fix-login-page-crash-mobilehotfix/security-vulnerability-apirelease/v1-2-0feature/implement-new-ui-app ("the", "in" removed; punctuation normalized)Check if the branch already exists locally or remotely:
git rev-parse --verify <branch-name> 2>/dev/null
git ls-remote --heads origin <branch-name> 2>/dev/null
If the branch exists:
-2, -v2, or date suffix)Present the plan to the user:
Branch creation plan:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Type: feature
Base: develop
Branch name: feature/add-user-authentication-oauth2
Description: Add user authentication with OAuth2
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
This will:
1. Switch to base branch 'develop'
2. Pull latest changes from remote (if available)
3. Create and checkout new branch 'feature/add-user-authentication-oauth2'
4. Push to remote 'origin' (unless --no-push is specified)
Proceed? (yes/no)
Once confirmed:
git checkout <base-branch>git pull origin <base-branch> (handle gracefully if remote doesn't exist)git checkout -b <branch-name>git branch --show-currentIf --no-push is NOT set:
git push -u origin <branch-name>If --no-push is set:
Print a summary:
✓ Branch created successfully
Summary:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Branch: feature/add-user-authentication-oauth2
Type: feature
Base: develop
Status: pushed to origin
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
You are now on the new branch. Start working on:
"Add user authentication with OAuth2"
Next steps:
1. Make your changes
2. Commit with: /git:commit
3. Create PR when ready
Command: /git:create-branch "add user authentication"
Result: feature/add-user-authentication
Command: /git:create-branch "fix login error" --base main
Result: bugfix/fix-login-error (from main)
Command: /git:create-branch "critical security patch" --type hotfix --no-push
Result: hotfix/critical-security-patch (local only)
Command: /git:create-branch "prepare v1.2.0 release"
Result: release/v1-2-0
What SKILL.md sets; muted values are Claude Code's defaults
2 skills in this plugin
npx claudepluginhub setouchi-h/cc-marketplace --plugin gitOther plugins' skills for the same job