explain-codebase
Skill2 starsChanged 32 days agoMITView on GitHub
Drop into any repo and generate a structured architecture overview. Maps the codebase, identifies entry points, frameworks, and dependencies — then produces a \"start here\" guide for new contributors. Use when onboarding to an unfamiliar repository or requesting a codebase or architecture overview.
- Reads credentials
9 other projects use a version of this.
Adopted by
Most recently taken up by
- marcellocurto/skillstheir own version, first seen Nov 8, 2026
- agentkitco/agentkit-dev-skillstheir own version, first seen Nov 1, 2026
- ShmalexM/agent-skillstheir own version, first seen Nov 1, 2026
- 26zl/universal-agent-skillstheir own version, first seen Oct 13, 2026
- KhaledSaeed18/dotclaudetheir own version, first seen Jul 4, 2026
- atherio-danp/cde-dotnetcctheir own version, first seen Jun 19, 2026
Other versions9 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 9
- atherio-danp/cde-dotnetcc★ 109same name
- KhaledSaeed18/dotclaude★ 5same name
- marcellocurto/skills★ 3same name
- 26zl/universal-agent-skills★ 2same name
- fabianmagrini/skills★ 1same name
- jokot/skills★ 1same name
- aakash-dhar/claude-skills★ 0same name
- agentkitco/agentkit-dev-skills★ 0same name
- ShmalexM/agent-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository11 other files it gives its agents.
- approval-blocked-maintenance-loopsSkill
- cost-trackerSkill
- cron-composerSkill
- cron-doctorSkill
- daily-archivistSkill
- git-guardianSkill
- narrated-motion-explainersSkill
- self-monitorSkill
- skill-securitySkill
- static-site-release-verificationSkill
- weekly-meta-auditSkill
The file
We split this skill into the rules it gives an agent
6 rules. 0 are common, 6 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 9 edited versions we read keep these.
6
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 28
Before a refactor that needs full system understanding
- Distinctive: line 34
Run these exploration commands first, then synthesize into a structured overview.
- Distinctive: line 88
After recon, read the most important files:
- Distinctive: line 297
If you can't determine something, say "unclear from static analysis — check [specific file/URL]"
- Distinctive: line 298
Don't invent architectural decisions you didn't observe
- Distinctive: line 299
If the codebase is messy, say so — "no clear separation of concerns in src/" is useful information
“Common” is measured: kept by at least 6 in 10 of the 9 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
🗺️ Explain Codebase
Uses the Agent Skills package format. Execution depends on the host tools and permissions; consult the frontmatter compatibility requirements where provided.
Drop into any unfamiliar repository and generate a complete architectural overview in minutes. Maps directory structure, identifies entry points and frameworks, explains dependencies, and produces a contributor-ready "start here" guide.
Triggers
Activate this skill when:
- User drops into an unfamiliar repo and asks what it does
- "explain this codebase", "give me an overview", "what does this project do"
- "architecture overview", "how is this structured", "where do I start"
- "onboarding guide", "explain the code", "map this repo"
- Starting work on a new project or PR
- Before a refactor that needs full system understanding
How It Works
Run these exploration commands first, then synthesize into a structured overview.
Phase 1: Recon (run these commands)
# 1. Top-level structure
ls -la
# 2. Directory tree (exclude noise)
find . -type d \
! -path './.git/*' \
! -path './node_modules/*' \
! -path './.venv/*' \
! -path './venv/*' \
! -path './__pycache__/*' \
! -path './dist/*' \
! -path './build/*' \
! -path './.next/*' \
| sort | head -80
# 3. Key config files (reveal framework & toolchain)
ls -la *.json *.toml *.yaml *.yml *.lock *.cfg *.ini 2>/dev/null | head -30
# 4. Dependency file contents
cat package.json 2>/dev/null || cat pyproject.toml 2>/dev/null || cat Cargo.toml 2>/dev/null || cat go.mod 2>/dev/null || cat pom.xml 2>/dev/null
# 5. Entrypoints — where does execution start?
grep -r "if __name__.*__main__" --include="*.py" -l 2>/dev/null | head -10
ls -la main.* index.* app.* server.* cmd.* 2>/dev/null
# 6. README and docs
cat README.md 2>/dev/null || cat README.rst 2>/dev/null | head -100
# 7. Docker / deployment clues
cat Dockerfile 2>/dev/null | head -40
cat docker-compose.yml 2>/dev/null | head -40
# 8. CI/CD
ls .github/workflows/ 2>/dev/null
ls .gitlab-ci.yml .circleci/ .travis.yml 2>/dev/null
# 9. Test structure
find . -name "test_*.py" -o -name "*.test.ts" -o -name "*.spec.js" 2>/dev/null | head -20
# 10. Size overview — what's actually big?
find . -type f \
! -path './.git/*' \
! -path './node_modules/*' \
! -path './.venv/*' \
| xargs wc -l 2>/dev/null | sort -rn | head -20Phase 2: Deep Dive (read these files)
After recon, read the most important files:
- Main entrypoint(s) identified above
- Core library / src directory (skim for class/function names)
- Config files (understand environment expectations)
- Any
core/,lib/,common/, orshared/directory - Database models or schema files
- API route definitions
Phase 3: Synthesize
Produce the structured overview below.
Output Format
# 📦 Codebase Overview: [Project Name]
> Generated by explain-codebase skill | [date]
## What This Project Does
[2–3 sentence plain-English description. What problem does it solve? Who uses it?]
---
## Tech Stack
| Layer | Technology | Notes |
|-------|-----------|-------|
| Language | Python 3.11 | |
| Framework | FastAPI | REST API |
| Database | PostgreSQL | via SQLAlchemy ORM |
| Cache | Redis | session + rate limiting |
| Frontend | React 18 | Vite, TypeScript |
| Testing | pytest | + httpx for API tests |
| CI/CD | GitHub Actions | deploy on push to main |
| Container | Docker + Compose | dev + prod configs |
---
## Repository Structure
project/ ├── src/ # Main application code │ ├── api/ # HTTP route handlers │ │ ├── auth.py # Login, JWT, session │ │ └── users.py # User CRUD endpoints │ ├── core/ # Business logic (no I/O) │ │ ├── models.py # SQLAlchemy ORM models │ │ └── services.py # Service layer │ ├── db/ # Database setup │ │ └── migrations/ # Alembic migrations │ └── main.py # ← ENTRYPOINT: FastAPI app ├── tests/ # Test suite │ ├── unit/ # Pure logic tests │ └── integration/ # API + DB tests ├── frontend/ # React SPA │ ├── src/ │ │ ├── components/ # Reusable UI │ │ ├── pages/ # Route-level pages │ │ └── main.tsx # ← ENTRYPOINT: React root │ └── package.json ├── Dockerfile # Production container ├── docker-compose.yml # Dev environment ├── pyproject.toml # Python deps + tool config └── .env.example # Required environment vars
---
## Entry Points
| What | File | How to Run |
|------|------|------------|
| API server | `src/main.py` | `uvicorn src.main:app --reload` |
| Frontend dev | `frontend/src/main.tsx` | `cd frontend && npm run dev` |
| DB migrations | `src/db/migrations/` | `alembic upgrade head` |
| Tests | `tests/` | `pytest tests/` |
| Production | `Dockerfile` | `docker-compose up` |
---
## Key Dependencies
| Package | Role | Why it matters |
|---------|------|----------------|
| fastapi | Web framework | Async HTTP, OpenAPI docs auto-generated |
| sqlalchemy | ORM | Database models + query builder |
| alembic | DB migrations | Schema versioning |
| pydantic | Data validation | Request/response models |
| httpx | HTTP client | Internal + external API calls |
| pytest | Test runner | Unit + integration tests |
| redis-py | Cache client | Session storage, rate limiting |
---
## Data Flow
HTTP Request ↓ FastAPI Router (src/api/) ↓ Pydantic validation ↓ Service layer (src/core/services.py) ↓ SQLAlchemy ORM (src/core/models.py) ↓ PostgreSQL ←→ Redis (cache) ↓ Pydantic response model ↓ HTTP Response
---
## Environment Variables
Required (see `.env.example`):
```bash
DATABASE_URL=postgresql://user:pass@localhost/dbname
REDIS_URL=redis://localhost:6379
SECRET_KEY=your-jwt-secret
API_PORT=8000Optional:
LOG_LEVEL=INFO
SENTRY_DSN= # Error tracking
MAX_CONNECTIONS=10 # DB pool sizeWhere to Start 🚀
New contributor quick path:
- Understand the domain: Read
README.md+ skimsrc/core/models.py(data model = mental model) - Run it locally:
docker-compose upor followdocs/local-setup.md - Explore the API: Hit
http://localhost:8000/docs(auto-generated Swagger) - Read the tests:
tests/integration/test_api.pyshows how every endpoint behaves - Find your first task: Search
TODO,FIXME,HACKinsrc/— or check open issues
Files to read first (in order):
src/main.py— app wiring, middleware, routerssrc/core/models.py— data structuresrc/api/— pick one route file, trace a request end-to-endtests/integration/— see expected behavior
Potential Gotchas
- [List any non-obvious things: env var requirements, DB setup steps, version constraints]
- [e.g., "Requires PostgreSQL 14+ for JSONB features used in models.py"]
- [e.g., "Frontend expects API at
/api/— set VITE_API_URL in frontend/.env"]
Architecture Decisions Worth Knowing
- [Why X was chosen over Y, if evident from comments/docs/commit messages]
- [Any known tech debt: "The auth module is being rewritten — don't extend it"]
- [Anything that surprised you during analysis]
Generated by explain-codebase · MIT License
---
## Adaptation Notes
### For different project types
**Node/TypeScript projects** — also check:
```bash
cat tsconfig.json
cat .eslintrc* .prettierrc* 2>/dev/null
ls src/ lib/ app/ pages/ components/ 2>/dev/nullPython projects — also check:
cat setup.py setup.cfg pyproject.toml requirements*.txt 2>/dev/null
python -c "import ast, sys; [print(f.__name__) for f in ast.walk(ast.parse(open('main.py').read())) if isinstance(f, ast.FunctionDef)]" 2>/dev/nullGo projects — also check:
cat go.mod go.sum
find . -name "main.go" | head -5Monorepos — structure overview first, then recurse into each package:
ls packages/ apps/ libs/ services/ 2>/dev/nullKeep it honest
- If you can't determine something, say "unclear from static analysis — check [specific file/URL]"
- Don't invent architectural decisions you didn't observe
- If the codebase is messy, say so — "no clear separation of concerns in src/" is useful information
- Flag anything that looks like a security issue (hardcoded secrets, missing auth, etc.)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

