通用编程33k · #9140
explore-codebase
它能做什么
这个技能指导智能体使用 code-review-graph 工具浏览代码库。适合刚加入项目,或需要了解各部分如何连接的开发者。
适用场景
- ✓当你刚加入一个项目,需要了解其主要模块的概况时。
- ✓当你想按名称或关键词查找某个函数或类时。
- ✓当你需要查看哪些代码调用了某个函数,或者它依赖什么时。
技能链接
https://github.com/tirth8205/code-review-graph/blob/staging/skills/explore-codebase/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
请用这个技能帮我:https://github.com/tirth8205/code-review-graph/blob/staging/skills/explore-codebase/SKILL.md
阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
npx skills add tirth8205/code-review-graph --skill explore-codebase
下载 SKILL.md,放进智能体的技能文件夹。
curl -L https://raw.githubusercontent.com/tirth8205/code-review-graph/staging/skills/explore-codebase/SKILL.md -o SKILL.md
可以这样问 AI
“能概括一下这个项目是如何组织的,以及登录逻辑在哪里吗?”
每周 5 个新技能,1 分钟读完。
工作原理
智能体请求图谱提供架构概览,搜索指定的代码,并沿着文件和函数之间的关系进行追踪。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Explore Codebase
Use the code-review-graph MCP tools to find your way around the codebase.
Steps
- Call
get_architecture_overview_toolfor the community structure. Calllist_communities_tool, thenget_community_tool, only for the modules you need. - Call
semantic_search_nodes_toolto find a function or class by name or keyword. - Call
query_graph_toolwithcallers_of,callees_oforimports_ofto trace relationships.children_ofon a file lists its functions and classes. - Call
list_flows_tool, thenget_flow_toolfor one flow, to follow an execution path. - Call
find_large_functions_toolto find oversized functions. - Call
list_graph_stats_toolonly when you need node, edge and language counts.
Token Efficiency Rules
- Call
get_minimal_context_tool(task="<your task>")before any other graph tool. - Pass
detail_level="minimal"wherever a tool accepts it. Use "standard" only when minimal is not enough. - Prefer a targeted
query_graph_toolcall over a broad listing call. - Budget: about five tool calls and 800 tokens of graph output per task.
- Read the implementation and its tests before changing code. The graph narrows scope; it does not replace the source.
常见问题
它能展示什么?
它能展示架构社区、函数、调用者、被调用者、导入关系和执行流程。
能找到过大的函数吗?
能。技能包含一个查找过大函数的工具。
需要先构建图谱吗?
需要。图谱必须先构建,导航工具才能返回有用的结果。
详情
作者的原始描述
Navigate and understand codebase structure using the knowledge graph
热度
- GitHub 星标
- 33k
- 排名
- #9140
- 许可证
- MIT
- 更新时间
- 2026/10/29
评论
- …