commit-message-format

Rules for formatting Git commit messages using a prefix, short summary, and optional bullet points. Conventional Commits is a common style that uses prefixes such as feat, fix, and docs to describe changes.

In plain words
What is it for?
Use it when writing commits for features, bug fixes, refactoring, tests, documentation, builds, and other changes.
Why use it?
It makes the project's history easier to scan and keeps commit messages in the required language and structure.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/kinopeee/cursorrules/commit-message-format
Clone the repo
git clone --depth 1 https://github.com/kinopeee/cursorrules

Made for: Cursor.

Per session 1,324 This file is loaded in full into every session.
When invoked 1,324 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.01324 $0.01324
Opus 5 $0.00662 $0.00662
Sonnet 5 $0.00265 $0.00265
Haiku 4.5 $0.00132 $0.00132

Measured yesterday against content hash b83da5ad5e4e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

commit-message-format scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/commit-message-format.mdc · 103 lines

How it starts

The opening of the file, as written. The whole thing — 103 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Gitコミットメッセージの書式ルール

このルールは、すべてのコミットに対して適用されるコミットメッセージのガイドラインです。

このルールの位置づけ

  • 本ルールは、Conventional Commits をベースにしたコミットメッセージ規約です。
  • PrefixBREAKING CHANGE などの基本フォーマットは Conventional Commits に準拠しつつ、language による言語指定や箇条書き本文など、このリポジトリ向けのガイドラインを追加しています。
  • 他プロジェクトで再利用する場合は、language や Prefix の一覧を各プロジェクトのポリシーに合わせて調整してください。

言語指定

  • このルールファイルでは、コミットメッセージに用いる言語を表す論理名として language を用いる。
  • language = "ja"
  • サマリおよび本文は、原則として language で指定した言語で記述する。

基本フォーマット(必須)

<Prefix>: <サマリ(命令形/簡潔に)>

- 変更内容1(箇条書き)
- 変更内容2(箇条書き)
- ...

Refs: #<Issue番号>(任意)
BREAKING CHANGE: <内容>(任意)

Prefix(先頭プレフィックス)

Prefix は、Conventional Commits における type に相当し、小文字の英単語を使用します。

  • feat: 新機能の追加
  • fix: バグ修正
  • refactor: リファクタリング(挙動変更なし)
  • perf: パフォーマンス改善
  • test: テスト追加/修正
  • docs: ドキュメント更新
  • build: ビルド/依存関係の変更
  • ci: CI関連の変更
  • chore: 雑務(ツール設定/スクリプト等)
  • style: スタイルのみの変更(コードロジック無関係)
  • revert: 取り消し

Conventional Commits と同様に、必要に応じて <Prefix>(scope): の形式も許可します(例: fix(translation): ...)。

  • 詳細な仕様については、Conventional Commits の公式ドキュメントも参照してください。

サマリ(1行目)

  • language で指定した言語で簡潔に書く。末尾の句点は不要。
  • 何を・なぜ(必要なら)を短く表現。
  • 文字数はおおよそ50文字以内を目安に。

メッセージ生成の原則

  • コミットメッセージは、必ず未コミットの差分(git diff / git diff --cached など)を確認したうえで、その内容からサマリと本文を生成する。
  • issue タイトルやブランチ名だけから推測して書かず、実際の差分に含まれる変更内容を要約・列挙する。
  • AI やスクリプトによる自動生成の場合も、同様に未コミットの差分を入力として用いる。
  • bot や自動化ツールがコミットする場合も、このルールに従い、必ず差分に基づいてメッセージを生成する。

本文(箇条書き)

  • 変更点を「- 」ではじめる箇条書きで列挙。
  • 原則としてサマリと同じ言語(このルールファイルで定義した language)で記述する。必要に応じて技術用語は英単語可。
  • 可能なら「影響範囲」「移行手順」「リスク」「ロールバック方法」等も箇条書きで追記。

フッター(任意)

  • Refs/Closes: 関連IssueやPRを Refs: #123 / Closes: #123 で明記。
  • BREAKING CHANGE: 後方互換を壊す変更がある場合は内容を明示(あるいは Prefix に ! を付ける fix!: ... 記法を併用)。

fix: 不要なデバッグログ出力を削除

- ユーザー情報取得処理の冗長なログ行を削除
- 必要な情報は残しつつログボリュームを削減

Refs: #123
refactor: 重複したバリデーション処理を共通関数へ集約

- フォーム入力チェックの重複コードをユーティリティ関数へ切り出し
- 呼び出し元の重複ロジックを削除し可読性を向上
- 挙動の変更はなし

禁止事項

  • language で指定した言語と異なる言語だけでサマリを書くこと
  • 意味が伝わらない曖昧なサマリ(例: "update", "fix bug" 等の抽象的な表現)
  • 箇条書きがなく、内容が把握しづらい長文だけの本文
  • 静的解析や検査を無効化・迂回するだけで、実質的な改善を伴わない変更のコミット(例: チェックルールを緩めるだけの設定変更など)

Read the full file on GitHub · 103 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 103 lines · 1,324 tokens per session scan A b83da5ad5e4e

Subscribe to this mod's changes

commit-message-format is a cursor rule published in the GitHub repository kinopeee/cursorrules (1,116 stars, last pushed 8mo ago), licensed MIT. It adds 1,324 tokens to every session, about $0.0066 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.