Skip to content

chore: enforce commit hygiene with commitlint and husky - #6

Merged
Bccorb merged 1 commit into
mainfrom
chore/commit-hygiene
Jul 2, 2026
Merged

Bccorb merged 1 commit into
mainfrom
chore/commit-hygiene

Conversation

@Bccorb

@Bccorb Bccorb commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

What

Two things:

  1. Branch naming convention documented in AGENTS.md: branches use a type prefix that matches the change (feat/, fix/, bug/, chore/, ci/, docs/) plus a short kebab-case description. No claude/ or other tool-generated prefix.
  2. Commit hygiene tooling via commitlint + Husky, matching the rest of the Seamless Auth ecosystem (seamless-auth-react, seamless-auth-api).

How

Surveyed neighbor repos in the fells-code org. seamless-auth-react and seamless-auth-api both use Husky v9 + @commitlint/cli + @commitlint/config-conventional, wired through a prepare: husky script, with a commit-msg hook running npx commitlint --edit and a pre-commit hook running the repo's own checks. This PR mirrors that, adapted to this repo:

  • commitlint.config.mjs: extends: ['@commitlint/config-conventional'] (matches seamless-auth-react).
  • .husky/commit-msg: runs commitlint on the message, so non-Conventional-Commit messages are rejected before they land.
  • .husky/pre-commit: runs npm run validate (this repo's structural check, the analog of the neighbors' lint/test pre-commit steps).
  • package.json: prepare: husky script so hooks install on npm install, plus the three devDependencies. Lockfile updated.
  • AGENTS.md: documents both the enforcement and the branch-naming convention.

The .husky/_ runtime directory is gitignored by Husky; only the two hook scripts are tracked.

Verification

  • commitlint rejects a non-conventional message and accepts a conventional one (tested locally).
  • The hooks ran against this very commit: pre-commit validated the registry and commit-msg linted the message.
  • npm run validate passes.

Note on changesets

No changeset is included. Per AGENTS.md, changesets are for changes that affect scaffolded projects; this is repo-internal dev tooling and does not touch template output, so adding one would put a tooling note into consumer-facing release notes. Happy to add one if you'd prefer a version bump.

Add Husky git hooks and commitlint to match the rest of the Seamless Auth
ecosystem. npm install now runs the prepare script to install hooks: a
commit-msg hook lints the message against @commitlint/config-conventional,
and a pre-commit hook runs npm run validate. Also document the branch
naming convention (type-prefixed branches, no claude/ prefix) in AGENTS.md.
@Bccorb
Bccorb merged commit efb7190 into main Jul 2, 2026
5 checks passed
@Bccorb
Bccorb deleted the chore/commit-hygiene branch July 2, 2026 21:50
@Bccorb Bccorb mentioned this pull request Sep 13, 2026
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant