All skills
github avatar

/conventional-branch

@dd0ff67 official
by githubgithub/awesome-copilot40k stars
5,040

Create Git branches following the Conventional Branch specification (feature/, bugfix/, hotfix/, release/, chore/). Use when creating a new branch, naming a branch, or checking whether a branch name complies with the spec.

Use this Skill: https://skilld.dev/gh/github/awesome-copilot/conventional-branch

This session only. Nothing lands on disk.

SKILL.md

β‰ˆ61 tokens always: the name and description. β‰ˆ1k when used: this file.

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

Type Alias Purpose
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)

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 allowed only in release/ version descriptions (e.g., release/v1.2.0)
  • 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

Invalid Examples

Branch Problem
Feature/Add-Login Uppercase letters
feature/new--login Consecutive hyphens
feature/-new-login Leading hyphen
feature/new-login- Trailing hyphen
release/v1.-2.0 Hyphen adjacent to dot
fix/header bug Space
fix/header_bug Underscore
unknown/some-task Unknown 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

Relationship with Conventional Commits

Conventional Branch complements Conventional Commits:

Conventional Branch Typical Conventional Commit
feature/add-login feat: add login page
bugfix/fix-header fix: header overflow on mobile
chore/update-deps chore: bump lodash to 5.0
release/v1.2.0 chore: release v1.2.0

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

Source: SKILL.md on GitHub

No alerts3mo3 checks Β· Risk SAFE
  • Gen Agent Trust Hub3mo

    This skill automates Git branch creation following Conventional Branch naming standards. It uses standard Git and shell commands to manage repository branches based on user input, including specific instructions to validate and sanitize branch names.

  • Socket3mo

    No alerts

  • Snyk3mo

    Risk: LOW Β· No issues

Signed by skilld at dd0ff67. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 18 hours ago.

Activeupdated 4 months ago
  • Git/VCS
  • conventional-branch
  • branch-naming
  • workflow
  • github

README badge

README badge for github/awesome-copilot/conventional-branch

Creates Git branches following the Conventional Branch specification with types like feature/, bugfix/, hotfix/, release/, and chore/. Use this when naming a new branch or validating branch names against the kebab-case, lowercase, and prefix rules defined in the spec.

Generated from the current SKILL.md.

Does this skill support aliases like feat/ and fix/?
Yes. feat/ is an alias for feature/ and fix/ is an alias for bugfix/. Both are valid and follow the spec.
Can I use underscores or spaces in branch names?
No. Only alphanumerics, hyphens, and dots are allowed. Spaces and underscores must be replaced with hyphens.
Are dots allowed in branch descriptions?
Dots are only allowed in release/ branches for version numbers (e.g., release/v1.2.0). They are not permitted in other branch types.
What trunk branches does this skill recognize?
The skill recognizes main, master, and develop as trunk branches. It detects the repo's default branch and branches off from it rather than creating new trunk branches.

Generated from the current SKILL.md. These answers refresh after source changes.