jpskill.com
✍️ ライティング コミュニティ

commit-prepare

gitのコミットメッセージを、特定のルール(conventional commits)に沿って自動で準備してくれるので、コミット作業を効率化し、プロジェクトの履歴管理をより分かりやすくするSkill。

📜 元の英語説明(参考)

Prepare git commit messages following conventional commits. Activates on: commit, prepare commit, commit this, commit message, ready to commit, stage and commit

🇯🇵 日本人クリエイター向け解説

一言でいうと

gitのコミットメッセージを、特定のルール(conventional commits)に沿って自動で準備してくれるので、コミット作業を効率化し、プロジェクトの履歴管理をより分かりやすくするSkill。

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o commit-prepare.zip https://jpskill.com/download/17653.zip && unzip -o commit-prepare.zip && rm commit-prepare.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/17653.zip -OutFile "$d\commit-prepare.zip"; Expand-Archive "$d\commit-prepare.zip" -DestinationPath $d -Force; ri "$d\commit-prepare.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して commit-prepare.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → commit-prepare フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
1

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

Commit Preparation Skill

Conventional Commits 標準に従って、コミットメッセージを自動的に準備します。

起動

このスキルは、以下のキーワードで起動します。

  • "commit", "prepare commit", "commit this"
  • "commit message", "write commit"
  • "stage and commit", "commit changes"
  • "what should I commit", "ready to commit"

ワークフロー

起動されると、以下の手順に従います。

1. コンテキストの収集

コミットされる内容を理解するために、以下のコマンドを実行します。

# すべての変更を表示
git status

# ステージングされた変更 (コミットされる内容)
git diff --cached --stat
git diff --cached

# ステージングされていない変更 (まだコミットされない)
git diff --stat

2. 変更の分析

以下を判断します。

  • Type: feat, fix, docs, refactor, test, chore, perf, ci
  • Scope: どのコンポーネント/モジュールが影響を受けるか (オプション)
  • Breaking: 破壊的な変更があるか?
  • What: 何が変更されたか
  • Why: なぜ変更されたか (明白でない場合)

3. コミットメッセージの生成

Conventional Commits 形式に従います。

<type>(<scope>): <subject>

<body>

<footer>

Type Reference

Type いつ使うか
feat 新機能 feat: add user authentication
fix バグ修正 fix: resolve null pointer in parser
docs ドキュメントのみ docs: update API reference
refactor コードの再構成 refactor: extract validation logic
test テストの追加/修正 test: add unit tests for auth
perf パフォーマンスの改善 perf: optimize database queries
chore メンテナンス、依存関係 chore: update dependencies
ci CI/CD の変更 ci: add caching to workflow
style フォーマットのみ style: fix indentation

Rules

  • Subject: 命令形 ("add" で "added" ではない)、ピリオドなし、最大 50 文字
  • Body: 72 文字で折り返し、何が、なぜ変更されたかを説明 (どのようにではない)
  • Footer: 破壊的な変更、issue への参照

4. ステージングの処理

ステージングされていない変更がある場合は、以下を尋ねます。

  • "すべての変更をステージングしますか?" (git add .)
  • "特定のファイルをステージングしますか?" (それらをリスト表示)
  • "最初に変更を確認しますか?" (diff を表示)

5. コミットの実行

ユーザーがメッセージを確認した後:

git add <files>
git commit -m "<message>"

重要: 複数行のコミットには常に HEREDOC を使用してください。

git commit -m "$(cat <<'EOF'
feat: add user authentication

Implement OAuth2 flow with Google and GitHub providers.
Includes session management with secure cookies.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
EOF
)"

6. コミット後

コミットが成功した後:

  • git log -1 を表示して確認
  • 準備ができている場合は git push を提案
  • ステージングされていない変更が残っている場合は言及

対話例

簡単なコミット

User: "commit these changes"

Claude:

git status
git diff --cached

ステージングされた変更を確認します:

  • 変更された src/auth/oauth.py - トークンリフレッシュロジックを追加
  • 変更された tests/test_auth.py - リフレッシュテストを追加

提案されたコミット:

feat(auth): add OAuth token refresh

Implement automatic token refresh when access token expires.
Includes retry logic with exponential backoff.

このメッセージでコミットしますか?


破壊的な変更

User: "ready to commit"

Claude: API レスポンス形式を変更したことがわかりました。これは破壊的な変更です。

提案されたコミット:

feat(api)!: change response envelope format

BREAKING CHANGE: API responses now use { data, meta, errors }
envelope instead of flat response. Clients must update parsing.

Migration: Update response handlers to access .data property.

これは ! で破壊的な変更としてマークされます。続行しますか?


複数の論理的な変更

User: "commit this"

Claude: 複数の無関係な領域への変更が見られます:

  1. parser.py のバグ修正
  2. export.py の新機能
  3. ドキュメントの更新

個別のコミットに分割することをお勧めします:

  1. fix(parser): handle empty input gracefully
  2. feat(export): add CSV export option
  3. docs: update export documentation

それぞれを個別にステージングしてコミットするのを手伝いましょうか?

帰属

AI 支援によるコミットには、常に Claude の帰属を含めてください。

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

安全規則

  • プッシュされたコミットに対して git commit --amend絶対に使用しないでください
  • 明示的に要求されない限り、--no-verify でフックを絶対にスキップしないでください
  • 実行する前に、常にコミットメッセージを表示してください
  • ステージングされたファイルにシークレット/クレデンシャルがないか確認してください
  • 大きなバイナリファイルについて警告してください
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

Commit Preparation Skill

Automatically prepare commit messages following conventional commits standard.

Activation

This skill activates on keywords:

  • "commit", "prepare commit", "commit this"
  • "commit message", "write commit"
  • "stage and commit", "commit changes"
  • "what should I commit", "ready to commit"

Workflow

When activated, follow these steps:

1. Gather Context

Run these commands to understand what's being committed:

# See all changes
git status

# Staged changes (what will be committed)
git diff --cached --stat
git diff --cached

# Unstaged changes (won't be committed yet)
git diff --stat

2. Analyze Changes

Determine:

  • Type: feat, fix, docs, refactor, test, chore, perf, ci
  • Scope: Which component/module is affected (optional)
  • Breaking: Are there breaking changes?
  • What: What was changed
  • Why: Why was it changed (if not obvious)

3. Generate Commit Message

Follow conventional commits format:

<type>(<scope>): <subject>

<body>

<footer>

Type Reference

Type When to Use Example
feat New feature feat: add user authentication
fix Bug fix fix: resolve null pointer in parser
docs Documentation only docs: update API reference
refactor Code restructuring refactor: extract validation logic
test Adding/fixing tests test: add unit tests for auth
perf Performance improvement perf: optimize database queries
chore Maintenance, deps chore: update dependencies
ci CI/CD changes ci: add caching to workflow
style Formatting only style: fix indentation

Rules

  • Subject: Imperative mood ("add" not "added"), no period, max 50 chars
  • Body: Wrap at 72 chars, explain what and why (not how)
  • Footer: Breaking changes, issue references

4. Handle Staging

If there are unstaged changes, ask:

  • "Stage all changes?" (git add .)
  • "Stage specific files?" (list them)
  • "Review changes first?" (show diff)

5. Execute Commit

After user confirms the message:

git add <files>
git commit -m "<message>"

Important: Always use HEREDOC for multi-line commits:

git commit -m "$(cat <<'EOF'
feat: add user authentication

Implement OAuth2 flow with Google and GitHub providers.
Includes session management with secure cookies.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
EOF
)"

6. Post-Commit

After successful commit:

  • Show git log -1 to confirm
  • Suggest git push if ready
  • Mention if more changes remain unstaged

Example Interactions

Simple Commit

User: "commit these changes"

Claude:

git status
git diff --cached

Looking at your staged changes:

  • Modified src/auth/oauth.py - added token refresh logic
  • Modified tests/test_auth.py - added refresh tests

Suggested commit:

feat(auth): add OAuth token refresh

Implement automatic token refresh when access token expires.
Includes retry logic with exponential backoff.

Shall I commit with this message?


Breaking Change

User: "ready to commit"

Claude: I see you've changed the API response format. This is a breaking change.

Suggested commit:

feat(api)!: change response envelope format

BREAKING CHANGE: API responses now use { data, meta, errors }
envelope instead of flat response. Clients must update parsing.

Migration: Update response handlers to access .data property.

This marks it as a breaking change with !. Proceed?


Multiple Logical Changes

User: "commit this"

Claude: I see changes to multiple unrelated areas:

  1. Bug fix in parser.py
  2. New feature in export.py
  3. Updated docs

Recommend splitting into separate commits:

  1. fix(parser): handle empty input gracefully
  2. feat(export): add CSV export option
  3. docs: update export documentation

Want me to help stage and commit each separately?

Attribution

Always include Claude attribution for AI-assisted commits:

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

Safety Rules

  • Never use git commit --amend on pushed commits
  • Never skip hooks with --no-verify unless explicitly asked
  • Always show the commit message before executing
  • Check for secrets/credentials in staged files
  • Warn about large binary files