Generates or validates Conventional Commits messages from staged diffs. Use when drafting commit messages, checking repo rules, or inferring scope from changed files.
Generate or validate Conventional Commits for the staged surface.
Default posture: subject line first; body only when risk, rationale, or breaking-change detail is needed; standard types only unless the repo already defines custom ones; never claim behavior not visible in the diff.
VALIDATION: WARN
Message:
feat: update stuff
Issues:
- `update stuff` is too vague
- summary should name the changed behavior or surface
Suggested fix:
feat(auth): add refresh token rotation
AI-Authored Commits
The commit message describes the change, not the tool that produced it. Apply the same rules regardless of whether a human or an AI agent drafted the code.
Banned in subject and body: generated by, co-authored-by: <ai-tool>, via copilot, via claude, chatgpt, ai assistant, bot.
If your team requires an audit trail for AI-assisted code, add an Assisted-by: trailer as an opt-in team policy (not a default). Keep it out of the subject line. Example:
This is an organizational opt-in pattern, not a general requirement. The default rule remains: no attribution.
Assisted-by: is a distinct trailer from Co-Authored-By: — several large open-source projects (Linux Kernel, Apache Software Foundation, LLVM, QEMU) have converged on Assisted-by: through 2026 specifically because Co-Authored-By: implies authorship/copyright standing that an AI tool cannot hold or sign a CLA for. If a repo already uses Co-Authored-By: <ai-tool> by convention, do not silently rewrite it to Assisted-by: — flag the distinction and let the maintainer choose; changing trailer conventions after history exists breaks blame/provenance tooling that greps for the old trailer.
Repo Policy Checks
Block or rewrite messages that:
omit the type prefix
use vague summaries: update, fix stuff, change code, WIP, misc
include assistant/tool attribution (see above)
overstate impact not visible in the diff
use past tense or gerund after the type prefix
exceed 72 characters on the subject line
end the subject line with a period
Scripts
Script
Purpose
scripts/commit_validator.py
Validate a single message, lint a history file, or generate a Markdown quality report
# Validate one message
python scripts/commit_validator.py validate --message "feat(auth): add refresh token rotation"
# Lint a batch history file
python scripts/commit_validator.py lint --input data/sample-commit-history.json
# Generate a full Markdown report
python scripts/commit_validator.py report --input data/sample-commit-history.json --output report.md
See scripts/README.md for the full quick-start, input format, and rule reference.
Worktree PR Loop
Use this skill as the commit step inside the broader worktree-first delivery loop defined by ../dev-git-workflow/SKILL.md.
In that loop: create or enter feature worktree → make code changes → stage intentionally → use this skill → run repo gate → open PR.
If the staged diff mixes several unrelated surfaces, stop and recommend split commits before the PR step.
Known Traps
Inferring scope from filenames alone, producing scopes that do not match the repo's bounded-context map.
Compressing unrelated changes into one "clean" conventional commit, destroying revert and release-note usefulness.
Treating AI-generated summaries as authoritative when the diff still contains hidden migrations or breaking changes.
Optimizing for lint-pass format while losing the operational intent maintainers need for incident archaeology.
Using ! or BREAKING CHANGE casually and creating noisy downstream automation.
Navigation
config.yaml — repo-specific scope mapping and validation defaults
assets/template-commit-message.md — optional detailed body template for complex commits
assets/template-security-commits.md — wording guidance for security-sensitive commits
references/conventional-commits-guide.md — full spec v1.0.0 (current stable), type definitions, breaking changes, tooling setup
references/monorepo-commit-conventions.md — scope strategy, per-package changelog generation, affected-package CI routing
references/changelog-generation-guide.md — release tooling comparison (standard-version deprecated since 2022; prefer release-please or changesets)
data/sources.json — curated primary sources for tool verification
data/sample-commit-history.json — 20-commit sample dataset for lint and report subcommands
Related: ../dev-git-workflow/SKILL.md — branching, hooks, PR workflow, release automation; use dev-git-workflow for branching/PR strategy, this skill for commit-message standards
Fact-Checking
Conventional Commits spec is v1.0.0 (stable as of July 2026; no v2 released).
commitlint is at v21.x (21.2.1 as of July 2026); requires Node 22+; config uses ESM (export default { extends: [...] }).
standard-version is deprecated, not archived — the repo carries a deprecation notice pointing to release-please (GitHub-native) or the community fork commit-and-tag-version. Do not recommend it for new projects either way.
release-please-action is at v5 (Node 24 runtime, April 2026 breaking change); the underlying release-please package is at v17.x. Re-check the major tag before pinning a workflow — this skill will drift again.
semantic-release is at v25.x as of mid-2026 and actively maintained (recent work adds npm trusted publishing).
For current tooling, hook behavior, or release-automation recommendations, verify against primary sources in data/sources.json and use web search when available — pinned major-version numbers in this skill are a snapshot, not a guarantee.
If browsing is unavailable, mark volatile tool guidance as unverified.
Learnings Loop
Before applying this skill on a non-trivial task, read learnings.consolidated.md in this directory (and learnings.md if present).
After applying it, if you encountered a pattern worth remembering, append one dated bullet to learnings.md via agents-skills-feedback-loop/scripts/append_learning.py. Do not modify SKILL.md itself.
1---2name: dev-git-commit-message3description: Generates or validates Conventional Commits messages from staged diffs. Use when drafting commit messages, checking repo rules, or inferring scope from changed files.4---56# Git Commit Message Generator
78Generate or validate Conventional Commits for the staged surface.
910Default posture: subject line first; body only when risk, rationale, or breaking-change detail is needed; standard types only unless the repo already defines custom ones; never claim behavior not visible in the diff.
1112## Quick Reference
1314| Need | Default | Reference |
15|------|---------|-----------|
16| Pick a type | `feat`/`fix`/`perf`/`refactor`/`docs`/`test`/`build`/`ci`/`chore`/`style`/`revert` | Type Selection table below |
17| Format a subject | `type(scope): imperative summary`, ≤72 chars (50 ideal), no trailing period | Pre-Commit Message Checklist below |
18| Mark a breaking change | `!` after type/scope, or a `BREAKING CHANGE:` footer | Breaking Change Format table below |
19| Decide on a body | Only for risk, non-obvious rationale, or breaking-change detail | Body Required? table below |
20| Handle AI-authored commits | No tool attribution ever; `Assisted-by:` trailer only if the repo opts in | AI-Authored Commits below |
21| Pick a release/changelog tool | release-please for reviewed PR releases; semantic-release for full automation; changesets for monorepos | [references/changelog-generation-guide.md](references/changelog-generation-guide.md) |
22| Scope a monorepo commit | package/app/service directory name, one level deep, stable over time | [references/monorepo-commit-conventions.md](references/monorepo-commit-conventions.md) |
23| Validate a message locally | `python scripts/commit_validator.py validate --message "..."` | Scripts section below |
2425## Decision Tables
2627### Mode Selection
2829| Trigger | Mode | Action |
30|---------|------|--------|
31| User provides staged diff or asks to commit | Generate | Inspect staged surface, produce primary + alternatives |
32| User provides an existing message string | Validate | Check rules, return PASS/WARN/FAIL + exact rewrite |
33| Staged diff mixes unrelated areas | Split | Recommend split commits before generating |
34| No staged changes | Stop | Report "no staged changes" |
3536### Type Selection
3738| Change | Type | Notes |
39|--------|------|-------|
40| New user- or API-visible capability | `feat` | Triggers MINOR bump |
41| Incorrect behavior corrected | `fix` | Triggers PATCH bump |
42| Measurable speed or memory improvement | `perf` | Triggers PATCH bump |
43| Structure improved, behavior unchanged | `refactor` | No release by default |
44| Documentation only | `docs` | No release by default |
45| Tests only | `test` | No release by default |
46| Build tooling or packaging | `build` | No release by default |
47| CI/CD workflow | `ci` | No release by default |
48| Repo hygiene, no product change | `chore` | No release by default |
49| Whitespace or formatting only | `style` | No release by default |
50| Reverting a prior commit | `revert` | Triggers PATCH bump |
51| Security fix | `fix(security):` | Prefer standard type + scope over custom `security:` type |
52| Prompt/skill/YAML behavioral change | `feat` or `fix` | Do not classify by file extension alone |
5354### Scope Selection
5556| Situation | Action |
57|-----------|--------|
58| Repo has a scope map in [config.yaml](config.yaml) | Use mapped scope |
59| One directory or package clearly dominates | Use that name, lowercase kebab-case |
60| Change spans 2+ stable areas equally | Use broader parent scope or omit |
61| Repository-wide change | Omit scope |
62| Monorepo with independently versioned packages | See [references/monorepo-commit-conventions.md](references/monorepo-commit-conventions.md) |
6364### Body Required?
6566| Condition | Include body? |
67|-----------|--------------|
68| Subject is self-explanatory | No |
69| Reason is non-obvious from subject | Yes — one sentence why |
70| Security-sensitive or risky change | Yes — risk/rollback note |
71| Breaking change | Yes — `BREAKING CHANGE:` footer required |
72| Caller requests detailed template | Yes — use [assets/template-commit-message.md](assets/template-commit-message.md) |
7374### Breaking Change Format
7576| Signal | Format |
77|--------|--------|
78| Inline marker | `feat(api)!: change auth to OAuth2` |
79| Footer | `BREAKING CHANGE: <migration summary>` |
80| Both | Acceptable; footer body gets the detail |
8182## Before/After Examples
8384```text
85BAD: update
86GOOD: docs(readme): add deployment instructions
8788BAD: fix stuff
89GOOD: fix(cart): prevent negative quantity on rapid add
9091BAD: feat: added user dashboard (past tense, missing scope)
92GOOD: feat(dashboard): add analytics overview panel
9394BAD: feat: add search (generated by Copilot)
95GOOD: feat(search): add full-text product search
9697BAD: feat(api): add comprehensive user search endpoint with full-text search across all profile fields including bio and location
98GOOD: feat(api): add full-text user search endpoint
99100BAD: feat: add dashboard, fix auth bug, update deps (mixed concerns)
101GOOD: (3 separate commits)
102 feat(dashboard): add analytics overview panel
103 fix(auth): correct token refresh race condition
104 chore(deps): update react to 18.3.0
105```
106107## Pre-Commit Message Checklist
108109- [ ] Starts with a valid type prefix (`feat`, `fix`, `docs`, `test`, `refactor`, `perf`, `build`, `ci`, `chore`, `style`, `revert`)
110- [ ] Subject is 72 characters or fewer (50 preferred)
111- [ ] Imperative mood: "add" not "added", "fix" not "fixing"
112- [ ] No trailing period on subject line
113- [ ] Scope, if used, matches repo conventions (lowercase kebab-case)
114- [ ] Single logical change; unrelated concerns split into separate commits
115- [ ] No tool/assistant attribution in subject or body
116- [ ] No generic placeholders: "update", "fix stuff", "WIP", "misc"
117- [ ] Breaking changes marked with `!` or `BREAKING CHANGE:` footer
118- [ ] Body present only when needed; answers "why", not "what"
119120## Workflow
1211221. Decide mode from the Mode Selection table above.
1232. For generate mode, inspect staged changes in this order:
124 - `git diff --staged --name-status`
125 - `git diff --staged --stat`
126 - `git diff --staged --unified=1` only when type, scope, or risk is ambiguous
1273. Classify type and scope using the tables above.
1284. Detect scope from [config.yaml](config.yaml) first, then from the nearest stable directory.
1295. Generate: one primary suggestion, up to two alternatives when scope or emphasis is ambiguous, short rationale.
1306. Validate: run all checklist items, return PASS/WARN/FAIL with exact rewrite on failure.
1317. If the diff mixes unrelated work, recommend split commits before offering a combined message.
132133## Output Contract
134135### Generate
136137```text
138[NOTE] Suggested commit messages (3 files changed)
139140PRIMARY:
141fix(auth): reject expired refresh tokens
142143ALTERNATIVES:
1441. fix(api): reject expired refresh tokens
1452. fix: reject expired refresh tokens during rotation
146147RATIONALE:
148- Type: fix
149- Scope: auth
150- Signals: token validation path, regression test update, no new feature surface
151```
152153### Validate
154155```text
156VALIDATION: WARN
157158Message:
159feat: update stuff
160161Issues:
162- `update stuff` is too vague
163- summary should name the changed behavior or surface
164165Suggested fix:
166feat(auth): add refresh token rotation
167```
168169## AI-Authored Commits
170171The commit message describes the change, not the tool that produced it. Apply the same rules regardless of whether a human or an AI agent drafted the code.
172173Banned in subject and body: `generated by`, `co-authored-by: <ai-tool>`, `via copilot`, `via claude`, `chatgpt`, `ai assistant`, `bot`.
174175If your team requires an audit trail for AI-assisted code, add an `Assisted-by:` trailer as an opt-in team policy (not a default). Keep it out of the subject line. Example:
176177```text
178feat(search): add full-text product search
179180Assisted-by: claude-sonnet-4-6
181```
182183This is an organizational opt-in pattern, not a general requirement. The default rule remains: no attribution.
184185`Assisted-by:` is a distinct trailer from `Co-Authored-By:` — several large open-source projects (Linux Kernel, Apache Software Foundation, LLVM, QEMU) have converged on `Assisted-by:` through 2026 specifically because `Co-Authored-By:` implies authorship/copyright standing that an AI tool cannot hold or sign a CLA for. If a repo already uses `Co-Authored-By: <ai-tool>` by convention, do not silently rewrite it to `Assisted-by:` — flag the distinction and let the maintainer choose; changing trailer conventions after history exists breaks blame/provenance tooling that greps for the old trailer.
186187## Repo Policy Checks
188189Block or rewrite messages that:
190191- omit the type prefix
192- use vague summaries: `update`, `fix stuff`, `change code`, `WIP`, `misc`
193- include assistant/tool attribution (see above)
194- overstate impact not visible in the diff
195- use past tense or gerund after the type prefix
196- exceed 72 characters on the subject line
197- end the subject line with a period
198199## Scripts
200201| Script | Purpose |
202|--------|---------|
203| [scripts/commit_validator.py](scripts/commit_validator.py) | Validate a single message, lint a history file, or generate a Markdown quality report |
204205```bash
206# Validate one message
207python scripts/commit_validator.py validate --message "feat(auth): add refresh token rotation"
208209# Lint a batch history file
210python scripts/commit_validator.py lint --input data/sample-commit-history.json
211212# Generate a full Markdown report
213python scripts/commit_validator.py report --input data/sample-commit-history.json --output report.md
214```
215216See [scripts/README.md](scripts/README.md) for the full quick-start, input format, and rule reference.
217218## Worktree PR Loop
219220Use this skill as the commit step inside the broader worktree-first delivery loop defined by [../dev-git-workflow/SKILL.md](../dev-git-workflow/SKILL.md).
221222In that loop: create or enter feature worktree → make code changes → stage intentionally → use this skill → run repo gate → open PR.
223224If the staged diff mixes several unrelated surfaces, stop and recommend split commits before the PR step.
225226## Known Traps
227228- Inferring scope from filenames alone, producing scopes that do not match the repo's bounded-context map.
229- Compressing unrelated changes into one "clean" conventional commit, destroying revert and release-note usefulness.
230- Treating AI-generated summaries as authoritative when the diff still contains hidden migrations or breaking changes.
231- Optimizing for lint-pass format while losing the operational intent maintainers need for incident archaeology.
232- Using `!` or `BREAKING CHANGE` casually and creating noisy downstream automation.
233234## Navigation
235236- [config.yaml](config.yaml) — repo-specific scope mapping and validation defaults
237- [assets/template-commit-message.md](assets/template-commit-message.md) — optional detailed body template for complex commits
238- [assets/template-security-commits.md](assets/template-security-commits.md) — wording guidance for security-sensitive commits
239- [references/conventional-commits-guide.md](references/conventional-commits-guide.md) — full spec v1.0.0 (current stable), type definitions, breaking changes, tooling setup
240- [references/commit-message-antipatterns.md](references/commit-message-antipatterns.md) — anti-pattern catalog, regex detection patterns, commitlint config, CI examples
241- [references/monorepo-commit-conventions.md](references/monorepo-commit-conventions.md) — scope strategy, per-package changelog generation, affected-package CI routing
242- [references/changelog-generation-guide.md](references/changelog-generation-guide.md) — release tooling comparison (standard-version deprecated since 2022; prefer release-please or changesets)
243- [data/sources.json](data/sources.json) — curated primary sources for tool verification
244- [data/sample-commit-history.json](data/sample-commit-history.json) — 20-commit sample dataset for lint and report subcommands
245- Related: [../dev-git-workflow/SKILL.md](../dev-git-workflow/SKILL.md) — branching, hooks, PR workflow, release automation; use dev-git-workflow for branching/PR strategy, this skill for commit-message standards
246247## Fact-Checking
248249- Conventional Commits spec is v1.0.0 (stable as of July 2026; no v2 released).
250- commitlint is at v21.x (21.2.1 as of July 2026); requires Node 22+; config uses ESM (`export default { extends: [...] }`).
251- `standard-version` is deprecated, not archived — the repo carries a deprecation notice pointing to `release-please` (GitHub-native) or the community fork `commit-and-tag-version`. Do not recommend it for new projects either way.
252- `release-please-action` is at v5 (Node 24 runtime, April 2026 breaking change); the underlying `release-please` package is at v17.x. Re-check the major tag before pinning a workflow — this skill will drift again.
253- `semantic-release` is at v25.x as of mid-2026 and actively maintained (recent work adds npm trusted publishing).
254- For current tooling, hook behavior, or release-automation recommendations, verify against primary sources in [data/sources.json](data/sources.json) and use web search when available — pinned major-version numbers in this skill are a snapshot, not a guarantee.
255- If browsing is unavailable, mark volatile tool guidance as unverified.
256257## Learnings Loop
258259Before applying this skill on a non-trivial task, read `learnings.consolidated.md` in this directory (and `learnings.md` if present).
260261After applying it, if you encountered a pattern worth remembering, append one dated bullet to `learnings.md` via `agents-skills-feedback-loop/scripts/append_learning.py`. Do not modify `SKILL.md` itself.
Run npx skillmds@latest add gabrielmoreira/dev-git-commit-message in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Generates or validates Conventional Commits messages from staged diffs. Use when drafting commit messages, checking repo rules, or inferring scope from changed files. It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. Capability flags: reads secrets. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
gabrielmoreira (@gabrielmoreira) published this skill. Their other Agent Skills are listed on their SkillMD profile.