Skip to content
Back to skills

Git Branch

ASecurity

Generates and validates conventional branch names. Use for any branch naming or renaming, such as when asked to "name this branch".

  • 2 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 2, 2026
developmentbashgit

Works with

  • claude code
  • cli

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned October 5, 2026

npx -y skills add erclx/canon --skill git-branch --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Git Branch?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Git Branch
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/erclx-git-branch/badge)](https://www.skillsdirectory.com/skills/erclx-git-branch)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: git-branch
description: Generates and validates conventional branch names. Use for any branch naming or renaming, such as when asked to "name this branch".
metadata:
  family: ship
---

# Git branch

Before generating a branch name, read:

- `${CLAUDE_SKILL_DIR}/../../standards/branch.md`: format, types, length limit, and constraints

Follow it exactly.

## Context

Run these commands in parallel to gather git context:

- `git branch --show-current 2>/dev/null || echo "NO_BRANCH"`
- `git rev-parse --verify "origin/$(git branch --show-current)" 2>/dev/null && echo "EXISTS" || echo "LOCAL_ONLY"`
- `git log main..HEAD --oneline 2>/dev/null || echo "NO_COMMITS"`

## Guards

- If already on main or master, stop: `❌ Cannot rename a protected branch.`
- If branch name already follows conventions, stop: `✅ Branch name already follows conventions.`
- If no commits and no args provided, stop: `❌ No commits or description to derive a branch name from.`

## Response format

### Preview

- **Current:** <current_branch>
- **Suggested:** <suggested_name>
- **Length:** <count>/50
- **Status:** <LOCAL_ONLY | EXISTS on remote>
- **Analysis:** <brief explanation of type choice>

If EXISTS on remote, warn and stop:

```plaintext
⚠️ Branch exists on remote. Rename manually via GitHub UI or gh CLI to avoid breaking open PRs.
```

After outputting the preview, execute the final command immediately. Claude Code's tool permission dialog is the confirmation gate. Do not wait for user input.

### Final command

Only output if LOCAL_ONLY:

```bash
git branch -m <current> <suggested>
```

## After execution

Respond with exactly one line:

`✅ Renamed: <current> → <suggested>`

Do not add any other text.

Files in this skill

  • REQUIREMENT.md1.9 KB
  • SKILL.md1.7 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…