Skip to main content

AI Commit Message Generator

Generate meaningful, conventional commit messages from diffs that communicate intent, scope, and impact following your team standards.

Fill in the placeholders

Edit the values, then copy your finished prompt.

Your Prompt
prompt.txt
Generate a commit message for the following code changes in a monorepo with frontend and backend packages project. The team follows Conventional Commits with Angular scopes conventions and the changes touch authentication module. Follow these rules: 1) Analyze the diff to determine the commit type: feat (new feature), fix (bug fix), refactor (code restructuring), docs (documentation), test (test changes), chore (maintenance), perf (performance), or style (formatting) — choose the most specific type that accurately represents the primary intent. 2) Write the subject line in imperative mood, under 72 characters, starting with the type and scope: type(scope): description. The description should answer "what does this commit do" not "what did I do." 3) Write a commit body separated by a blank line that explains moderate — explain why but keep it under 5 lines: why this change was necessary, what approach was chosen and why alternatives were rejected, and any non-obvious side effects. 4) Add footer references: Closes #123 or Refs JIRA-456 for issue tracking, BREAKING CHANGE if the commit introduces backward-incompatible changes, and Co-authored-by if pair programming. 5) If the diff contains multiple logical changes, suggest splitting into 3 separate commits with their own messages, ordered by dependency. 6) Flag any concerns: if the diff includes debugging code, commented-out code, or TODO comments that should not be committed.

What this prompt does

This prompt generates a conventional commit message from a diff in a [project_type] that follows [commit_convention] and touches [scope_area]. It does more than label the change — it classifies the type, writes an imperative subject, explains the why in the body, and flags problems in the diff before they land.

The structure works because it encodes commit discipline as rules. It picks the most specific type — feat, fix, refactor, docs, test, chore, perf, or style — from the diff's primary intent, then writes a type(scope): description subject under [char_limit] characters in imperative mood. The body, at the [body_detail_level] you set, explains why the change was necessary and which alternatives were rejected. Footer references use your [footer_format], BREAKING CHANGE is added when warranted, and if the diff mixes concerns it suggests splitting into up to [max_commits] ordered commits. It also flags debugging code, commented-out blocks, and stray TODOs that should not be committed.

When to use it

  • You work in conventional-commit repos and want consistent type(scope) subjects.
  • You want commit bodies that explain why, so git history stays searchable later.
  • Your diff mixes concerns and you want it split into clean commits.
  • You need a quick check for debugging leftovers before committing.
  • You want footer references in your [footer_format] for issue tracking.
  • You need BREAKING CHANGE flagged when a diff breaks compatibility.

Example output

Expect a formatted commit message ready to drop into your editor. The subject line reads type(scope): description in imperative mood and stays under [char_limit] characters, answering what the commit does rather than what you did. Below a blank line sits a body written at your [body_detail_level], explaining why the change was necessary, what approach was chosen, and which alternatives were rejected. Footer references follow your [footer_format], with a BREAKING CHANGE note added when the diff breaks compatibility and a Co-authored-by line for pair work. If the diff bundles unrelated changes, you also get a suggestion to split it into up to [max_commits] ordered commits, plus warnings about any debugging code, commented-out blocks, or stray TODOs the diff would otherwise commit.

Pro tips

  • Set [char_limit] to your team's real subject cap (often 72) so the subject does not get truncated in tooling.
  • Keep [body_detail_level] honest about scope — a short, focused body that explains why beats a long one that restates the diff.
  • Let it split tangled diffs; landing up to [max_commits] single-concern commits keeps history bisectable.
  • Match [footer_format] to your tracker (Closes #123 or a Jira key) so issues link automatically.
  • Trust the leftover-detection step; catching commented-out code and stray TODOs before they land saves a cleanup commit later.
  • Make sure the chosen type reflects the primary intent — a fix bundled with a refactor should usually be two commits.

Frequently Asked Questions

How does it choose the commit type?
It analyzes the diff and picks the most specific type that matches the primary intent — feat, fix, refactor, docs, test, chore, perf, or style. When a diff serves more than one purpose, it leans toward suggesting a split so each commit carries a single, accurate type.
Can it split one diff into multiple commits?
Yes. If the diff contains multiple logical changes, it proposes splitting into up to `[max_commits]` separate commits, each with its own message and ordered by dependency. This keeps history bisectable and makes each change easier to review and revert.
Does it catch things I shouldn't commit?
It flags debugging code, commented-out blocks, and TODO comments present in the diff that probably shouldn't land. This pre-commit check is useful for catching leftovers before they reach the branch and save you a follow-up cleanup commit.
Will it format issue references for my tracker?
Yes. It adds footer references in your `[footer_format]`, such as Closes #123 or a Jira reference, and includes a BREAKING CHANGE footer when the diff introduces a backward-incompatible change. Set the format to match your tracker so links resolve automatically.
Engr Mejba Ahmed

Need this built for real?

Engr Mejba Ahmed

AI Developer · Software Engineer

I'm Mejba — I design and ship production AI systems, automations, and full-stack apps. If you want this turned into a working solution for your team, let's talk.

More in AI Writing for Developers

Engr Mejba Ahmed

Engr Mejba Ahmed

AI assistant · trained on my work

👋

Hey there!

Quick Actions

WhatsApp Direct line to me

Chat on WhatsApp

+880 1723 741224 · Replies within the hour on working days

Popular Questions

Engr Mejba Ahmed is connected
Engr Mejba Ahmed is typing...
Engr Mejba Ahmed avatar

✉ Want me to follow up? Drop your email

Engr Mejba Ahmed avatar

📞 Connect Directly

Choose how you'd like to reach me

WhatsApp

+880 1723 741224

Email

mejba.13@gmail.com

✓ Details sent! I'll get back to you shortly.

Powered by OpenAI

335+

Blog Posts

25

AI Courses

63

Projects

Services & Expertise

Pricing & Process

Learning & Resources

Connect & Support