commitlint
$ commitlint Community Low RiskStandard Node.js linter validating commit messages against Conventional Commits or custom project rulesets. Supports non-interactive stdin piping, commit range validation (--from/--to), and hook-file checking (--edit), exiting non-zero on policy violations.
brew install commitlint Validates local commit messages in-repo against commitlint.config.*; no reason to wrap in MCP.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Accepts stdin, --from/--to, --edit, and --color=false non-interactively, though built-in output is formatted text unless a custom --format plugin is installed.
- Stdin and
--from/--towork deterministically in non-TTY shells - Default formatter emits text rather than native
--json
Read-only commit message validator with zero repository or file writes.
- Strictly validates commit text and returns exit codes
Cross-platform via npm/npx and Homebrew, though requires Node.js and usually a companion config package like @commitlint/config-conventional.
- Requires Node.js runtime and config preset packages
Prevents CI/hook rejections by letting agents pre-flight commit messages before committing.
- Fast stdin pre-check against project commit conventions
Widely adopted open-source project (conventional-changelog/commitlint) under MIT.
- Standard ecosystem tool under MIT license
Well-documented CLI flags and rule reference at commitlint.js.org.
- Official CLI reference at commitlint.js.org/reference/cli
Security, Auth & Guardrails
Purely local commit message linter; no credentials stored or required.
MIT open-source Node.js package; free to use.
# commitlint Agent Rules - Pipe proposed commit messages through `commitlint` before running `git commit` in repos with commitlint configs. - Use `--from main --to HEAD` to verify branch commit hygiene before opening a PR.
Agent-Ready Command Recipes
Safe Read-Only Queries
echo "feat(api): add pagination" | npx commitlint --color=false
Checks a candidate commit message against the repo's rules before running git commit.
npx commitlint --from main --to HEAD --verbose
Audits every commit between main and HEAD without modifying git history.
Strengths for Agents
- + Strictly read-only stdin and
--from/--tochecks let agents validate commit messages beforegit commit. - + Clear exit codes and concise rule failure messages.
Caveats & Pitfalls
- ! No built-in
--jsonflag out of the box without custom formatter modules. - ! Requires Node.js and project-level config/preset packages (
@commitlint/config-conventional).