domains / software-engineering / create-git-branch / create-branch

create-branch

Skill card

combined

Both copies implement the same Sentry-style branch naming workflow, but they disagree on the branch name format and on how much interaction is allowed. The getsentry/skills copy uses <type>/<short-description> and is explicitly non-interactive, auto-deriving a generic description when there are no local changes and auto-resolving base/collision cases. The sickn33/agentic-awesome-skills copy uses <username>/<type>/<short-description>, requires a username prefix, asks the user when there are no local changes, asks for confirmation before creating, and asks the user to choose a different name on collision. Crowning one copy would hide a real alternative naming convention and interaction model.

Repositories

RepositoryPath
getsentry/skillsskills/create-branch/SKILL.md
sickn33/agentic-awesome-skillsplugins/agentic-awesome-skills-claude/skills/create-branch/SKILL.md

Other copies

RoleRepositoryPath
peergetsentry/skillsskills/create-branch/SKILL.md
peersickn33/agentic-awesome-skillsplugins/agentic-awesome-skills-claude/skills/create-branch/SKILL.md
adaptersickn33/agentic-awesome-skillsplugins/agentic-awesome-skills/skills/create-branch/SKILL.md
adaptersickn33/agentic-awesome-skillsplugins/agentic-bundle-oss-maintainer/skills/create-branch/SKILL.md
adaptersickn33/agentic-awesome-skillsskills/create-branch/SKILL.md

Combined skill

---
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.

## Conflicts

- getsentry/skills: branch name is <type>/<short-description>; workflow is non-interactive; auto-derives a generic description when there are no local changes; auto-resolves base and collision cases.
- sickn33/agentic-awesome-skills: branch name is <username>/<type>/<short-description>; workflow asks the user for a username prefix, asks for confirmation before creating, asks the user to choose a different name on collision, and asks whether to branch from the current branch or switch to the default branch.

## Workflow

1. Resolve the work description:
   - If `$ARGUMENTS` is present, use it.
   - Otherwise inspect:
     ```bash
     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:
     - getsentry/skills: use a generic description like `repo-maintenance`, `tooling-update`, or `work-in-progress`.
     - sickn33/agentic-awesome-skills: ask the user what they are about to work on.

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.

3. Generate the branch name:
   - getsentry/skills: `<type>/<short-description>`.
   - sickn33/agentic-awesome-skills: `<username>/<type>/<short-description>`, where `<username>` is obtained from `gh api user --jq .login` or asked from the user if the command fails.
   - Keep `<short-description>` kebab-case, ASCII-only, and ideally 3 to 6 words.

4. Choose the base without prompting (getsentry/skills) or with prompting (sickn33/agentic-awesome-skills):
   ```bash
   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 (getsentry/skills) or ask the user (sickn33/agentic-awesome-skills).
   - If on a detached HEAD, branch from the current commit (getsentry/skills) or ask the user (sickn33/agentic-awesome-skills).
   - If already on a non-default branch, branch from the current branch (getsentry/skills) or ask the user (sickn33/agentic-awesome-skills).
   - Only switch to the default branch when the user explicitly asks (getsentry/skills) or when the user chooses to switch (sickn33/agentic-awesome-skills).

5. Avoid collisions:
   - getsentry/skills: append `-2`, `-3`, and so on until the name is unused locally and remotely.
   - sickn33/agentic-awesome-skills: check that the name doesn't already exist locally or on the remote (`git show-ref`); if it does, ask the user to choose a different name.

6. Create the branch:
   ```bash
   git checkout -b <branch-name>
   ```
   - getsentry/skills: report the final branch name, but do not stop for confirmation.
   - sickn33/agentic-awesome-skills: present the proposed name to the user and ask if they want to use it, modify it, or change the type before creating.

## References

- [Sentry Branch Naming](https://develop.sentry.dev/sdk/getting-started/standards/code-submission/#branch-naming)