chore(claude): require ticket-scoped conventional commits on every commit #84

Merged
lyrathorpe merged 3 commits from chore/claude-memory-commit-conventions into main 2026-08-06 16:57:27 +01:00
Owner

Tightens the git_conventions Claude memory after three commits in core-services-cloud had to be rebased by hand to fix their subjects.

Cause

Two defects in the memory, both real:

  1. "Match the repo's existing log style." multicluster and core-services-cloud have histories dominated by bare WSP-1234: summary subjects written by other people. Following that instruction produced commits carrying a ticket ID but not in conventional form.
  2. Scope decay across a session. The first commit was correct (fix(WSP-32798): ...), and the three that followed in the same sitting degraded to bare test: and refactor:. Those three are the ones that were rebased.

Changes

  • <type>(<TICKET-ID>): <summary> is now mandatory on every commit and explicitly overrides repository log style. Style matching applies to branch names only.
  • Document how to establish the real ticket ID — named in the request, extracted from the branch, or taken from the branch's existing commits — and require asking rather than guessing when none is available.
  • Replace every literal WSP-1234 with <TICKET-ID> so the placeholder cannot be copied into a commit verbatim.
  • Record scope decay as a named failure mode.
  • Cover merge commits: prefer rebase, and set an explicit message when a merge commit is unavoidable.
  • Add a pre-push verification grep that must return no output.
  • Note that a clean git log does not prove a subject was correct when written, since rebasing replaces it. Compare author and committer dates instead.
  • Second commit records the exception for repositories with no issue tracker: in personal repos such as this one the scope is the area of the change (claude, deps, hosts), conventional form still applies, and no WSP number should be invented.

Notes

Takes effect on the next session after a nh home switch~/.claude/memory is a Nix store symlink.

Tightens the `git_conventions` Claude memory after three commits in `core-services-cloud` had to be rebased by hand to fix their subjects. ## Cause Two defects in the memory, both real: 1. **"Match the repo's existing log style."** `multicluster` and `core-services-cloud` have histories dominated by bare `WSP-1234: summary` subjects written by other people. Following that instruction produced commits carrying a ticket ID but not in conventional form. 2. **Scope decay across a session.** The first commit was correct (`fix(WSP-32798): ...`), and the three that followed in the same sitting degraded to bare `test:` and `refactor:`. Those three are the ones that were rebased. ## Changes - `<type>(<TICKET-ID>): <summary>` is now mandatory on every commit and explicitly overrides repository log style. Style matching applies to branch names only. - Document how to establish the real ticket ID — named in the request, extracted from the branch, or taken from the branch's existing commits — and require asking rather than guessing when none is available. - Replace every literal `WSP-1234` with `<TICKET-ID>` so the placeholder cannot be copied into a commit verbatim. - Record scope decay as a named failure mode. - Cover merge commits: prefer rebase, and set an explicit message when a merge commit is unavoidable. - Add a pre-push verification grep that must return no output. - Note that a clean `git log` does not prove a subject was correct when written, since rebasing replaces it. Compare author and committer dates instead. - Second commit records the exception for repositories with no issue tracker: in personal repos such as this one the scope is the area of the change (`claude`, `deps`, `hosts`), conventional form still applies, and no WSP number should be invented. ## Notes Takes effect on the next session after a `nh home switch` — `~/.claude/memory` is a Nix store symlink.
lyrathorpe added 2 commits 2026-08-06 16:44:34 +01:00
The git conventions memory said to match the repository's existing log
style. Several repositories (multicluster, core-services-cloud) have
histories dominated by bare "WSP-1234: summary" subjects, so matching
them produced commits that were not in conventional form. A related
failure was scope decay within a session: the first commit was correct
and later ones degraded to bare "test:" or "refactor:" subjects. Both
required commit history to be rebased by hand.

- Make "<type>(<TICKET-ID>): <summary>" mandatory on every commit and
  explicitly override repository log style. Style matching now applies
  to branch names only.
- Describe how to establish the real ticket ID (named in the request,
  extracted from the branch, or taken from existing commits on the
  branch) and require asking rather than guessing when none is
  available. Replace the literal WSP-1234 examples with <TICKET-ID> so
  the placeholder cannot be committed verbatim.
- Record scope decay across a session as a named failure mode.
- Cover merge commits, preferring rebase and requiring an explicit
  message when a merge commit is unavoidable.
- Add a pre-push verification grep that must return no output.
- Note that a clean git log does not prove a subject was correct when
  written, because rebasing replaces it; compare author and committer
  dates instead.

Update the MEMORY.md index entry to match.
chore(claude): exempt repos without an issue tracker from the ticket scope
CI / flake (push) Skipped
CI / flake (pull_request) Failing after 1m8s
1d5a5adbcc
The previous commit required a ticket scope on every commit in every
repository. This repository has no Jira project, so the rule as written
would either block a commit or invite a fabricated WSP number.

Record the exception: in personal repositories the scope is the area of
the change (claude, deps, hosts) and conventional form still applies.
The ticket requirement is scoped to the Jira-backed work repositories
that enforce it in CI.
lyrathorpe scheduled this pull request to auto merge when all checks succeed 2026-08-06 16:45:43 +01:00
lyrathorpe added 1 commit 2026-08-06 16:56:12 +01:00
style(claude): apply prettier formatting to the git conventions memory
CI / flake (push) Skipped
CI / flake (pull_request) Successful in 1m6s
f61a206977
treefmt runs prettier over markdown in this repository and the CI
formatting check failed on the two preceding commits. Prettier prefers
underscores for emphasis and requires blank lines around fenced code
blocks.

No wording changes.
lyrathorpe merged commit 3cdf4d4e54 into main 2026-08-06 16:57:27 +01:00
lyrathorpe deleted branch chore/claude-memory-commit-conventions 2026-08-06 16:57:29 +01:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: lyrathorpe/nixfiles#84