option
HomeHome Skill Git & Version Control conventional-git

conventional-git

samber/cc-skills 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 organiz

...Expand all
15
Updated time August 26, 2026

About conventional-git

Defines Conventional Commits v1.0.0 standards for branch names, git worktree names, and commit messages across GitHub and GitLab projects, so tooling can auto-generate changelogs, enforce SemVer bumps, and filter history by concern. Apply it when creating branches, naming worktrees, writing or generating commit messages, reviewing branch conventions, or setting up changelog automation, and whenever a project needs consistent git history, SemVer-driven releases, parseable changelogs, or automatic issue closing. It is designed for Claude Code or similar AI coding agents and requires git.

Branch names follow '/[issue-]' in lowercase with hyphens only, prefixed with an issue number when one exists so GitHub and GitLab auto-link it, and kept under 50 characters. Worktrees are treated as local checkout directories that never reach the remote: they live under .claude/worktrees/ and mirror the branch name with the slash replaced by a hyphen, and the skill is explicit that 'worktree' must never appear in a branch name. It advises running 'git worktree list' before creating a new one, keeping worktrees scoped to a single branch, and removing them once the branch is merged, with 'git worktree remove' and 'git worktree prune' commands provided.

Commit messages use the standard '[optional scope]: ' header with optional body and footers. A type table maps each type (feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert) to its SemVer impact and intended use. Rules require subject lines of 72 characters or fewer, imperative mood, no capital letter or trailing period, a blank line before the body, and explicit breaking-change signaling via '!' or a 'BREAKING CHANGE:' footer. Notably, it instructs never to add a Claude signature, AI agent attribution, or Co-authored-by trailer for any AI agent. It also documents closing issues through footer keywords (close/fix/resolve variants) on the default branch, including cross-repo and multiple-issue forms, and warns that squash merges take the PR title as the commit message, so the title must follow the convention.

FAQ

What format should branch names follow?

'/[issue-]' in lowercase with hyphens only, for example feat/42-user-authentication. Prefix with the issue number when one exists and keep the description under 50 characters.

Where should git worktrees be placed and how are they named?

Under .claude/worktrees/, named by mirroring the branch name with the slash replaced by a hyphen. The word 'worktree' must never appear in a branch name, since worktrees are a local checkout mechanism.

Does this skill add a Co-authored-by trailer for AI agents?

No. It explicitly instructs never to add a Claude signature, AI agent attribution, or Co-authored-by trailer for Claude or any other AI agent to commits.

How do I mark a breaking change in a commit?

Use a '!' after the type or scope, or add a 'BREAKING CHANGE:' footer, which triggers a MAJOR version bump. A breaking change described only in the body is invisible to changelog tools.

How can a commit close an issue automatically?

Place a keyword like Closes, Fixes, or Resolves with the issue reference in the footer; it triggers when merged into the default branch. Cross-repo and multiple-issue forms such as 'Closes owner/repo#42' are supported.

All Files

2 filesevals/evals.json12.1 KBViewSKILL.md7.2 KBView
View on GitHub

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-authenticationfeat/42-user-authenticationfix/login-race-conditionfix/87-login-race-conditiondocs/api-reference-updaterefactor/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-authenticationgit 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 locallygit worktree prune                                                # remove refs to already-deleted directories

Commit Message Format

<type>[optional scope]: <description>[optional body][optional footer(s)]

Types:

TypeSemVerWhen
featMINORNew feature
fixPATCHBug fix
docsDocs only
styleFormatting, no logic change
refactorRestructure, no feature/fix
perfPerformance improvement
testAdd/fix tests
buildBuild system, deps
ciCI config
choreAnything else (not src/test)
revertReverts 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 add BREAKING CHANGE: footer (triggers MAJOR bump) — body-only descriptions are invisible to changelog tools
  • revert commits SHOULD include This reverts commit <hash>. in the body — git revert generates this automatically; don't strip it
  • NEVER add a Claude signature, AI agent attribution, or Co-authored-by trailer for Claude or any other AI agent to commits

Examples:

feat(auth): add JWT token refresh
fix: prevent race condition on concurrent requestsIntroduce request ID and reference to latest request.Dismiss responses from stale requests.
refactor!: drop support for Go 1.18BREAKING 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 conditionCloses #42Closes 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 supportResolves #101Closes 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.

Common Mistakes

MistakeFix
feat: Added login pagefeat: add login page — imperative, no capital
fix: fix bug.fix: fix bug — no trailing period
Subject over 72 charsShorten; move detail to body
Breaking change only in bodyAdd ! 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 lineMove to footer — keeps subject clean and parseable

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, not feat(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.

All Files

0 files

Install conventional-git

Download and extract the skill files to your .claude/skills/ directory.

Download ZIP

Clone the repository and copy the skill files to your project.

git clone https://github.com/samber/cc-skills/blob/main/skills/conventional-git/SKILL.md # Copy SKILL.md to your .claude/skills/ directory

Copy Copy
Quick Setup: Copy the skill folder to .claude/skills/Claude will automatically detect and use the skill
Repository samber/cc-skills

Related Skills

github-project-management
Updated time June 29, 2026
using-git-worktrees
Updated time June 29, 2026
readme-blueprint-generator
Updated time July 5, 2026
finishing-a-development-branch
Updated time June 29, 2026
OR