From predicate
Enforces commit message formatting (Conventional Commits, 50/72 rule) and atomic commit boundaries for a clean, reviewable git history.
How this skill is triggered — by the user, by Claude, or both
Slash command
/predicate:commit-hygieneThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Guidelines and constraints for writing clear, structured, and reviewer-centric git commit messages. Every commit is a unit of structured information designed to optimize human comprehension and git history utility.
Guidelines and constraints for writing clear, structured, and reviewer-centric git commit messages. Every commit is a unit of structured information designed to optimize human comprehension and git history utility.
The goal of commit hygiene is not formatting for its own sake. The goal is a clean, human-reviewable git history.
A well-maintained history lets a human reviewer reconstruct the reasoning behind a codebase by reading git log. Every commit should answer: what changed, why it changed, and where the logical boundary of that change is. When history achieves this, it becomes a durable decision record — not just a log of file mutations.
This requires two things working together:
Neither is sufficient alone. A perfectly formatted message attached to a 40-file spaghetti diff is useless. A clean single-file diff with a message that says "update stuff" is nearly as bad. Both disciplines are required, always — not only when a formal workflow like C.O.R.E. is active.
All commit messages MUST satisfy these structural invariants:
Commits must conform to the Conventional Commits v1.0.0 specification:
<type>(<scope>)[!]: <description>
[optional body]
[optional footer(s)]
A breaking change must be indicated by:
! suffixing the type or scope in the summary header (e.g., feat!: remove deprecated api or fix(parser)!: adjust breaking parser logic).BREAKING CHANGE: <description> footer entry.feat: Introduction of a new capability or feature.fix: Resolution of a bug or regression.docs: Additions or modifications to documentation.style: Formatting, whitespace adjustments, or cosmetic corrections (no functional change).refactor: Structural codebase changes that neither modify behavior nor add features.perf: Optimizations that improve execution speed or resource utilization.test: Addition, restructuring, or correction of tests.build: Modifications to build configuration, dependencies, or packaging (e.g. Cargo.toml, package.json, go.mod).ci: Alterations to CI pipeline or automation configurations.chore: Auxiliary tasks, infrastructure tooling updates, or miscellaneous maintenance.revert: Reversion of a previous commit.Commits are written for human reviewers, not systems. Prioritize cognitive clarity:
Commit messages must be self-contained. A reviewer reading
git log has access to exactly two things: the repository's
committed history and the public internet. If a reference in a
commit message cannot be resolved from one of those two sources,
it is meaningless noise.
.ledger/,
.scratch/, agent scratch pads, etc.) are never committed
to history. Referencing labels that originate from these
artifacts — workstream items like "(P3)", sketch IDs, plan
phase names, task-tracker shortcodes — is prohibited.
These tokens carry zero information for any reader who did
not have the ephemeral document open. Describe the actual
change and its motivation instead.skills/commit-hygiene/SKILL.md)
or full URLs. If the context is not committed and not on the
public internet, paraphrase it inline instead of citing it.feat: add user login and fix lint errors), evaluate whether it should be split.The hard constraints are deterministic, so they are enforced by an evaluator, not by recall. Before every commit (and after, when auditing history), run:
python3 skills/commit-hygiene/scripts/check_commit_msg.py --message "<msg>"
python3 skills/commit-hygiene/scripts/check_commit_msg.py --file <msgfile>
python3 skills/commit-hygiene/scripts/check_commit_msg.py --ref HEAD
Exit 0 is required to proceed. Errors (E1–E5) cover the header
limit, Conventional Commits structure, trailing period, blank-line
separation, and body line length (URL-bearing lines exempt). Warnings
(W1–W2) flag probable case/mood issues but do not fail — they need
human judgment (proper nouns, unusual verbs). If the script is missing
or fails to execute, fall back to the manual checklist below; never
skip validation silently.
Before presenting a commit, run this audit:
! in the header and/or a BREAKING CHANGE: <description> footer?Manages git commit workflows: checks status and diffs, stages changes selectively, generates and validates conventional commit messages, then executes commits.
Generates and validates conventional commit messages following the conventionalcommits.org spec. Useful when committing code, reviewing commit format, or creating pull requests.
Creates Conventional Commits with pre-commit checklists for scope, quality, tests, linting, formatting, and documentation. Ensures one logical change per commit before git commit.
npx claudepluginhub nrdxp/predicate --plugin predicate