codebase-explainer
Skill1 starsChanged 3 months agoMITView on GitHub
Produce a durable onboarding artifact for a codebase — writes ONBOARDING.md covering a "read this first" minimum, system overview, dependency map, startup flow, auth flow, and 5-15 important files, every claim backed by file:line citations; refreshes an existing onboarding doc instead of rewriting it. Use this skill whenever the user says "explain this codebase", "explain the codebase", "onboard me", "give me a tour", "tour this repo", "what does this repo do", "where do I start", "codebase overview", "read this first", "I haven't looked at this in months", or "/codebase-explainer" — even if they don't name the skill.
3 other projects use a version of this.
Adopted by
Most recently taken up by
- milad-ahmd/agent-skillstheir own version, first seen Nov 1, 2026
- bhaveyx/codebase-explainertheir own version, first seen Oct 25, 2026
- TheophilusChinomona/idevtheir own version, first seen Jun 12, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- milad-ahmd/agent-skills★ 5same name
- bhaveyx/codebase-explainer★ 0same name
- TheophilusChinomona/idev★ 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 repository38 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- api-contract-reviewSkill
- autopilotSkill
- backlog-plannerSkill
- code-reviewSkill
- context-dietSkill
- conventional-commitsSkill
- create-prSkill
- design-briefSkill
- diagnoseSkill
- dotnet-conventionsSkill
- dotnet-onion-apiSkill
- draw-optionsSkill
- e2e-verifySkill
- githubSkill
- goal-runnerSkill
- grill-with-docsSkill
- handoffSkill
- humanizerSkill
- improve-codebase-architectureSkill
- maestro-mobile-testSkill
- migration-safetySkill
- model-inventorySkill
- nextjs-app-routerSkill
- plan-and-buildSkill
- record-browser-testSkill
- regression-huntSkill
- safe-refactorSkill
- security-reviewSkill
- ship-itSkill
- sql-reviewSkill
- task-executorSkill
- tauri-2-appSkill
- think-like-fableSkill
- upgrade-depsSkill
- worktree-sandboxSkill
- write-a-skillSkill
- write-testsSkill
The file
We split this skill into the rules it gives an agent
7 rules. 0 are common, 4 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 25
Do not auto-trigger for:
- Distinctive: line 37
Read root-level signals directly to scope the exploration:
- Very specific: line 44
If an ONBOARDING.md already exists, this is refresh mode: read it first, then look for drift (new top-level deps, moved entry points, …
- Very specific: line 60
Write the artifact to docs/ONBOARDING.md if a docs/ directory exists, otherwise ONBOARDING.md at repo root.
- Distinctive: line 75
No timestamps in the file body (dates rot).
- Distinctive: line 79
After writing the file, render in chat: the "Read this first" bullets verbatim, plus a one-sentence pointer to the file path.
- Very specific: line 83
If making this teammate-accessible would help, mention ShareOnboardingGuide — it uploads ONBOARDING.md and returns a link.
“Common” is measured: kept by at least 6 in 10 of the 3 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
Codebase Explainer
Produce a durable onboarding artifact — the document past-you wishes you'd written before stepping away from this repo for six months. Not a chat answer that disappears: a committed ONBOARDING.md with a tight "read this first" list, system overview, dependency map, startup flow, auth flow, and the important files. Every claim cited with file:line.
When to use this skill
- "explain this codebase" / "explain the codebase" / "what does this repo do"
- "onboard me" / "give me a tour" / "tour this repo" / "where do I start"
- "I haven't looked at this in months" / "I forgot how this works"
- "codebase overview" / "read this first" / "create an onboarding doc"
/codebase-explainer//onboard
Do not auto-trigger for:
- Architecture refactor suggestions →
improve-codebase-architecture - Feature implementation →
task-executor - Bug triage →
diagnose - A specific diff review →
code-review - Session hand-off (different artifact, session-scoped) →
handoff
Workflow
1. Detect the lay of the land (no sub-agents yet)
Read root-level signals directly to scope the exploration:
- Manifests —
package.json,pyproject.toml,Cargo.toml,go.mod,*.csproj,*.sln,Gemfile,composer.json,pom.xml,build.gradle*. - Entry-point hints —
next.config.*,vite.config.*,tsconfig.json,Procfile,Dockerfile,docker-compose*.yml,main.*,Program.cs,manage.py. - Existing docs —
README.md,CONTEXT.md,docs/, anyONBOARDING.mdalready present. - Workspace shape — monorepo (
pnpm-workspace.yaml,lerna.json,nx.json,turbo.json) vs. single project.
If an ONBOARDING.md already exists, this is refresh mode: read it first, then look for drift (new top-level deps, moved entry points, new/removed routes, auth changes) and update in place — don't rewrite from scratch.
2. Run Explore sub-agents in parallel
Spawn subagent_type=Explore calls in a single message so they run concurrently. Brief each agent self-containedly — it has no conversation context. Default fan-out:
- System overview — what this project actually does, key domains, top-level modules, public-facing surfaces (HTTP routes / CLI commands / exported APIs).
- Dependency map — top-level prod deps only (skip dev/test/types). For each: what it does in this codebase (not generic), and the load-bearing call site (
file:line). If a dep is genuinely non-obvious (niche library, internal fork, name that doesn't reveal its purpose), the agent MAY checkcontext7(or any docs-MCP server available in the environment) for a one-line "what is this library" —context7__resolve-library-id→context7__query-docs. Skip the lookup for well-known libraries (React, Express, Prisma, etc.) — the generic description is what we're trying to avoid; what matters is how it's used here. The "how it's used here" line requires a call site the agent actually opened. If no call site is found, the row reads "declared but no usage found" — that's a finding (candidate for removal), not a gap to paper over with a guess from the package name. - Startup flow — entry point → bootstrap → config loading → server start. A numbered sequence with
file:lineper step. - Auth flow — login/session/token handling, middleware/guards, user model, where authorization decisions are made. This section must be a traced code path — a middleware/guard/session check the agent read this session, cited
file:line— never an inference from an auth library appearing in the manifest. If none, the agent must say "no auth detected" explicitly AND state what was searched (e.g. "grepped for middleware,session,jwt,[Authorize], guards — no hits") so Step 3 doesn't fabricate one. - Important files — the 5–15 files a new contributor must know about, each with a one-line "why it matters." A file earns its slot by being load-bearing, and the agent names the evidence per file: imported widely (roughly how many importers), owns a core domain concept, or is an entry point. "Looks important" is not evidence.
Each agent reports back in ≤300 words with file:line citations. Don't ask Explore to read entire files — ask for the specific answer plus citations.
3. Synthesize ONBOARDING.md
Write the artifact to docs/ONBOARDING.md if a docs/ directory exists, otherwise ONBOARDING.md at repo root.
No-fabrication gate: every claim in the file traces to a probe run this session — a file an agent read, a grep it ran. If a claim can't name its probe, it's a hypothesis: verify it or omit it. Never fill a section by inference from framework conventions ("Next.js apps usually…").
Sections, in this order:
- Read this first — 3–7 bullets max. The minimum a fresh contributor needs to not be dangerous.
- System overview — 1–3 paragraphs. What it does, who it serves, the dominant architectural shape.
- Startup flow — numbered, with
file:lineper step. - Auth flow — same shape, or a one-liner "No authentication layer — this is X (searched: middleware, session/token handling, guards)" if the agent confirmed none.
- Dependency map — table:
Dependency | What it does here | Key call site. - Important files — bulleted list with
file:lineand a one-line "why it matters." - Project glossary (optional) — only if
CONTEXT.mdexists or domain terms surfaced repeatedly during exploration. - Footer — one line: "Generated by
/codebase-explainer. Re-run to refresh."
No timestamps in the file body (dates rot). The git history is the timestamp.
4. Render a condensed summary inline
After writing the file, render in chat: the "Read this first" bullets verbatim, plus a one-sentence pointer to the file path. Do not re-paste the full document — the file is the artifact.
5. Offer the share step (optional)
If making this teammate-accessible would help, mention ShareOnboardingGuide — it uploads ONBOARDING.md and returns a link. Offer once; never auto-invoke.
Examples
Example 1: First pass on a six-month-old project
User: "I haven't touched this repo since November — onboard me"
Claude:
- Reads
package.json,next.config.ts,prisma/schema.prisma, existingREADME.md. Notes: Next.js App Router + NextAuth + Prisma + Postgres. - Spawns five Explore agents in parallel (overview, deps, startup, auth, important files) in one message.
- Synthesizes → writes
ONBOARDING.mdwith startup flow rooted atapp/layout.tsx:12→lib/auth.ts:34and auth flow citing the NextAuthauthOptionsand therequireSession()helper. - Prints the "Read this first" bullets and the file path. Offers
ShareOnboardingGuide.
Example 2: Refresh against an existing onboarding doc
User: "/codebase-explainer — refresh the onboarding doc, I added Stripe and a new admin route last sprint"
Claude:
- Reads existing
docs/ONBOARDING.md. Spawns Explore agents scoped to "what's changed": new top-level deps, new routes underapp/**/route.ts, auth changes. - Updates the dependency map (Stripe row added with
lib/payments/stripe.ts:18citation), appends the admin route to startup flow, leaves untouched sections alone. - Reports a diff-style summary in chat: "+1 dep, +1 route, auth unchanged."
Anti-patterns
- ❌ Generic framework descriptions ("This is a Next.js app."). Call out what makes THIS codebase non-obvious — the custom session helper, the funky background job runner, the legacy module that traps newcomers.
- ❌ Listing every dependency including dev/test/types. Prod + top-level only.
- ❌ "Important files" with 40 entries. 5–15 is the budget. If you can't pick, you don't understand the codebase yet — Explore more.
- ❌ Inventing an auth flow when there isn't one. If the agent reports no auth, the section says "No authentication layer" plus what was searched. That's load-bearing information for a future reader.
- ❌ Auth described from the manifest instead of the code. ❌ "Uses NextAuth for authentication" because
next-authsits inpackage.jsonvs. ✅ "Requests hitmiddleware.ts:8→auth()fromlib/auth.ts:12; unauthenticated users redirect atmiddleware.ts:19." Trace the path or write "none detected (searched: …)". - ❌ Papering over a dependency with no found call site. "Declared but no usage found" goes in the table verbatim — it's a finding.
- ❌ Important files picked by vibes. Each entry names its evidence: import count, domain concept owned, or entry-point role.
- ❌ Reading whole source files into the main context. Sub-agents return summaries with
file:linecitations — trust them. - ❌ Claims without
file:linecitations. A claim the next reader can't verify rots fast. - ❌ Hard-coded dates ("as of November 2025") in the file body. Git history is the timestamp.
- ❌ Rewriting an existing
ONBOARDING.mdfrom scratch when the user asked to refresh. - ✅ Tight "read this first," cited everywhere, explicit about absences, refreshable.
Notes
- Composes with
improve-codebase-architecture: an onboarding pass often surfaces shallow-module clusters worth a deepening review. Hand the user a pointer; don't propose refactors here. - Composes with
handoff:ONBOARDING.mdis project-level orientation (durable across many sessions); a handoff is session-level state. Different artifacts, both useful. ShareOnboardingGuide(when available in the environment) uploadsONBOARDING.mdand returns a teammate-shareable link. Optional; user-initiated.
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.

