{"id":"code-dev-revert-commit-team-format","audience":"developers","category":"coding","track":"coding","technique":"format","title":"Write a revert commit message in your team's format","free":false,"task":"You're reverting the fuzzy-search commit after last night's incident. Your team's revert format: subject 'revert(search): <original subject after the colon> (<short sha>)', a blank line, 'Reason: <under 15 words>', then the trailers 'Incident: INC-2291' and 'Approved-by: Mira Okafor' as the last two lines. Only you know the reason: p95 search latency went from 180ms to 2.4s. Put the message in exactly 1 code block of at most 5 non-empty lines, under 10 words outside it.","materialLabel":"Recent history (attached to your prompt automatically)","material":"$ git log --oneline -8\n9d03b7e chore(deps): bump pg to 8.12.0\n4e1a9c2 feat(search): add fuzzy matching\nb7720fa feat(search): add fuzzy matching config flag\n31c9e04 fix(cart): keep coupon after login\ne88a1d0 docs: update search README\n2fa6c11 feat(search): debounce input by 200ms\n0c4be19 test(search): cover empty query\na91f3d3 chore: format with prettier 3.3\n\n$ git show --stat 4e1a9c2\ncommit 4e1a9c2d7f0b13e8a6c5d2f9e1b4a7c3d8e0f6a1\nAuthor: Tomas Reyes <tomas@lumora.test>\nDate:   Wed Nov 4 16:12:40 2026\n\n    feat(search): add fuzzy matching\n\n    Uses trigram similarity on product names when exact search\n    returns fewer than 5 results.\n\n src/search/query.ts      | 48 +++++++++++++++++++++------\n src/search/query.test.ts | 66 +++++++++++++++++++++++++++++++++++++\n 2 files changed, 102 insertions(+), 12 deletions(-)\n\nNote: b7720fa only adds the flag definition (default off) and is\nsafe to keep. On-call chat says to revert the matching itself.","rules":[{"type":"codeBlocks","count":1},{"type":"maxCodeLines","max":5},{"type":"maxProseWords","max":10}],"mistakes":[{"title":"Git's default subject","why":"The AI writes Revert \"feat(search): ...\", which your changelog tool can't parse.","fix":"Show it: \"Subject: revert(search): add fuzzy matching (4e1a9c2)\".","checks":["r0"]},{"title":"A vague reason","why":"The AI writes 'caused issues' because it doesn't know what happened.","fix":"Add: \"Reason: p95 search latency went from 180ms to 2.4s.\"","checks":["r1"]},{"title":"Missing trailers","why":"Your release checks look for the incident and approver lines.","fix":"Add: \"Last two lines: Incident: INC-2291 and Approved-by: Mira Okafor.\"","checks":["r2"]},{"title":"Extra text","why":"The AI adds git commands and a note about the flag commit.","fix":"Add: \"Only the message in one code block, nothing else.\"","checks":["codeBlocks","maxCodeLines","maxProseWords"]}],"promptHints":[{"label":"Gives the subject format","patterns":["revert\\(search\\)","4e1a9c2"]},{"label":"Gives the real reason","patterns":["180","2\\.4","latency","p95"]},{"label":"Adds the trailers","patterns":["INC-2291","Approved-by","Mira"]},{"label":"Picks the right commit","patterns":["not.{0,20}(flag|config|b7720fa)","matching itself"]},{"label":"Asks for only the message","patterns":["only the message","code block","nothing else"]}],"hint":"A revert message is for whoever reads the history later. Give the AI your team's exact format, the real reason and the trailers.","rubricLabels":["The subject is exactly revert(search): add fuzzy matching (4e1a9c2), reverting 4e1a9c2 and not the config flag commit b7720fa","Has a line starting 'Reason: ' under 15 words that says p95 search latency went from 180ms to 2.4s","The last two lines are exactly 'Incident: INC-2291' and 'Approved-by: Mira Okafor'"]}