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

codebase-memory-mcp

Skill này làm gì

Công cụ này giúp bạn hiểu và điều hướng mã lập trình phức tạp. Nó lập bản đồ cấu trúc mã, tìm các phần cụ thể và cho thấy chúng kết nối với nhau thế nào.

Khi nào nên dùng

  • ✓Khi bạn gặp mã mà bạn chưa biết.
  • ✓Để hiểu toàn bộ chương trình được tổ chức ra sao.
  • ✓Để tìm nơi một hàm cụ thể được dùng hoặc gọi.

Liên kết skill

https://github.com/github/awesome-copilot/blob/main/skills/codebase-memory-mcp/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/github/awesome-copilot/blob/main/skills/codebase-memory-mcp/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

“Cho tôi xem hàm 'calculate_total' được dùng ở đâu trong dự án 'ecommerce'.”

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

Cách hoạt động

Công cụ dùng một “bản đồ” của mã (gọi là Codebase Memory) để tìm thông tin. Bạn hỏi, nó tra cứu bản đồ và hiển thị kết quả, như một hướng dẫn viên.

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.

Codebase Memory MCP

Use the configured Codebase Memory graph as a discovery accelerator, not as the sole source of truth. Confirm graph-derived conclusions with source snippets or local files before editing code or making strong claims.

Evidence Levels

  • Scout — Provisional positive orientation only. Do not make absence, exhaustive, dead-code, or complete-impact claims.
  • Verify — Default for task-directed work. Check freshness where material, exact source snippets, relevant traces, path coverage, and every result page needed by the claim.
  • Auditor — Use for negative, exhaustive, security, dead-code, architecture-boundary, and complete-impact work. Require the current index generation, a bounded scope, complete result streams, coverage inspection, and source checks for gaps.

Match the evidence level to the claim. If Auditor evidence cannot be completed, state the bounded limitation instead of making an absolute claim.

Workflow

  1. Discover the Codebase Memory tools exposed by the current MCP client and use their callable schemas; clients may prefix or rename tools and expose different parameters.
  2. Call list_projects first. Select only the entry whose canonical root_path matches the live checkout, and retain both its exact project name and root for later calls. If no match appears and has_more is true, continue with offset=next_offset before concluding the index is absent. For an absent index, follow the authorization rule in Safety and Fallbacks or use rooted local exploration; never substitute a similarly named project.
  3. Before branch-sensitive or edit-sensitive conclusions, use index_status and verify the actual version-control state. Use detect_changes only when its Git base and head are valid for the checkout. If it unexpectedly reports zero changes, or the checkout uses another VCS, inspect that VCS's status or diff before claiming no impact.
  4. Use get_architecture once for unfamiliar structure. Request clusters to discover de-facto module seams. Treat cycles as an opt-in whole-call-graph scan: path does not scope cycle detection, so verify relevant cycles before making module-local claims.
  5. Use search_graph for definitions, implementations, routes, classes, interfaces, and related symbols. Prefer a BM25 query for keyword discovery and a name or qualified-name pattern for known symbols. Use semantic_query for vocabulary mismatch and verify matches with source snippets; similarity scores are not confidence probabilities. Narrow by label or path and set a result limit. Continue the main stream with offset=next_offset while has_more is true, not by adding the requested limit: output budgets can return fewer rows. Page semantic results independently with semantic_offset=semantic_next_offset while semantic_has_more is true.
  6. Use search_code or normal repository search for literal strings, configuration keys, test identifiers, error messages, and non-code files. Do not turn a precise text lookup into a broad graph query.
  7. After graph search, use get_code_snippet with the returned qualified name. For a File, Module, Class, or Interface node spanning more than 200 lines, source_mode="auto" returns an outline; continue members with member_offset=next_member_offset. To read such a container's body, pass source_mode="full": start_line and max_lines alone do not switch off the outline. With full, page the body with start_line/max_lines and continue from next_start_line while source_clipped is true and a continuation is available. To list a file's declarations without reading it, use get_file_outline(file_path=...); this tool uses offset += returned while has_more is true. If source snippets are unavailable, open the local file before relying on the result.
  8. Use trace_path for callers, callees, dependency paths, data flow, cross-service paths, and impact analysis. Include tests when the claim covers them. When has_more and a continuation are present, pass next (tree output) or next_cursor (json output) back as cursor, keeping traversal arguments unchanged; the output budget may increase. truncated=true alone does not promise another page: engine ceilings can yield a lower-bound total (gte) without a cursor. With direction="both" callers are paged after all callees, so page 1 can show zero callers while callers_total is positive; ask direction="inbound" when the question is who calls a symbol.

…

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

Tôi có tin hoàn toàn vào kết quả không?

Không, hãy xem nó như một hướng dẫn. Luôn xác nhận thông tin quan trọng bằng cách xem mã gốc trước khi thay đổi.

Công cụ có tìm được mọi loại mã không?

Nó phù hợp nhất với mã lập trình. Với văn bản thuần hoặc tệp cấu hình, các công cụ khác có thể trực tiếp hơn.

“Evidence levels” là gì?

Đó là các mức độ tin cậy. “Scout” là xem nhanh, “Verify” dùng để kiểm tra chi tiết, và “Auditor” dành cho phân tích sâu và các phân tích phủ định (như tìm mã không dùng đến).

Chi tiết

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

Use when exploring unfamiliar code, mapping architecture, finding symbols or relationships, tracing callers, callees, data flow or dependencies, assessing impact, auditing dead or complex code, or handling explicit Codebase Memory requests. Otherwise skip tasks confined to a supplied known file, tiny one-file check, exact literal, configuration value, error string, or non-code text.

repo: github/awesome-copilot

Độ phổ biến

Sao GitHub
40k
Vị trí xếp hạng
#7111
Giấy phép
MIT
Cập nhật
15/10/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ự