Community生產力與協作github.com

rohitg00/commit-context

追溯檔案、函式或程式碼行至產生其當前提交的代理工作階段。當使用者問「這段程式碼為什麼在這裡」、「這個變更時代理在做什麼」、「這是誰寫的」或想要程式碼庫中某個特定位置的背景資訊時使用。

commit-context 是什麼?

此技能旨在幫助開發者快速理解程式碼庫中特定位置的歷史背景。它能夠追溯一個檔案、函式或程式碼行,找到產生當前提交內容的代理工作階段。當開發者提出「為什麼這段程式碼在這裡」、「這個變更時代理在做什麼」或「這是誰寫的」等問題時,此技能便會被觸發。它支援多種 AI 代理平台(如 Claude Code、Cursor、Codex),並透過解析 Git 提交記錄與關聯的工作階段中繼資料來運作。使用此技能可以顯著提升程式碼審查、除錯與專案理解的工作效率,節省手動查詢 Git log 與溝通記錄的時間。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/rohitg00/agentmemory/tree/main/skills/commit-context

Installed? Explore more 生產力與協作 skills: steipete/gemini, steipete/gh-issues, steipete/skill-creator · View all 6 →

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

commit-context 是做什麼的?

追溯檔案、函式或程式碼行至產生其當前提交的代理工作階段。當使用者問「這段程式碼為什麼在這裡」、「這個變更時代理在做什麼」、「這是誰寫的」或想要程式碼庫中某個特定位置的背景資訊時使用。

功能

  • 從檔案路徑、函式名稱或程式碼行號出發,找出對應的 Git 提交
  • 將提交關聯到原始的代理工作階段(例如 Claude Code、Cursor 等平台記錄)
  • 提供易於理解的背景資訊,解釋該變更的產生原因

使用方式

  1. 在使用者提出相關問題時(例如「這個函式為什麼存在?」)觸發此技能
  2. 技能會自動查詢 Git 歷史記錄與工作階段中繼資料
  3. 返回結構化結果,包含提交 ID、作者、時間戳記與原始工作階段的摘要

支援平台

  • Claude Code
  • Cursor
  • Codex
  • 其他支援 Git 提交追蹤的 AI 代理工具

技術實作

技能透過解析 git log 輸出與特定格式的工作階段日誌來運作。建議在工作階段結束時,將工作階段摘要寫入提交訊息或附加上下文標記(例如 [session: <id>]),以便此技能進行關聯查詢。

Individual skills in this repo

This repo contains 7 individual skills — each has its own dedicated page.

rohitg00/commit-history

List recent git commits linked to agent sessions, optionally filtered by branch or repo. Use when the user asks "show agent commits", "what has the agent shipped", "list linked commits", or wants commits with their session context.

rohitg00/forget

Delete specific observations or sessions from agentmemory. Use when user says "forget this", "delete memory", or wants to remove specific data for privacy.

rohitg00/handoff

Resume the most recent agent session for the current working directory, leading with any unanswered question. Use when the user says "where were we", "resume", "handoff", "pick up where I left off", or starts a session with no fresh context.

rohitg00/recall

Search agentmemory for past observations, sessions, and learnings about a topic using hybrid BM25 plus vector plus graph search. Use when the user says "recall", "what did we do about", "did we ever", "have we seen", or needs context from past sessions.

rohitg00/recap

Summarize the last N agent sessions for the current project, grouped by date, with highlight observations per session. Use when the user asks "recap", "what have we been doing", "today", "this week", or wants a rollup of recent work.

rohitg00/remember

Save an insight, decision, or learning to agentmemory's long-term storage with searchable concept tags. Use when the user says "remember this", "save this", "note that", "don't forget", or wants to preserve knowledge for future sessions.

rohitg00/session-history

Show what happened in recent past sessions on this project as a clean timeline. Use when the user asks "what did we do last time", "session history", "past sessions", or wants an overview of previous work.

相關技能