К основному содержанию
правило CX Codex

commit-message-format — правило для Claude Code: формат коммитов

Правило commit-message-format для единообразных коммитов по Conventional Commits: префикс типа, краткая суть на английском и список изменений буллетами.

MIT ★ 359 обновлён 2025-12-01

Установить в Claude Code · Вручную: положить файлы Все способы и платформы ↓
.claude/rules/commit-message-format.md
Открыть на GitHub

Что делает commit-message-format

Правило применяется при создании коммитов и задаёт структуру сообщения: префикс (feat, fix, refactor, docs и другие), краткое описание в императиве до 50 знаков, затем тело из буллет-пойнтов с перечислением изменений. Опционально — ссылка на Issue (Refs: #123) и пометка BREAKING CHANGE, если изменения ломают совместимость.

Правило требует генерировать сообщение из реального диффа (git diff или git diff --cached), а не угадывать по названию ветки или Issue. Запрещены размытые фразы вроде «update», «fix bug» без деталей и коммиты, которые только отключают проверки.

Какие задачи решает

  • написать структурированное сообщение коммита по Conventional Commits
  • перечислить изменения буллетами вместо сплошного текста
  • сгенерировать commit message из диффа, а не из названия Issue

Примеры запросов агенту

  • Сформируй коммит для staged-изменений по правилу commit-message-format
  • Напиши commit message в формате Conventional Commits с буллет-листом
  • Проверь, соответствует ли мой последний коммит правилу форматирования

Как установить commit-message-format

Вручную: положить файлы

.claude/rules/commit-message-format.md

Поле paths во frontmatter ограничивает файлы

По шагам, с командами для каждой платформы: AGENTS.md и CLAUDE.md: что это, кто читает и какой выбрать

Вопросы о commit-message-format

Как установить commit-message-format в Claude Code?

Положи файл правила в .claude/rules/commit-message-format.md — агент будет применять его при создании коммитов.

Что делает commit-message-format?

Задаёт формат сообщения коммита: префикс типа (feat, fix), краткое описание и список изменений буллетами. Правило требует генерировать текст из диффа, а не из названия задачи.

Какие префиксы можно использовать в коммитах?

feat для новых фич, fix для багфиксов, refactor, perf, test, docs, build, ci, chore, style, revert. Можно добавить scope: fix(translation): ....

Исходный текст

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

Похожие правила IDE

Все правила IDE по теме «Git и GitHub» →
commit-message herdodp Скилл commit-message для Claude Code регламентирует формат коммитов и поэтапно готовит изменения к фиксации. Включается по просьбе закоммитить правки или составить текст коммита. CX Codex +1 ★ 325звёзд репо Conventional Commit Message Generator jeff-nasseri Промпт Conventional Commit Message Generator для ChatGPT и Claude.ai, который генерирует коммиты по спецификации Conventional Commits. Даёшь git diff или описание изменений — получаешь готовое сообщение с типом, скоупом и телом. GP ChatGPT ★ 178 201звёзд репо git-commit официальный github Доводит правки до коммита: читает диф, отбирает файлы, пишет сообщение по Conventional Commits и запускает git commit. CX Codex +1 47 165установок commit getsentry Скилл для коммитов в стиле Sentry: собирает conventional commits со ссылками на задачи и следит, чтобы вы не коммитили прямо в main. CX Codex +1 4 900установок ce-commit EveryInc Скилл ce-commit для Claude Code автоматически создаёт гит-коммиты с осмысленными сообщениями, разбивая изменения на логические блоки. Запускается для фиксации staged- или unstaged-файлов без пуша. CX Codex +1 3 600установок conventional-commit marcelorodrigo Заставляет их писать коммиты по спецификации Conventional Commits: тип, scope, императив в заголовке. CX Codex +1 964установок

Из того же набора7

planning-mode-guard Правило planning-mode-guard запрещает ИИ менять рабочий код во время планирования и заставляет отвечать на языке пользователя. CX Codex +1 ★ 359звёзд репо pr-message-format Правило pr-message-format задаёт формат заголовка и структурированного описания Pull Request. Оно пригодится, когда агент готовит PR по изменениям в коде. CX Codex +1 ★ 359звёзд репо test-strategy Правило test-strategy для Claude Code задаёт структуру тест-плана и требования к автотестам — от граничных случаев до проверки ошибок. Описывает тесты, добавляемые или изменяемые вместе с кодом. CX Codex +1 ★ 359звёзд репо prompt-injection-guard Правило prompt-injection-guard останавливает агента перед опасной командой из внешнего источника и требует подтверждения, а не просто предупреждает и выполняет её. CX Codex +1 ★ 359звёзд репо v5 Правило v5 задаёт регламент написания кода: делит задачи на лёгкие, стандартные и критические, запрещает длинные предисловия и регулирует вызов инструментов. CX Codex +1 ★ 359звёзд репо v5 v5 задаёт порядок работы ИИ-ассистента над кодом: от мелких исправлений до критичных изменений. Помогает согласовать план, чтение файлов и проверки с масштабом задачи. CX Codex +1 ★ 359звёзд репо

Спонсоры проекта

Компании, которые помогают держать аналитику открытой