commit-context
できること
このスキルは、ファイル、関数、行を、その現在のコミットを生んだエージェントのセッションまでさかのぼります。gitとメモリの検索が実際に返したものだけを報告します。
使う場面
- ✓なぜそのコードがコードベースにあるのかを尋ねるとき。
- ✓変更が加えられたとき、エージェントが何をしていたかを知りたいとき。
- ✓コードの特定の場所について、文脈を知りたいとき。
スキルのリンク
https://github.com/rohitg00/agentmemory/blob/main/plugin/skills/commit-context/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“このリフレッシュトークンのコードはなぜここにあるのですか?それを書いたセッションまでさかのぼってください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントは、指定された行のコミットを見つけるためにgit blameを使い、そのコミットをメモリサーバーで検索します。リンクされたセッションと主な観測を報告します。セッションのリンクより前のコミットであれば、そのことを記します。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
The user wants commit context for: $ARGUMENTS
Quick start
git blame -L 40,52 src/auth/refresh.ts # -> SHA 9a1b2c3d
memory_commit_lookup { "sha": "9a1b2c3d4e5f60718293a4b5c6d7e8f901234567" }
Expected output:
9a1b2c3 on main by dev: "rotate refresh tokens"
Linked session 7f3a9c2 "Auth refresh rework", 14 obs.
Why
Report only what git and the lookup return. When the lookup gives commit: null,
the commit predates session linking; do not invent intent.
Workflow
- Find the SHA:
git blame -L <start>,<end> <file>for a line range;git log -L :<function>:<file>for a function;git log -n 1 -- <file>for a bare path. - Look it up:
memory_commit_lookup { "sha": "<full-sha>" }. - Present the commit (sha, short sha, branch, author, message), the linked
session(s) (id, project, started/ended, observation count, summary), and the
importance >= 7 observations via
memory_recallwhen available.
Anti-patterns
WRONG: lookup returns { "commit": null }, you narrate "the agent was
refactoring auth" from the diff alone.
RIGHT: "This commit predates session linking, so there is no recorded agent
session. From git show: it changed token rotation in refresh.ts."
Checklist
- SHA came from git blame/log, not a guess.
commit: nullreported as "predates linking", no fabricated session.- Session details quote the lookup response verbatim.
- No intent claimed beyond what observations state.
See also
commit-history: list many agent-linked commits at once.recall: dig deeper into the linked session's observations.
Troubleshooting
See TROUBLESHOOTING.md if memory_commit_lookup is not available.
よくある質問
セッションがリンクされていない場合はどうなりますか?
スキルは、そのコミットがセッションのリンク機能より前のものだと伝え、説明を作り上げることはしません。
gitを使いますか?
はい。コミットは、git blame、git log、またはファイルの履歴で見つけます。
変更の意図を推測しますか?
いいえ。記録されたセッションがなければ、差分が示すことだけを説明します。
詳細
作者による元の説明
Trace a file, function, or line back to the agent session that produced its current commit. Use when the user asks "why is this code here", "what was the agent doing when this changed", "who wrote this", or wants context on a specific location in the codebase.
repo: rohitg00/agentmemory
人気
- GitHubのスター
- 30k
- ランキング
- #9345
- ライセンス
- Apache-2.0
- 更新日
- 2026/11/2
コメント
- …
このリポジトリの他のスキル
agentmemory-agents
30kエージェントが、agentmemoryメモリサーバーをClaude Code、Cursor、Codexなどのコーディングツールに接続できるよう支援します。
agentmemory-architecture
30kエージェントが、agentmemoryが記憶を保存、検索、管理する仕組みを、記録から想起まで説明できるよう支援します。
agentmemory-config
30kエージェントが、ポート、設定、機能フラグを含め、agentmemoryメモリサーバーをセットアップし確認できるよう支援します。
agentmemory-hooks
30kエージェントが、保存を一つずつ手作業で行わなくても、コーディングセッションの有用なメモを自動で取り込めるよう支援します。
似ているスキル
diffs
394k編集内容の実際の共有可能な差分を、手書きの要約ではなく、ビューアーのリンクや画像ファイルとして作成するようエージェントを支援します。
coding-agent
394kCodex、Claude Code、OpenCodeに大きめのコーディング作業をバックグラウンドのワーカーとして渡し、その進捗を確認するようエージェントを支援します。
gh-issues
394kGitHubのイシューを探し、取り組むものを選び、修正を含むプルリクエストを開くようエージェントを支援します。レビューコメントへの対応も含みます。