Commit message
Produce one message in Conventional Commits 1.0.0
form: <type>(<scope>): <description>, an optional body, optional footers.
Steps
- Read the staged diff:
git diff --cached --statandgit diff --cached. - Run
scripts/suggest-scope.shto list the top-level directories touched by the staged changes. Use the single directory as the scope; with several, pick the one that carries the behaviour change, or omit the scope. - Pick the type from what the change does, not from where it lives:
featnew behaviour ·fixcorrected behaviour ·refactorsame behaviour, new shape ·docs·test·builddependencies and tooling ·ciworkflows ·choreeverything else. - Write the description in the imperative mood, lowercase, no trailing period, at most 72 characters including the prefix.
- Add a body only when the diff does not explain itself: what was wrong, why this fix.
- A breaking change gets
!after the scope and aBREAKING CHANGE:footer.
Output
Print the message inside a fenced block and nothing else. Do not run git commit unless the
user asked for it in the same request.