contextual-commit
できること
このスキルは、意図、決定事項、制約など、コードの変更の背後にある理由を残すコミットメッセージを書きます。後から読む人がコードを書いた理由を理解できるようにしたい開発者向けです。
使う場面
- ✓コードをコミットしているとき、またはタスクを終えるとき。
- ✓エージェントに変更のコミットを頼むとき。
- ✓コードの差分だけでは分からない、制約やトレードオフによって変更が形作られたとき。
スキルのリンク
https://github.com/yamadashy/repomix/blob/main/.agents/skills/contextual-commit/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“これらの変更をコミットしてください。このやり方を選んだ理由と、それを形作った制約も記録してください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントは標準のコミットの件名を維持し、本文に、意図、決定事項、制約、学んだことを説明する種類付きの行を追加します。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Contextual Commits
You write commits that carry development reasoning in the body — the intent, decisions, constraints, and learnings that the diff alone cannot show.
The Problem You Solve
Standard commits preserve WHAT changed. The diff shows that too. What gets lost is WHY — what the user asked for, what alternatives were considered, what constraints shaped the implementation, what was learned along the way. This context evaporates when the session ends. You prevent that.
Commit Format
The subject line is a standard Conventional Commit. The body contains action lines — typed, scoped entries that capture reasoning.
type(scope): subject line (standard conventional commit)
action-type(scope): description of reasoning or context
action-type(scope): another entry
Subject Line
Follow Conventional Commits exactly. Nothing changes here:
feat(auth): implement Google OAuth providerfix(payments): handle currency rounding edge caserefactor(notifications): extract digest scheduling logic
Action Lines
Each line in the body follows: action-type(scope): description
scope is a human-readable concept label — the domain area, module, or concern. Examples: auth, payment-flow, oauth-library, session-store, api-contracts. Use whatever is meaningful in this project's vocabulary. Keep scopes consistent across commits when referring to the same concept.
Action Types
Use only the types that apply. Most commits need 1-3 action lines. Never pad with noise.
intent(scope): ...
What the user wanted to achieve and why. Captures the human's voice, not your interpretation.
intent(auth): social login starting with Google, then GitHub and Appleintent(notifications): users want batch notifications instead of per-event emailsintent(payment-flow): must support EUR and GBP alongside USD for enterprise clients
When to use: Most feature work, refactoring with a purpose, any change where the motivation isn't obvious from the subject line.
decision(scope): ...
What approach was chosen when alternatives existed. Brief reasoning.
decision(oauth-library): passport.js over auth0-sdk for multi-provider flexibilitydecision(digest-schedule): weekly on Monday 9am, not daily — matches user researchdecision(currency-handling): per-transaction currency over account-level default
When to use: When you evaluated options. Skip for obvious choices with no real alternatives.
rejected(scope): ...
What was considered and explicitly discarded, with the reason. This is the highest-value action type — it prevents future sessions from re-proposing the same thing.
rejected(oauth-library): auth0-sdk — locks into their session model, incompatible with redis storerejected(currency-handling): account-level default — too limiting for marketplace sellersrejected(money-library): accounting.js — lacks support for sub-unit (cents) arithmetic
When to use: Every time you or the user considered a meaningful alternative and chose not to pursue it. Always include the reason.
constraint(scope): ...
Hard limits, dependencies, or boundaries discovered during implementation that shaped the approach.
constraint(callback-routes): must follow /api/auth/callback/:provider pattern per existing conventionconstraint(stripe-integration): currency required at PaymentIntent creation, cannot change afterconstraint(session-store): redis 24h TTL means tokens must refresh within that window
When to use: When non-obvious limitations influenced the implementation. Things the next person working here would need to know.
learned(scope): ...
Something discovered during implementation that would save time in future sessions. API quirks, undocumented behavior, performance characteristics.
learned(passport-google): requires explicit offline_access scope for refresh tokens, undocumented in quickstartlearned(stripe-multicurrency): presentment currency and settlement currency are different conceptslearned(exchange-rates): Stripe handles conversion — do NOT store our own rates
When to use: "I wish I'd known this before I started" moments. Library gotchas, API surprises, non-obvious behaviors.
Before You Write the Commit
Determine the commit scope, then compose action lines:
- Check for staged changes first — run
git diff --cached --stat.- If staged changes exist: these are the commit scope. Do no
よくある質問
コミットの件名の形式は変わりますか?
いいえ、件名は標準のConventional Commitsの形式に従います。
本文には何を書きますか?
決定事項、制約、学んだことなど、理由を説明する種類付きの行を書きます。
変更内容を説明するだけではだめなのですか?
差分にはどこが変わったかが表れていますが、本文には失われてしまう理由が残ります。
詳細
作者による元の説明
Write contextual commits that capture intent, decisions, and constraints alongside code changes. Use when committing code, finishing a task, or when the user asks to commit. Extends Conventional Commits with structured action lines in the commit body that preserve WHY code was written, not just WHAT changed.
repo: yamadashy/repomix
人気
- GitHubのスター
- 29k
- ランキング
- #9762
- ライセンス
- MIT
- 更新日
- 2026/11/1
コメント
- …
このリポジトリの他のスキル
repomix
29kエージェントが、コードのプロジェクト全体を、AIが読みやすい1つのファイルにまとめ、構造を把握し、パターンを見つけ、トークン数を数えられるよう支援します。
agent-carnet
29kエージェントが、セッションをまたいで残る短いメモを保存し、探し、整理できるよう支援します。メモは使われるたびに30日の期限がリセットされ、使われないメモはゴミ箱に移ります。
repomix-explorer
29kエージェントが、ローカルでもリモートでも、なじみのないコードベースをまとめて出力を読み、構造を説明しパターンを見つけられるよう支援します。
似ているスキル
diffs
394k編集内容の実際の共有可能な差分を、手書きの要約ではなく、ビューアーのリンクや画像ファイルとして作成するようエージェントを支援します。
coding-agent
394kCodex、Claude Code、OpenCodeに大きめのコーディング作業をバックグラウンドのワーカーとして渡し、その進捗を確認するようエージェントを支援します。
gh-issues
394kGitHubのイシューを探し、取り組むものを選び、修正を含むプルリクエストを開くようエージェントを支援します。レビューコメントへの対応も含みます。