graph-query
它能做什么
这个技能查询代码库各部分之间的依赖关系,例如哪些函数调用了某个函数。适合在修改之前需要知道改动可能影响什么的开发者。
适用场景
- ✓当开发者想在修改某个函数之前知道谁在调用它的时候。
- ✓当一项改动可能影响其他组件,需要检查其依赖关系的时候。
- ✓当有人想找出两个函数之间的调用路径的时候。
技能链接
https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/ai-maestro/graph-query/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“在我修改之前,请找出所有调用 saveOrder 函数的函数。”
每周 5 个新技能,1 分钟读完。
工作原理
这个技能运行图查询,查找调用者、被调用者、相关组件或调用路径。它需要 AI Maestro 在本地运行,并且代码库已被索引。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
AI Maestro Code Graph Query
Query your codebase's dependency graph to understand component relationships, call chains, and the impact of changes before making modifications. Part of the AI Maestro suite.
Prerequisites
Requires AI Maestro running locally with codebase indexed.
# Install graph tools
git clone https://github.com/23blocks-OS/ai-maestro-plugins.git
cd ai-maestro-plugins && ./install-graph-tools.sh
Core Behavior
After reading any code file, query the graph to understand dependencies:
Read file -> Query graph -> Then proceed
Commands
Query
| Command | Description |
|---|---|
graph-describe.sh <name> |
Describe a component or function |
graph-find-callers.sh <fn> |
Find all callers of a function |
graph-find-callees.sh <fn> |
Find all functions called by this function |
graph-find-related.sh <component> |
Find related components |
graph-find-by-type.sh <type> |
Find all components of a type |
graph-find-serializers.sh <model> |
Find serializers for a model |
graph-find-associations.sh <model> |
Find model associations |
graph-find-path.sh <from> <to> |
Find call path between functions |
Index
| Command | Description |
|---|---|
graph-index-delta.sh [path] |
Index or update the code graph |
Component Types
Use with graph-find-by-type.sh: model, serializer, controller, service, job, concern, component, hook
Usage Examples
# After reading a model file
graph-describe.sh User
graph-find-serializers.sh User
graph-find-associations.sh User
# Before modifying a function
graph-find-callers.sh process_payment
graph-find-callees.sh process_payment
# Find call chain between components
graph-find-path.sh handleRequest sendResponse
# Index your codebase
graph-index-delta.sh /path/to/project
Why Query Before Modifying
Without checking the graph, you risk:
- Breaking callers when changing a function signature
- Missing serializers that need updating with a model change
- Overlooking child classes that inherit your modifications
Full AI Maestro Experience
This skill is part of the AI Maestro platform, which provides 6 skills for AI agent orchestration: messaging, memory, docs, graph, planning, and agent management.
常见问题
它能找到什么?
它能找到调用者、被调用者、相关组件、序列化器、模型关联和调用路径。
它需要先建立索引吗?
需要。查询图之前,必须先对代码库建立索引。
它会修改代码吗?
不会。它只查找关系,帮助你决定要改什么。
详情
作者的原始描述
Query the code graph database to understand component relationships, dependencies, and change impact. Use when the user asks to "find callers", "check dependencies", "what uses this", "show relationships", "find serializers", or when reading code and needing to understand what depends on a component before modifications.
热度
- GitHub 星标
- 33k
- 排名
- #8522
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
owasp-security
33k教你的智能体掌握面向网页应用、API、移动端、容器和 AI 智能体的 OWASP 安全指南,以便发现常见弱点并提出修复建议。
agent-management
33k让你的智能体使用 AI Maestro 命令行工具创建、列出、休眠、唤醒、重命名和删除 AI 智能体,管理每个智能体的生命周期。
agent-messaging
33k让你的智能体使用智能体消息协议,在 AI 智能体之间发送、接收和回复带签名的消息,大部分在你自己的电脑上完成。
docs-search
33k让你的智能体搜索自动生成的代码文档,查找函数签名、类定义和注释,从而在修改代码之前核对真实的 API。