Commit Message Generation
VCS Detection
FIRST: Detect which VCS this repo uses:
bash
[[ -d .jj ]] && echo "JJ" || echo "GIT"
Getting Changes
If JJ repo:
bash
jj diff # shows current changes jj log -r @ # shows current change description
If Git repo:
bash
git diff --staged # for staged changes git diff # for unstaged changes git status # context on what's changed
Message Format
Generate messages with:
- •Summary (under 50 chars, present tense)
- •Detailed description (why + what, not how)
- •Affected components if relevant
Style:
- •Present tense ("Add feature" not "Added feature")
- •Explain why the change matters
- •Reference file:line for key changes
- •Keep it human-readable
Never include:
- •Co-author tags (especially not yourself)
- •Thread IDs or internal agent metadata
- •Generic fluff like "fixes bug" without context
Example
code
Add user authentication timeout handling Users were getting stuck in limbo when auth tokens expired during long sessions. Now we detect expiration and prompt re-login. - auth/session.go:42 - token expiration check - ui/Login.tsx:18 - re-login prompt
Workflow
For JJ repos:
- •Show current diff with
jj diff - •Suggest message
- •User runs:
jj describe -m "your message"
For Git repos:
- •Show staged changes with
git diff --staged - •Suggest message
- •User runs:
git commit -m "your message"
Do not automatically commit unless explicitly requested.