Git Branch
Create a new branch from the latest main branch using the project's naming convention.
Arguments
The user may provide arguments in the format: <type>/<description>
- •
type— one offeat,fix, orchore - •
description— short kebab-case description (e.g.,add-map-clustering)
If not provided, ask the user for the branch type and description.
Process
- •Fetch latest main:
bash
git fetch origin main
- •
Determine branch name:
- •If the user provided arguments (e.g.,
/git-branch feat/add-map-clustering), use them directly. - •Otherwise, ask the user for:
- •Branch type:
feat,fix, orchore - •Short description: a brief kebab-case slug describing the work
- •Branch type:
- •Construct the branch name as
{type}/{slug}(e.g.,feat/add-map-clustering).
- •If the user provided arguments (e.g.,
- •
Create and switch to the new branch:
bash
git checkout -b {branch_name} origin/main
- •Confirm by reporting the new branch name to the user.
Rules
- •Branch names MUST follow the
{type}/{slug}convention. - •Valid types are
feat,fix, andchoreonly. - •The slug MUST be kebab-case (lowercase, hyphens, no spaces or underscores).
- •Always branch from
origin/main, never from the current branch. - •Do NOT push the branch — just create it locally.