{"id":"code-col-commit-message-scoped-format","audience":"college","category":"coding","track":"coding","technique":"format","title":"Write a commit message in your club repo's exact format","free":false,"task":"You're committing this fix to the Campus Events open-source club repo, which uses this format: a subject 'fix(calendar): ...' in lowercase imperative under 50 characters, a blank line, exactly 2 body lines starting with '- ', and a last line 'Closes #214'. Put the message in exactly 1 code block of at most 4 non-empty lines, with under 10 words outside it.","materialLabel":"Your staged diff and the issue (attached to your prompt automatically)","material":"Issue #214 (opened by @rina-k): Events after 8pm show up on the wrong day\n\"An event at 9:30pm on Oct 3 shows on Oct 4 in the week view. Only\nhappens for people west of UTC I think? Saw it on my laptop in Denver.\"\n\n$ git diff --staged\ndiff --git a/src/calendar/groupByDay.js b/src/calendar/groupByDay.js\nindex 3b1c2e0..9f4a7d1 100644\n--- a/src/calendar/groupByDay.js\n+++ b/src/calendar/groupByDay.js\n@@ -4,9 +4,12 @@\n export function groupByDay(events) {\n   const days = {};\n   for (const event of events) {\n-    const key = new Date(event.start).toISOString().slice(0, 10);\n+    const d = new Date(event.start);\n+    const key = `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`;\n     (days[key] ||= []).push(event);\n   }\n   return days;\n }\n+\n+const pad = (n) => String(n).padStart(2, \"0\");\ndiff --git a/src/calendar/groupByDay.test.js b/src/calendar/groupByDay.test.js\nindex 77ab210..c01de55 100644\n--- a/src/calendar/groupByDay.test.js\n+++ b/src/calendar/groupByDay.test.js\n@@ -18,3 +18,10 @@\n+test(\"keeps a 9:30pm event on its local day\", () => {\n+  process.env.TZ = \"America/Denver\";\n+  const days = groupByDay([{ start: \"2026-10-03T21:30:00-06:00\" }]);\n+  expect(Object.keys(days)).toEqual([\"2026-10-03\"]);\n+});\n\nRecent commits in the repo, for reference:\n  feat(rsvp): add waitlist when an event is full\n  docs: fix broken link in CONTRIBUTING\n  chore(deps): bump vite to 5.4.10","rules":[{"type":"codeBlocks","count":1},{"type":"maxCodeLines","max":4},{"type":"maxProseWords","max":10}],"mistakes":[{"title":"Letting the AI guess the format","why":"Without your repo's rules, the AI writes 'Fix timezone bug' or a long paragraph body.","fix":"Show the shape: \"fix(calendar): <subject>, blank line, 2 lines starting '- ', then Closes #214.\"","checks":["r0","maxCodeLines"]},{"title":"A vague body","why":"The AI often writes 'fixed the bug' instead of what the code changed.","fix":"Ask: \"One bullet on local date vs toISOString (UTC), one on the new test.\"","checks":["r1"]},{"title":"Wrong closing keyword","why":"The AI picks Fixes, Resolves or leaves it out, and your repo's bot only reads one form.","fix":"Add: \"Last line exactly: Closes #214.\"","checks":["r2"]},{"title":"Chatter around it","why":"The AI adds 'Here's a commit message' and tips about git.","fix":"Add: \"Only the message in one code block, nothing else.\"","checks":["codeBlocks","maxProseWords"]}],"promptHints":[{"label":"Gives the subject format","patterns":["fix\\(calendar\\)","imperative","50 char"]},{"label":"Sets the body lines","patterns":["\\b(2|two)\\b.{0,20}(bullet|line)","- "]},{"label":"Gives the closing line","patterns":["closes #214","#214"]},{"label":"Says what the change was","patterns":["utc","toisostring","local (date|time)","time ?zone"]},{"label":"Asks for only the message","patterns":["only the (message|commit)","code block","nothing else"]}],"hint":"Every repo has its own commit rules and the AI doesn't know yours. Show it the exact subject prefix, how many body lines, and the closing line.","rubricLabels":["The first line starts with 'fix(calendar): ', is lowercase and imperative (e.g. 'use local date when grouping events'), and is under 50 characters","There are exactly 2 body lines starting with '- ', one about using the local date instead of the UTC date from toISOString, and one about the added Denver time zone test","The last line is exactly 'Closes #214' (not 'Fixes' or 'Resolves')"]}