Defra commit-message format — provisionally Conventional Commits (type(scope) subject + optional body and footers). Subject ≤ 72 chars, imperative mood, no trailing period. Use whenever the agent is about to run git commit -m, draft a commit message for a developer, or review an existing commit message.
Ships in defra-shared. 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.
Until the project owner pins a final format, Defra repositories use Conventional Commits. The commit message is a contract: it tells future readers (and changelog generators) what changed and why.
Commit subject:
<type>(<optional-scope>): <subject>
<type> is one of: feat, fix, chore, docs, refactor, test, build, ci, perf, style, revert.<scope> is optional, in lowercase, naming the area (e.g. frontend, auth, deps).<subject> is imperative mood ("add", not "added" / "adds"), starts lowercase, has no trailing period, and is ≤ 72 characters.Optional body, separated by a blank line, wrapped at ~72 chars, explaining why rather than what.
Optional footers (one per line) include:
BREAKING CHANGE: <description> — required when the change breaks API or behaviour.Refs: CAIT-123 — link to the Jira ticket the work tracks.Co-authored-by: Name <email> — for pair work.The companion hook commit-message-format enforces the subject regex on every git commit -m / --message. It additionally refuses forms that bypass subject inspection — -F / --file, --template, -C / --reuse-message, --fixup, --squash, and editor-driven commits (no -m) — and tells the agent to use -m "type(scope): subject" instead. git commit --amend --no-edit is explicitly allowed, since it reuses an already-validated message.
WIP, wip, temp, fix, update, stuff, . — non-informative subjects.add date-of-birth field instead of feat: add date-of-birth field).Refs: CAIT-123).git commit -F <file>, --template, -C <hash>, --reuse-message, --fixup, --squash, or by letting the editor open. Use -m "type(scope): subject" so the hook can read it.If a user asks the agent to commit with a non-conforming message, the agent rewrites the message and explains why.
Conforming:
feat(frontend): add date-of-birth field to registration form
Adds a GOV.UK date input with day/month/year fields, Joi validation,
and an error-summary entry for each invalid sub-field.
Refs: CAIT-104
Non-conforming, rewritten:
# Before
git commit -m "added DOB field"
# After (agent rewrites)
git commit -m "feat(frontend): add date-of-birth field to registration form"
The agent volunteers the imperative-mood and missing-type fixes without being asked.
commit-message-format hook update together. See the open-questions list in docs/spec/PLAN.md "Decisions still required" in the upstream planning repo.docs/requirements/non_goals.md.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
/defra-shared:defra-commit-messagesfrom defra-shared
npx claudepluginhub defra/defra-ai-plugins --plugin defra-shared5 skills in this plugin
/defra-accessibilityDefra accessibility expectations — WCAG 2.2 AA for code-generating roles (frontend, backend rendering HTML), and semantic-markup expectations for documentation roles. Use when the agent generates a page, a component, a markdown file, or any artefact that will be read by a screen reader, a keyboard-only user, or a user with reduced vision./defra-branchingDefra branching strategy — never commit or push directly to main or master. Use a feature branch named for the work, open a pull request, get review, then merge. Use when the agent is about to run git commit, git push, or git checkout, or when a developer asks how to start a piece of work./defra-quality-gatesDefra code-quality gates — lint, format, test, and coverage must all pass before code is committed. The role plugin pins the exact toolchain (ESLint/Prettier/Vitest, dotnet format/xUnit, ruff/black/pytest, etc.); this skill states the universal expectations. Use before git commit, when wiring a new project, or when a hook reports a failure./defra-security-piiDefra security and PII handling — never hard-code secrets, never log PII, refuse unsafe template patterns, and redact known UK PII (NI numbers, NHS numbers, postcodes, DoB combinations) before any output leaves the service. Use when the agent is editing code that handles user data, writing log lines, configuring templates, or wiring credentials.