Automates feature branch creation from spec files or direct branch names. Triggers: "create a branch", "branch for this spec", "start a feature branch", "branch this", "create branch from spec". Do NOT use for committing (use commit skill). Do NOT use for creating PRs (use pr skill).
Create a properly named feature branch from a spec file or direct branch name, based on the latest remote base branch (main/master).
SPEC_OR_BRANCH: A spec file path (e.g., specs/feat-user-auth.md) or a direct branch name (e.g., feat/my-feature).BASE_BRANCH: Auto-detected via git remote show origin (typically main or master).Determine the branch name.
/ with a file extension or matches specs/):
- to get the prefix and the rest: feat-user-auth -> feat/user-auth, fix-login-bug -> .fix/login-bugprefix/name format, use it directly.Validate the branch name.
feat/, fix/, chore/, docs/, refactor/, test/, ci/.-, /, _.Detect the base branch.
git remote show origin and parse the HEAD branch: line.main if detection fails.Fetch the latest base branch.
git fetch origin <BASE_BRANCH>.Create and switch to the new branch.
git checkout -b <BRANCH_NAME> origin/<BASE_BRANCH>.git_createBranch({ name: BRANCH_NAME, base: BASE_BRANCH }) tool.Confirm success.
git_branch tool or run git branch --show-current to verify.Input (spec file or branch name)
-> Parse branch name
-> Validate format
-> Detect base branch
-> Fetch latest
-> Create & checkout branch
-> Confirm ready
User: "Create a branch for specs/feat-user-auth.md"
Action: Creates branch `feat/user-auth` from `origin/main`
User: "Create branch fix/login-bug"
Action: Creates branch `fix/login-bug` from `origin/main`
User: "Branch this" (with specs/chore-cleanup.md in context)
Action: Creates branch `chore/cleanup` from `origin/main`
prefix/name format with a valid prefix.git branch --show-current matches the intended branch name.Input: specs/feat-user-auth.md
Branch: feat/user-auth
Input: specs/fix-login-bug.md
Branch: fix/login-bug
Input: feat/my-feature
Branch: feat/my-feature
Input: specs/refactor-db-layer.md
Branch: refactor/db-layer