Git Branch Creation Workflow
Execute feature branch creation with intelligent naming, automatic type detection, and sequential numbering.
Usage
This skill is invoked when:
- User runs
/create-branch or /git:create-branch command
- User requests to create a new feature branch
- User asks to start a new branch for a task
Two Operation Modes
Mode 1: With Description (Manual)
The command takes a description and automatically detects the commit type.
Format: /create-branch <description>
Examples:
/create-branch add user authentication
→ Creates: feat/001-user-authentication
/create-branch fix login bug
→ Creates: fix/002-login-bug
/create-branch refactor auth service
→ Creates: refactor/003-auth-service
/create-branch remove deprecated code
→ Creates: chore/004-remove-deprecated
/create-branch document api endpoints
→ Creates: docs/005-document-api
Mode 2: Auto-Generate from Changes (No Arguments)
When no arguments provided and no sdlc-develop specs exist, analyze uncommitted changes to generate branch name automatically.
Format: /create-branch (no arguments)
Process:
- Check for sdlc-develop specs (see Mode 3)
- If no specs, check for uncommitted changes (both staged and unstaged)
- If no changes exist, display error and require description
- If changes exist, analyze to generate description
- Create branch with auto-generated name
Examples:
# After modifying authentication files
/create-branch
→ Auto-detected from changes: feat/006-authentication-system
→ (based on: login.py, auth_service.ts, user_model.py)
# After fixing payment bug
/create-branch
→ Auto-detected from changes: fix/007-payment-processing
→ (based on: payment.js, checkout.py)
Mode 3: From SDLC-Develop Spec (Arkhe Integration)
When no arguments provided and sdlc-develop specs exist, the skill can create branches linked to existing feature specs.
Detection Flow:
- Check if
.arkhe.yaml exists → read develop.specs_dir (default: arkhe/specs)
- Scan
{specs_dir}/ for existing spec directories
- If specs found → present selection via
AskUserQuestion
- Use spec directory name for branch name
Example:
# Specs exist: arkhe/specs/01-user-auth/, arkhe/specs/02-dashboard/
/create-branch
# Prompt: "Select a feature spec for this branch"
# Options: 01-user-auth, 02-dashboard, None (auto-generate from changes)
# User selects 01-user-auth
→ Creates: feat/01-user-auth
Commit Type Detection
The workflow automatically detects commit types from keywords in the description:
| Type |
Keywords |
| feat |
add, create, implement, new, update, improve |
| fix |
fix, bug, resolve, correct, repair |
| refactor |
refactor, rename, reorganize |
| chore |
remove, delete, clean, cleanup |
| docs |
docs, document, documentation |
If no keyword is detected, defaults to feat.
Branch Naming Format
Pattern: {type}/{number}-{keyword1}-{keyword2}
Components:
- type: Auto-detected commit type (feat, fix, refactor, chore, docs)
- number: Auto-incremented 3-digit number (001, 002, 003...)
- keywords: First 2-3 meaningful words from description (lowercase, hyphenated)
Examples:
Input: "add user authentication system"
Output: feat/001-user-authentication
Input: "fix null pointer in login"
Output: fix/002-null-pointer
Important Notes
- Sequential Numbering: Finds next available number by scanning existing branches
- Keyword Extraction: Filters common words, keeps 2-3 meaningful terms
- Lowercase Convention: All branch names are lowercase with hyphens
- Conventional Commits: Aligns with conventional commit types
- SDLC-Develop Integration: Detects feature specs from
.arkhe.yaml
Supporting Documentation
- WORKFLOW.md - Detailed step-by-step process with bash scripts
- EXAMPLES.md - Real-world examples for all branch types
- TROUBLESHOOTING.md - Common issues and solutions
1---2name: creating-branch-23description: Creates feature branches with optimized short naming, auto-incrementing, and commit type detection (feat/fix/refactor). Supports manual descriptions and auto-generation from uncommitted git changes. Use when user requests to create branch, start new branch, make branch, checkout new branch, switch branch, new task, start working on, begin work on feature, begin feature, create feature branch, run /create-branch command, or mentions "branch", "feature", "new feature", "feat", "fix", or "checkout".4---5
6# Git Branch Creation Workflow
7
8Execute feature branch creation with intelligent naming, automatic type detection, and sequential numbering.
9
10## Usage
11
12This skill is invoked when:
13- User runs `/create-branch` or `/git:create-branch` command
14- User requests to create a new feature branch
15- User asks to start a new branch for a task
16
17## Two Operation Modes
18
19### Mode 1: With Description (Manual)
20
21The command takes a description and automatically detects the commit type.
22
23**Format**: `/create-branch <description>`
24
25**Examples**:
26```bash
27/create-branch add user authentication
28→ Creates: feat/001-user-authentication
29
30/create-branch fix login bug
31→ Creates: fix/002-login-bug
32
33/create-branch refactor auth service
34→ Creates: refactor/003-auth-service
35
36/create-branch remove deprecated code
37→ Creates: chore/004-remove-deprecated
38
39/create-branch document api endpoints
40→ Creates: docs/005-document-api
41```
42
43### Mode 2: Auto-Generate from Changes (No Arguments)
44
45When no arguments provided and no sdlc-develop specs exist, analyze uncommitted changes to generate branch name automatically.
46
47**Format**: `/create-branch` (no arguments)
48
49**Process**:
501. Check for sdlc-develop specs (see Mode 3)
512. If no specs, check for uncommitted changes (both staged and unstaged)
523. If no changes exist, display error and require description
534. If changes exist, analyze to generate description
545. Create branch with auto-generated name
55
56**Examples**:
57```bash
58# After modifying authentication files
59/create-branch
60→ Auto-detected from changes: feat/006-authentication-system
61→ (based on: login.py, auth_service.ts, user_model.py)
62
63# After fixing payment bug
64/create-branch
65→ Auto-detected from changes: fix/007-payment-processing
66→ (based on: payment.js, checkout.py)
67```
68
69### Mode 3: From SDLC-Develop Spec (Arkhe Integration)
70
71When no arguments provided and sdlc-develop specs exist, the skill can create branches linked to existing feature specs.
72
73**Detection Flow:**
741. Check if `.arkhe.yaml` exists → read `develop.specs_dir` (default: `arkhe/specs`)
752. Scan `{specs_dir}/` for existing spec directories
763. If specs found → present selection via `AskUserQuestion`
774. Use spec directory name for branch name
78
79**Example:**
80```bash
81# Specs exist: arkhe/specs/01-user-auth/, arkhe/specs/02-dashboard/
82/create-branch
83
84# Prompt: "Select a feature spec for this branch"
85# Options: 01-user-auth, 02-dashboard, None (auto-generate from changes)
86
87# User selects 01-user-auth
88→ Creates: feat/01-user-auth
89```
90
91## Commit Type Detection
92
93The workflow automatically detects commit types from keywords in the description:
94
95| Type | Keywords |
96|------|----------|
97| **feat** | add, create, implement, new, update, improve |
98| **fix** | fix, bug, resolve, correct, repair |
99| **refactor** | refactor, rename, reorganize |
100| **chore** | remove, delete, clean, cleanup |
101| **docs** | docs, document, documentation |
102
103If no keyword is detected, defaults to `feat`.
104
105## Branch Naming Format
106
107**Pattern**: `{type}/{number}-{keyword1}-{keyword2}`
108
109**Components**:
110- **type**: Auto-detected commit type (feat, fix, refactor, chore, docs)
111- **number**: Auto-incremented 3-digit number (001, 002, 003...)
112- **keywords**: First 2-3 meaningful words from description (lowercase, hyphenated)
113
114**Examples**:
115- Input: "add user authentication system"
116- Output: `feat/001-user-authentication`
117
118- Input: "fix null pointer in login"
119- Output: `fix/002-null-pointer`
120
121## Important Notes
122
123- **Sequential Numbering**: Finds next available number by scanning existing branches
124- **Keyword Extraction**: Filters common words, keeps 2-3 meaningful terms
125- **Lowercase Convention**: All branch names are lowercase with hyphens
126- **Conventional Commits**: Aligns with conventional commit types
127- **SDLC-Develop Integration**: Detects feature specs from `.arkhe.yaml`
128
129## Supporting Documentation
130
131- **[WORKFLOW.md](WORKFLOW.md)** - Detailed step-by-step process with bash scripts
132- **[EXAMPLES.md](EXAMPLES.md)** - Real-world examples for all branch types
133- **[TROUBLESHOOTING.md](TROUBLESHOOTING.md)** - Common issues and solutions