
Commit Validator
- 33 installs
- 36 repo stars
- Updated July 14, 2026
- oimiragieo/agent-studio
Helps with git & pull requests tasks.
About
commit-validator is a Claude Code skill for git & pull requests. It helps solo builders move faster with AI-assisted development.
- commit-validator
- Git & Pull Requests
- AI-coding skill
Commit Validator by the numbers
- 33 all-time installs (skills.sh)
- Ranked #348 of 733 Git & Pull Requests skills by installs in the Skillselion catalog
- Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/oimiragieo/agent-studio --skill commit-validatorAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 33 |
|---|---|
| repo stars | ★ 36 |
| Last updated | July 14, 2026 |
| Repository | oimiragieo/agent-studio ↗ |
What it does
Helps with git & pull requests tasks.
Files
References (archive): SCAFFOLD_SKILLS_ARCHIVE_MAP.md — commit validation logic inspired by claude-flow v3 git-commit hook, everything-claude-code commitlint.
<identity> Commit Message Validator - Programmatically validates commit messages against the Conventional Commits specification. </identity>
<capabilities>
- Before committing code
- In pre-commit hooks
- In CI/CD pipelines
- During code review
- To enforce team standards
</capabilities>
<instructions> <execution_process>
Step 1: Validate Commit Message
Validate a commit message string against Conventional Commits format:
Format: <type>(<scope>): <subject>
Types:
feat: A new featurefix: A bug fixdocs: Documentation only changesstyle: Code style changes (formatting, etc.)refactor: Code refactoringperf: Performance improvementstest: Adding or updating testschore: Maintenance tasksci: CI/CD changesbuild: Build system changesrevert: Reverting a previous commit
Validation Rules:
1. Must start with type (required) 2. Scope is optional (in parentheses) 3. Subject is required (after colon and space) 4. Use imperative, present tense ("add" not "added") 5. Don't capitalize first letter 6. No period at end 7. Can include body and footer (separated by blank line) </execution_process> </instructions>
<examples> <code_example> 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[0];
// Check format
if (!CONVENTIONAL_COMMIT_REGEX.test(header)) {
return {
valid: false,
error: 'Commit message does not follow Conventional Commits format',
};
}
// Check length
if (header.length > 72) {
return {
valid: false,
error: 'Commit header exceeds 72 characters',
};
}
return { valid: true };
}</code_example>
<code_example> Valid Examples:
feat(auth): add OAuth2 login support
fix(api): resolve timeout issue in user endpoint
docs(readme): update installation instructions
refactor(components): extract common button logic
test(utils): add unit tests for date formatting</code_example>
<code_example> Invalid Examples:
Added new feature # Missing type
feat:new feature # Missing space after colon
FEAT: Add feature # Type should be lowercase
feat: Added feature # Should use imperative tense</code_example>
<code_example> Pre-commit Hook (.git/hooks/pre-commit):
#!/bin/bash
commit_msg=$(git log -1 --pretty=%B)
if ! node .claude/tools/cli/validate-commit.mjs "$commit_msg"; then
echo "Commit message validation failed"
exit 1
fi</code_example>
<code_example> CI/CD Integration:
# .github/workflows/validate-commits.yml
- name: Validate commit messages
run: |
git log origin/main..HEAD --pretty=%B | while read msg; do
node .claude/tools/cli/validate-commit.mjs "$msg" || exit 1
done</code_example> </examples>
<examples> <formatting_example> Output Format
Returns structured validation result:
{
"valid": true,
"type": "feat",
"scope": "auth",
"subject": "add OAuth2 login support",
"warnings": []
}Or for invalid messages:
{
"valid": false,
"error": "Commit message does not follow Conventional Commits format",
"suggestions": [
"Use format: <type>(<scope>): <subject>",
"Valid types: feat, fix, docs, style, refactor, perf, test, chore, ci, build, revert"
]
}</formatting_example> </examples>
<examples> <usage_example> Example Commands:
# Validate a commit message
node .claude/tools/cli/validate-commit.mjs "feat(auth): implement jwt login"
# Validate from stdin (e.g. in a hook)
echo "fix: incorrect variable name" | node .claude/tools/cli/validate-commit.mjs</usage_example> </examples>
<instructions> <best_practices> 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 </best_practices> </instructions>
Iron Laws
1. ALWAYS validate commit messages in both pre-commit hook and CI — pre-commit catches local violations; CI catches cases where the hook was bypassed or not installed; both layers are required. 2. NEVER accept commit messages without a type prefix — conventional commit format (type: subject) is the foundation; messages without a type are unparseable for changelog generation and semantic versioning. 3. ALWAYS enforce subject line length limit (72 characters) — subjects over 72 characters are truncated in git log --oneline and GitHub PR views; conciseness is enforced, not just encouraged. 4. NEVER block commits for body/footer format issues — only type, subject, and length are blocking; optional sections (body, footer, co-authorship) should warn, not block. 5. ALWAYS provide the correct format example in rejection messages — error messages without examples cause developers to guess the format; show feat: add user authentication alongside every rejection.
Anti-Patterns
| Anti-Pattern | Why It Fails | Correct Approach |
|---|---|---|
| Validating only in CI (not pre-commit) | Developers don't discover format issues until after push | Add pre-commit hook for local instant feedback |
| Blocking on body/footer format | Excessive friction leads developers to bypass hooks | Only block on missing type prefix and subject length |
| Rejection without format example | Developer must guess the correct format | Always show a passing example in the error message |
| Allowing freeform subject without type | Breaks changelog generation and semantic versioning | Require type: subject format unconditionally |
| Single-line validation (no body check) | Missing Co-Authored-By and footer go undetected | Validate presence of required footers when configured |
Memory Protocol (MANDATORY)
Before starting: Read .claude/context/memory/learnings.md
After completing:
- New pattern ->
.claude/context/memory/learnings.md - Issue found ->
.claude/context/memory/issues.md - Decision made ->
.claude/context/memory/decisions.md
ASSUME INTERRUPTION: If it's not in memory, it didn't happen.
Invoke the commit-validator skill and follow it exactly as presented to you
'use strict';
/**
* Post-execute hook for commit-validator
* Auto-generated by enterprise-bundle-scaffolder
*
* Records metrics after skill execution.
*/
function postExecute(_context) {
// Record execution metrics
return { ok: true, skill: 'commit-validator' };
}
module.exports = { postExecute };
'use strict';
/**
* Pre-execute hook for commit-validator
* Auto-generated by enterprise-bundle-scaffolder
*
* Validates inputs before skill execution.
*/
function preExecute(context) {
// Validate skill invocation context
if (!context || typeof context !== 'object') {
return { allow: true, message: 'commit-validator: no context to validate' };
}
return { allow: true };
}
module.exports = { preExecute };
commit-validator Research Requirements
Generated: 2026-02-28
Skill 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.
Research Areas
- Current best practices for commit-validator
- Industry standards and tooling
- Integration patterns
Source References
- To be populated by skill-updater research phase
commit-validator Rules
Purpose
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.
Best Practices
- Validate early in pre-commit hooks
- Provide clear error messages
- Enforce in CI/CD pipelines
Integration Points
See SKILL.md for complete documentation.
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "commit-validator Input Schema",
"description": "Input validation schema for commit-validator skill",
"type": "object",
"required": [],
"properties": {},
"additionalProperties": true
}
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "commit-validator Output Schema",
"description": "Output validation schema for commit-validator skill",
"type": "object",
"required": ["success"],
"properties": {
"success": {
"type": "boolean",
"description": "Whether the skill executed successfully"
},
"result": {
"type": "object",
"description": "The skill execution result",
"additionalProperties": true
},
"error": {
"type": "string",
"description": "Error message if execution failed"
}
},
"additionalProperties": true
}
#!/usr/bin/env node
/**
* Commit Validator - Main Script
* Validate commit messages against Conventional Commits specification — provides instant feedback with types, scope, and subject rules enforcement
*/
const options = Object.fromEntries(
process.argv
.slice(2)
.filter(arg => arg.startsWith('--'))
.map(flag => [flag.replace(/^--/, ''), true])
);
if (options.help) {
console.log('Commit Validator - Main Script');
process.exit(0);
}
console.warn('WARNING: This skill is currently a scaffold and has no implementation.');
process.exit(1);
commit-validator Implementation Template
Goal
- Define target outcome and acceptance criteria.
TDD
1. Red 2. Green 3. Refactor
Verification
- lint
- format
- targeted tests