.cursor/commands/cmt.md
Generate a commit message for changes in this chat. Do not commit or push (staging allowed with flag).
Edit this section when using in a new repository.
Scopes must match package/app names. No scope is also valid. Invalid scope = commitlint rejection.
noask — skip questions, generate immediatelystage — stage affected files after showing messageall — include all git changes (default: only files discussed in chat)staged — include staged files in addition to chat context (default: only files discussed in chat)Examples: /cmd cmt, /cmd cmt noask, /cmd cmt stage all, /cmd cmt noask stage
Types (REQUIRED - ALWAYS FIRST): feat | fix | build | chore | ci | perf | refactor | revert | style | test
CRITICAL: Type is MANDATORY and ALWAYS comes FIRST
type(scope): description ← CORRECT: type first, scope optional
type: description ← CORRECT: type without scope
WRONG FORMATS:
docs: description ← WRONG: "docs" is a SCOPE, not a type!
scope: description ← WRONG: missing type!
If working with docs:
feat(docs): add new guide ← CORRECT
chore(docs): update readme ← CORRECT
docs: something ← WRONG
If "noask" present → skip to step 4
Review conversation for problem/decisions/rationale
Determine scope:
git diff for all changesClassify impact:
If high impact AND conversation lacks clear "why" → ask:
"Significant changes detected. Please explain: Why needed? What problem solved? Any trade-offs?"
Then STOP and wait for response.
Generate commit message (TYPE FIRST, then optional scope in parentheses)
If "stage" present → run git add on affected files (only chat-mentioned files unless "all" flag present)
type(scope): description
High impact (with context):
type(scope): short description
Why:
[Problem/requirement that prompted this]
What changed:
[Key decisions, trade-offs, non-obvious choices]
Context (optional):
[Future work, related issues, caveats]
Low impact or limited context:
type(scope): short description
Why:
[1 sentence if not obvious from title]
feat(api): add rate limiting to auth endpoints
Why:
DDoS attacks on /api/sign-in caused production degradation.
What changed:
Redis over in-memory for multi-instance support.
Sliding window with exponential backoff for better UX.
Context:
May need IP allowlist for trusted services (CLERK-5678).
chore(docs): fix typo in authentication guide
Why:
Users reported confusion from misspelling.
ci: consolidate test job into checks to speed up pipeline
Why:
Reduce CI overhead by running tests in same job as lint/type checks.
feat(docs): document commitlint scope validation system
Why:
Added clear documentation to help contributors understand scope requirements.