Skip to content

Instantly share code, notes, and snippets.

@rlorenzo
Last active February 12, 2026 00:01
Show Gist options
  • Select an option

  • Save rlorenzo/7987fbe10e55c62726b432ac7a288c7a to your computer and use it in GitHub Desktop.

Select an option

Save rlorenzo/7987fbe10e55c62726b432ac7a288c7a to your computer and use it in GitHub Desktop.
Commit message creator prompt

Propose a single, high-quality git commit message for the currently staged changes in this repository.

How to gather context:

  • Read the staged diff: git diff --staged
  • List staged files: git status -s
  • Skim recent history to avoid repetition: git log -n 20 --oneline
  • Get the current branch name: git branch --show-current
    • If the branch name contains a ticket identifier like ABC-123, include it at the start of the subject line, before the type.

Goals:

  • Capture the big picture and user-facing impact first.
  • Prefer intent and observable behavior over implementation details.
  • Optimize for future readers, not exhaustiveness.
  • Brevity is a requirement, not a preference.
  • Only describe what is actually in the staged diff — never fabricate or infer changes that are not present.

When to include a body:

  • Include bullet points only if the subject line alone does not sufficiently explain the change.
  • Omit the body entirely for minor, obvious, or single-focus changes.

Significance filter for bullets:

  • Each bullet must answer: "What would be unclear or risky if this were omitted?"
  • Include only distinct, material changes in behavior, data, or UX.
  • Merge related changes into a single bullet whenever possible.
  • Skip internal plumbing, refactors, DTOs, helpers, and test coverage unless they are the primary change.

Style rules:

  • Use Conventional Commits.
  • Choose the most accurate type, prefer feat when adding new behavior.
  • Optional scope is allowed.
  • Subject line is imperative, concise, max 72 chars, no trailing period.
  • Body wraps at 72 chars.
  • Lead with why, then what. Avoid how unless it affects behavior.

Output format exactly:

[optional-ticket] type(optional-scope): concise big-picture subject

  • Important change or impact
  • Another important change, only if distinct and necessary
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment