docs(agents): document Conventional Commits enforcement in AGENTS.md - #1575
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates CLAUDE.md to document that Conventional Commits are enforced in CI, explaining the required prefix format, the Verify Commits workflow, and a potential issue with the local Husky hook when node_modules is missing. There are no review comments, and I have no feedback to provide.
Coverage Report
File CoverageNo changed files found. |
kriszyp
left a comment
There was a problem hiding this comment.
I realize you are editing an existing file, but I think it is supposed to be spelled AGENTS.md, not CLAUDE.md (CLAUDE.md should direct claude to read from AGENTS.md). Claude isn't the only agent being used. I suppose it is fine to omit this from this PR, but maybe @dawsontoth could fix this?
🤖 Reviewed with GPT 5.6
| `refactor`, `perf`, `ci`, `build`, `style`, `revert`; scope optional; subject case is | ||
| unrestricted). The **Verify Commits** workflow runs commitlint on every PR and on pushes | ||
| to `dev`/`stage`/`prod` — a single unprefixed commit fails the check, and history that | ||
| already landed on a deploy branch has to be rewritten and force-pushed to fix it. |
There was a problem hiding this comment.
The configured action lints the commits in each push event, so a bad commit that already landed does not poison every later run: a subsequent push containing only valid commits gets a new passing check. Rewriting and force-pushing dev/stage/prod is therefore not required, and recommending it here is risky. Could we remove this clause, or limit amend/force-push guidance to the PR branch before merge?
| already landed on a deploy branch has to be rewritten and force-pushed to fix it. | ||
|
|
||
| Don't rely on the local hook to catch this: `.husky/commit-msg` runs | ||
| `pnpm commitlint --edit`, which needs `node_modules` — in a fresh worktree without |
There was a problem hiding this comment.
The fresh-worktree gap happens before pnpm commitlint runs: Husky's generated .husky/_/commit-msg wrapper is created by pnpm install/the prepare script, so a worktree that has not installed dependencies has no hook for Git to invoke. If that wrapper exists but node_modules is later absent, pnpm commitlint exits nonzero rather than failing open. Could we describe the missing generated hook as the root cause, e.g. “until pnpm install has installed Husky's hooks, commits are not linted locally”?
|
@Devin-Holland can you rebase on the latest stage? In #1573 I renamed the root file per @kriszyp 's request, so you'll need to replay your changes on the new file. |
The Verify Commits workflow runs commitlint on every PR and on pushes to dev/stage/prod, but nothing warns locally: .husky/commit-msg only fires once pnpm install has run the prepare script that sets core.hooksPath, so a fresh clone or worktree commits non-conforming messages silently and CI is the first objection. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2e7d6cf to
65deff6
Compare
|
Done — thanks for the heads-up on the rename, and nice call making Branch is now a single commit on top of current While replaying I re-verified the claims rather than carrying them over, and one was wrong. The original text said the local hook "fails open" because I left the branch name ( 🤖 Written by Claude Opus 5 |
Adds an
AGENTS.mdsection documenting that the Verify Commits workflow enforces Conventional Commits (type(scope): subject,@commitlint/config-conventional) on every PR and on pushes todev/stage/prod— and that nothing warns locally first, so CI is the first thing that objects.Context: unprefixed commit messages on the #1574 deploy branches failed Verify Commits, which meant rewriting history that had already landed. This makes the convention discoverable for agents and humans working from bare worktrees.
Rebased on stage, replayed onto
AGENTS.mdPer @dawsontoth — the original commit edited
CLAUDE.md, which #1573 renamed toAGENTS.md(withCLAUDE.mdleft as a pointer, per @kriszyp). This branch is now a single commit on top of currentstage, with the section added toAGENTS.mdinstead. The staleCLAUDE.mdin the branch name is cosmetic — renaming the branch would orphan this PR.The local-hook claim is now the verified mechanism, not the guess
The first version blamed a missing
node_modulesfor the hook "failing open". Checked it instead of assuming, in a fresh clone that had never runpnpm install:git config --get core.hooksPath→ unset..husky/commit-msgis only wired up by theprepare: huskyscript, whichpnpm installruns — skip install and git never looks in.huskyat all.not a conventional messagein that checkout: it landed, no hook output, exit 0.So the hook doesn't run and pass — it doesn't run. The section says that now, and names
core.hooksPathso the fix is obvious to whoever hits it.Every other fact in the section was re-checked against current
stage: the workflow triggers (.github/workflows/verify-commits.yaml), the 11config-conventionaltypes, andsubject-casebeing disabled incommitlint.config.cjs.Verification
dprint check AGENTS.md→ exit 0. Markdown-only diff, one file, +16 lines; no code, config, or dependency changes.🤖 Generated with Claude Code