An AI agent skill that generates comprehensive markdown documentation from any codebase. Point it at a repo, and it produces structured docs covering project structure, database schema, features, API endpoints, architecture, and frontend components.
| Stack | Detection |
|---|---|
| Ruby on Rails | Gemfile with rails |
| React / Next.js | package.json with react or next |
| Python (Django / FastAPI / Flask) | requirements.txt or pyproject.toml |
| Node.js (Express / Fastify / NestJS) | package.json with framework dependency |
| Go (net/http, Gin, Echo, Fiber) | go.mod |
| iOS (SwiftUI / UIKit) | .xcodeproj or .xcworkspace |
| Generic / Polyglot | Fallback for unrecognized stacks |
Each run produces up to 6 markdown documents, depending on what the codebase contains:
| Document | Contents |
|---|---|
structure.md |
Directory layout, tech stack, config files, setup instructions |
database.md |
Tables, columns, relationships, indexes, ER diagrams |
features.md |
Business logic, core features, background jobs, integrations |
api.md |
Endpoints, request/response formats, authentication |
architecture.md |
Design patterns, request lifecycle, data flow (with mermaid diagrams) |
frontend.md |
Components, routing, state management, styling approach |
An index.md is also generated to link all documents together.
curl -fsSL https://raw.githubusercontent.com/ekohe/codebase-docs/main/install.sh | bashThis installs the skill to ~/.claude/skills/codebase-docs/ (and ~/.cursor/skills/codebase-docs/ if Cursor is detected).
git clone https://github.com/ekohe/codebase-docs.git
cd codebase-docs
# For Claude Code
mkdir -p ~/.claude/skills/codebase-docs
cp -R SKILL.md references/ scripts/ ~/.claude/skills/codebase-docs/
# For Cursor
mkdir -p ~/.cursor/skills/codebase-docs
cp -R SKILL.md references/ scripts/ ~/.cursor/skills/codebase-docs/Once installed, the skill activates automatically when you ask Claude to document a codebase:
"Document this repo"
"Generate docs for my project"
"Write up what this codebase does"
"Create technical documentation"
Claude will detect the framework, read the relevant source files, and generate the documentation.
The included Python script calls the Anthropic API directly to generate docs:
pip install anthropic
export ANTHROPIC_API_KEY="your-key"
# Generate all dimensions
python scripts/generate_docs.py --repo /path/to/repo --output ./docs
# Generate specific dimensions only
python scripts/generate_docs.py --repo /path/to/repo --dimensions structure,api,databaseAvailable dimensions: structure, database, features, api, architecture, frontend.
┌─────────────┐ ┌──────────────┐ ┌──────────────┐ ┌────────────┐
│ Detect │────▶│ Select │────▶│ Collect │────▶│ Generate │
│ Stack │ │ Dimensions │ │ Files │ │ Markdown │
└─────────────┘ └──────────────┘ └──────────────┘ └────────────┘
Gemfile? go.mod? structure, api, Framework-specific Structured
package.json? database, etc. file selection prompts per
.xcodeproj? (lean context) dimension
- Detection — Scans for indicator files (
Gemfile,package.json,go.mod, etc.) to identify the tech stack - Dimension selection — Picks which docs to generate based on what the codebase contains (e.g., skip
database.mdif no DB is detected) - File collection — Reads only the files relevant to each dimension using framework-specific strategies (defined in
references/*.md), keeping context lean - Generation — Uses structured prompts to produce each markdown document, including mermaid diagrams where appropriate
codebase-docs/
├── SKILL.md # Skill definition (prompts, detection, workflow)
├── install.sh # One-command installer
├── scripts/
│ └── generate_docs.py # Standalone doc generation script
└── references/ # Framework-specific file selection guides
├── ios.md # iOS (SwiftUI, UIKit)
├── ruby-on-rails.md # Ruby on Rails
├── react-next.md # React / Next.js
├── python-web.md # Django, FastAPI, Flask
├── node.md # Express, Fastify, NestJS
├── go.md # Go
└── generic.md # Unknown / polyglot repos
MIT