| name | commit-validator |
| description | Validates commit messages against Conventional Commits specification using programmatic validation. Replaces the git-conventional-commit-messages text file with a tool that provides instant feedback. |
| version | 1.1.0 |
| model | haiku |
| invoked_by | both |
| user_invocable | true |
| tools | ["Read","Grep","Bash"] |
| agents | ["developer","devops"] |
| category | Git & Version Control |
| tags | ["git","commit","conventional-commits","validation","pre-commit"] |
| verified | true |
| lastVerifiedAt | "2026-02-22T08:50:48.826Z" |
| best_practices | ["Validate early in pre-commit hooks","Provide clear error messages","Enforce in CI/CD pipelines"] |
| error_handling | graceful |
| streaming | supported |
| source | builtin |
| trust_score | 100 |
| provenance_sha | ef16e68537194a80 |
References (archive): SCAFFOLD_SKILLS_ARCHIVE_MAP.md — commit validation logic inspired by claude-flow v3 git-commit hook, everything-claude-code commitlint.
Commit Message Validator - Programmatically validates commit messages against the [Conventional Commits](https://www.conventionalcommits.org/) specification.
- Before committing code
- In pre-commit hooks
- In CI/CD pipelines
- During code review
- To enforce team standards
Step 1: Validate Commit Message
Validate a commit message string against Conventional Commits format:
Format: <type>(<scope>): <subject>
Types:
feat: A new feature
fix: A bug fix
docs: Documentation only changes
style: Code style changes (formatting, etc.)
refactor: Code refactoring
perf: Performance improvements
test: Adding or updating tests
chore: Maintenance tasks
ci: CI/CD changes
build: Build system changes
revert: Reverting a previous commit
Validation Rules:
- Must start with type (required)
- Scope is optional (in parentheses)
- Subject is required (after colon and space)
- Use imperative, present tense ("add" not "added")
- Don't capitalize first letter
- No period at end
- Can include body and footer (separated by blank line)
</execution_process>
**Implementation**
Use this regex pattern for validation:
const CONVENTIONAL_COMMIT_REGEX =
/^(feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert)(\(.+\))?: .{1,72}/;
function validateCommitMessage(message) {
const lines = message.trim().split('\n');
const header = lines[];
(!.(header)) {
{
: ,
: ,
};
}
(header. > ) {
{
: ,
: ,
};
}
{ : };
}
**Output Format**
**Example Commands**:
1. **Validate Early**: Check commit messages before pushing
2. **Provide Feedback**: Show clear error messages with suggestions
3. **Enforce in CI**: Add validation to CI/CD pipelines
4. **Team Training**: Educate team on Conventional Commits format
5. **Tool Integration**: Integrate with Git hooks and IDEs