| name | cs-map |
| description | Map project architecture: discover modules, build call graphs, visualize structure,
trace critical paths. Complete architecture overview with dependency flows.
|
| allowed-tools | ["mcp__codescalpel__crawl_project","mcp__codescalpel__get_call_graph","mcp__codescalpel__get_project_map","mcp__codescalpel__get_cross_file_dependencies"] |
| preamble-tier | 1 |
/cs-map โ Project Architecture Mapping
Discover your entire project structure: modules, call graphs, dependencies, and
complexity hotspots. Visualize how everything connects.
Usage
/cs-map
/cs-map src/
/cs-map src/api/
The Complete Architecture Workflow
Step 1: Crawl Project
Discover all modules and files:
- List all Python, JavaScript, TypeScript, Java files
- Identify entry points and main modules
- Group by package/directory structure
- Calculate total metrics (files, functions, classes)
Step 2: Build Call Graph
Map function-to-function calls:
- How does main() call other functions?
- What functions call authenticate()?
- What are the circular dependencies?
- Call paths from entry point to critical functions
Step 3: Visualize Structure
High-level project map:
- Package hierarchy
- Module roles (API layer, data layer, utilities)
- Complexity hotspots (functions with highest cyclomatic complexity)
- Import patterns (what imports what)
- Service boundaries (loosely coupled domains)
Step 4: Trace Critical Paths
For important symbols:
- All functions that call it (incoming)
- All functions it calls (outgoing)
- Full dependency chain (what else gets pulled in)
- Impact zone (what breaks if you change it)
What You Learn
Project Structure
- How many modules/packages?
- Which files are largest/most complex?
- What are the natural boundaries?
Dependency Flow
- How does data flow through the system?
- What are the entry points?
- Where are the bottlenecks?
Complexity Hotspots
- Which functions are most complex?
- Which files have the most dependencies?
- Where should you invest in refactoring?
Call Patterns
- Is the code layered (API โ Services โ Data)?
- Are there circular dependencies?
- How deep are the call chains?
Example Output
Project Structure:
โโโ src/
โ โโโ api/ (HTTP handlers, 12 functions)
โ โ โโโ users.py
โ โ โโโ products.py
โ โโโ services/ (business logic, 34 functions)
โ โ โโโ auth.py
โ โ โโโ payment.py
โ โ โโโ notifications.py
โ โโโ models/ (data models, 8 classes)
โ โโโ utils/ (helpers, 15 functions)
โ โโโ main.py (entry point)
Call Graph (from main):
main()
โโโ setup_api()
โ โโโ register_routes()
โ โโโ api.users.list_users()
โ โโโ api.products.get_product()
โโโ run_server()
Complexity Hotspots:
1. services/payment.py โ process_payment() [CC: 8]
2. api/users.py โ validate_request() [CC: 7]
3. models/user.py โ User.save() [CC: 6]
When to Use This
โ
Onboarding to a new codebase
โ
Planning a major refactor
โ
Understanding system boundaries
โ
Finding where to add features
โ
Identifying technical debt
โ
Documenting architecture
โ
Preparing for code review
Next Steps
- Review the map โ Understand overall structure
- Use
/cs-extract โ Dive into specific functions
- Use
/cs-analyze โ Understand a module
- Use
/cs-refactor โ Improve the structure
- Use
/cs-security โ Check for vulnerabilities
Languages Supported
- Python (full analysis)
- JavaScript/TypeScript (full analysis)
- Java (full analysis)
- Go, Rust, C++ (basic analysis)
See CLAUDE.md for the complete architecture mapping workflow.