
conventional-git
β 157by samber Β· part of samber/cc-skills
Conventional Commits v1.0.0 branch naming, worktree naming, and commit message standards for GitHub and GitLab projects. Use when creating branches, naming worktrees, writing commits, generating commit messages, reviewing branch conventions, or setting up changelog automation. Apply when your project needs consistent git history, SemVer-driven releases, parseable changelog generation, or automatic issue closing. Trigger when the user asks how to name a worktree, create a git worktree, or...
Conventional Commits v1.0.0 branch naming, worktree naming, and commit message standards for GitHub and GitLab projects. Use when creating branches, naming worktrees, writing commits, generating commit messages, reviewing branch conventions, or setting up changelog automation. Apply when your project needs consistent git history, SemVer-driven releases, parseable changelog generation, or automatic issue closing. Trigger when the user asks how to name a worktree, create a git worktree, or...
Inspect the full instructions your agent will receiveExpandCollapse
This is the exact playbook injected into your agent when the skill activates β shown here so you can audit it before installing. You don't need to read it to use the skill.
by samber
Conventional Commits v1.0.0 branch naming, worktree naming, and commit message standards for GitHub and GitLab projects. Use when creating branches, naming worktrees, writing commits, generating commit messages, reviewing branch conventions, or setting up changelog automation. Apply when your project needs consistent git history, SemVer-driven releases, parseable changelog generation, or automatic issue closing. Trigger when the user asks how to name a worktree, create a git worktree, or...
npx skills add https://github.com/samber/cc-skills --skill conventional-git
Download ZIPGitHub157
Conventional Commits & Branch Naming
Follow Conventional Commits v1.0.0 for both branch names and commit messages β consistent naming lets tools auto-generate changelogs, enforce SemVer bumps, and filter history by concern.
Branch Naming
Format: <type>/[issue-]<description> β lowercase, hyphens only, no special chars except /.
feat/user-authentication
feat/42-user-authentication
fix/login-race-condition
fix/87-login-race-condition
docs/api-reference-update
refactor/payment-module
Prefix with the issue number when one exists β GitHub and GitLab auto-link it and it makes git log immediately traceable to the tracker. Keep the description under 50 characters β most git UIs truncate branch names in lists around that length. Match the type to the work you're doing β this is the contract readers use to understand the branch purpose at a glance.
NEVER include worktree in a branch name β git worktrees are a local checkout mechanism, not a branch concept; the name would leak implementation details into the remote and confuse other contributors.
Worktree Naming
Worktrees are local checkout directories β they never appear in the remote. Place them under .claude/worktrees/ and name them by replacing the branch / separator with -.
git worktree add .claude/worktrees/feat-user-authentication feat/user-authentication
git worktree add .claude/worktrees/fix-87-login-race-condition fix/87-login-race-condition
The directory name mirrors the branch name so git worktree list stays readable and each worktree is immediately traceable to its branch without inspecting the checkout. Run git worktree list before creating a new one β reuse an existing worktree if it already covers the same branch.
Keep worktrees scoped to a single branch. Doing unrelated work inside someone else's worktree obscures which changes belong where and makes cleanup error-prone.
Remove the worktree once its branch is merged β either after a local merge or after the pull/merge request is closed on the remote. Stale worktrees accumulate and make git worktree list unreadable.
git worktree remove .claude/worktrees/feat-user-authentication # branch merged locally
git worktree prune # remove refs to already-deleted directories
Commit Message Format
[optional scope]:
[optional body]
[optional footer(s)]
Types:
Type SemVer When
feat MINOR New feature
fix PATCH Bug fix
docs β Docs only
style β Formatting, no logic change
refactor β Restructure, no feature/fix
perf β Performance improvement
test β Add/fix tests
build β Build system, deps
ci β CI config
chore β Anything else (not src/test)
revert β Reverts a previous commit
Rules:
-
Subject line β€ 72 characters β git log and GitHub/GitLab UIs silently truncate longer subjects
-
Imperative mood: "add" not "added" β reads as an instruction, not a history log
-
No capital letter, no trailing period β enforces uniform parsing by changelog tools
-
Body separated by blank line β parsers split header/body at the first blank line
-
Breaking changes: use
!after type/scope, or addBREAKING CHANGE:footer (triggers MAJOR bump) β body-only descriptions are invisible to changelog tools -
revertcommits SHOULD includeThis reverts commit <hash>.in the body βgit revertgenerates this automatically; don't strip it -
NEVER add a Claude signature, AI agent attribution, or
Co-authored-bytrailer for Claude or any other AI agent to commits
Examples:
feat(auth): add JWT token refresh
fix: prevent race condition on concurrent requests
Introduce request ID and reference to latest request.
Dismiss responses from stale requests.
refactor!: drop support for Go 1.18
BREAKING CHANGE: Go 1.18 no longer supported; uses stdlib APIs from 1.21+
Closing Issues via Commit Messages
Both GitHub and GitLab detect keywords in commit messages and automatically close the referenced issue when the commit lands on the default branch. Place the reference in the footer (preferred β keeps the subject line clean).
Keywords: close, closes, closed, fix, fixes, fixed, resolve, resolves, resolved β case-insensitive.
GitHub:
fix(auth): prevent token expiry race condition
Closes #42
Closes owner/repo#99
-
Triggers when merged into the default branch (usually
main) -
Cross-repo:
Closes owner/repo#42 -
Close multiple:
Closes #42, closes #43 -
Works in PR descriptions too
GitLab:
feat: add dark mode support
Resolves #101
Closes group/project#42
-
Triggers when merged into the default branch (configurable per project)
-
Cross-project:
Closes group/project#42 -
Close multiple:
Closes #101, closes #102 -
Works in MR descriptions too
Tip: Pair with the commit type β fix: closing a bug issue, feat: closing a feature request β keeps the changelog semantically coherent.
Best Practices
-
Align branch type and commit type β
feat/auth-*branch βfeat(auth):commits -
One concern per branch β mixing fixes into feature branches obscures the changelog
-
Use scope consistently within a branch β
feat(auth):throughout, notfeat(user):mid-way -
Squash merge: when squash-merging a PR/MR, the branch commits are collapsed into one β the PR/MR title becomes the commit message. If the title doesn't follow conventional commits format, changelog generation breaks silently. Always set the PR title before squashing.
npx skills add https://github.com/samber/cc-skills --skill conventional-gitRun this in your project β your agent picks the skill up automatically.
Common Mistakes
Mistake Fix
feat: Added login page feat: add login page β imperative, no capital
fix: fix bug. fix: fix bug β no trailing period
Subject over 72 chars Shorten; move detail to body
Breaking change only in body Add ! or BREAKING CHANGE: footer β tools won't detect body-only
feat(adding-auth): ... feat(auth): ... β scope is a noun, not a verb
Closes #42 in subject line Move to footer β keeps subject clean and parseable