跳到正文
Skillpedia
通用编程33k · #8522

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。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/ai-maestro/graph-query/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 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.

repo: davila7/claude-code-templates

热度

GitHub 星标
33k
排名
#8522
许可证
MIT
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能