Conventional Commit Message Generator

CategoryCoding
Authorjeff-nasseri
LicenseMIT
Rating4.10/5
Uses16.1K

What it does

Standardize your project's version history by automating the creation of commit messages that follow the Conventional Commits specification. Instead of writing vague messages like "fixed bug" or "updated files," you can feed the AI your git diff or a brief summary of changes to receive a machine-readable, professional commit message. This is particularly useful for teams using automated semantic versioning (SemVer) tools, as it ensures that changelogs are generated accurately and that the history remains searchable. It removes the mental overhead of remembering specific type prefixes and formatting rules while maintaining a strict, consistent audit trail for your codebase.

Use cases

  • Diff-to-Commit: Paste the output of git diff --cached to get a precise summary of staged changes.
  • Feature Wrap-up: Provide a bulleted list of implemented changes to generate a comprehensive commit with a detailed body and issue references.
  • Refactoring Cleanup: Quickly categorize a series of code cleanups as refactor or style without manually typing the boilerplate.
  • Breaking Change Alerts: Ensure that architectural shifts are explicitly flagged with the ! modifier or BREAKING CHANGE footer to alert other developers.

How to use

Provide the AI with the prompt below. Once initialized, simply paste your git diff or a description of your work, and the AI will return a formatted commit message.
text
I want you to act as a conventional commit message generator following the Conventional Commits specification. I will provide you with git diff output or description of changes, and you will generate a properly formatted commit message. The structure must be: <type>[optional scope]: <description>, followed by optional body and footers. Use these commit types: feat (new features), fix (bug fixes), docs (documentation), style (formatting), refactor (code restructuring), test (adding tests), chore (maintenance), ci (CI changes), perf (performance), build (build system). Include scope in parentheses when relevant (e.g., feat(api):). For breaking changes, add ! after type/scope or include BREAKING CHANGE: footer. The description should be imperative mood, lowercase, no period. Body should explain what and why, not how. Include relevant footers like Refs: #123, Reviewed-by:, etc. (This is just an example, make sure do not use anything from in this example in actual commit message).

Tips

  • Use Staged Diffs: For the most accurate results, use git diff --cached so the AI only sees the changes you actually intend to commit.
  • Specify the Scope: If the AI misses the scope (e.g., the specific module or package), mention the component name in your input to help it categorize the change correctly.
  • Provide Context for "Why": If the "why" behind a change isn't obvious from the code (like a weird workaround for a third-party bug), add a quick note to your input so the AI can include it in the commit body.
  • Batch Small Changes: If you have multiple unrelated changes, feed them to the AI one by one to maintain the "one commit per logical change" best practice.

Notes

  • Review the Output: Always double-check the generated message to ensure the AI hasn't misinterpreted a complex logic change as a simple "refactor."
  • Context Window: Extremely large diffs may exceed the AI's context window or lead to generic summaries; try to keep your commits atomic and small.
Join our Telegram