commit-message-format — Claude Code rule: commit message format
commit-message-format — a rule for consistent Conventional Commits: type prefix, concise English summary, and bulleted change list.
MIT ★ 359 updated 2025-12-01
.claude/rules/commit-message-format.mdWhat commit-message-format does
The rule applies when creating commits and defines message structure: prefix (feat, fix, refactor, docs, and others), imperative summary under 50 characters, then body with bulleted change list. Optional footer includes Issue reference (Refs: #123) and BREAKING CHANGE marker for backward-incompatible changes.
The rule requires generating messages from actual diffs (git diff or git diff --cached) rather than guessing from branch or Issue titles. Vague phrases like "update" or "fix bug" without details are prohibited, as are commits that only disable checks.
What it helps with
- write structured commit message following Conventional Commits
- list changes as bullet points instead of plain text
- generate commit message from diff rather than Issue title
Example prompts for the agent
- Generate a commit for staged changes following
commit-message-formatrule - Write a commit message in Conventional Commits format with bulleted body
- Check if my last commit follows the format rule
How to install commit-message-format
Manually: put the files in place
.claude/rules/commit-message-format.mdThe paths frontmatter field limits the files
AGENTS.md
Codex reads AGENTS.md: paste the rule text there
Manually: put the files in place
.cursor/rules/commit-message-format.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.github/instructions/commit-message-format.instructions.mdThe applyTo field sets which files it applies to
Manually: put the files in place
.devin/rules/commit-message-format.mdManually: put the files in place
.clinerules/commit-message-format.mdStep by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use
Questions about commit-message-format
How to install commit-message-format in Claude Code?
Place the rule file in .claude/rules/commit-message-format.md — the agent will apply it when creating commits.
What does commit-message-format do?
Defines commit message format: type prefix (feat, fix), short summary, and bulleted change list. The rule requires generating text from diffs rather than task titles.
Which prefixes can I use in commits?
feat for features, fix for bugs, refactor, perf, test, docs, build, ci, chore, style, revert. You can add scope: fix(translation): ....
Source text
commit-message-format.md · MIT
--- trigger: model_decision description: Applied when creating Git commit messages. Format rules for Conventional Commits-based Prefix + English summary + bulleted body globs: --- # Git Commit Message Format Rules This rule is a guideline for commit messages that applies to all commits. ## Position of This Rule - This rule is a commit message convention based on Conventional Commits. - While adhering to basic formats like `Prefix` and `BREAKING CHANGE` from Conventional Commits, it adds guidelines specific to this repository such as `language` specification and bulleted body. - When reusing in other projects, adjust `language` and the list of Prefixes according to each project's policy. ## Language Specification - In this rule file, `language` is used as a logical name representing the language used in commit messages. - `language = "en"` - Summary and body should be written in the language specified by `language` as a rule. ## Basic Format (Required) ``` <Prefix>: <Summary (imperative/concise)> - Change 1 (bullet point) - Change 2 (bullet point) - ... Refs: #<Issue number> (optional) BREAKING CHANGE: <content> (optional) ``` ## Prefix (Leading Prefix) Prefix corresponds to `type` in Conventional Commits and uses lowercase English words. - feat: Add new feature - fix: Bug fix - refactor: Refactoring (no behavior change) - perf: Performance improvement - test: Add/modify tests - docs: Documentation update - build: Build/dependency changes - ci: CI-related changes - chore: Miscellaneous tasks (tool settings/scripts, etc.) - style: Style-only changes (unrelated to code logic) - revert: Revert As with Conventional Commits, the format `<Prefix>(scope):` is also allowed as needed (e.g., `fix(translation): ...`). - For detailed specifications, also refer to the official [Conventional Commits](https://www.conventionalcommits.org/) documentation. ## Summary (First Line) - Write concisely in the language specified by `language`. No period at the end. - Briefly express what and why (if necessary). - Aim for approximately 50 characters or less. ## Principles for Message Generation - Commit messages must always be generated from uncommitted diffs (e.g., `git diff` / `git diff --cached`) after reviewing their content. - Do not guess from issue titles or branch names alone; summarize and enumerate the actual changes contained in the diff. - Even for automatic generation by AI or scripts, use uncommitted diffs as input. - When bots or automation tools commit, follow this rule and always generate messages based on diffs. ## Body (Bullet Points) - List changes as bullet points starting with "- ". - Write in the same language as the summary (the `language` defined in this rule file) as a rule. Technical terms in English are acceptable as needed. - If possible, also add bullet points for "impact scope," "migration steps," "risks," "rollback method," etc. ## Footer (Optional) - Refs/Closes: Specify related Issues or PRs with `Refs: #123` / `Closes: #123`. - BREAKING CHANGE: If there are backward-incompatible changes, clearly state the content (or use the `!` notation with Prefix like `fix!: ...`). ## Examples ``` fix: Remove unnecessary debug log output - Remove verbose log lines from user info retrieval process - Reduce log volume while keeping necessary information Refs: #123 ``` ``` refactor: Consolidate duplicate validation logic into common function - Extract duplicate form input check code to utility function - Remove duplicate logic from callers to improve readability - No behavior changes ``` ## Prohibited - Writing summary only in a language different from that specified by `language` - Ambiguous summaries that don't convey meaning (e.g., abstract expressions like "update", "fix bug") - Body with only long text without bullet points that makes content hard to grasp - Commits that only disable or bypass static analysis or checks without substantial improvement (e.g., configuration changes that only relax check rules)
© kinopeee · MIT · kinopeee/windsurf-antigravity-rules