- Home
- Skills
- Technical Documentation
- Code Cartography — Verified Dependency Maps
Works with the AI Agents you already use
Code Cartography — Verified Dependency Maps
Maps who-imports-what across a repository and delivers a verified Mermaid dependency graph, with hubs, cycles, layers and dead-code candidates. Every edge comes from a real import line.
Free
Code Cartography — Verified Dependency Maps
Example session with this skill installed
Map the dependencies for the src/ folder in this TypeScript project. Check for cycles between the 'auth' and 'api' modules and identify any isolated files.
- Read your context and instructions
- Compiled the code cartography
I have completed the topological mapping of the src/ directory. I analyzed 12 files across 3 modules, resolving all @/ aliases via tsconfig.json.
Repository Topology Audit
File Dependencies
| File | Imports | Imported By | Status |
|---|---|---|---|
src/auth/service.ts | auth/store.ts, api/client.ts | auth/index.ts | Hub |
src/api/client.ts | (none) | auth/service.ts, ui/button.ts | Leaf |
src/utils/unused.ts | (none) | (none) | Isolated |
src/auth/store.ts | auth/service.ts | auth/index.ts | Cycle |
Dependency Graph (Module Level)
flowchart LR
subgraph "src/auth"
auth_index["index.ts"]
auth_service["service.ts"]
auth_store["store.ts"]
end
subgraph "src/api"
api_client["client.ts"]
end
subgraph "src/utils"
utils_unused["unused.ts"]
end
auth_index --> auth_service
auth_index --> auth_store
auth_service --> auth_store
auth_store --> auth_service
auth_service --> api_client
Architectural Analysis
Circular Dependency Found: A direct cycle exists between auth/service.ts and auth/store.ts. This will complicate unit testing and may cause issues with certain bundlers.
2.
Isolated Code: src/utils/unused.ts has no incoming or outgoing edges. Unless this is loaded dynamically or via reflection, it is likely dead code.
3.
Critical Hub: auth/service.ts is the central node. Changes here have the largest blast radius, affecting both the internal auth state and external API interactions.
Next steps
- Review
src/auth/store.tsto break the circular dependency by extracting shared types. - Verify if
src/utils/unused.tsis required for any dynamic runtime execution. - Export the complete
file-graph.mmdfor use in specialized architecture visualization tools.
Connects securely to your tools. The creator never sees your data.
About this skill
What it does
Code Cartography turns any repository into a verified dependency map: files are nodes, import / require / include statements are edges. You get a Mermaid graph plus a written reading of it — the shape of the codebase, its layers, its critical files and the blast radius of changing them.
Why "verified"
Invented edges destroy a map's value: one wrong link and nobody trusts the diagram again. This skill forbids guessing. Every edge must come from an import line the agent actually read; anything it cannot resolve is labelled external or unresolved, never linked to a plausible-looking file. It prefers deterministic extraction (a small script over the code) to inference.
What you get
file-graph.md— the file graph, an imports / imported-by table for every file, hubs, cycles, isolated files and externalsmodule-graph.md— the module-level graph and a coupling matrixfile-graph.mmd+graph.json— the complete, untruncated graph for other tools- A prose reading: layers, critical files, cycles and what it would cost to break them
Languages
Python, JavaScript/TypeScript, Go, Java/Kotlin, C/C++, Rust, Ruby and PHP, with known pitfalls handled explicitly (Go packages, bundler aliases, C# namespaces, dependency injection, monorepos). Large repos (~140+ nodes) are split into a module view plus one diagram per module, without losing coverage.
Good for
- Onboarding into an unfamiliar codebase
- Finding dead code and dependency cycles before a refactor
- Documenting architecture from what the code really does, not what the README says
Origin
This is the methodology behind the cartography stage of wiki-generator, an open-source (MIT) tool that generates a complete, standardized engineering wiki from any repository with Claude Code in headless mode. If you want the whole wiki and not just the map, use the tool — and a ⭐ on GitHub is always appreciated.
Dynamic imports and dependency injection are not resolved. Requires access to config files (e.g., tsconfig.json) for path aliases. Large repos (>140 nodes) are split into sub-diagrams.
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 any payment.
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
Free forever
No account required to browse
Trust & safety
Security scan
Security scan passed 19 days ago
- Free with an Agensi account