Create Branch

by getsentryd18b7aa8ba87No license1K starsListed Oct 8, 2026Updated Oct 8, 2026Repository updated 5 days ago

Create a git branch following Sentry naming conventions. Use when asked to "create a branch", "new branch", "start a branch", "make a branch", "switch to a new branch", or when starting new work on the default branch.

Instructions onlySoftware Development
AI-generated overview

Creates a git branch using Sentry naming conventions, deriving the type and description from the work at hand.

What it does
This skill guides an agent through creating a git branch with a Sentry-style name of the form type/short-description. It resolves a work description from the user's argument or from local git changes, classifies the branch type (feat, fix, ref, chore, and others), and picks a base branch without prompting. It then avoids name collisions by appending numeric suffixes and runs git checkout -b, reporting the final branch name.
When to use it
Use it when asked to create, start, make, or switch to a new branch, or when beginning new work on the default branch. It suits repositories that follow Sentry branch naming conventions.
Requirements
Requires a git repository and the git command-line tool available to the agent. No scripts or credentials are included; the skill is instructions only.

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

  1. Resolve the work description:

    • If $ARGUMENTS is present, use it
    • Otherwise inspect:
      bash
      git diffgit diff --cachedgit status --short
    • 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, or work-in-progress
  2. Classify the branch type:

TypeUse when
featNew functionality
fixBroken behavior now works
refBehavior stays the same, structure changes
choreMaintenance of existing tooling/config
perfSame behavior, faster
styleVisual or formatting only
docsDocumentation only
testTests only
ciCI/CD config
buildBuild system
metaRepo metadata
licenseLicense changes

When unsure: use feat for new things, ref for restructuring, chore for maintenance.

  1. Generate <type>/<short-description>. Keep <short-description> kebab-case, ASCII-only, and ideally 3 to 6 words.

  2. Choose the base without prompting:

    bash
    git branch --show-currentgit remote | grep -qx origin && echo origin || git remote | head -1git symbolic-ref refs/remotes/<remote>/HEAD 2>/dev/null | sed 's|refs/remotes/<remote>/||' | tr -d '[:space:]'
    • If default branch detection fails, fall back to main, then master, 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
  3. Avoid collisions by appending -2, -3, and so on until the name is unused locally and remotely.

  4. Create the branch:

    bash
    git checkout -b <branch-name>

    Report the final branch name, but do not stop for confirmation.

References

Source and attribution

Source:getsentry/skillsinskills/create-branchat commitd18b7aa

License: No license

Content belongs to its original authors. SourceWeft indexes it from a public repository.

Report or request removal