commit-hygiene

Validates git commit messages against Conventional Commits structure and line-length constraints.

10|2|Updated Jan 24, 2026
One-click install
npx skills add https://github.com/nrdxp/predicate --skill commit-hygiene-nrdxp
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: commit-hygiene
Source: https://github.com/nrdxp/predicate/tree/main/skills/commit-hygiene
Command: npx skills add https://github.com/nrdxp/predicate --skill commit-hygiene-nrdxp

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? Git histories degrade when commit messages are inconsistent, over-length, or reference ephemeral context that reviewers cannot resolve. This Skill enforces Conventional Commits formatting, hard line-length limits, and atomic commit boundaries so that git log remains a readable decision record. ## Core Features & Use Cases - Deterministic message validation: A Python script checks header length (50 chars), Conventional Commits structure, blank-line separation, and body line length (72 chars), returning errors E1-E5 and warnings W1-W2. - Boundary discipline rules: Guidelines for splitting changesets into atomic, reviewable commits and avoiding spaghetti diffs and "and" commits. - Self-containment rules: Prohibits references to uncommitted artifacts (scratch files, workstream labels) so every message resolves from committed history or public URLs. - Use Case: Before committing a bug fix, run the validator on your drafted message; it fails a 60-character header or a missing blank line, and warns on non-imperative verbs like "added". ## Quick Start Ask the agent to validate your drafted commit message with the commit-hygiene checker before creating the commit.

Frequently Asked Questions about commit-hygiene

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I validate a git commit message against Conventional Commits?

Run check_commit_msg.py with --message, --file, or --ref HEAD to validate a commit message. It checks the header against the Conventional Commits pattern, enforces length limits, and exits 0 on pass or 1 on hard-constraint violations.

What commit types are allowed in Conventional Commits?

The validator accepts feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert, and merge. An optional scope in parentheses and a ! suffix for breaking changes are also supported.

Why does my commit message fail validation with error E4?

Error E4 means there is no blank line separating the header from the body. Insert exactly one empty line after the summary header before the body text to satisfy the structural requirement.

Can long URLs exceed the 72-character body line limit?

Yes, lines containing a URL are exempt from the 72-character body limit because unbreakable tokens cannot be wrapped. All other body and footer lines must stay within 72 characters.

When should a changeset be split into multiple commits?

Split a changeset when the message needs the word "and" to describe it, when the diff spans unrelated concerns, or when a reviewer cannot follow it in one sitting. Each commit should capture one cohesive logical change.