commit-helper
リポジトリのルールや履歴、変更内容を分析し、適切なスタイルでコミットメッセージの草案を作成するSkill。
📜 元の英語説明(参考)
Inspect explicit repo-local commit rules, recent history, and staged changes to draft commit messages in the right style family. Use when the user asks for a commit message, asks to commit staged changes, or wants help choosing between conventional, gitmoji, plain imperative, or repo-custom commit formats.
🇯🇵 日本人クリエイター向け解説
リポジトリのルールや履歴、変更内容を分析し、適切なスタイルでコミットメッセージの草案を作成するSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-17
- 取得日時
- 2026-05-17
- 同梱ファイル
- 1
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
コミットヘルパー
概要
このスキルは、ユーザーが普遍的な形式やトーンを想定するのではなく、ターゲットリポジトリに合ったコミットメッセージを望む場合に使用します。
このスキルは、一般的なスタイルファミリーの小規模なセットをサポートしています。
- Conventional Commits
- 絵文字 / gitmoji スタイルのコミット
- 簡潔な命令形サブジェクト
- リポジトリカスタムテンプレートまたは文書化されたコミットルール
このヘルパーは、あらゆるコミット形式をサポートしようとはしません。以下を区別します。
format: conventional、gitmoji、plain、またはリポジトリカスタムテンプレートphrasing: 言語、トーン、タイトルの長さ、および一般的な言い回しの習慣
まず、ステージングされた差分から意味を推測し、その意味をリポジトリの推奨するスタイルファミリーとフレーズプロファイルに変換します。
呼び出し境界
このスキルが呼び出されると、コミットメッセージの作成はコミットヘルパーのみによって管理されます。
- 明示的なリポジトリローカルルール、最近の Git 履歴、ステージングされた差分のセマンティクス、およびユーザーの直接的な言い回しの好みのみを使用します。
- 外部のハーネスメタデータ、Lore トレーラー、隠れたワークフローノート、自動化の帰属、または共同作成者トレーラーは、ターゲットリポジトリ自身のコミットされたルール/テンプレートによって明示的に要求されるか、ユーザーが明示的に要求しない限り、追加しないでください。
- オーケストレーションレイヤーやプリツールフックが要求するからといって、
Co-authored-by: OmX <omx@oh-my-codex.dev>、Constraint:、Rejected:、Confidence:、Scope-risk:、Directive:、Tested:、またはNot-tested:を追加しないでください。 - コミットヘルパーが外部のインラインメッセージの変更なしに、ステージングされたタイトル/本文の契約を維持できるように、生の
git commit -m ...よりもscripts/draft_commit_message.py ... --commitを優先してください。 - 外部フックが、リポジトリ以外のコミットトレーラーや自動化の帰属を要求するためにコミットをブロックする場合、コミットメッセージを汚染してそれを満たすのではなく、そのブロッカーを報告してください。ユーザーが明示的に要求しない限り、
--no-verifyでフックをバイパスしないでください。
互換性と前提条件
PATHにpython3があることPATHにgitがあること- ターゲットリポジトリへの読み取りアクセス
デフォルトのワークフロー
- ターゲットリポジトリを特定します。
- リポジトリに
AGENTS.mdがある場合は読み取ります。 - ドラフトまたはコミットする前に
scripts/inspect_commit_style.py <repo-path>を実行します。- これは正規の検査ステップです。
- まず明示的なリポジトリローカルルールをチェックし、次に最近の履歴、そしてステージングされた差分のセマンティクスをチェックします。
- 優先順位を尊重します。
- 明示的なリポジトリローカルルール
- 最近の履歴
- 保守的なフォールバック
- 形式とフレーズを別々に扱います。
- 形式は明示的なルール、履歴、およびフォールバックポリシーから来ます。
- フレーズは、形式が保守的にフォールバックする場合でも、主に最近の履歴から来ます。
- 標準の生成パスとして
scripts/draft_commit_message.py <repo-path> --summary ... [--body-line ...]を使用します。- ユーザーがコミットの作成を依頼した場合は
--commitを追加します。 - このスクリプトは複数行の本文を安全に保持するため、生の
git commit -m ...よりも優先してください。
- ユーザーがコミットの作成を依頼した場合は
- ステージングされた変更のみからドラフトを作成します。
- 強いシグナルがない場合は、Conventional Commit のタイトルと保守的なフレーズにフォールバックします。
ルールの記述
- 普遍的なコミット形式を仮定しないでください。
- ステージングされた変更のみからコミットを作成します。
- タイトルはステージングされた変更に限定し、関連のないステージングされていない作業には限定しないでください。
- 競合する場合は、最近の履歴よりも明示的なローカルルールを使用します。
- 明示的なローカルルールがない場合は、一般的なヒューリスティックよりも最近の履歴を使用します。
- 明示的なルールと履歴が弱いか混在している場合は、保守的なフォールバックを使用します。
- セマンティックレイヤーはグローバルです。プレゼンテーションレイヤーはリポジトリ固有です。
- ステージングされた差分の意味を
feature、bugfix、critical-bug、refactor、structure、move、ui-style、responsive、accessibility、docs、config、tooling、cleanup、またはmodifyのいずれかとして推測します。 - その後、その意味をリポジトリのスタイルファミリーで表現します。
- ステージングされた差分の意味を
- リポジトリが別のスタイルを明確に示さない場合、Conventional Commit のフォールバックがデフォルトの安全なフォールバックです。
- フレーズのフォールバックは保守的に保つべきです。
- 韓国語: 報告書のような説明よりも、短い自然な名詞/動詞スタイルの言い回しを優先します。
- 英語: 短い命令形の言い回しを優先します。
- 混合リポジトリ: 信頼性が十分な場合は主要な言語に従います。そうでない場合は、タイトルを短く中立に保ちます。
- Gitmoji はグローバルなデフォルトではありません。
- リポジトリローカル設定、リポジトリドキュメント、または明確な絵文字優勢の履歴がそうするように指示する場合にのみ、gitmoji を強くアクティブ化します。
- リポジトリローカルの許可リストが存在する場合、その許可リスト外の絵文字は使用しないでください。
- gitmoji の信頼性が低い場合、リポジトリローカルのフォールバック gitmoji が存在する場合はそれを優先します。曖昧な変更にバグ修正の絵文字を強制しないでください。
- バグ修正の分類は保守的でなければなりません。
bugfixまたはcritical-bugは、ステージングされた差分が壊れた動作、検証ブロック、リグレッション、クラッシュ、または誤った状態を明確に修正する場合にのみ使用します。- UI の間隔、モーダルのサイズ設定、ラッパーのクリーンアップ、およびレイアウトの変更は、通常
ui-style、structure、またはmodifyに分類されるべきです。
title-only-preferred、body-optional、およびbody-requiredのポリシーを明確に区別します。- ヘルパーは、可能な限りリポジトリローカルの言い回しの習慣に合わせるべきです。
dominant_language、dominant_tone、title_length_profile、common_korean_suffixes、common_action_nouns、preferred_summary_style、およびavoid_report_like_phrasingを追跡します。- ユーザーが提供した要約が不自然な場合は、根本的な意味を変えずに言い回しを修正します。
- 本文のデフォルト: リポジトリが本文を強く要求しない場合、
title-only-preferredをデフォルトとして扱います。 - 本文が必要な場合は、短くして数行の箇条書きを使用します。
- コミット本文ではリテラルな
\nは禁止されています。"title\n\nbody"のようなシェル文字列を作成しないでください。 $commit-helperの呼び出しでは、外部メッセージバリデータがリポジトリ以外のメタデータを挿入する原因となる場合、生のインラインgit commit -mにフォールバックせず、可能な限りdraft_commit_message.py --commitを標準のコミット実行パスとして使用します。
安全なコミット例
- タイトルのみのドラフト
(原文がここで切り詰められています)
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Commit Helper
Overview
Use this skill when the user wants a commit message that matches the target repository instead of assuming one universal format or one universal tone.
This skill supports a small set of common style families:
- Conventional Commits
- Emoji / gitmoji-style commits
- Plain imperative subjects
- Repo-custom templates or documented commit rules
The helper does not try to support every commit format in the wild. It separates:
format: conventional, gitmoji, plain, or repo-custom templatephrasing: language, tone, title length, and common wording habits
It first infers semantic meaning from the staged diff, then converts that meaning into the repository's preferred style family and phrasing profile.
Invocation Boundary
When this skill is invoked, commit-message construction is governed by commit-helper only:
- Use only explicit repo-local rules, recent git history, staged diff semantics, and direct user wording preferences.
- Do not add external harness metadata, Lore trailers, hidden workflow notes, automation attribution, or co-author trailers unless they are explicitly required by the target repository's own committed rules/templates or the user explicitly asks for them.
- Do not add
Co-authored-by: OmX <omx@oh-my-codex.dev>,Constraint:,Rejected:,Confidence:,Scope-risk:,Directive:,Tested:, orNot-tested:merely because an orchestration layer or pre-tool hook asks for them. - Prefer
scripts/draft_commit_message.py ... --commitover rawgit commit -m ...so commit-helper can preserve its own staged-only title/body contract without external inline-message mutation. - If an external hook blocks a commit because it demands non-repo commit trailers or automation attribution, report that blocker instead of satisfying it by polluting the commit message. Do not bypass hooks with
--no-verifyunless the user explicitly asks.
Compatibility and Prerequisites
python3inPATHgitinPATH- read access to the target repository
Default Workflow
- Identify the target repository.
- Read
AGENTS.mdif the repo has one. - Run
scripts/inspect_commit_style.py <repo-path>before drafting or committing.- This is the canonical inspection step.
- It checks explicit repo-local rules first, then recent history, then staged diff semantics.
- Respect the priority order:
- explicit repo-local rules
- recent history
- conservative fallback
- Treat format and phrasing separately.
- Format comes from explicit rules, history, and fallback policy.
- Phrasing comes mostly from recent history, even when format falls back conservatively.
- Use
scripts/draft_commit_message.py <repo-path> --summary ... [--body-line ...]as the standard generation path.- Add
--commitwhen the user asked you to create the commit. - Prefer this script over raw
git commit -m ...because it preserves multiline bodies safely.
- Add
- Draft from staged changes only.
- If no strong signal exists, fall back to a conventional commit title and conservative phrasing.
Writing Rules
- Do not assume one universal commit format.
- Write the commit from staged changes only.
- Keep the title scoped to the staged changes, not to unrelated unstaged work.
- Use explicit local rules over recent history whenever they conflict.
- Use recent history over generic heuristics whenever explicit local rules are absent.
- If explicit rules and history are weak or mixed, use the conservative fallback.
- The semantic layer is global. The presentation layer is repo-specific.
- Infer staged diff meaning as one of:
feature,bugfix,critical-bug,refactor,structure,move,ui-style,responsive,accessibility,docs,config,tooling,cleanup, ormodify. - Then express that meaning in the repository's style family.
- Infer staged diff meaning as one of:
- Conventional fallback is the default safe fallback when the repo does not clearly signal another style.
- Phrasing fallback should stay conservative.
- Korean: prefer short natural noun/verb-style wording over report-like description.
- English: prefer short imperative wording.
- Mixed repos: follow the dominant language when confidence is sufficient; otherwise keep the title short and neutral.
- Gitmoji is not the global default.
- Strongly activate gitmoji only when repo-local config, repo documentation, or clear emoji-dominant history says to do so.
- If a repo-local allowlist exists, do not use emojis outside that allowlist.
- If gitmoji confidence is low, prefer the repo-local fallback gitmoji when one exists. Do not force a bugfix emoji on ambiguous changes.
- Bugfix classification must be conservative.
- Use
bugfixorcritical-bugonly when the staged diff clearly fixes broken behavior, validation blocks, regressions, crashes, or incorrect state. - UI spacing, modal sizing, wrapper cleanup, and layout changes should usually land in
ui-style,structure, ormodifyinstead.
- Use
- Keep
title-only-preferred,body-optional, andbody-requiredpolicies distinct. - The helper should match repo-local wording habits when possible.
- Track
dominant_language,dominant_tone,title_length_profile,common_korean_suffixes,common_action_nouns,preferred_summary_style, andavoid_report_like_phrasing. - If the user-supplied summary is awkward, polish the wording without changing the underlying meaning.
- Track
- Body default: if the repo does not strongly require a body, treat
title-only-preferredas the default. - If a body is needed, keep it short and use a few bullet lines.
- Literal
\nis forbidden in commit bodies. Do not build a shell string like"title\n\nbody". - Use
draft_commit_message.py --commitas the standard commit execution path whenever practical; for$commit-helperinvocations, do not fall back to raw inlinegit commit -mif that would trigger external message validators to inject non-repo metadata.
Safe Commit Examples
- Title-only draft:
python3 scripts/draft_commit_message.py <repo-path> --summary "..." --no-body - Title + multiline body draft:
python3 scripts/draft_commit_message.py <repo-path> --summary "..." --body-line "first bullet" --body-line "second bullet" - Safe commit execution without literal
\n:python3 scripts/draft_commit_message.py <repo-path> --summary "..." --body-line "first bullet" --body-line "second bullet" --commit - If you must use raw
git commit, pass an actual multiline second-m, not a literal backslash escape:BODY="$(printf '%s\n' '- first bullet' '- second bullet')"git -C <repo-path> commit -m "title" -m "$BODY"
Script
scripts/inspect_commit_style.py- inspects explicit rule files such as
AGENTS.md,CONTRIBUTING.md,README*, commit templates, commitlint configs, and.vscode/settings.jsononly when it containsgitmoji.*keys - classifies recent history into common style families:
conventional,gitmoji,plain, or mixed - infers staged semantic categories before choosing a commit style expression
- infers phrasing profile fields such as
dominant_language,dominant_tone,title_length_profile,common_korean_suffixes,common_action_nouns,preferred_summary_style, andavoid_report_like_phrasing - emits policy fields such as
style_mode,repo_has_explicit_commit_rule,repo_has_gitmoji_signal,should_use_gitmoji,fallback_commit_style,fallback_gitmoji,requires_human_gitmoji_review,semantic_confidence,is_bugfix_confident, andpresentational_change_likelihood
- inspects explicit rule files such as
scripts/draft_commit_message.py- is the standard generation and commit path
- assembles a staged-only title/body draft from inspect output
- applies explicit-rule, history, and fallback policy in that order
- polishes wording to match repo-local phrasing when it can do so safely
- warns when manual overrides conflict with repo policy or low-confidence semantics
- normalizes body bullets without literal
\n - can execute
git commitsafely with subprocess argv via--commit
Reference
references/commit-patterns.md- style-family notes and conservative fallback guidance
Evals
evals/train_queries.jsonevals/validation_queries.jsonevals/behavior_cases.json