Standardize Git commit messages in the format `[type] area - summary` with a required detailed body and explicit wrapped lines. Use when generating, rewriting, or reviewing commit messages so all agent commits follow one consistent structure, include clear intent, and apply line wrapping with `\r`.
Generate one complete commit message with:
Use this exact subject format:
[type] area - summary
Follow these subject rules:
type from: feat, fix, refactor, docs, test, chore, perf, build, ci, style, revert.area to the changed scope (for example auth, api, ui, infra, deps, repo, book/ch02).summary as a concise imperative phrase that states the main change.Always include a detailed body. Cover these sections:
Why: explain motivation or problem context.What: list key code or content changes (prefer 2 to 5 concrete bullets).Impact: explain behavior changes, risks, migration notes, or follow-up.Validation: list tests/checks run; if none, write Validation: not run.Keep wording concrete and specific to changed files and behavior.
Wrap detailed-body lines to a maximum of 72 characters.
Use literal \r characters to mark wrap points in the detailed body.
Choose area by these rules:
api, ui, infra, core) or repo.area empty.[type] area - summary
Why:
...
What:
- ...
- ...
Impact:
...
Validation:
...
Apply wrapping only to the detailed body (Why, What, Impact, Validation).
Do not wrap the subject line.
When a body line exceeds 72 characters, insert the literal characters \r
at wrap points.
[fix] auth - reject expired refresh tokens before middleware handoff
Why:
Expired refresh tokens were not rejected in one branch,\r
which caused inconsistent auth failures downstream.
What:
- Add an explicit expiry check before the refresh path.
- Normalize 401 error mapping for expired and malformed tokens.
- Extend middleware tests to cover refresh-token expiry.
Impact:
Auth failures now happen earlier with a consistent 401\r
response, reducing downstream error handling noise.
Validation:
pnpm test auth/middleware.spec.ts