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.

25 stars

Best use case

codebase-mapping is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

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.

Teams using codebase-mapping should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/codebase-mapping/SKILL.md --create-dirs "https://raw.githubusercontent.com/ComeOnOliver/skillshub/main/skills/aiskillstore/marketplace/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

error-mapping-helper

25
from ComeOnOliver/skillshub

Error Mapping Helper - Auto-activating skill for API Integration. Triggers on: error mapping helper, error mapping helper Part of the API Integration skill category.

cursor-codebase-indexing

25
from ComeOnOliver/skillshub

Set up and optimize Cursor codebase indexing for semantic code search and @Codebase queries. Triggers on "cursor index", "codebase indexing", "index codebase", "cursor semantic search", "@codebase", "cursor embeddings".

generate-custom-instructions-from-codebase

25
from ComeOnOliver/skillshub

Migration and code evolution instructions generator for GitHub Copilot. Analyzes differences between two project versions (branches, commits, or releases) to create precise instructions allowing Copilot to maintain consistency during technology migrations, major refactoring, or framework version upgrades.

codebase-search

25
from ComeOnOliver/skillshub

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

25
from ComeOnOliver/skillshub

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

ddd-context-mapping

25
from ComeOnOliver/skillshub

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

codebase-cleanup-tech-debt

25
from ComeOnOliver/skillshub

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

25
from ComeOnOliver/skillshub

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

25
from ComeOnOliver/skillshub

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

25
from ComeOnOliver/skillshub

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

explore-codebase

25
from ComeOnOliver/skillshub

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

investigating-codebases

25
from ComeOnOliver/skillshub

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"