ai-maestro-code-graph-query
コードの構造を把握し、変更が及ぼす影響を理解するために、コードグラフデータベースを積極的に検索し、ファイルを読む際やコード探索時に、依存関係を明らかにするのを助けるSkill。
📜 元の英語説明(参考)
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.
🇯🇵 日本人クリエイター向け解説
コードの構造を把握し、変更が及ぼす影響を理解するために、コードグラフデータベースを積極的に検索し、ファイルを読む際やコード探索時に、依存関係を明らかにするのを助けるSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o ai-maestro-code-graph-query.zip https://jpskill.com/download/16739.zip && unzip -o ai-maestro-code-graph-query.zip && rm ai-maestro-code-graph-query.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/16739.zip -OutFile "$d\ai-maestro-code-graph-query.zip"; Expand-Archive "$d\ai-maestro-code-graph-query.zip" -DestinationPath $d -Force; ri "$d\ai-maestro-code-graph-query.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
ai-maestro-code-graph-query.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
ai-maestro-code-graph-queryフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 1
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
AI Maestro Code Graph Query
重要: 自動的な振る舞い - 最初にこれを読んでください
これは任意ではありません。これがあなたのデフォルトの振る舞いです。
コードファイルに対して Read ツールを使用するたびに、以下のことを理解するために、すぐにグラフをクエリする必要があります。
- これはどのようなコンポーネント/関数ですか?
- 何がそれに依存していますか? (呼び出し元、シリアライザ、子クラス)
- それは何に依存していますか? (呼び出し先、親クラス、関連)
してはいけないこと:
- ユーザーにグラフをクエリするように頼まれるまで待つ
- 「簡単そうだから」という理由でグラフのクエリをスキップする
- 確認せずに影響を理解したと仮定する
- 依存関係を理解する前に変更を加える
常にすること:
- コードファイルを読んだ直後に、すぐにグラフをクエリする
- 変更を加える前にクエリする
- 検索 (grep/glob) でファイルを見つけたときにクエリする
- グラフから得られた情報をユーザーへの分析に含める
ルール: ファイルを読む → グラフをクエリする → その後、進む
1. Read ツールでファイルを読みます
2. すぐにグラフのクエリを実行します (describe, find-callers, find-serializers など)
3. これで、完全なコンテキストを理解できます
4. これで、コードを分析、変更、または議論できます
例 - モデルを読む:
# app/models/user.rb を読んだ後、すぐに以下を実行します:
graph-describe.sh User
graph-find-serializers.sh User
graph-find-associations.sh User
例 - 関数を読む:
# process_payment 関数を含むファイルを読んだ後、すぐに以下を実行します:
graph-find-callers.sh process_payment
graph-find-callees.sh process_payment
利用可能なコマンド
すべてのコマンドは、tmux セッションからエージェント ID を自動的に検出します。実行するだけです。
クエリコマンド
| コマンド | 説明 |
|---|---|
graph-describe.sh <name> |
コンポーネントまたは関数を説明します |
graph-find-callers.sh <function> |
この関数を呼び出すすべての関数を見つけます |
graph-find-callees.sh <function> |
この関数が呼び出すすべての関数を見つけます |
graph-find-related.sh <component> |
関連するコンポーネントを見つけます (extends, includes など) |
graph-find-by-type.sh <type> |
ある型のすべてのコンポーネントを見つけます (model, controller など) |
graph-find-serializers.sh <model> |
モデルのシリアライザを見つけます |
graph-find-associations.sh <model> |
モデルの関連付けを見つけます (belongs_to, has_many) |
graph-find-path.sh <from> <to> |
2 つの関数間の呼び出しパスを見つけます |
インデックス作成コマンド
| コマンド | 説明 |
|---|---|
graph-index-delta.sh [project-path] |
差分インデックス - 変更されたファイルのみを再インデックスします |
差分インデックス (新規)
コードベース内のファイルが変更された場合は、差分インデックスを使用してグラフをすばやく更新します。
# 差分インデックス - 変更されたファイルのみを処理します
graph-index-delta.sh
# 特定のプロジェクトを差分インデックスします
graph-index-delta.sh /path/to/project
初回実行時の振る舞い:
- 初回: 完全なインデックスを作成し、ファイル追跡メタデータを初期化します
- それ以降の実行: 新規/変更/削除されたファイルのみをインデックスします
出力には以下が表示されます:
- 追加された新しいファイル
- 再インデックスされた変更されたファイル
- 削除されたファイル
- スキップされた変更されていないファイル
パフォーマンス:
- 完全なインデックス: 30〜120秒 (1000以上のファイル)
- 差分インデックス: 1〜5秒 (5〜10の変更されたファイル)
何を読んだかに基づいて何をクエリするか
| ファイルの種類 | すぐにクエリする |
|---|---|
| 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 |
これが重要な理由
グラフをクエリしないと、次のようになります。
- モデルを変更するときに更新する必要があるシリアライザを見逃す
- 関数のシグネチャを変更するときに呼び出し元を壊す
- 変更を継承する子クラスを見逃す
- このモデルに依存する関連付けを見落とす
グラフのクエリには 1 秒かかります。壊れたデプロイメントの修正には数時間かかります。
コンポーネントの種類
graph-find-by-type.sh で使用します。
model- データベースモデルserializer- JSON シリアライザcontroller- API コントローラservice- サービスオブジェクトjob- バックグラウンドジョブconcern- 共有モジュールcomponent- React/Vue コンポーネントhook- React フック
エラー処理
スクリプトが見つかりません:
- PATH を確認します:
which graph-describe.sh - スクリプトがインストールされていることを確認します:
ls -la ~/.local/bin/graph-*.sh - スクリプトは
~/.local/bin/にインストールされており、これは PATH に含まれているはずです - 見つからない場合は、以下を実行します:
./install-graph-tools.sh
API 接続に失敗しました:
- AI Maestro が実行されていることを確認します:
curl http://localhost:23000/api/agents - エージェントが登録されていることを確認します (スクリプトは tmux セッションから自動的に検出します)
- 正確なコンポーネント名を確認します (大文字と小文字を区別します)
グラフが利用できません:
- ユーザーに通知します: 「グラフが利用できません。手動分析を続行します - 依存関係の見落としのリスクが高まります。」
インストール
コマンドが見つからない場合:
./install-graph-tools.sh
これにより、スクリプトが ~/.local/bin/ にインストールされます。
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
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:
# 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:
# 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:
# 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 modelsserializer- JSON serializerscontroller- API controllersservice- Service objectsjob- Background jobsconcern- Shared modulescomponent- React/Vue componentshook- 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:
./install-graph-tools.sh
This installs scripts to ~/.local/bin/.