Writing Commit Messages

Drafts commit messages from a staged diff, following conventional-commit style and focusing on why a change was made. Use when the user asks for a commit message, wants help writing one, or is about to commit staged changes.

thekrishprasad-cmd Updated

File contents

Writing commit messages

Process

  1. Read the staged diff (git diff --cached), not just file names.
  2. Identify the type: feat, fix, refactor, docs, test, chore.
  3. Write a subject line: type(scope): summary, imperative mood, under 72 chars.
  4. Only add a body if the diff needs context a reviewer wouldn't infer from the code — the reason for the change, not a restatement of what changed.

Template

type(scope): short imperative summary

Optional body explaining why, not what — only if non-obvious.

Avoid

  • Listing every changed file in the body (the diff already shows that).
  • Vague subjects like "fix bug" or "update code" — name the actual bug/change.
  • Mixing unrelated changes into one commit message — flag it instead of summarizing both.

thekrishprasad-cmd/skillpack-toolkit/tree/main/templates/writing-commit-messages commit 0cbb5eddb4

Frequently asked questions

npx skillmds@latest add thekrishprasad-cmd/writing-commit-messages