Validate commit message
validate_commit_messageValidate a commit message against commit-check rules (Conventional Commits, subject length, body, sign-off). Get pass/fail status with warnings and fixes before committing.
Instructions
Validate a commit message against commit-check rules (Conventional Commits type and format, subject length and case, body, sign-off, WIP/fixup markers, AI attribution: whatever the effective config enables). Read-only; touches no git state.
Returns {status, warnings, checks[]}. status is 'pass', 'fail' or 'skip': only 'fail' is a rejection; 'skip' means every check skipped, so nothing was validated and the result is not approval. warnings is the number of checks with status 'warn'. Each check has: rule_id (stable rule id, e.g. 'CC001'); check (rule name, e.g. 'message'); status 'pass' | 'fail' | 'warn' | 'skip' ('warn' = the config lists the check under warn, so the finding is reported without failing the run; 'skip' = the rule did not run, e.g. the author is in ignore_authors or there was nothing to check); value (what was checked); error (why it failed); suggest (advice for a person); fix (the corrected value when the correction is unambiguous, else ''); docs_url (documentation for the rule). On 'fail', apply a non-empty fix verbatim; when fix is '', rewrite following suggest; then validate again.
Use this when you have one commit message string to check before committing. To check message, branch and author in one call use validate_commit_context; to check the latest commit already in a repository use validate_repository_state.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| config | No | Inline commit-check config overrides as a JSON object, merged on top of the built-in defaults and any config file, e.g. {"warn": ["message"]} or {"commit": {"require_body": true}}. | |
| message | Yes | Full commit message text to validate: subject line, optional blank line, body (and trailers such as Signed-off-by). Must be non-empty. | |
| repo_path | No | Path to the git repository to validate against. Its cchk.toml or commit-check.toml (also looked up under .github/) is loaded, and a relative config_path is resolved from it. Omit to use the server's working directory. | |
| config_path | No | Path to a commit-check TOML config file, used instead of the repository's own cchk.toml/commit-check.toml; a relative path is resolved from repo_path. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||