From craft-skills
Dispatch as a haiku agent to run code-review-graph queries. Handles graph freshness, embedding setup, semantic search, and targeted queries. Other skills should dispatch this as an agent rather than calling graph tools directly.
npx claudepluginhub alexiolan/craft-skills --plugin craft-skillsThis skill uses the workspace's default tool permissions.
Reference for code-review-graph MCP tool operations. **Other skills call graph MCP tools directly in the main conversation** — no dedicated agents.
Builds persistent knowledge graph of codebase using Tree-sitter and SQLite, enabling Claude to query blast radius of changes and reduce tokens up to 49x on code reviews and tasks.
Analyzes codebase to produce knowledge-graph.json for interactive dashboard exploring architecture, components, and relationships
Queries AST-based code graph for sub-ms symbol lookup, call tracing, dependency analysis, and blast radius via codebase-memory-mcp. Use before file reads for code navigation and planning.
Share bugs, ideas, or general feedback.
Reference for code-review-graph MCP tool operations. Other skills call graph MCP tools directly in the main conversation — no dedicated agents.
Calling skills load graph tools via ToolSearch (search for "code-review-graph") and call them directly. The typical pattern:
build_or_update_graph_tool — ensure graph is freshsemantic_search_nodes_tool — search with feature keywords (2-3 variations)query_graph_tool with file_summary — for relevant domain directoriesquery_graph_tool with imports_of / importers_of — for key filesEach calling skill has the tool sequences inline. This skill serves as the detailed reference for available modes and safety rules.
Task types:
explore "<feature keywords>" <repo-root> — Full feature discovery: semantic search, file summaries, dependency mappingimpact "<file1> <file2> ..." — Blast radius analysis for changed filesreview — Post-develop review context (auto-detects changed files from git)The user input is: $ARGUMENTS
Load these tools via ToolSearch at the start:
mcp__plugin_code-review-graph_code-review-graph__build_or_update_graph_toolmcp__plugin_code-review-graph_code-review-graph__semantic_search_nodes_toolmcp__plugin_code-review-graph_code-review-graph__query_graph_toolmcp__plugin_code-review-graph_code-review-graph__embed_graph_toolmcp__plugin_code-review-graph_code-review-graph__get_impact_radius_toolmcp__plugin_code-review-graph_code-review-graph__get_review_context_toolIf tools are not available (MCP server not connected), return: "GRAPH_UNAVAILABLE: code-review-graph MCP server not connected."
Run build_or_update_graph_tool (incremental — fast if already up-to-date).
Run a test search with semantic_search_nodes_tool using a common keyword (e.g., "service").
If search_mode in the response is "keyword" (not "semantic"), embeddings are missing. Run embed_graph_tool to compute them. This is a one-time operation (~30s for ~1000 nodes).
If search_mode is "semantic", embeddings are ready.
exploreGoal: Map existing code related to a feature, so the caller can design without reading files.
semantic_search_nodes_tool with the feature keywords. Try 2-3 keyword variations if first returns few results (e.g., "referral invite" then "email send notification" then "discount credit").query_graph_tool with file_summary to list all files and their contents.query_graph_tool with imports_of and importers_of to understand how they connect.Output format:
## Graph Exploration: [keywords]
### Relevant Code Found
- [file path] — [what it contains, key exports]
- ...
### Domain Structure
- domain/X/ — [summary of what's in this domain]
- ...
### Key Dependencies
- [file A] imports [file B] (for [purpose])
- ...
### Suggested Starting Points
- [file] — [why it's relevant to the feature]
Safety rules:
get_architecture_overview_tool, list_communities_tool, or detect_changes_tool — they can return 90-300K+ chars and overflow context.file_summary queries to specific domain directories, not the entire src/.query_graph_tool calls to avoid excessive output.impactGoal: Analyze blast radius of changed files for plan review or risk assessment.
get_impact_radius_tool with the provided file list.Output format:
## Impact Analysis
### Changed Files
- [file] — [direct impact count] dependents
### High-Risk Areas
- [file] is imported by [N] files — changes here affect [list]
### Recommended Review Focus
- [file] — [reason it's risky]
reviewGoal: Generate token-efficient review context for post-develop review.
build_or_update_graph_tool to capture new files.get_review_context_tool (auto-detects changed files from git).Output format:
## Review Context
### Changed Files
- [file] — [change summary]
### High-Risk Files (review these first)
- [file] — [reason: N importers, critical path, etc.]
### Review Guidance
- [specific things to check based on graph analysis]
Return the structured summary to the caller. Be concise — the caller will use this to inform design decisions, not as exhaustive documentation.
Embeddings require sentence-transformers in the MCP server environment. The code-review-graph plugin's .mcp.json must include it:
{
"mcpServers": {
"code-review-graph": {
"command": "uvx",
"args": ["--with", "sentence-transformers", "code-review-graph", "serve"]
}
}
}
Without this, embed_graph_tool will fail and semantic search falls back to keyword matching. The skill still works — it uses file_summary and query_graph_tool as alternatives — but results are less accurate.
This is a one-time global setup. After adding --with sentence-transformers, restart Claude Code for the MCP server to pick it up.
all-MiniLM-L6-v2 by default (~80MB model, downloaded once per project)embed_graph_tool fails (missing dependency), the agent should log a warning and continue with keyword search — do not block the pipeline