ステージ済みの差分から Conventional Commits 形式のコミットメッセージを作成
Conventional Commit message writer from the staged diff
git add した変更だけを要約し、種類・スコープ・リポジトリの過去の書き方に合わせたコミットメッセージを日本語または英語で作ります。秘密情報らしきファイルや行も警告します。
できること
git add でステージした変更だけを対象に、正確なコミットメッセージを作ります。
- 付属スクリプトが
git diff --cachedを要約: 変更ファイル・追加/削除行数・ファイルの種類(コード・テスト・ドキュメント・ビルド・CI・バイナリ)・スコープ候補・リネーム - 直近 15 件のコミットから、Conventional Commits を使っているか、日本語か、どのスコープ名を使ってきたかを調べて書き方を合わせる
.envや秘密鍵のファイル名、トークンやパスワードらしき追加行を見つけたら警告- 変更が 3 か所以上の領域にまたがるときはコミットの分割を提案
- 破壊的変更には
!とBREAKING CHANGE:を付ける
使い方
python scripts/staged_summary.py --repo .
その後エージェントに「ステージした変更のコミットメッセージを書いて」と頼みます。Claude・Codex・Hermes Agent・Cursor で使えます。コミットまで頼んだ場合だけ git commit -F で実行します。
必要な環境
- Python 3(標準ライブラリのみ)
- Git
注意点
- スクリプトは読み取り専用で、ステージやコミットは行いません。
- 何もステージされていないときは、勝手にステージせずに確認します。
- 種類の判定はファイル名からのヒントにすぎず、最終的には差分の中身から判断します。
- 秘密情報の検出は簡易的なパターンによるもので、すべてを見つけられるわけではありません。
English description
Summarizes only what is staged and drafts a Conventional Commit message in English or Japanese that matches the repository's existing style. Warns about staged secrets.
What it does
Writes an accurate commit message for exactly what is staged.
- The bundled script summarizes
git diff --cached: files, added/deleted lines, file kinds (code, test, docs, build, CI, binary), scope candidates and renames - Reads the last 15 commit subjects to match the repository's style: Conventional Commits or not, Japanese or English, scope names already in use
- Warns about staged
.envfiles, private keys, and added lines that look like tokens or passwords - Suggests splitting the commit when code changes span 3 or more areas
- Marks breaking changes with
!and aBREAKING CHANGE:footer
How to use
python scripts/staged_summary.py --repo .
Then ask the agent to write a commit message for the staged changes. Works with Claude, Codex, Hermes Agent and Cursor. The agent runs git commit -F only when you ask it to commit.
Requirements
- Python 3 (standard library only)
- Git
Caveats
- The script is read-only; it never stages or commits.
- If nothing is staged, the agent asks instead of staging on its own.
- The type hint comes from file names only; the final type is decided from the diff itself.
- Secret detection uses simple patterns and will not catch everything.
インストール方法
- ダウンロードしたZIPを展開します(中に
git-commit-message-writer/フォルダとSKILL.mdがあります)。 - フォルダごと、使うエージェントのスキル置き場にコピーします。
- Claude:
~/.claude/skills/(プロジェクト単位なら.claude/skills/) - Hermes Agent:
~/.hermes/skills/ - Codex:
~/.agents/skills//Cursor:~/.cursor/skills/ - Claude アプリ(claude.ai):「カスタマイズ → スキル」からZIPをアップロード
- Claude:
- エージェントを再起動し、スキル一覧に表示されることを確認します。
出品者
出品スキル 44 件