Chuyển đến nội dung
Skillpedia
Lập trình chung30k · #9345

commit-context

Skill này làm gì

Skill này truy ngược một file, hàm hoặc dòng về phiên agent đã tạo ra commit hiện tại của nó. Nó chỉ báo cáo những gì git và tra cứu bộ nhớ thật sự trả về.

Khi nào nên dùng

  • ✓Khi bạn hỏi vì sao một đoạn mã có trong codebase.
  • ✓Khi bạn muốn biết agent đang làm gì khi một thay đổi được thực hiện.
  • ✓Khi bạn muốn có ngữ cảnh cho một vị trí cụ thể trong mã.

Liên kết skill

https://github.com/rohitg00/agentmemory/blob/main/plugin/skills/commit-context/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/rohitg00/agentmemory/blob/main/plugin/skills/commit-context/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Vì sao đoạn mã làm mới refresh token này lại có ở đây? Truy ngược nó về phiên đã viết ra nó.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent dùng git blame để tìm commit cho các dòng bạn nêu, rồi tra cứu commit đó trong máy chủ bộ nhớ. Nó báo cáo phiên được liên kết và các quan sát chính, hoặc ghi chú rằng commit có trước khi liên kết phiên được bật.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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

  1. 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.
  2. Look it up: memory_commit_lookup { "sha": "<full-sha>" }.
  3. 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_recall when 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: null reported 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.

Câu hỏi thường gặp

Nếu không có phiên nào được liên kết thì sao?

Skill nói rằng commit có trước khi liên kết phiên và không tự bịa ra lời giải thích.

Nó có dùng git không?

Có. Nó tìm commit bằng git blame, git log hoặc lịch sử file.

Nó có đoán ý định đằng sau một thay đổi không?

Không. Nếu không có phiên được ghi lại, nó chỉ mô tả những gì diff cho thấy.

Chi tiết

Mô tả gốc của tác giả

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

Độ phổ biến

Sao GitHub
30k
Vị trí xếp hạng
#9345
Giấy phép
Apache-2.0
Cập nhật
2/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự