feat(commits): follow project convention, else short messages
New lib/commit-message.md looks for a documented convention first. Without one, messages stay under 50 words at medium technical level.
This commit is contained in:
1 parent
eb1cfe55a9
commit
e91dcb3f12
8 files changed
+58
-31
No files matched your search
@@ -1,5 +1,10 @@
|
||||
# TODO
|
||||
|
||||
## 2026-10-15 — short commit messages (feature/short-commit-messages)
|
||||
- [x] `lib/commit-message.md`: lookup of a documented convention (README, CONTRIBUTING, CLAUDE.md, `.claude/` rules, commitlint, template), else 50 words max, medium technical level. Git log is not a convention.
|
||||
- [x] Citers patched: commit-changer, bugfix STEP 6, feat STEP 5, hotfix STEP 4, client-handover-writer, CLAUDE.global.md (1 line, 320-line budget).
|
||||
- [ ] Residual: `chore(memory)` / `docs:` helper commits untouched (already one line). release-executor prep message untouched (fixed one-liner).
|
||||
|
||||
## 2026-10-15 — model-router: probe a move target before routing main to it (bugfix/router-probe-before-route)
|
||||
Contract `.claude/tasks/contracts/2026-10-14-router-probe-before-route-0005.md`, plan r3 `.claude/tasks/plans/2026-10-14-router-probe-before-route-0005.md`.
|
||||
- [x] /bugfix run: Fable out of credits routed (BLK-030, LRN-218); r1 → r3; 497 tests, verifier CONFORME 11/11, security PASS; commit 2cccc43 + docs.
|
||||
|
||||
@@ -193,6 +193,7 @@ when asked: the user runs `! git push`. An invalid value counts as manual,
|
||||
nothing pushes and the stop is named. `GITFLOW_NO_PUSH=1` only for
|
||||
throwaway test repos. Outside manual mode a branch ahead of its upstream
|
||||
is a defect, not a state.
|
||||
Commit messages: project convention, else 50 words max (lib/commit-message.md).
|
||||
|
||||
## Security — non-negotiable defaults
|
||||
Apply at every step: design, scaffolding, implementation, review.
|
||||
|
||||
@@ -564,8 +564,8 @@ If `PENDING_CHANGES` non-empty → invoke /commit-change skill via subagent:
|
||||
> auto-fix iterations of /seo, /harden (web) or /cso (non-web). Group into
|
||||
> atomic logical commits (e.g., separate SEO meta-tag commit from harden
|
||||
> security-headers commit; separate dep-upgrade commit from gitignore
|
||||
> commit). Use Conventional Commits format. After committing, return the
|
||||
> SHA list."
|
||||
> commit). Message per `~/.claude/lib/commit-message.md`. After committing,
|
||||
> return the SHA list."
|
||||
|
||||
**PUSH STATE READ.** Three separate Bash calls, never combined, read-only:
|
||||
`git branch --show-current` → `<br>`;
|
||||
|
||||
@@ -123,18 +123,9 @@ artificially split what was done as one action.
|
||||
|
||||
### Commit message format
|
||||
|
||||
Follow Conventional Commits and match the repo's existing style:
|
||||
|
||||
```
|
||||
<type>(<scope>): <short description>
|
||||
|
||||
<optional body — what and why, not how>
|
||||
```
|
||||
|
||||
Types: `feat`, `fix`, `refactor`, `chore`, `docs`, `test`, `style`, `perf`
|
||||
|
||||
Keep the first line under 72 characters. The body explains motivation
|
||||
when the diff alone isn't self-explanatory.
|
||||
Follow `$HOME/.claude/lib/commit-message.md`: the project's documented
|
||||
convention if there is one, else a short message (50 words max, medium
|
||||
technical level). Run its lookup once for the whole plan.
|
||||
|
||||
### Capitalize candidates (draft only — decided later, written in `MODE: apply`)
|
||||
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
# Commit message: project convention first, else short
|
||||
|
||||
Run before composing ANY commit message (flow or ad-hoc). Read-only lookup:
|
||||
|
||||
```bash
|
||||
git config --get commit.template
|
||||
ls CONTRIBUTING* commitlint.config.* .commitlintrc* .gitmessage 2>/dev/null
|
||||
grep -n -i -m3 -E "commit (message|convention)|conventional commit" \
|
||||
README* CONTRIBUTING* CLAUDE.md .claude/rules/* docs/* 2>/dev/null
|
||||
```
|
||||
|
||||
## 1. A convention is documented
|
||||
|
||||
Hit in the project's own files (README, CONTRIBUTING, project `CLAUDE.md`,
|
||||
`.claude/` rules, commitlint config, commit template) → follow it to the
|
||||
letter: format, language, length, scope list. Nothing below applies.
|
||||
|
||||
Read each grep hit before trusting it. The git log is NOT a convention: it
|
||||
can carry the verbosity this file removes.
|
||||
|
||||
## 2. No convention: short
|
||||
|
||||
- Subject `<type>(<scope>): <what>`, 72 chars max. Types: feat, fix,
|
||||
refactor, chore, docs, test, perf, style.
|
||||
- Optional body: one or two sentences on why. Whole message 50 words max.
|
||||
- Medium technical level: say the behavior and its cause. No file lists,
|
||||
line numbers, step-by-step of the diff or internal identifiers. A reader
|
||||
who knows the stack follows without opening the diff.
|
||||
|
||||
```
|
||||
fix(auth): reject expired refresh tokens
|
||||
|
||||
The refresh check compared the expiry in seconds against milliseconds, so
|
||||
expired tokens passed. Both sides now use seconds.
|
||||
```
|
||||
|
||||
Out of scope: `chore(memory)` and `docs:` commits made by
|
||||
`memory-commit.sh` / `doc-commit.sh`, already one line by their own style.
|
||||
@@ -223,13 +223,9 @@ Parse the `BUGFIX-EXEC REPORT`:
|
||||
- `skip` → leave changes uncommitted, exit cleanly.
|
||||
- `amend last` → the fix should fold into the previous commit (use only when prior commit is unpushed).
|
||||
|
||||
3. Commit using conventional format (after approval):
|
||||
```
|
||||
fix(<scope>): <root cause description>
|
||||
|
||||
<what was wrong and why>
|
||||
<what the fix does>
|
||||
```
|
||||
3. Commit after approval, message per `$HOME/.claude/lib/commit-message.md`
|
||||
(project convention first, else short: root cause in the subject, at most
|
||||
two sentences of body).
|
||||
4. Print summary:
|
||||
```
|
||||
BUGFIX COMPLETE
|
||||
|
||||
@@ -191,12 +191,9 @@ run + one verifier + one security dispatch.
|
||||
|
||||
## STEP 5 — COMMIT
|
||||
|
||||
Commit using conventional format:
|
||||
```
|
||||
feat(<scope>): <what was added>
|
||||
|
||||
<brief description of the feature>
|
||||
```
|
||||
Commit with the message per `$HOME/.claude/lib/commit-message.md`
|
||||
(project convention first, else short: what was added, at most two
|
||||
sentences of body).
|
||||
|
||||
If the feature touched multiple concerns (e.g., feature + config +
|
||||
test), consider splitting into 2-3 atomic commits grouped by logical
|
||||
|
||||
@@ -190,10 +190,9 @@ Parse the `HOTFIX-EXEC REPORT`:
|
||||
- Structural failure (mute / unparsable / no VERDICT line) → treat as a
|
||||
failed gate: retry ONCE fresh; a 2nd structural failure → revert +
|
||||
escalate. A mute auditor is never a PASS.
|
||||
3. Commit using conventional format (only after smoke AND security pass):
|
||||
```
|
||||
fix(<scope>): <what was wrong>
|
||||
```
|
||||
3. Commit only after smoke AND security pass, message per
|
||||
`$HOME/.claude/lib/commit-message.md` (no convention: one subject line,
|
||||
`fix(<scope>): <what was wrong>`).
|
||||
4. Print summary:
|
||||
```
|
||||
HOTFIX APPLIED
|
||||
|
||||
Reference in new issue
Block a user