0

Example — Commit Message Writer

Demonstration of prompts/dev/commit-message.txt with the variables filled in. Illustrative example of what such a prompt can produce. The response was generated by an AI in one pass — not guaranteed, and not professional advice. All names, numbers, and

Prompt · برومبت

Works with

claude-code (compatible), claude (compatible), codex (compatible), chatgpt (compatible), gemini-cli (compatible), cursor (compatible), copilot (compatible), opencode (compatible), amp (compatible), roo (compatible), kiro (compatible), goose (compatible), junie (compatible), trae (compatible), cline (compatible), continue (compatible), antigravity (compatible), windsurf (compatible), augment (compatible), qwen-code (compatible), aider (compatible)

Content

Example — Commit Message Writer

Demonstration of [prompts/dev/commit-message.txt](../prompts/dev/commit-message.txt) with the variables filled in. Illustrative example of what such a prompt can produce. The response was generated by an AI in one pass — not guaranteed, and not professional advice. All names, numbers, and details are fictional (Egypt-plausible where relevant).

Prompt (filled)

You are a senior engineer who reviews git history for a living. Write clean commit messages for my changes using the Conventional Commits style (feat:, fix:, docs:, refactor:, chore:).
MY DETAILS
- What changed (paste a summary or the diff): I added a discount_code column to the orders table, passed it through the checkout API, and applied it in the total calculation. Also updated the checkout tests.
- Type of change I think it is: feat
YOUR TASK — answer in this exact order:
1. BEST MESSAGE: subject line under 50 characters, imperative mood ("add", not "added"), plus a body of 2–3 lines explaining WHY the change was made, not what (the diff already shows what).
2. TWO ALTERNATIVES: 2 other valid messages in case the first does not match my team's style.
3. TYPE CHECK: is feat the right Conventional Commits type? If not, the correct one and why.
4. SPLIT ADVICE: if my changes mix unrelated things (e.g. a bug fix + a new feature), say so and propose how to split them into separate commits, one message each.
5. BREAKING CHANGE: if anything here could break other people (removed option, changed output), add the correct BREAKING CHANGE footer.
RULES
- Input-complete prompt: if the pasted material is unreadable or clearly incomplete, say exactly what is missing instead of proceeding on assumptions.
- No vague subjects ("update", "changes", "wip").
- Body lines under 72 characters.
- If the diff is huge and I pasted only a summary, say what detail would make the message better.
OUTPUT FORMAT
- Five numbered sections: best message in a code block (subject ≤50 chars + body ≤3 lines), 2 alternatives, type verdict (1 line), split advice, breaking-change footer if needed. Lead with BEST MESSAGE.

Example AI response

1. BEST MESSAGE

feat(checkout): apply discount codes at checkout

Promo campaigns need per-order discounts, which we previously
handled manually in support. Storing the code on the order also
gives us an audit trail for refunds and campaign reporting.

2. TWO ALTERNATIVES

feat(orders): support discount codes end to end
feat: add discount codes to checkout flow

3. TYPE CHECK feat is correct — you added new user-facing functionality (a working discount path), not a repair or internal cleanup.

4. SPLIT ADVICE Your description mentions two separable concerns:

  1. Schema + API + total calculation → the feature itself.
  2. Checkout test updates → the verification of that feature. If the tests only cover the new feature, one commit is defensible. But if you also touched existing tests that were failing before, split it: test: fix flaky checkout tests first, then the feature commit — otherwise the feature commit looks like it also repaired unrelated breakage.

5. BREAKING CHANGE No footer needed: adding an optional discount_code column and honoring it when present is backward-compatible — clients that never send the field behave exactly as before. If your API *rejects* requests without the field, or the totals response shape changed, that would warrant:

BREAKING CHANGE: checkout requests without a discount_code field are rejected

--- *Generated for demonstration as part of Prompt Stash. Outputs vary by model and run.*

Source and license

Source
Prompt Stash
Original
Ziadtareks/prompt-stash/examples/dev-commit-message.md
License
MIT