Generated banner for Conventional Branch
Generated logo for Conventional Branch

Conventional Branch

GitHubOfficialFirst committed by shenxianpengDistributed by GitHub

  • Skill
  • Workflow
  • Software development
  • MIT
  • No issues found

From the author

Create Git branches following the Conventional Branch specification (feature/, bugfix/, hotfix/, release/, chore/, plus AI agent prefixes ai/, copilot/, cursor/, claude/, codex/). Use when creating a new branch, naming a branch, or checking whether a branch name complies with the spec.
— the description by shenxianpeng

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

Conventional Branch provides a structured, consistent naming convention for Git branches to improve repository organization and clarity. It defines a clear format consisting of a type prefix and a descriptive name, including specific support for AI-generated branches. The skill guides users through selecting the correct branch type, validating the name against strict formatting rules, identifying the appropriate base branch, and executing the creation process. It is designed to complement Conventional Commits, ensuring that branch intent aligns with commit history.

What it does

  • Standardizes branch names using the format type/description
  • Supports standard types like feature, bugfix, hotfix, release, and chore
  • Includes specific prefixes for AI coding agents like Copilot, Cursor, and Claude
  • Validates branch names against strict character and formatting rules
  • Automates the detection of the correct trunk branch for branching
  • Provides a step-by-step workflow to create and checkout new branches

When to use it

  • When starting a new development task and needing to create a branch
  • When you want to enforce consistent naming standards across a team
  • When you need to distinguish between human-authored and AI-generated branches
  • When preparing for a release or performing urgent hotfixes
  • When you need to ensure branch names are compatible with automated CI tools

Advantages

  • Improves repository readability and navigation
  • Ensures consistency across team contributions
  • Facilitates better integration with automated CI/CD pipelines
  • Provides clear visibility into the origin of AI-generated code
  • Reduces errors by enforcing strict naming conventions

Usage examples

“Create a new branch for a login page feature.”
The agent identifies the type as feature, validates the name feature/add-login-page, detects the base branch, and executes the checkout and creation commands.
“I need a branch for a bug fix related to the header.”
The agent suggests fix/header-bug, validates the format, and prepares the branch based on the current repository trunk.
“Create a branch for code generated by Cursor.”
The agent uses the cursor/ prefix to create a branch like cursor/refactor-auth-flow, ensuring it follows the required naming rules.
“Check if my branch name release/v1.2.0 is valid.”
The agent verifies the name against the specification rules and confirms it is a valid branch name.

Install

  1. Download the skill as a ZIP:

    https://mp-staging.autogineer.com/agent-skills/github/conventional-branch/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip conventional-branch.zip -d .agents/skills

Documentation by shenxianpeng

Conventional Branch

Create Git branches that follow the Conventional Branch specification — a simple, consistent convention for naming Git branches.

Branch Name Format

<type>/<description>
Branch Types

Purpose prefixes — describe the intent of the work:

TypeAliasPurpose
feature/feat/New features or enhancements
bugfix/fix/Bug fixes
hotfix/—Urgent production fixes
release/—Release preparation (dots allowed in version: release/v1.2.0)
chore/—Non-code tasks (deps, docs, config)

AI agent source prefixes — identify branches generated by AI coding agents:

TypeAliasPurpose
ai/—Generic prefix for any AI coding agent
copilot/—GitHub Copilot
cursor/—Cursor
claude/—Claude Code by Anthropic
codex/—OpenAI Codex

Use a vendor-specific prefix when you know which agent is producing the branch; use ai/ as a vendor-neutral fallback.

Trunk Branches

main, master, and develop are trunk branches — they do not use a prefix. Never create new branches with the same names as trunk branches; branch off them instead.

Naming Rules

  • Lowercase only — no uppercase letters anywhere

  • Alphanumerics, hyphens, and dots — a-z, 0-9, -, .

  • Dots are allowed in any description, typically for version numbers (e.g., release/v1.2.0, chore/upgrade-node-v20.11)

  • No underscores, spaces, or special characters

  • No consecutive hyphens (--), dots (..), or hyphen-dot adjacency (-. or .-)

  • No leading or trailing hyphens or dots in the description

Valid Examples

main
master
develop
feature/add-login-page
feat/add-login-page
bugfix/fix-header-bug
fix/header-bug
hotfix/security-patch
release/v1.2.0
chore/update-dependencies
feature/issue-123-new-login
ai/refactor-auth-flow
copilot/add-login-page
cursor/fix-header-bug
claude/security-patch
codex/optimize-query

Invalid Examples

BranchProblem
Feature/Add-LoginUppercase letters
feature/new--loginConsecutive hyphens
feature/-new-loginLeading hyphen
feature/new-login-Trailing hyphen
release/v1.-2.0Hyphen adjacent to dot
fix/header bugSpace
fix/header_bugUnderscore
unknown/some-taskUnknown prefix type

Description Guidelines

  • Use kebab-case with 2-5 words

  • Be descriptive but concise (~50 chars total)

  • Good: add-oauth-login, fix-header-overflow, update-ci-config

  • Bad: fix-bug, new-feature

Workflow

Follow these steps:

Step 1 — Determine Branch Type

Ask the user (if not already clear):

  • Branch type — default to feature when uncertain

  • Brief description — what the branch is for

If the user mentions a ticket or issue number, include it in the description (e.g., feature/issue-123-add-oauth).

Step 2 — Validate the Name

Check the assembled name against the Naming Rules above. If any rule fails, fix it:

  • Lowercase everything

  • Replace underscores and spaces with hyphens

  • Collapse consecutive hyphens

  • Strip leading/trailing hyphens

Step 3 — Detect the Base Branch

Different repos use different trunk branches. Detect which one this repo uses:

# Prefer the remote's default branch
git symbolic-ref --short refs/remotes/origin/HEAD 2>/dev/null | sed 's|^origin/||'

If that returns nothing, check which trunk branch exists locally (priority order: develop, main, master):

for b in develop main master; do
  git show-ref --verify --quiet "refs/heads/$b" && echo "$b" && break
done

Step 4 — Create and Checkout

git checkout <base>
git pull origin <base>
git checkout -b <type>/<description>

Step 5 — Confirm

Tell the user:

  • The branch name that was created

  • That they are now on the new branch

  • Remind them: git push -u origin <branch-name> when ready

Validation

commit-check validates branch names against the specification. Run commit-check --branch, use its check-branch pre-commit hook, or commit-check-action in GitHub Actions. Configuration for GitHub rulesets, GitLab, Bitbucket and Git hooks is at https://conventionalbranch.org/enforce/.

Relationship with Conventional Commits

Conventional Branch complements Conventional Commits:

Conventional BranchTypical Conventional Commit
feature/add-loginfeat: add login page
bugfix/fix-headerfix: header overflow on mobile
chore/update-depschore: bump lodash to 5.0
release/v1.2.0chore: release v1.2.0

Align the branch type with commit types where possible (e.g., feature/* branches with feat: commits).

Files

SKILL.md

Conventional Branch

Create Git branches that follow the Conventional Branch specification — a simple, consistent convention for naming Git branches.

Branch Name Format

<type>/<description>
Branch Types

Purpose prefixes — describe the intent of the work:

TypeAliasPurpose
feature/feat/New features or enhancements
bugfix/fix/Bug fixes
hotfix/—Urgent production fixes
release/—Release preparation (dots allowed in version: release/v1.2.0)
chore/—Non-code tasks (deps, docs, config)

AI agent source prefixes — identify branches generated by AI coding agents:

TypeAliasPurpose
ai/—Generic prefix for any AI coding agent
copilot/—GitHub Copilot
cursor/—Cursor
claude/—Claude Code by Anthropic
codex/—OpenAI Codex

Use a vendor-specific prefix when you know which agent is producing the branch; use ai/ as a vendor-neutral fallback.

Trunk Branches

main, master, and develop are trunk branches — they do not use a prefix. Never create new branches with the same names as trunk branches; branch off them instead.

Naming Rules

  • Lowercase only — no uppercase letters anywhere

  • Alphanumerics, hyphens, and dots — a-z, 0-9, -, .

  • Dots are allowed in any description, typically for version numbers (e.g., release/v1.2.0, chore/upgrade-node-v20.11)

  • No underscores, spaces, or special characters

  • No consecutive hyphens (--), dots (..), or hyphen-dot adjacency (-. or .-)

  • No leading or trailing hyphens or dots in the description

Valid Examples

main
master
develop
feature/add-login-page
feat/add-login-page
bugfix/fix-header-bug
fix/header-bug
hotfix/security-patch
release/v1.2.0
chore/update-dependencies
feature/issue-123-new-login
ai/refactor-auth-flow
copilot/add-login-page
cursor/fix-header-bug
claude/security-patch
codex/optimize-query

Invalid Examples

BranchProblem
Feature/Add-LoginUppercase letters
feature/new--loginConsecutive hyphens
feature/-new-loginLeading hyphen
feature/new-login-Trailing hyphen
release/v1.-2.0Hyphen adjacent to dot
fix/header bugSpace
fix/header_bugUnderscore
unknown/some-taskUnknown prefix type

Description Guidelines

  • Use kebab-case with 2-5 words

  • Be descriptive but concise (~50 chars total)

  • Good: add-oauth-login, fix-header-overflow, update-ci-config

  • Bad: fix-bug, new-feature

Workflow

Follow these steps:

Step 1 — Determine Branch Type

Ask the user (if not already clear):

  • Branch type — default to feature when uncertain

  • Brief description — what the branch is for

If the user mentions a ticket or issue number, include it in the description (e.g., feature/issue-123-add-oauth).

Step 2 — Validate the Name

Check the assembled name against the Naming Rules above. If any rule fails, fix it:

  • Lowercase everything

  • Replace underscores and spaces with hyphens

  • Collapse consecutive hyphens

  • Strip leading/trailing hyphens

Step 3 — Detect the Base Branch

Different repos use different trunk branches. Detect which one this repo uses:

# Prefer the remote's default branch
git symbolic-ref --short refs/remotes/origin/HEAD 2>/dev/null | sed 's|^origin/||'

If that returns nothing, check which trunk branch exists locally (priority order: develop, main, master):

for b in develop main master; do
  git show-ref --verify --quiet "refs/heads/$b" && echo "$b" && break
done

Step 4 — Create and Checkout

git checkout <base>
git pull origin <base>
git checkout -b <type>/<description>

Step 5 — Confirm

Tell the user:

  • The branch name that was created

  • That they are now on the new branch

  • Remind them: git push -u origin <branch-name> when ready

Validation

commit-check validates branch names against the specification. Run commit-check --branch, use its check-branch pre-commit hook, or commit-check-action in GitHub Actions. Configuration for GitHub rulesets, GitLab, Bitbucket and Git hooks is at https://conventionalbranch.org/enforce/.

Relationship with Conventional Commits

Conventional Branch complements Conventional Commits:

Conventional BranchTypical Conventional Commit
feature/add-loginfeat: add login page
bugfix/fix-headerfix: header overflow on mobile
chore/update-depschore: bump lodash to 5.0
release/v1.2.0chore: release v1.2.0

Align the branch type with commit types where possible (e.g., feature/* branches with feat: commits).

Requirements and compatibility

Written for: GitHub Copilot

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Needs: Needs a command-line tool, Needs Node.js

Security

No issues found by our static scan· No issues found

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

First committed by
GitHub avatar of shenxianpengshenxianpeng
Publisher
GitHub (Official)
Distributed by
GitHub
Source
github/awesome-copilot · skills/conventional-branch · commit 797337f
Licence
MIT License (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced
Contributors
shenxianpeng

AutoGineer is not affiliated with or endorsed by shenxianpeng or GitHub.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download conventional-branch.zip