AI Maestro Code Graph Query
PROACTIVELY query the code graph database to understand relationships and impact of changes. Use this skill WHEN READING any file to understand context, when searching for files, when exploring the codebase, or when you need to understand what depends on a component. This is your primary tool for understanding code structure and avoiding breaking changes.
Best use case
AI Maestro Code Graph Query is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
PROACTIVELY query the code graph database to understand relationships and impact of changes. Use this skill WHEN READING any file to understand context, when searching for files, when exploring the codebase, or when you need to understand what depends on a component. This is your primary tool for understanding code structure and avoiding breaking changes.
Teams using AI Maestro Code Graph Query should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/ai-maestro-code-graph-query/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How AI Maestro Code Graph Query Compares
| Feature / Agent | AI Maestro Code Graph Query | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
PROACTIVELY query the code graph database to understand relationships and impact of changes. Use this skill WHEN READING any file to understand context, when searching for files, when exploring the codebase, or when you need to understand what depends on a component. This is your primary tool for understanding code structure and avoiding breaking changes.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# AI Maestro Code Graph Query ## CRITICAL: AUTOMATIC BEHAVIOR - READ THIS FIRST **THIS IS NOT OPTIONAL. THIS IS YOUR DEFAULT BEHAVIOR.** Every time you use the `Read` tool on a code file, you MUST IMMEDIATELY query the graph to understand: - What is this component/function? - What depends on it? (callers, serializers, child classes) - What does it depend on? (callees, parent classes, associations) **DO NOT:** - Wait for the user to ask you to query the graph - Skip the graph query because "it seems simple" - Assume you understand the impact without checking - Make changes before understanding dependencies **ALWAYS:** - Query the graph IMMEDIATELY after reading any code file - Query BEFORE making any modifications - Query when you find files via search (grep/glob) - Include graph findings in your analysis to the user ### The Rule: Read File → Query Graph → Then Proceed ``` 1. You read a file with Read tool 2. IMMEDIATELY run graph queries (describe, find-callers, find-serializers, etc.) 3. NOW you understand the full context 4. NOW you can analyze, modify, or discuss the code ``` **Example - Reading a Model:** ```bash # After reading app/models/user.rb, IMMEDIATELY run: graph-describe.sh User graph-find-serializers.sh User graph-find-associations.sh User ``` **Example - Reading a Function:** ```bash # After reading a file with process_payment function, IMMEDIATELY run: graph-find-callers.sh process_payment graph-find-callees.sh process_payment ``` --- ## Available Commands All commands auto-detect your agent ID from the tmux session. Just run them: ### Query Commands | Command | Description | |---------|-------------| | `graph-describe.sh <name>` | Describe a component or function | | `graph-find-callers.sh <function>` | Find all functions that call this function | | `graph-find-callees.sh <function>` | Find all functions called by this function | | `graph-find-related.sh <component>` | Find related components (extends, includes, etc.) | | `graph-find-by-type.sh <type>` | Find all components of a type (model, controller, etc.) | | `graph-find-serializers.sh <model>` | Find serializers for a model | | `graph-find-associations.sh <model>` | Find model associations (belongs_to, has_many) | | `graph-find-path.sh <from> <to>` | Find call path between two functions | ### Indexing Commands | Command | Description | |---------|-------------| | `graph-index-delta.sh [project-path]` | **Delta index** - only re-index changed files | ## Delta Indexing (New) When files change in your codebase, use delta indexing to quickly update the graph: ```bash # Delta index - only process changed files graph-index-delta.sh # Delta index a specific project graph-index-delta.sh /path/to/project ``` **First Run Behavior:** - First time: Does a full index + initializes file tracking metadata - Subsequent runs: Only indexes new/modified/deleted files **Output shows:** - New files added - Modified files re-indexed - Deleted files removed - Unchanged files skipped **Performance:** - Full index: 30-120 seconds (1000+ files) - Delta index: 1-5 seconds (5-10 changed files) ## What to Query Based on What You Read | File Type | IMMEDIATELY Query | |-----------|-------------------| | Model | `graph-describe.sh`, `graph-find-serializers.sh`, `graph-find-associations.sh` | | Controller | `graph-describe.sh`, `graph-find-callees.sh` | | Service | `graph-describe.sh`, `graph-find-callers.sh` | | Function | `graph-find-callers.sh`, `graph-find-callees.sh` | | Serializer | `graph-describe.sh` | | Any class | `graph-find-related.sh` | ## Why This Matters Without querying the graph, you will: - Miss serializers that need updating when you change a model - Break callers when you change a function signature - Miss child classes that inherit your changes - Overlook associations that depend on this model **The graph query takes 1 second. A broken deployment takes hours to fix.** ## Component Types Use with `graph-find-by-type.sh`: - `model` - Database models - `serializer` - JSON serializers - `controller` - API controllers - `service` - Service objects - `job` - Background jobs - `concern` - Shared modules - `component` - React/Vue components - `hook` - React hooks ## Error Handling **Script not found:** - Check PATH: `which graph-describe.sh` - Verify scripts installed: `ls -la ~/.local/bin/graph-*.sh` - Scripts are installed to `~/.local/bin/` which should be in your PATH - If not found, run: `./install-graph-tools.sh` **API connection fails:** - Ensure AI Maestro is running: `curl http://localhost:23000/api/agents` - Ensure your agent is registered (scripts auto-detect from tmux session) - Check exact component names (case-sensitive) **Graph is unavailable:** - Inform the user: "Graph unavailable, proceeding with manual analysis - increased risk of missing dependencies." ## Installation If commands are not found: ```bash ./install-graph-tools.sh ``` This installs scripts to `~/.local/bin/`.
Related Skills
adr-graph-easy-architect
ASCII architecture diagrams for ADRs via graph-easy. TRIGGERS - ADR diagram, architecture diagram, ASCII diagram.
ActiveRecord Query Patterns
Complete guide to ActiveRecord query optimization, associations, scopes, and PostgreSQL-specific patterns. Use this skill when writing database queries, designing model associations, creating migrations, optimizing query performance, or debugging N+1 queries and grouping errors.
3d-graphics
3D web graphics with Three.js (WebGL/WebGPU). Capabilities: scenes, cameras, geometries, materials, lights, animations, model loading (GLTF/FBX), PBR materials, shadows, post-processing (bloom, SSAO, SSR), custom shaders, instancing, LOD, physics, VR/XR. Actions: create, build, animate, render 3D scenes/models. Keywords: Three.js, WebGL, WebGPU, 3D graphics, scene, camera, geometry, material, light, animation, GLTF, FBX, OrbitControls, PBR, shadow mapping, post-processing, bloom, SSAO, shader, instancing, LOD, WebXR, VR, AR, product configurator, data visualization, architectural walkthrough, interactive 3D, canvas. Use when: creating 3D visualizations, building WebGL/WebGPU apps, loading 3D models, adding animations, implementing VR/XR, creating interactive graphics, building product configurators.
Quick Query
Execute simple network status queries that require 1-2 commands. Use when user asks to "check device status", "show interface", "query routing table", "display BGP neighbors", or needs simple read-only information retrieval.
subgraph-explorer
Explore and query blockchain subgraphs through a private MCP server running in Docker. Use this skill when exploring GraphQL subgraphs, querying blockchain data from subgraphs (NFT transfers, DEX swaps, DeFi metrics), examining subgraph schemas, or exporting discovered queries for project use. The skill manages Docker-based MCP server interaction and provides utilities for query development and export.
scrapegraph-ai-automation
Automate Scrapegraph AI tasks via Rube MCP (Composio). Always search tools first for current schemas.
photographer-lindbergh
Generate images in Peter Lindbergh's iconic black and white style. Use when users ask for Lindbergh style, raw authentic beauty, emotional B&W portraits, supermodel aesthetic, or unretouched natural photography.
ac-knowledge-graph
Manage knowledge graph for autonomous coding. Use when storing relationships, querying connected knowledge, building project understanding, or maintaining semantic memory.
performing-steganography-detection
Detect and extract hidden data embedded in images, audio, and other media files using steganalysis tools to uncover covert communication channels.
bigquery-cli
Use when working with BigQuery from command line using bq tool, including querying data, loading/exporting tables, managing datasets, cost estimation with dry-run, or partitioning strategies
libgraphql-plans
Track, organize, and maintain plans.md files and code TODOs for the libgraphql project. Use when the user asks to update plans, sync TODOs, mark tasks complete, add new tasks, identify high-impact work, or asks what's left to do in the libgraphql codebase. Triggers include phrases like "update plans", "sync TODOs", "what's left to do", "mark X as done", "track a new task", "highest-impact work", or references to plans.md files.
graphql
GraphQL gives clients exactly the data they need - no more, no less. One endpoint, typed schema, introspection. But the flexibility that makes it powerful also makes it dangerous. Without proper co...