Works with the AI Agents you already use
astermesh code graph
Deterministic AST graph navigation and blast-radius analysis for Python and JavaScript codebases.
$4
astermesh code graph
Example session with this skill installed
I need to refactor _resolve_symbol in GraphBuilder to improve alias disambiguation when multiple modules export identical function names. Analyze its blast radius, inspect current 1-hop and transitive callers across the codebase, and provide an impact assessment with a safe migration plan.
- Read your context and instructions
- Compiled the astermesh code graph
Summary of Findings
Completed deterministic dependency audit for src.astermesh.graph.builder.GraphBuilder._resolve_symbol using the in-memory AST knowledge graph.
- Total tokens consumed: 285 tokens (compared to ~3,900 tokens required for broad file scans).
- Resolved target location:
src/astermesh/graph/builder.pylines 162–180. - Transitive blast radius: LOW (1 direct caller, 2 upstream entrypoints, 0 public API leaks).
1. Blast Radius & Transitive Dependency Matrix
Querying get_impact_radius(symbol="src.astermesh.graph.builder.GraphBuilder._resolve_symbol", max_depth=2) returned the following dependency chain:
| Hop | Dependent Entity | Type | File Path | Line Range | Edge Type |
|---|---|---|---|---|---|
| Target | GraphBuilder._resolve_symbol | Method | src/astermesh/graph/builder.py | 162–180 | TARGET |
| 1-Hop | GraphBuilder._link_file_relations | Method | src/astermesh/graph/builder.py | 134–160 | CALLS |
| 2-Hop | GraphBuilder.build_full | Method | src/astermesh/graph/builder.py | 43–54 | CALLS |
| 2-Hop | GraphBuilder.update_file | Method | src/astermesh/graph/builder.py | 183–191 | CALLS |
The method is completely private to GraphBuilder. Downstream modules interact strictly via GraphBuilder.build_full() and GraphBuilder.update_file().
2. Physical Code Slice (Lines 162–180)
def _resolve_symbol(self, raw_name: str, parsed: FileParseResult) -> str | None:
clean = raw_name.removeprefix("self.").removeprefix("cls.")
local_candidate = f"{parsed.module_fqn}.{clean}"
if local_candidate in self._symbol_table:
return self._symbol_table[local_candidate]
if clean in parsed.imports:
imp_target = parsed.imports[clean]
if imp_target in self._symbol_table:
return self._symbol_table[imp_target]
if clean in self._symbol_table:
return self._symbol_table[clean]
short = clean.split(".")[-1]
matches = self._short_names.get(short)
if matches and len(matches) == 1:
return next(iter(matches))
return None
Key Risk Identified
Line 178 (len(matches) == 1) discards ambiguous short names when two classes define methods with identical identifiers (e.g., build or run), resulting in dropped CALLS edges in large codebases.
3. Proposed Safe Refactoring
Intersect ambiguous short-name candidates with the current file's imported module prefixes before falling back to None:
short = clean.split(".")[-1]
matches = self._short_names.get(short)
if matches:
if len(matches) == 1:
return next(iter(matches))
# Disambiguate against known module imports
imported_modules = set(parsed.imports.values())
disambiguated = [m for m in matches if any(m.startswith(mod) for mod in imported_modules)]
if len(disambiguated) == 1:
return disambiguated[0]
return None
4. Next Steps & Regression Verification
- Apply the disambiguation patch to
src/astermesh/graph/builder.py. - Run targeted test verification:
pytest tests/test_builder.py tests/test_resolver.py -v - Re-verify graph connectivity via MCP:
Callget_neighbors(symbol="src.astermesh.graph.builder.GraphBuilder._resolve_symbol", direction="in")to confirm that incoming call edges from_link_file_relationsremain active.
Connects securely to your tools. The creator never sees your data.
About this skill
Codebases often grow too large for context windows, leading to hallucinated call paths and broken refactors. This skill replaces broad regex searches with deterministic AST graph navigation via the Astermesh MCP server.
What it does
- AST symbol resolution provides exact file paths and 1-based line boundaries for any class, method, or variable.
- Transitive blast-radius analysis computes multi-hop dependents to identify every call site affected by a signature change.
- Execution pathway tracing identifies the shortest call or dependency chain between any two symbols in the graph.
- Community detection groups code into Leiden communities to map macro architecture and identify God nodes.
- Line-bounded reading ensures the agent only loads specific code slices instead of entire files.
How it works
- Analyze the codebase architecture by reading the
codebase://reportresource to identify logical modules and hubs. - Navigate to specific logic using
locate_symbolandget_file_outlineto find exact line ranges. - Trace dependencies using
get_neighborsorget_impact_radiusbefore attempting any code modifications. - Refactor with precision by visiting every node identified in the impact radius to update call sites.
Frameworks & tools
Built for Python 3.10+ environments. It utilizes the Astermesh MCP server to interface with Python, TypeScript, and JavaScript source code through an in-memory AST graph.
Why this beats prompting it yourself
Standard prompting relies on the agent's "best guess" or expensive recursive grepping, which misses indirect dependencies. This skill enforces a graph-first protocol that guarantees the agent sees the actual call graph and respects physical line boundaries.
Use cases
- Onboarding to a massive, unfamiliar repository by visualizing Leiden communities and God nodes.
- Safe refactoring of core library functions by calculating a 3-hop impact radius.
- Bug hunting by tracing the execution pathway between a source trigger and a target error.
- Architectural audits to find and decouple highly coupled modules.
Known limitations
Requires the Astermesh package installed and configured as an MCP server. Support is currently limited to Python and JavaScript/TypeScript ecosystems.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for LLM Ops.
Requires Python 3.10+ and the astermesh package installed as an MCP server. Supports Python, TS, and JS files only.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 2 days ago
- Software
Python
Git