Repository navigation
chore: enforce commit hygiene with commitlint and husky - #6
Merged
Merged
Conversation
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.
13 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two things:
AGENTS.md: branches use a type prefix that matches the change (feat/,fix/,bug/,chore/,ci/,docs/) plus a short kebab-case description. Noclaude/or other tool-generated prefix.seamless-auth-react,seamless-auth-api).How
Surveyed neighbor repos in the
fells-codeorg.seamless-auth-reactandseamless-auth-apiboth use Husky v9 +@commitlint/cli+@commitlint/config-conventional, wired through aprepare: huskyscript, with acommit-msghook runningnpx commitlint --editand apre-commithook running the repo's own checks. This PR mirrors that, adapted to this repo:commitlint.config.mjs:extends: ['@commitlint/config-conventional'](matchesseamless-auth-react)..husky/commit-msg: runs commitlint on the message, so non-Conventional-Commit messages are rejected before they land..husky/pre-commit: runsnpm run validate(this repo's structural check, the analog of the neighbors' lint/test pre-commit steps).package.json:prepare: huskyscript so hooks install onnpm 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
pre-commitvalidated the registry andcommit-msglinted the message.npm run validatepasses.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.