/predicate:commit-hygienefrom predicate
Enforces commit message formatting per Conventional Commits and logical boundary discipline for clean, reviewable git history. Activates when drafting or validating commit messages.
Ships in predicate. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
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.merge: Integration of one branch, pull request, or workstream into another.
(On forge-hosted projects, merges follow the forge discipline:
consent-to-merge, self-contained PR prose, review-on-record.)Use merge: for any commit whose primary purpose is integrating a branch or
pull request:
merge: integrate the payment-retry branch
The same hard constraints apply: the header must not exceed 50 characters, a blank line must separate header from body, and body lines must not exceed 72 characters. A body is encouraged when the integration is non-trivial — what conflict was resolved, what design decision the merge closes.
Distinction from the recorder convention. The .ledger/log/ flight-log uses
log: subjects for its own sketch commits. log: is a recorder-only convention
scoped to that sub-repository and does not appear in working-repository commits.
merge: is a working-repository type and does not appear in the recorder.
Auto-generated merge subjects are not valid. Git's default Merge branch 'foo' and Merge pull request #N subjects do not carry a conventional type and
will fail the validator. Replace them with a merge: header that names what
was integrated and why it landed when the merge was not self-evident.
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?What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub nrdxp/predicate --plugin predicate35 skills in this plugin
/ai-auditSOP for auditing AI-generated code.
Trigger when:
- Reviewing, refactoring, or cleaning up AI-generated code to prevent regressions or hallucinated APIs.
- Prompt contains: /ai-audit, code audit, AI cleanup, common flaws.
/api-auditProtocol for auditing API surface coherence and type safety.
Trigger when:
- Evaluating API designs, interface type safety, or design elegance.
- Prompt contains: /api-audit, API surface, API coherence, type safety.
/boundaryNormative sufficiency conditions for Initial Boundary Conditions (IBCs)
and the SOP for the cheap-tier boundary refinement loop (/boundary).
Trigger when:
- Crafting, auditing, or refining a prompt/IBC destined for an expensive
(architect-class) model or an autonomous worker dispatch.
- Evaluating whether a task frame is sufficient to bound an agent walk.
- Prompt contains: /boundary, IBC, initial boundary condition, boundary
contract, sufficiency conditions, worker prompt, prompt refinement.
Other plugins' skills for the same job