explain-codebase
Generates a comprehensive overview of a codebase for onboarding, knowledge transfer, or architecture understanding. Use when the user says "explain this project", "how does this codebase work?", "onboard me", "give me an overview", "I'm new to this project", "walk me through the architecture", or "map this codebase".
What this skill does
# Explain Codebase Skill
When explaining a codebase, follow this structured process. The goal is to give someone everything they need to understand the project and start contributing confidently.
## 1. Discovery — Scan the Project
Before explaining anything, gather information:
### Project Identity
```bash
# What is this project?
cat README.md 2>/dev/null
cat package.json 2>/dev/null | grep -E '"name"|"description"|"version"'
cat pyproject.toml 2>/dev/null | head -20
cat Cargo.toml 2>/dev/null | head -20
cat go.mod 2>/dev/null | head -5
cat pom.xml 2>/dev/null | head -30
cat Gemfile 2>/dev/null | head -10
cat composer.json 2>/dev/null | grep -E '"name"|"description"'
# What does the directory structure look like?
find . -maxdepth 2 -type d ! -path '*/node_modules/*' ! -path '*/.git/*' ! -path '*/vendor/*' ! -path '*/__pycache__/*' ! -path '*/dist/*' ! -path '*/build/*' | sort
```
### Tech Stack Detection
```bash
# Languages — count lines by file type
find . -type f \( -name "*.ts" -o -name "*.tsx" -o -name "*.js" -o -name "*.jsx" -o -name "*.py" -o -name "*.go" -o -name "*.rs" -o -name "*.java" -o -name "*.rb" -o -name "*.php" -o -name "*.swift" -o -name "*.kt" \) ! -path '*/node_modules/*' ! -path '*/vendor/*' | sed 's/.*\.//' | sort | uniq -c | sort -rn
# Framework detection
cat package.json 2>/dev/null | grep -E "react|next|vue|nuxt|angular|express|fastify|nest|svelte|remix|astro"
cat requirements.txt pyproject.toml 2>/dev/null | grep -E "django|flask|fastapi|celery|sqlalchemy"
cat Gemfile 2>/dev/null | grep -E "rails|sinatra|sidekiq"
cat go.mod 2>/dev/null | grep -E "gin|echo|fiber|chi"
cat pom.xml build.gradle 2>/dev/null | grep -E "spring|quarkus|micronaut"
# Database
cat docker-compose.yml 2>/dev/null | grep -E "postgres|mysql|mongo|redis|elasticsearch"
grep -rn "DATABASE_URL\|MONGO_URI\|REDIS_URL" .env.example .env.sample 2>/dev/null
# Infrastructure
ls Dockerfile docker-compose.yml k8s/ terraform/ .github/workflows/ .circleci/ 2>/dev/null
```
### Codebase Size
```bash
# File count and lines of code (excluding deps and build)
find . -type f \( -name "*.ts" -o -name "*.tsx" -o -name "*.js" -o -name "*.jsx" -o -name "*.py" -o -name "*.go" -o -name "*.rs" -o -name "*.java" -o -name "*.rb" -o -name "*.php" \) ! -path '*/node_modules/*' ! -path '*/vendor/*' ! -path '*/dist/*' ! -path '*/build/*' | wc -l
# Lines of code
find . -type f \( -name "*.ts" -o -name "*.tsx" -o -name "*.js" -o -name "*.jsx" -o -name "*.py" -o -name "*.go" \) ! -path '*/node_modules/*' ! -path '*/dist/*' -exec cat {} + | wc -l
# Test file count
find . -type f \( -name "*.test.*" -o -name "*.spec.*" -o -name "test_*" -o -name "*_test.*" \) ! -path '*/node_modules/*' | wc -l
```
## 2. The 30-Second Overview
Start with a concise summary anyone can understand:
```
[Project Name] is a [type of application] that [what it does] for [who uses it].
Built with [primary tech stack], it [key capability 1], [key capability 2],
and [key capability 3].
The codebase is [size: small/medium/large] with approximately [X] files
and [X]k lines of code.
```
Example:
```
Acme Dashboard is a web application that provides real-time analytics
and reporting for e-commerce merchants.
Built with Next.js, PostgreSQL, and Redis, it processes order data,
generates sales reports, and sends automated alerts when metrics
fall outside configured thresholds.
The codebase is medium-sized with approximately 320 source files
and 45k lines of TypeScript.
```
## 3. Architecture Overview
### System Diagram
Always provide an ASCII diagram showing the major components:
```
┌─────────────────────────────────────────────────────────┐
│ CLIENT │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ Pages │ │Components│ │ Hooks │ │
│ │ (Routes) │──│ (UI) │──│ (State) │ │
│ └────┬─────┘ └──────────┘ └────┬─────┘ │
│ │ │ │
│ └───────────┬───────────────┘ │
│ │ API Calls │
└───────────────────┼──────────────────────────────────────┘
│
┌───────────────────┼──────────────────────────────────────┐
│ │ SERVER │
│ ┌────────────────▼───────────────┐ │
│ │ API Layer │ │
│ │ (Routes / Controllers) │ │
│ └────────────────┬───────────────┘ │
│ │ │
│ ┌────────────────▼───────────────┐ │
│ │ Service Layer │ │
│ │ (Business Logic) │ │
│ └───┬────────────┬───────────┬──┘ │
│ │ │ │ │
│ ┌───▼───┐ ┌────▼────┐ ┌──▼──────┐ │
│ │ DB │ │ Cache │ │ External│ │
│ │(Postgres)│ │(Redis) │ │ APIs │ │
│ └───────┘ └─────────┘ └─────────┘ │
└──────────────────────────────────────────────────────────┘
```
### Directory Map
Explain what each top-level directory contains and WHY it's organized that way:
```
project/
├── src/
│ ├── api/ → HTTP route handlers. Validates input, calls services, returns responses.
│ │ Does NOT contain business logic.
│ ├── services/ → Core business logic. Orchestrates operations across repositories
│ │ and external services. This is where the "rules" live.
│ ├── db/ → Database access layer. Queries, models, migrations.
│ │ Only layer that imports the ORM.
│ ├── models/ → TypeScript interfaces and types shared across layers.
│ │ No runtime code — only type definitions.
│ ├── middleware/ → Express/Fastify middleware: auth, logging, rate limiting, error handling.
│ ├── utils/ → Pure utility functions. No side effects, no external dependencies.
│ ├── config/ → Configuration loading and validation. Reads from env vars.
│ ├── jobs/ → Background job definitions (queue workers, cron jobs).
│ └── lib/ → Third-party service wrappers (Stripe, SendGrid, S3).
│ Isolates external dependencies behind clean interfaces.
├── tests/
│ ├── unit/ → Fast tests for individual functions and classes.
│ ├── integration/ → Tests that hit the database or external services.
│ └── e2e/ → End-to-end tests simulating real user flows.
├── scripts/ → Developer tooling: seed data, migrations, deploy scripts.
├── docs/ → Architecture decisions, API docs, onboarding guides.
├── infra/ → Infrastructure as code: Terraform, Kubernetes, Docker.
└── .github/ → CI/CD workflows, PR templates, issue templates.
```
## 4. Key Concepts & Domain Model
Explain the core business domain:
### Domain Entities
Identify and explain the main entities/models:
- What are they?
- How do they relate to each other?
- Where are they defined in code?
```
┌──────────┐ ┌──────────┐ ┌──────────┐
│ User │────▶│ Order │────▶│ Item │
│ │ 1:N │ │ 1:N │ │
└──────────┘ └────┬─────┘ └──────────┘
│ 1:1
┌────▼─────┐
│ Payment │
└──────────┘
```
### Key Business Rules
List the non-obvious rules that drive behavior:
- "Orders over $100 get free shipping"
- "Users can only cancel within 24 hours"
- "Inventory is reserved at checkout, released after 30 minutes if unpaid"
### Glossary
Define project-specific terms:
| Term | Meaning | Where in Code |
|------|---------|---------------|
| Merchant | A business using our platform | `src/models/merchant.ts` |
| FulfillmRelated in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.