AI Prompts for Git Workflow, Commit Messages, and Code Review Comments
Git hygiene is one of those engineering practices that compounds over time — good commits make debugging six months later dramatically easier, and good pull request descriptions make code review faster. I've automated most of my commit message and PR description writing with AI. The prompts that produce useful descriptions are structured around communicating intent, not summarizing changes.
Commit Message Prompts: Writing Conventional Commits at Scale
Conventional Commits (type(scope): subject format) make changelogs and semantic versioning automation work. Writing them well under time pressure is where AI helps most. My prompt: 'Write a commit message for these changes: [paste git diff or describe changes]. Use Conventional Commits format: type(scope): subject. Types: feat, fix, docs, style, refactor, test, chore, perf. Subject line under 72 characters. Body: one paragraph explaining WHY this change was made (not WHAT — the diff shows what, the body explains why). Footer: note any breaking changes with BREAKING CHANGE: prefix. Return 3 options for the subject line in different framings so I can pick the clearest.' The WHY vs WHAT distinction in the body is the most important instruction. Developers writing commit messages naturally describe what changed (because it's visible). The message that's valuable six months later when debugging explains why — the business context, the edge case being fixed, the trade-off made.
For automated changelog generation with tools like commitizen or semantic-release, add: 'This project uses semantic-release for automated versioning. Flag if this commit should trigger a major, minor, or patch version bump based on the change type.' This keeps the developer thinking about semantic impact with every commit.
Conventional Commits: type(scope): subject under 72 characters
Body: explain WHY, not WHAT — the diff shows what, the why is what matters later
BREAKING CHANGE footer: required for semantic-release to detect breaking changes
Get 3 subject line options: pick the framing that best conveys intent
For semantic-release: note the version bump type with each commit message
Types to know: feat (minor bump), fix (patch bump), BREAKING CHANGE (major bump)
Pull Request Description Prompts That Speed Up Code Review
Good pull request descriptions reduce review time by giving reviewers context before they look at a single line of code. My PR description prompt: 'Write a pull request description for these changes: [list changes or paste diff summary]. Structure: (1) one-paragraph summary — what this PR accomplishes from a product or engineering perspective, not a list of files changed, (2) motivation — why this change is being made (link to issue if relevant, or context if no issue), (3) approach — the key technical decision made and why this approach was chosen over alternatives, (4) testing done — what was tested manually and what automated tests cover this change, (5) screenshots or demo — flag where a screenshot would help reviewers understand UI changes, (6) review focus — what should the reviewer pay closest attention to, and what can be reviewed quickly.' The 'review focus' section is the highest-value element for reviewer productivity — it tells the reviewer where to allocate their attention instead of making them infer it from the diff.
For PRs that are part of a larger feature being built incrementally, add: 'This is PR 3 of 5 in a series implementing [feature]. Note what's already been merged and what's coming in subsequent PRs.' Context on incremental feature PRs prevents reviewers from asking 'why isn't X implemented?' when X is coming in the next PR.
PR description: product/engineering summary, not file list
Approach section: the key technical decision + why this approach over alternatives
Review focus: explicit direction on where reviewers should spend their attention
For incremental feature PRs: note which PR in the series this is
Screenshots for UI changes: flag in the template where one would help
Testing section: both manual test steps and automated test coverage summary