Write Conventional Commit Messages from a Pasted Git Diff
Paste a Git diff and get conventional commit messages with 50-character subjects and bodies that explain why, plus a split plan when the changes are unrelated.
You getSplit decision and for each commit
Prompt
You are a senior software engineer who reviews commits for a team that uses Conventional Commits.
I will paste a Git diff (from git diff or git diff --staged) right after this message. Write the commit message or messages for it.
Rules:
1. The subject uses type(scope): summary. Type is one of feat, fix, refactor, docs, test, chore, perf, style, build or ci. The whole subject is 50 characters or fewer, in imperative mood, with no trailing period.
2. Wrap the body at 72 characters. Explain why the change was made and what problem it solves. Describe what changed only when the diff does not make it obvious.
3. If the diff mixes unrelated changes, split it into separate commits. For each commit, list its files or hunks and give the staging commands. Use git add -p when one file mixes concerns.
4. Add a BREAKING CHANGE: footer only if the diff changes a public API, a config key or behavior that callers rely on.
5. If the reason for a change cannot be read from the diff, give your best guess and mark it (verify).
Output format:
- Split decision: one line stating single commit or N commits, and why.
- For each commit: a heading "Commit N", the files or hunks it includes, the staging commands, the full message in a code block, and the subject's character count.
End with one line listing what you assumed or could not tell from the diff.Example output
Tips and common edits
Why this works
- A hard 50-character subject limit with a reported count keeps git log readable and makes the rule easy to check.
- Requiring the body to explain why gives reviewers the reasoning the diff cannot show.
- Flagging guesses with (verify) stops the model from presenting invented reasons as facts.
Use before committing messy work. Run git diff --staged or git diff, then paste the output into ChatGPT, Claude or Gemini right after the prompt. Remove any secrets or keys first.
Common edits
- Swap the type list for your team's own commit types or add a required ticket ID footer.
- Ask for a single squash-merge message instead of a split plan when merging a pull request.
Prompt details
- By
- Prompts-GPT editors
- Published
Did this prompt work?
Keep exploring
More like this
Resolve a Git Merge Conflict and Keep What Both Branches Intended
Paste your conflict markers and get a plain explanation of each side's change, a merged version that keeps both intents, and a test checklist.
Release Notes From Git Log Skill for Users and Developers (SKILL.md)
A SKILL.md that writes release notes from the commits between two tags, split into a plain-language section for users and a technical changelog for developers.
Explain a Complex SQL Query in Plain English, Step by Step
Get a plain-English walkthrough of any SQL query in execution order, with tiny sample tables, row counts after each clause, and the hidden gotchas.
Explain a Confusing Coding Tutorial or Docs Passage in Plain English
Paste a confusing passage from a programming tutorial or docs and get a plain-English rewrite, inline jargon definitions, a tiny runnable example and a list of what to learn first.
Explain Any Regex Token by Token with Matching and Failing Examples
Get a token-by-token table explaining your regex, plus strings that match, nearly match and fail, and a clear catastrophic backtracking risk check with a safer rewrite.
Find and Fix Data Quality Issues with Ready-to-Run SQL Checks
Paste your schema and get SQL queries that catch duplicates, NULLs, orphaned foreign keys and out-of-range values, each with what a bad result means and a fix.