Works with the AI Agents you already use
Astermesh Code Knowledge Graph & MCP
Deterministic AST knowledge graph, #ACN2 context compression with up to 98% token savings, and blast-radius analysis for Python, TypeScript, React, Vue, Svelte, and NestJS via MCP.
$3
Astermesh Code Knowledge Graph & MCP
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 knowledge
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 quickly outgrow LLM context windows, causing coding agents to waste thousands of tokens on blind grep searches, miss transitive callers, and break downstream modules during refactoring. This skill pairs the deterministic Astermesh v1.3.3 MCP server with a strict Graph-First Navigation Protocol for AI coding assistants.
What it does
- Dense
#ACN2Context Compression (95.9%–98.3% Token Savings): Compresses multi-hundred-thousand-token repositories into budget-cappedL0/L1/L2topological wire views (codebase://contextandget_community_wire). - Polyglot AST Symbol Resolution: Resolves exact file paths and 1-based physical line boundaries
[line_start, line_end]across Python, TypeScript, JavaScript, React/JSX, Vue SFC, Svelte SFC, Angular, and NestJS with 100%tsconfig.jsonpath-alias resolution. - Transitive Blast-Radius Analysis: Computes multi-hop incoming callers and component render trees via
get_impact_radiusbefore modifying any function, class, or shared hook. - Precision Line Slicing: Uses
read_file_snippetandget_file_outlineso the agent reads only the exact 20–40 target lines instead of loading entire 500-line files. - Leiden Community & Satellite Indexing: Clusters logic entities into cohesive architectural modules while linking satellite configs (
.toml,.json,.yaml,.md,Dockerfile) and isolating static assets.
How it works
- Orient: Read
codebase://reportorcodebase://context(#ACN2) to map Leiden communities, God nodes, and circular dependencies. - Zoom & Slice: Call
get_community_wire,locate_symbol, andread_file_snippetto inspect exact physical line ranges with sub-millisecond latency. - Assess Blast Radius: Run
get_impact_radiusandget_neighborsto identify all 1-hop and transitive dependents across modules. - Verify: Trace execution pathways with
trace_pathas the background file watcher incrementally updates the in-memory graph in under 1ms on every file save.
Frameworks & tools
Requires Python 3.10+ and the open-source Astermesh MCP runtime (tree-sitter, networkx, python-igraph, leidenalg). Supports Python, TypeScript, JavaScript, React, Next.js, Vue, Svelte, Angular, and NestJS.
Why this beats prompting it yourself
Naive prompting relies on recursive text grepping that misses barrel re-exports, tsconfig path aliases, NestJS dependency injection, and Vue/React component render hierarchies. Battle-tested on production enterprise codebases up to 31,956 LOC (516 files), Astermesh indexes 87–113 files/sec in 1.2s–2.3s using under 13 MB RAM and cuts a 234,466-token codebase down to 3,997 tokens.
Use cases
- Rapid onboarding onto unfamiliar monorepos using Leiden community maps and
#ACN2wire subgraphs. - Zero-regression refactoring of shared hooks, services, and core classes by auditing multi-hop impact radius first.
- Root-cause bug localization by tracing shortest call and render chains between entrypoints and failing components.
- Architectural debt audits to detect circular dependencies and decouple high-degree God nodes.
Known limitations
Requires the local astermesh Python package installed and registered as an MCP server. AST extraction currently targets Python and the JavaScript/TypeScript web ecosystem; Go, Rust, and Java extractors are not yet included.
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 8 days ago
- Software
Python
Git
Permissions
File Scopes
Astermesh runs 100% locally in memory over stdio. File reading is strictly sandboxed to the target workspace root with realpath symlink traversal protection. Zero source code or telemetry ever leaves the machine.