create-branch
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 prefix:
- First try
gh api user --jq .login - Then
git config github.user - Then the local part of
git config user.email - Then
whoami - Sanitize to lowercase ASCII letters, digits, and hyphens; if empty, use
local
- First try
-
Resolve the work description:
- If
$ARGUMENTSis present, use it - Otherwise inspect:
git diff git diff --cached git 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, orwork-in-progress
- If
-
Classify the branch type:
| Type | Use when |
|---|---|
feat |
New functionality |
fix |
Broken behavior now works |
ref |
Behavior stays the same, structure changes |
chore |
Maintenance of existing tooling/config |
perf |
Same behavior, faster |
style |
Visual or formatting only |
docs |
Documentation only |
test |
Tests only |
ci |
CI/CD config |
build |
Build system |
meta |
Repo metadata |
license |
License changes |
When unsure: use feat for new things, ref for restructuring, chore for maintenance.
-
Generate
<prefix>/<type>/<short-description>. Keep<short-description>kebab-case, ASCII-only, and ideally 3 to 6 words. -
Choose the base without prompting:
git branch --show-current git remote | grep -qx origin && echo origin || git remote | head -1 git 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, 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:
git checkout -b <branch-name>Report the final branch name, but do not stop for confirmation.
References
More from getsentry/skills
security-review
Security code review for vulnerabilities. Use when asked to "security review", "find vulnerabilities", "check for security issues", "audit security", "OWASP review", or review code for injection, XSS, authentication, authorization, cryptography issues. Provides systematic review with confidence-based reporting.
5.1Kcode-simplifier
Simplifies and refines code for clarity, consistency, and maintainability while preserving all functionality. Use when asked to "simplify code", "clean up code", "refactor for clarity", "improve readability", or review recently modified code for elegance. Focuses on project-specific best practices.
4.3Kfind-bugs
Find bugs, security vulnerabilities, and code quality issues in local branch changes. Use when asked to review changes, find bugs, security review, or audit code on the current branch.
2.3Kagents-md
Creates and maintains concise AGENTS.md and CLAUDE.md project instruction files. Use when asked to create AGENTS.md, update AGENTS.md, maintain agent docs, set up CLAUDE.md, document repository agent conventions, or keep coding-agent instructions minimal and reference-backed.
2.2Kcode-review
Perform code reviews following Sentry engineering practices. Use when reviewing pull requests, examining code changes, or providing feedback on code quality. Covers security, performance, testing, and design review.
2.1Kcommit
ALWAYS use this skill when committing code changes — never commit directly without it. Creates commits following Sentry conventions with proper conventional commit format and issue references. Trigger on any commit, git commit, save changes, or commit message task.
2.0K