Create Branch
Create a git branch following Sentry naming conventions. Keep this workflow non-interactive unless the user explicitly asks to choose the name manually.
Workflow
-
Resolve the work description:
- If
$ARGUMENTSis present, use it - Otherwise inspect:
- If there are local changes, derive a short description from the diff
- If there are no local changes, use a generic description like
repo-maintenance,tooling-update, orwork-in-progress
- If
-
Classify the branch type:
When unsure: use feat for new things, ref for restructuring, chore for maintenance.
-
Generate
<type>/<short-description>. Keep<short-description>kebab-case, ASCII-only, and ideally 3 to 6 words. -
Choose the base without prompting:
- If default branch detection fails, fall back to
main, thenmaster, then the current branch - If on a detached HEAD, branch from the current commit
- If already on a non-default branch, branch from the current branch
- Only switch to the default branch when the user explicitly asks
- If default branch detection fails, fall back to
-
Avoid collisions by appending
-2,-3, and so on until the name is unused locally and remotely. -
Create the branch:
Report the final branch name, but do not stop for confirmation.

