Library › Coding AI › College students
Write a commit message in your club repo's exact format
Practice: Asking for a format you can use. About 5 minutes.
About this exercise
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.
Common mistakes when you ask AI for this
- Letting the AI guess the format. Without your repo's rules, the AI writes 'Fix timezone bug' or a long paragraph body. Try: Show the shape: "fix(calendar): <subject>, blank line, 2 lines starting '- ', then Closes #214."
- A vague body. The AI often writes 'fixed the bug' instead of what the code changed. Try: Ask: "One bullet on local date vs toISOString (UTC), one on the new test."
- Wrong closing keyword. The AI picks Fixes, Resolves or leaves it out, and your repo's bot only reads one form. Try: Add: "Last line exactly: Closes #214."
- Chatter around it. The AI adds 'Here's a commit message' and tips about git. Try: Add: "Only the message in one code block, nothing else."
What a strong prompt includes
- Gives the subject format
- Sets the body lines
- Gives the closing line
- Says what the change was
- Asks for only the message
Related exercises
- Add a cron line that matches the others in a crontab (Coding AI · Product managers)
- Add dark mode by overriding your existing CSS variables (Coding AI · Software developers)
- Add input checks to your number guessing game (Coding AI · High school students)
- Add input validation to a Java method with exact messages (Coding AI · Software developers)
- Add labels to a signup form without rewriting the page (Coding AI · High school students)