/whiting:commit-conventionsfrom Whiting
Install Conventional Commits enforcement (a commit-msg hook) and a no-direct-push-to-main guard (a pre-push hook), plus generate AGENTS.md and CLAUDE.md rule files covering working-agreement defaults (register, answer scope, disagreement, language, JOURNAL.md work log) plus commit format, semver-bump discipline, changelog-first workflow, and branch protection policy — merging into existing files instead of replacing them. Use when the user wants commit conventions enforced or wants Claude/agents to follow a documented rule set in this repo.
Ships in Whiting. 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.
None: SKILL.md is the whole skill.
Installs local git hooks that enforce Conventional Commits and block
direct pushes to the default branch, and generates the AGENTS.md /
CLAUDE.md files that document these rules (and others) for both human
contributors and AI agents working in the repo.
git config --get core.hooksPath. If it's already set to
something other than scripts/hooks, stop and ask before overriding —
another tool may own it.AGENTS.md/CLAUDE.md. Never overwrite existing
content — merge into it instead (see step 4/5 below). A repo that
already has these files keeps every word it has; whiting only adds
what's missing.Copy the hook scripts, unmodified, and make them executable:
Source ($CLAUDE_PLUGIN_ROOT/...) | Destination |
|---|---|
scripts/hooks/commit-msg | scripts/hooks/commit-msg |
scripts/hooks/pre-push | scripts/hooks/pre-push |
chmod +x scripts/hooks/commit-msg scripts/hooks/pre-push
Resolve and record the default branch once, so pre-push never needs
a network call at push time:
git config whiting.defaultbranch "$(gh repo view --json defaultBranchRef --jq .defaultBranchRef.name)"
Fall back to main if gh isn't available or the repo has no remote
yet.
Activate both hooks for this clone:
git config core.hooksPath scripts/hooks
Note in AGENTS.md (below) that every other clone/contributor needs
to run this same command once after cloning — core.hooksPath is a
local, unversioned config, not something git syncs automatically.
Write AGENTS.md. Render the template first, into a scratch file:
python3 $CLAUDE_PLUGIN_ROOT/scripts/render_template.py \
$CLAUDE_PLUGIN_ROOT/templates/AGENTS.md.tmpl \
DEFAULT_BRANCH="main" > /tmp/whiting-agents.md
No AGENTS.md yet: move the rendered file into place.
AGENTS.md already exists: merge, never replace. Existing
content is the repo's own and stays untouched; only the sections it
is missing get appended, in template order:
python3 $CLAUDE_PLUGIN_ROOT/scripts/merge_agents_md.py \
AGENTS.md /tmp/whiting-agents.md --report
That prints one present:/missing: line per template section.
Show it to the user, then apply the merge:
python3 $CLAUDE_PLUGIN_ROOT/scripts/merge_agents_md.py \
AGENTS.md /tmp/whiting-agents.md > /tmp/whiting-agents-merged.md \
&& mv /tmp/whiting-agents-merged.md AGENTS.md
Sections are matched on their heading, ignoring case, punctuation,
and anything past the first four words — so a repo that already
says "No direct pushes to develop" keeps its own wording instead of
getting a duplicate rule about main. If a repo's existing section
covers the same ground under a heading whiting doesn't recognise,
the merge will append a near-duplicate: read the result and
reconcile the two by hand before committing.
Wire up CLAUDE.md:
templates/CLAUDE.md.tmpl verbatim (it's
just @AGENTS.md).AGENTS.md: prepend the
@AGENTS.md line, leaving the rest of the file untouched. Never
move that repo's own instructions into AGENTS.md or delete them —
the import is additive.Create JOURNAL.md if it's missing — the work log the rule set
refers to:
python3 $CLAUDE_PLUGIN_ROOT/scripts/render_template.py \
$CLAUDE_PLUGIN_ROOT/templates/JOURNAL.md.tmpl \
DATE="$(date +%F)" > JOURNAL.md
If it already exists, leave it alone.
Two groups of rules. The first is how agents work here at all — the defaults every repo gets:
JOURNAL.md after each task, read it before
starting, compact it past ~40 entries.The second is this repo's release discipline:
type(scope)!: description, allowed types
feat fix docs style refactor perf test build ci chore revert, a
BREAKING CHANGE: footer or ! marks a breaking change.semver-release's bump script, never hand-edited; tags are the source
of truth for "what version is this."## [Unreleased] in CHANGELOG.md in the same commit/PR.pre-push hook enforces this locally.The template closes with a short note on the three-axes-framework plugin, explaining what it covers so those rules aren't duplicated here. If that plugin isn't in use, drop that last section — nothing else depends on it.
AGENTS.md is the only copy of these rules. CLAUDE.md imports it, so
Claude Code, Codex, and anything else that reads AGENTS.md all work
from the same file.
Branch, commit, PR — same rule the files themselves are about to start enforcing.
Run semver-release next to wire up the version-bump-to-release pipeline
that AGENTS.md's semver rule refers to.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
whiting@lux-solari-plugins is listed by luxsolari/lux-solari-plugins — review the source before installing
npx claudepluginhub luxsolari/lux-solari-plugins --plugin whiting4 skills in this plugin
/inspectAudit an existing repo against whiting's conventions (Keep a Changelog, Conventional Commits, semver tags, GitHub Release automation, AGENTS.md/ CLAUDE.md/JOURNAL.md) and produce a compliance report plus a remediation plan. Use when the user wants to know what's missing or non-conforming before running repo-init, commit-conventions, or semver-release on a repo that wasn't bootstrapped by whiting from scratch. Read-only — makes no changes./repo-initBootstrap a repo's baseline — git init if needed, LICENSE, README.md skeleton, a Keep a Changelog-formatted CHANGELOG.md, and the agent rule files (AGENTS.md, CLAUDE.md importing it, JOURNAL.md) — whether starting from an empty directory or filling gaps in an existing repo. Use when the user wants to start a new project properly or is missing one of these files. Never overwrites an existing file without asking./semver-releaseWire a repo's CHANGELOG.md up to its GitHub Releases, and suggest the next semver bump from Conventional Commits since the last tag. Use when the user wants to populate an empty GitHub Releases tab, backfill releases for existing tags, automate publishing a Release on every version tag push, or figure out what the next version number should be. Applies to any repo following Keep a Changelog conventions and tagging releases with a "v*.*.*" scheme.