Directives de commit Git

VérifiéSûr

Guidelines pour les commits Git suivant Conventional Commits avec des types autorisés spécifiques (feat, fix, refactor, etc.) et un format `<type>: <description impérative en minuscules>`. Ce skill aide à structurer les messages de commit, à scinder les modifications en commits logiques lors de la revue pré-commit, et à décider entre un nouveau commit et un amend selon le contexte.

Spar Skills Guide Bot
DeveloppementIntermédiaire
14002/06/2026
Claude CodeCursorWindsurfCopilotCodex
#git#commits#conventional-commits#version-control

Recommandé pour

Notre avis

Fournit des directives pour créer, modifier, fusionner ou reformuler des commits Git en respectant la convention Conventional Commits.

Points forts

  • Applique strictement le format Conventional Commits avec types prédéfinis
  • Encourage la séparation logique des modifications en commits distincts
  • Propose d'amender le dernier commit lorsque approprié après approbation explicite
  • Signe automatiquement les commits avec -S

Limites

  • Ne convient pas si le projet utilise des scopes ou un format de message différent
  • Peut ralentir le flux de travail en exigeant des décisions de l'utilisateur pour amendement ou séparation
  • Ne gère pas automatiquement les pushs après les commits
Quand l'utiliser

Pour toutes les opérations de commit dans un projet Git, surtout lorsqu'une discipline stricte de messages de commit est nécessaire.

Quand l'éviter

Si le workflow requiert des messages de commit avec scopes, des formats non conventionnels, ou si l'utilisateur préfère un commit unique rapide sans revue.

Analyse de sécurité

Sûr
Score qualité95/100

The skill only uses safe Git commands (add, commit, diff, log, status) and does not instruct any destructive, exfiltrating, or obfuscated actions. No system or network risks are introduced.

Aucun point d'attention détecté

Exemples

Simple commit with conventional message
Stage all changes and create a commit with message 'fix: resolve login bug'
Suggest commit splitting
Review my staged changes and suggest how to split them into multiple logical commits
Amend vs new commit decision
I just made a small fix for a previous commit that hasn't been pushed. Should I amend or create a new commit?

name: commit description: Git commit guidelines. Use when creating, amending, squashing, or rewording git commits, staging files, or writing commit messages. allowed-tools: Bash(git add:), Bash(git commit:), Bash(git diff:), Bash(git log:), Bash(git status:*)

Git Commit Guidelines

Follow Conventional Commits with these overrides:

  • Allowed types: feat, fix, refactor, chore, docs, test, ci
  • Message format: <type>: <lowercase imperative description>
  • No scopes — do not use <type>(scope): form
  • Add body, separated by blank line, only when subject line insufficient

Pre-Commit Review

Before committing, review all staged and unstaged changes to determine if they should be split into multiple commits. Changes belong in separate commits when they have different types (e.g., feat + fix), affect unrelated areas, or serve distinct purposes.

If the user has not explicitly asked to split, suggest doing so and list the proposed commits. Proceed with a single commit only if all changes are logically cohesive.

Also check for changes made outside the current session (e.g., editor saves, other tools). If they are relevant to the commit, offer to include them. If they are unrelated, silently ignore them unless the user asks to include them.

New Commit vs. Amend

When changes closely follow a previous commit (e.g., a quick fix or forgotten file), evaluate whether amending the previous commit is more appropriate than creating a new one. Amending is preferable when the change corrects or completes the previous commit and that commit has not been pushed.

Never amend without the user's explicit approval. Present the two options (new commit vs. amend) and let the user decide.

Additional Guidelines

  • Always sign commits with git commit -S
  • Do NOT include AI co-authoring information
  • Do NOT use git -C <path> when the current directory is already the repository root
Skills similaires