Git Branch
Overview
Create and checkout a new branch with consistent naming that links to issue tracking when available. Uses the naming convention: [category]/[issue-id]_[branch-name] or [category]/[branch-name] when no issue ID is provided.
Arguments
Definitions
- •
[category](optional): Branch type. Common values: poc, feature, fix, chore, doc, refactor. Accepts any value. Defaults tofeature. - •
[branch-name](required): Short kebab-case description of the work. - •
[issue-id](optional): GitHub issue number associated with this work.
Values
$ARGUMENTS
Core Principles
- •Use kebab-case for branch names (lowercase, hyphens)
- •Keep branch names concise but descriptive
- •Include issue ID when context provides one
- •Never prompt interactively - extract from context or use defaults
- •Accept any category value provided
Instructions
- •Parse the provided arguments to extract category, branch-name, and issue-id (if present)
- •If arguments are incomplete, infer from conversation context:
- •Look for GitHub issue references (#123, issue 123)
- •Derive branch name from the task description
- •Default category to
featureif not provided
- •Use the provided category or default to
feature. Common categories: poc, feature, fix, chore, doc, refactor - •Construct the branch name:
- •With issue:
<category>/<issue-id>_<branch-name> - •Without issue:
<category>/<branch-name>
- •With issue:
- •Execute:
git checkout -b <constructed-branch-name> - •Report the created branch name
Output Guidance
Provide a brief confirmation message:
On success:
code
Created and switched to branch: feature/123_add-authentication
On error:
code
Failed to create branch: <error message from git>