Skip to content

zarathon/Codebase-Context-Mapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Codebase Context Mapper

A prompt specification for LLM agents (designed for Claude Code) that scans a software repository and generates structured Markdown documentation covering every dimension of the codebase — from executive summary to module-level details.

What it produces

A .context/ directory at the repository root containing:

File What it covers
CODEBASE.md Entry point — executive summary + index to all documents
ARCHITECTURE.md System design, boundaries, topology, layers
TECH_STACK.md Languages, frameworks, libraries, infra
DOMAIN_MODEL.md Business entities, bounded contexts, data flow
MODULES.md Module inventory, responsibilities, dependency graph
PATTERNS.md Code patterns, conventions, idioms, anti-patterns
DATA_LAYER.md Databases, ORMs, caching, migrations
API_SURFACE.md External/internal APIs, auth, versioning
TESTING.md Test strategy, frameworks, coverage
BUILD_AND_DEPLOY.md CI/CD, build system, environments
TECH_DEBT.md Debt areas, coupling hotspots, legacy zones
CONVENTIONS.md Naming, file org, commit/PR patterns
GLOSSARY.md Domain and project terminology

Why

Any LLM session that starts with the .context/ documents loaded has dramatically better accuracy when working on the codebase. It eliminates the cold-start problem where the LLM has to rediscover architecture, patterns, and conventions on every session.

Usage

Basic (full analysis)

Open Claude Code at the repository root and run:

Analyze this repository and generate complete codebase context documentation following the Codebase Context Mapper specification. Create all output files in the .context/ directory.

Scoped (specific modules)

Analyze this repository following the Codebase Context Mapper spec. Focus deep analysis on the src/payments/ and src/billing/ modules. Do shallow analysis for everything else.

Monorepo

Analyze this monorepo following the Codebase Context Mapper spec. Treat each directory under apps/ as a separate application. Create a top-level index and per-app context documents.

Re-execution

The prompt is designed to be idempotent. Run it periodically to keep documentation in sync with code changes. It regenerates all documents from scratch rather than patching.

Recommended .gitignore addition

Decide per team whether to version-control the context docs. If not:

.context/

If yes (recommended for team-shared LLM context), commit the .context/ directory.

Specification

The full prompt specification is in PROMPT.md.

About

Mapping a codebase to LLMs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors