💻 Coding

Git Commit Message & PR Description from Diff

Turn a diff and intent into Conventional Commits, a full PR body, test plan, and reviewer notes. Flags risk without inventing files.

0.0
0Reviews
P
August 24, 2026

Prompt

Act as a staff engineer writing the commit and PR that a reviewer can trust. Use the diff as source of truth. Do not invent files, tests, or behavior that are not in the diff or the stated intent.

Inputs:
- Diff: [Paste git diff or gh pr diff]
- Intent: [What I meant to do]
- Repo conventions: [Conventional Commits / Jira keys / none]
- Ticket: [ID or none]
- Risk I worry about: [Risk]
- Reviewer audience: [Team, new hire, open source]
- Tests I ran: [Commands and results, or none]
- Breaking?: [Yes / No / Unsure]

Generate:
1. Diff readout: What actually changed, in 8-12 bullets. Group by file. Call out anything that does not match Intent.
2. Commit message options (3): Conventional Commits unless conventions say otherwise. Subject 50-72 chars. Body: why, not a file list. Mark recommended. If the diff is two unrelated concerns, split into 2 commit messages and say so.
3. PR title (60 chars or less) and full PR body in this markdown:
   - Summary
   - Motivation
   - Changes
   - Test plan (checkboxes). Include Tests I ran. Add missing tests as unchecked boxes, labeled "not run / not in diff"
   - Risks and rollback
   - Screenshots: only if UI; else "n/a"
4. Reviewer guide: 4 places to look first. One question you want them to answer.
5. Risk flags: race conditions, access control, migrations, feature flags, secrets. Only if the diff supports it. If Risk I worry about is not visible in the diff, say so.
6. Follow-ups: 3 items that should not sneak into this PR.

Constraints:
- Never invent a test, screenshot, or benchmark.
- Do not claim fully covered if Tests I ran is none.
- Subjects: imperative mood, no period, no WIP unless Intent says so.
- If Diff is thin or truncated, list what you cannot certify.
- No "please find attached." 

Instructions

Replace every [bracket] with your details before running. Works on ChatGPT, Claude, and Gemini.

Examples

Example Input

Diff (summarized, full patch in the PR):
app/waitlist/page.tsx: submit disabled when pending or email empty.
Label Sending while pending, else Join waitlist.
If empty, show: No seats left in this cohort. Join the next list.
app/waitlist/page.test.tsx: disables submit while pending; email a@b.co; button disabled.
Intent: stop double-submit and show a real empty state when the cohort is full
Repo conventions: Conventional Commits, no ticket in subject
Ticket: none
Risk I worry about: empty state might show on first paint before the count loads
Reviewer audience: two teammates on the waitlist page
Tests ran: unit tests for waitlist page, 6 passed
Breaking?: No

Example Output

1. Diff readout
- waitlist/page.tsx: submit disabled when pending or email is empty.
- Label switches to Sending while pending.
- Empty-state paragraph when empty is true: cohort full, join next list.
- waitlist/page.test.tsx: one test, pending path, button disabled.
- No test for empty copy, no test for missing email.
- No loading gate in the change. Double-submit is covered. First-paint empty flicker is not.

2. Commit messages (* = rec)
* fix(waitlist): disable submit while pending and show full-cohort empty

Stops double-submit. Empty copy only when empty is true. No fetch change here.
fix(waitlist): pending button label and empty state
Same change, weaker subject.
feat(waitlist): add empty cohort message
Wrong type: this is a fix to submit plus empty UI, not a feature.
One concern, one commit.

3. PR
Title: fix(waitlist): block double-submit and show full-cohort empty

Summary
Disable submit while pending or email is blank. Show empty copy when empty is true.

Motivation
Double-submit on slow join. Need a real empty state when the cohort is full.

Changes
- Button disabled when pending or email empty; label Sending
- empty paragraph
- Test: pending disables the button
- Not in diff: fetch for empty, loading gate, tests for empty copy or blank email

Test plan
- [x] waitlist page tests (pass, 6 tests)
- [ ] empty copy visible when empty (not in diff)
- [ ] button disabled with blank email (not in diff)
- [ ] empty stays false until count resolves (not in this diff)

Risks and rollback
empty on first paint can flash No seats left if empty defaults true. Rollback: revert the two files. No migration.
Screenshots: n/a in the change. Add pending and empty captures before merge if you have them.

4. Reviewer guide
Look first: default of empty; pending source; empty vs invalid email; test only covers pending.
Question: what is empty before the cohort count returns?

5. Risk flags
Access control: none. Secrets: none. Migrations: none. Feature flags: none.
Named risk is real and not visible as a loading gate in the change.

6. Follow-ups
1. Tests for empty copy and blank email. 2. Loading state so empty cannot flash. 3. Invalid-email handling separate from missing email.

Reviews (0)

Please login to leave a review.
Loading reviews...