graph-query

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

AI Maestro Code Graph Query

AI Maestro 代码图查询

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.
在进行代码修改前,查询代码库的依赖图,以理解组件关系、调用链和变更影响。本工具是AI Maestro套件的一部分。

Prerequisites

前置要求

Requires AI Maestro running locally with codebase indexed.
bash
undefined
需要本地运行已索引代码库的AI Maestro
bash
undefined

Install graph tools

Install graph tools

git clone https://github.com/23blocks-OS/ai-maestro-plugins.git cd ai-maestro-plugins && ./install-graph-tools.sh
undefined
git clone https://github.com/23blocks-OS/ai-maestro-plugins.git cd ai-maestro-plugins && ./install-graph-tools.sh
undefined

Core Behavior

核心行为

After reading any code file, query the graph to understand dependencies:
Read file -> Query graph -> Then proceed
在读取任意代码文件后,查询代码图以理解依赖关系:
Read file -> Query graph -> Then proceed

Commands

命令

Query

查询

CommandDescription
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
命令描述
graph-describe.sh <name>
描述组件或函数
graph-find-callers.sh <fn>
查找函数的所有调用者
graph-find-callees.sh <fn>
查找该函数调用的所有函数
graph-find-related.sh <component>
查找相关组件
graph-find-by-type.sh <type>
查找指定类型的所有组件
graph-find-serializers.sh <model>
查找模型对应的序列化器
graph-find-associations.sh <model>
查找模型关联关系
graph-find-path.sh <from> <to>
查找函数间的调用路径

Index

索引

CommandDescription
graph-index-delta.sh [path]
Index or update the code graph
命令描述
graph-index-delta.sh [path]
索引或更新代码图

Component Types

组件类型

Use with
graph-find-by-type.sh
:
model
,
serializer
,
controller
,
service
,
job
,
concern
,
component
,
hook
graph-find-by-type.sh
配合使用的组件类型:
model
serializer
controller
service
job
concern
component
hook

Usage Examples

使用示例

bash
undefined
bash
undefined

After reading a model file

读取模型文件后

graph-describe.sh User graph-find-serializers.sh User graph-find-associations.sh User
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
graph-find-callers.sh process_payment graph-find-callees.sh process_payment

Find call chain between components

查找组件间的调用链

graph-find-path.sh handleRequest sendResponse
graph-find-path.sh handleRequest sendResponse

Index your codebase

索引代码库

graph-index-delta.sh /path/to/project
undefined
graph-index-delta.sh /path/to/project
undefined

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

完整AI Maestro体验

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.
本技能是AI Maestro平台的一部分,该平台为AI Agent编排提供了6项技能:消息传递、记忆、文档、代码图、规划和Agent管理。