codebase-mapping

Repository structure and dependency analysis for understanding a codebase's architecture. Use when needing to (1) generate a file tree or structure map, (2) analyze import/dependency graphs, (3) identify entry points and module boundaries, (4) understand the overall layout of an unfamiliar codebase, or (5) prepare for deeper architectural analysis.

242 stars

Best use case

codebase-mapping is best used when you need a repeatable AI agent workflow instead of a one-off prompt. It is especially useful for teams working in multi. Repository structure and dependency analysis for understanding a codebase's architecture. Use when needing to (1) generate a file tree or structure map, (2) analyze import/dependency graphs, (3) identify entry points and module boundaries, (4) understand the overall layout of an unfamiliar codebase, or (5) prepare for deeper architectural analysis.

Repository structure and dependency analysis for understanding a codebase's architecture. Use when needing to (1) generate a file tree or structure map, (2) analyze import/dependency graphs, (3) identify entry points and module boundaries, (4) understand the overall layout of an unfamiliar codebase, or (5) prepare for deeper architectural analysis.

Users should expect a more consistent workflow output, faster repeated execution, and less time spent rewriting prompts from scratch.

Practical example

Example input

Use the "codebase-mapping" skill to help with this workflow task. Context: Repository structure and dependency analysis for understanding a codebase's architecture. Use when needing to (1) generate a file tree or structure map, (2) analyze import/dependency graphs, (3) identify entry points and module boundaries, (4) understand the overall layout of an unfamiliar codebase, or (5) prepare for deeper architectural analysis.

Example output

A structured workflow result with clearer steps, more consistent formatting, and an output that is easier to reuse in the next run.

When to use this skill

  • Use this skill when you want a reusable workflow rather than writing the same prompt again and again.

When not to use this skill

  • Do not use this when you only need a one-off answer and do not need a reusable workflow.
  • Do not use it if you cannot install or maintain the related files, repository context, or supporting tools.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/codebase-mapping/SKILL.md --create-dirs "https://raw.githubusercontent.com/aiskillstore/marketplace/main/skills/dowwie/codebase-mapping/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/codebase-mapping/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How codebase-mapping Compares

Feature / Agentcodebase-mappingStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Repository structure and dependency analysis for understanding a codebase's architecture. Use when needing to (1) generate a file tree or structure map, (2) analyze import/dependency graphs, (3) identify entry points and module boundaries, (4) understand the overall layout of an unfamiliar codebase, or (5) prepare for deeper architectural analysis.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Codebase Mapping

Maps repository structure and dependencies to enable targeted architectural analysis.

## Quick Start

Generate a structural map:

```bash
python scripts/map_codebase.py /path/to/repo --output structure.json
```

## Process

1. **Clone or access** the target repository
2. **Generate file tree** excluding noise (node_modules, __pycache__, .git, etc.)
3. **Parse imports** to build dependency graph
4. **Identify entry points** (main.py, index.ts, setup.py, pyproject.toml)
5. **Detect boundaries** - package structure and public APIs

## Output Artifacts

The skill produces:

- `file_tree.txt` - Annotated directory structure
- `dependencies.json` - Import graph in adjacency list format
- `entry_points.md` - Identified entry points with descriptions
- `module_map.md` - Package boundaries and public interfaces

## Key Patterns to Identify

### Entry Point Detection

Look for these patterns:

- Python: `if __name__ == "__main__"`, `setup.py`, `pyproject.toml`
- Node: `package.json` main/bin fields, `index.js`
- Frameworks: `app.py` (Flask), `manage.py` (Django), `main.ts` (Nest)

### Dependency Classification

Classify imports as:

- **External**: Third-party packages (from package manager)
- **Internal**: Project modules (relative imports)
- **Standard**: Language standard library

### Noise Exclusion

Always exclude:

```
node_modules/
__pycache__/
.git/
.venv/
venv/
dist/
build/
*.egg-info/
.mypy_cache/
.pytest_cache/
```

## Integration with Other Skills

This skill provides the foundation for:

- `data-substrate-analysis` → Focus on types.py, models.py
- `execution-engine-analysis` → Focus on runner files
- `control-loop-extraction` → Focus on agent.py, loop files
- `component-model-analysis` → Focus on base classes

## Example Output

```markdown
## Repository: langchain

### Structure Summary
- 342 Python modules across 28 packages
- Primary entry: langchain/__init__.py
- Core packages: agents, chains, llms, tools

### Key Files for Analysis
- Types: langchain/schema.py, langchain/types.py
- Execution: langchain/agents/executor.py
- Tools: langchain/tools/base.py
```

Related Skills

codebase-search

242
from aiskillstore/marketplace

Search and navigate large codebases efficiently. Use when finding specific code patterns, tracing function calls, understanding code structure, or locating bugs. Handles semantic search, grep patterns, AST analysis.

threat-mitigation-mapping

242
from aiskillstore/marketplace

Map identified threats to appropriate security controls and mitigations. Use when prioritizing security investments, creating remediation plans, or validating control effectiveness.

ddd-context-mapping

242
from aiskillstore/marketplace

Map relationships between bounded contexts and define integration contracts using DDD context mapping patterns.

codebase-cleanup-tech-debt

242
from aiskillstore/marketplace

You are a technical debt expert specializing in identifying, quantifying, and prioritizing technical debt in software projects. Analyze the codebase to uncover debt, assess its impact, and create acti

codebase-cleanup-refactor-clean

242
from aiskillstore/marketplace

You are a code refactoring expert specializing in clean code principles, SOLID design patterns, and modern software engineering best practices. Analyze and refactor the provided code to improve its quality, maintainability, and performance.

codebase-cleanup-deps-audit

242
from aiskillstore/marketplace

You are a dependency security expert specializing in vulnerability scanning, license compliance, and supply chain security. Analyze project dependencies for known vulnerabilities, licensing issues, outdated packages, and provide actionable remediation strategies.

when-mapping-dependencies-use-dependency-mapper

242
from aiskillstore/marketplace

Comprehensive dependency mapping, analysis, and visualization tool for software projects

explore-codebase

242
from aiskillstore/marketplace

Pattern for efficiently exploring codebases using parallel subagents. Use when you need to understand code structure, find patterns, or gather context.

investigating-codebases

242
from aiskillstore/marketplace

Automatically activated when user asks how something works, wants to understand unfamiliar code, needs to explore a new codebase, or asks questions like "where is X implemented?", "how does Y work?", or "explain the Z component"

codebase-analysis

242
from aiskillstore/marketplace

Systematically analyze codebase structure, complexity, dependencies, and architectural patterns to understand project organization

codebase-explorer

242
from aiskillstore/marketplace

Explore and understand the Empathy Ledger codebase architecture, data flows, database schema, services, and how components connect. Use when you need to understand where things are, how data flows, or how different parts of the system relate to each other.

azure-quotas

242
from aiskillstore/marketplace

Check/manage Azure quotas and usage across providers. For deployment planning, capacity validation, region selection. WHEN: "check quotas", "service limits", "current usage", "request quota increase", "quota exceeded", "validate capacity", "regional availability", "provisioning limits", "vCPU limit", "how many vCPUs available in my subscription".

DevOps & Infrastructure