conventional-git
samber/cc-skills
Normes « Conventional Commits v1.0.0 » relatives à la dénomination des branches, à la dénomination des arborescences de travail et aux messages de commit pour les projets GitHub et GitLab. À utiliser lors de la création de branches, de la dénomination des arborescences de travail, de la rédaction de commits, de la génération de messages de commit, de la vérification des conventions relatives aux branches ou de la mise en place de l’automatisation du journal des modifications. Appliquez ces règles lorsque votre projet nécessite un historique Git cohérent, des versions basées sur SemVer, la génération d'un journal des modifications analysable ou la fermeture automatique des tickets. Déclenchez ces règles lorsque l'utilisateur demande comment nommer un arborescence de travail, créer une arborescence de travail Git ou organiser
...Développer toutÀ propos conventional-git
Définit les normes « Conventional Commits v1.0.0 » relatives aux noms de branches, aux noms d'arborescences Git et aux messages de commit dans les projets GitHub et GitLab, afin que les outils puissent générer automatiquement des journaux de modifications, appliquer les incréments SemVer et filtrer l'historique par thème. Appliquez-les lors de la création de branches, de la dénomination des arborescences de travail, de la rédaction ou de la génération de messages de commit, de la révision des conventions de branche ou de la mise en place de l’automatisation des journaux de modifications, ainsi que chaque fois qu’un projet nécessite un historique Git cohérent, des versions basées sur SemVer, des journaux de modifications analysables ou la clôture automatique des tickets. Cette spécification est conçue pour Claude Code ou des agents de codage IA similaires et nécessite Git.
Les noms de branches suivent le format «
Les messages de commit utilisent l’en-tête standard «
FAQ
Quel format les noms de branches doivent-ils respecter ?
«
Où faut-il placer les arborescences de travail Git et comment les nommer ?
Dans le répertoire .claude/worktrees/, en les nommant de manière à refléter le nom de la branche, en remplaçant la barre oblique par un tiret. Le mot « worktree » ne doit jamais apparaître dans le nom d’une branche, car les worktrees constituent un mécanisme de checkout local.
Cette compétence ajoute-t-elle une ligne « Co-authored-by » pour les agents IA ?
Non. Elle indique explicitement de ne jamais ajouter de signature Claude, d’attribution d’agent IA ou de mention « Co-authored-by » pour Claude ou tout autre agent IA aux commits.
Comment signaler une modification rompant la compatibilité dans un commit ?
Utilisez un « ! » après le type ou la portée, ou ajoutez un pied de page « BREAKING CHANGE: », ce qui déclenche une mise à jour majeure de la version. Un changement de compatibilité décrit uniquement dans le corps du commit est invisible pour les outils de journal des modifications.
Comment un commit peut-il clôturer automatiquement un ticket ?
Placez un mot-clé tel que « Closes », « Fixes » ou « Resolves » avec la référence du ticket dans le pied de page ; cela se déclenche lors de la fusion dans la branche par défaut. Les formes inter-répertoires et multi-tickets telles que « Closes owner/repo#42 » sont prises en charge.
Tous les fichiers
2fichiers evals/evals.json 12,1Ko Afficher SKILL.md 7,2 Ko AfficherFollow 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-modulePrefix 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-conditionThe 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:
| 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 refreshfix: 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
| 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 |
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.
Tous les fichiers
0 fichiersInstaller conventional-git
Téléchargez et décompressez les fichiers de compétences dans votre répertoire .claude/skills/.
Télécharger le ZIPClonez le dépôt et copiez les fichiers de compétence dans votre projet.
git clone https://github.com/samber/cc-skills/blob/main/skills/conventional-git/SKILL.md # Copy SKILL.md to your .claude/skills/ directory
Copier





Maison
