Agent Skillsgetsentry/skills › create-branch

create-branch

GitHub

根据Sentry规范自动创建Git分支。通过分析工作描述、分类类型及检测基础分支,生成符合约定的分支名并执行切换,全程无需交互确认。

skills/create-branch/SKILL.md getsentry/skills

Trigger Scenarios

创建新分支 开始新功能开发

Install

npx skills add getsentry/skills --skill create-branch -g -y
More Options

Use without installing

npx skills use getsentry/skills@create-branch

指定 Agent (Claude Code)

npx skills add getsentry/skills --skill create-branch -a claude-code -g -y

安装 repo 全部 skill

npx skills add getsentry/skills --all -g -y

预览 repo 内 skill

npx skills add getsentry/skills --list

SKILL.md

Frontmatter
{
    "name": "create-branch",
    "description": "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.",
    "argument-hint": "[optional description of the work]"
}

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:
      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, or work-in-progress
  2. 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.

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

  2. 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, 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:

    git checkout -b <branch-name>
    

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

References

Version History

  • 9a85b59 Current 2026-07-24 21:13

Same Skill Collection

skills/agents-md/SKILL.md
skills/brand-guidelines/SKILL.md
skills/claude-settings-audit/SKILL.md
skills/code-review/SKILL.md
skills/code-simplifier/SKILL.md
skills/commit/SKILL.md
skills/django-access-review/SKILL.md
skills/django-perf-review/SKILL.md
skills/doc-coauthoring/SKILL.md
skills/find-bugs/SKILL.md
skills/gh-review-requests/SKILL.md
skills/gha-security-review/SKILL.md
skills/iterate-pr/SKILL.md
skills/pr-link-issue/SKILL.md
skills/pr-writer/SKILL.md
skills/presentation-creator/SKILL.md
skills/prompt-optimizer/SKILL.md
skills/replay-ux-research/SKILL.md
skills/security-review/SKILL.md
skills/skill-scanner/SKILL.md
skills/skill-writer/SKILL.md
skills/sred-project-organizer/SKILL.md
skills/sred-work-summary/SKILL.md
skills/triage-frontend-issues/SKILL.md
skills/typing-exclusion-worker/SKILL.md
skills/blog-writing-guide/SKILL.md
skills/document-api-endpoint/SKILL.md

Metadata

Files
0
Version
24fdb83
Hash
0e017d30
Indexed
2026-07-24 21:13

Главная - Вики-сайт
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-20 10:20
浙ICP备14020137号-1 $Гость$