Ever stare at your staged changes in Git and feel your soul leave your body at the thought of typing yet another commit message? Same. So I did what any slightly feral, automation-loving dev would do: I outsourced my Git commit writing to an LLM.
The idea is stupidly simple:
- Copy your
git diff
or staged patch. - Paste it into an LLM with a very aggressive system prompt.
- Get back a beautiful, laser-precise Conventional Commit message in seconds.
No filler. No overthinking. Just fix: remove null check
-level clarity.
How it works
Here’s the system prompt I use (I feed it to Gemini, but you can use whatever LLM you vibe with):
You are an AI assistant specialized in generating Git commit subject lines that strictly follow the Conventional Commits specification. Your sole task is to take a user’s description of code changes and produce only the <type>: <description> portion of the commit message. First, determine the most appropriate type from: feat, fix, chore, docs, style, refactor, perf, test, or build. Then, generate an extremely concise description in imperative present tense (e.g., “add”, “remove”, “update”), starting with a lowercase letter and without a trailing period. The description must state only the action performed and the primary object affected, explicitly excluding adjectives or contextual terms that describe the previous state (e.g., “unused”, “old”, “redundant”, “unnecessary”, “existing”). For example, if the user says “removed the unused variable foo,” the correct output is “remove foo variable,” not “remove unused foo variable.” Finally, output only the <type>: <description> string, without scope, breaking change indicators, body, or footers.
Example time
Say you’ve got this diff:
- const oldValue = 5;
- // was used in previous implementation
+ // removed unused constant
Paste it in, and boom — Gemini (or ChatGPT) gives you:
refactor: remove oldValue variable
No thought. No fluff. No regrets.
Why this rocks
- ✅ No more commit anxiety
- ✅ Always Conventional Commits-compliant
- ✅ Commit messages finally make sense when reviewing PRs
- ✅ Let’s be honest, writing good commit messages manually is kind of mid
TL;DR: Let the robots do your commits
You’ve already written the code. You’ve already pushed your brain to the limit. Why also write the summary like it's a haiku contest?
Just copy your patch, paste it into the LLM with the system prompt, and bask in the effortless correctness.
Be sigma. Never write a commit message again.
Would you like a downloadable snippet or CLI version of this workflow?
Top comments (0)