This SkillRun capsule validates a proposed Git commit message before an agent
uses it. It is designed to move Conventional Commits rules out of fragile
prompts and into a typed, testable preflight boundary.
SOP
Accept only concise Conventional Commits subject lines.
Require one of the supported types: feat, fix, docs, style,
refactor, perf, test, chore, build, ci or revert.
Require type: summary or type(scope): summary with exactly one space
after the colon.
Keep the subject at or below 70 characters.
Reject multiline messages in this capsule. Longer release notes belong in a
separate artifact or PR body, not the commit subject.
Do not stage files automatically.
Execution Boundary
By default this capsule only validates and returns a normalized subject. If
perform_commit is set to true, it may run git commit -m <message> for
already staged changes only. It never runs git add ..
Required Context
message: proposed commit subject.
perform_commit: defaults to false.
Recovery Guidance
If this capsule returns PolicyViolation, rewrite the commit subject according
to the llm_hint and retry. If it returns DependencyError, inspect the local
Git repository state before retrying.
Prohibited Behavior
Do not auto-stage files.
Do not include multiline explanations in the commit subject.
Do not bypass a rejected message by calling Git directly.
1---2name: commit-message-gate3description: Commit Message Gate4---5# Commit Message Gate67## Purpose89This SkillRun capsule validates a proposed Git commit message before an agent10uses it. It is designed to move Conventional Commits rules out of fragile11prompts and into a typed, testable preflight boundary.1213## SOP14151. Accept only concise Conventional Commits subject lines.162. Require one of the supported types: `feat`, `fix`, `docs`, `style`,17 `refactor`, `perf`, `test`, `chore`, `build`, `ci` or `revert`.183. Require `type: summary` or `type(scope): summary` with exactly one space19 after the colon.204. Keep the subject at or below 70 characters.215. Reject multiline messages in this capsule. Longer release notes belong in a22 separate artifact or PR body, not the commit subject.236. Do not stage files automatically.2425## Execution Boundary2627By default this capsule only validates and returns a normalized subject. If28`perform_commit` is set to `true`, it may run `git commit -m <message>` for29already staged changes only. It never runs `git add .`.3031## Required Context3233- `message`: proposed commit subject.34- `perform_commit`: defaults to `false`.3536## Recovery Guidance3738If this capsule returns `PolicyViolation`, rewrite the commit subject according39to the `llm_hint` and retry. If it returns `DependencyError`, inspect the local40Git repository state before retrying.4142## Prohibited Behavior4344- Do not auto-stage files.45- Do not include multiline explanations in the commit subject.46- Do not bypass a rejected message by calling Git directly.
Run npx skillmds@latest add iiwish/commit-message-gate 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.
Commit Message Gate It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. 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.
iiwish (@iiwish) published this skill. Their other Agent Skills are listed on their SkillMD profile.