skill-codebase-onboarding
Skill0 starsChanged 3 months agoMITView on GitHub
MANDATORY FIRST STEP for ANY repository exploration, inspection, debugging, or feature work. Systematic repository exploration, architecture cartography, entrypoint discovery, and operational command extraction. MUST ACTIVATE before exploring, searching, reading, debugging, or adding features to ANY repository or codebase unless a complete REPO_MAP is already established in context. DO NOT skip to grep or file reading without this skill.
- Reads credentials
In this repository42 other files it gives its agents.
- AGENTS.mdAGENTS.md
- templates/AGENTS.mdAGENTS.md
- core/CLAUDE.mdCLAUDE.md
- llms.txtllms.txt
- avoid-ai-writingSkill
- c-cpp-systemsSkill
- doubt-driven-developmentSkill
- marketing-copywritingSkill
- mempalace-recallSkill
- mempalaceSkill
- mempalace-taskSkill
- retro-emulation-engineeringSkill
- seo-optimization-and-auditSkill
- skill-ai-mlSkill
- skill-backend-architectSkill
- skill-code-reviewSkill
- skill-context-engineeringSkill
- skill-creative-designSkill
- skill-data-analysisSkill
- skill-data-scienceSkill
- skill-design-engineeringSkill
- skill-devops-cloudSkill
- skill-emulator-wasmSkill
- skill-frontend-architectSkill
- skill-graph-analyticsSkill
- skill-graphics-webglSkill
- skill-low-level-programmingSkill
- skill-master-orchestratorSkill
- skill-mcp-builderSkill
- skill-monorepo-architectSkill
- skill-osint-engineeringSkill
- skill-plugin-architectureSkill
- skill-qa-engineerSkill
- skill-researchSkill
- skill-resume-tailorSkill
- skill-stealth-scrapingSkill
- skill-system-diagnosticsSkill
- skill-web-architectureSkill
- skill-web-performanceSkill
- spec-driven-developmentSkill
- spec-minerSkill
- wasm-emscriptenSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
17 rules. About 0 are common, 5 are distinctive, and 12 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
12
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Never read entire repositories blindly.
- Distinctive: line 27
Before reading source code, identify what the project is and what machine-readable rules already exist.
- Very specific: line 30
Call mempalace_search with the project name / directory leaf to recall previously mapped architectures, ADRs, test commands, and past …
- Very specific: line 60
Use list_dir on root and top-level folders.
- Very specific: line 61
Do NOT run recursive directory listings on un-ignored node_modules, venv, target, dist, or build dirs.
- Very specific: line 64
Monorepo: Look for apps/, packages/, services/, libs/ (Turborepo, Nx, Lerna, PNPM Workspaces).
- Very specific: line 65
Clean / Hexagonal Architecture: Look for domain/, application/, infrastructure/, adapters/, ports/.
- Very specific: line 66
Layered MVC: Look for controllers/, services/, models/, views/, routes/.
- Very specific: line 67
Modular / Feature-Based: Look for features/, modules/, components/.
- Very specific: line 68
Event-Driven / Serverless: Look for handlers/, functions/, events/, workers/.
- Very specific: line 114
Create or update a concise REPO_MAP.md in the project root or memory directory using the template in resources/repo-map-template.md.
- Distinctive: line 117
When MemPalace is active, write the extracted facts:
- Very specific: line 125
NO FULL FILE DUMPS: Never call view_file on large files (>150 lines) without StartLine and EndLine slicing.
- Very specific: line 126
PRECISION GREP FIRST: Use grep_search with specific identifiers (export function, class , router., struct ) rather than reading whole …
- Very specific: line 127
EXCLUDE NOISE: Always ignore lockfiles (package-lock.json, pnpm-lock.yaml, Cargo.lock), minified bundles, sourcemaps, and build outputs …
- Distinctive: line 134
When creating or recommending an AGENTS.md for a project, structure it as follows:
- Distinctive: line 142
Use single H1 for project name.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Codebase Onboarding & Repository Cartography Skill
This skill defines the deterministic, 5-phase protocol for exploring, understanding, and mapping any unfamiliar codebase, tool, or library without flooding the context window or guessing architectural patterns.
1. Core Philosophy: Progressive Disclosure
Never read entire repositories blindly. Treat the context window as a finite token budget. Gather information systematically from highest abstraction to lowest implementation:
[Level 0: Metadata & Rules] ──→ [Level 1: Tree Topography] ──→ [Level 2: Entrypoints & Flow]
│
[Level 4: Map & Memory] ◀── [Level 3: Operational Harness] ◀─────────┘2. The 5-Phase Onboarding Protocol
Phase 1: Project Identity & Machine Rules (Metadata Scan)
Before reading source code, identify what the project is and what machine-readable rules already exist.
- Check MemPalace Palace Memories (MANDATORY FIRST STEP):
- Call
mempalace_searchwith the project name / directory leaf to recall previously mapped architectures, ADRs, test commands, and past solutions. - Query
mempalace_kg_queryto inspect entity graphs and domain models before touching the disk.
- Call
- Check for AI/Agent Instruction Files (Second Priority):
AGENTS.md(universal Agentic AI Foundation standard)CLAUDE.md/.claude/CLAUDE.md.cursor/rules/*.mdcor.cursorrules.github/copilot-instructions.mdllms.txt/llms-full.txt.gemini/rulesorGEMINI.md
- Inspect Package & Build Manifests (Stack Detection):
- Node/TypeScript:
package.json,pnpm-workspace.yaml,tsconfig.json - Python:
pyproject.toml,requirements.txt,Pipfile,setup.py - Rust:
Cargo.toml,Cargo.lock - Go:
go.mod - Java/Kotlin:
pom.xml,build.gradle,settings.gradle - C/C++:
CMakeLists.txt,Makefile,meson.build - PHP/Ruby/Elixir:
composer.json,Gemfile,mix.exs
- Node/TypeScript:
- Read High-Level Human Documentation:
README.md(focus on architecture/setup sections, skip marketing fluff)docs/architecture/orADR/(Architecture Decision Records) if present.
Phase 2: Topography & Architectural Mapping
Map the repository structure to understand module boundaries and architectural style.
- Scan Directory Structure (Depth 1-2):
- Use
list_diron root and top-level folders. - Do NOT run recursive directory listings on un-ignored
node_modules,venv,target,dist, orbuilddirs.
- Use
- Identify the Architecture Pattern:
- Monorepo: Look for
apps/,packages/,services/,libs/(Turborepo, Nx, Lerna, PNPM Workspaces). - Clean / Hexagonal Architecture: Look for
domain/,application/,infrastructure/,adapters/,ports/. - Layered MVC: Look for
controllers/,services/,models/,views/,routes/. - Modular / Feature-Based: Look for
features/,modules/,components/. - Event-Driven / Serverless: Look for
handlers/,functions/,events/,workers/.
- Monorepo: Look for
- Record Boundaries:
- Identify which modules are isolated and which share common utilities (
common/,shared/,core/).
- Identify which modules are isolated and which share common utilities (
Phase 3: Entrypoints, Schemas & "Request Lifecycle"
Locate how execution begins and how data flows through the application.
- Locate Runtime Entrypoints:
- Backend:
src/index.ts,server.ts,main.py,app.py,cmd/main.go,src/main.rs. - Frontend:
src/App.tsx,pages/_app.tsx,app/layout.tsx,src/main.js. - CLI tools:
bin/,cli.ts,cmd/,__main__.py.
- Backend:
- Map Data Contracts & Schemas:
- Database / ORM:
prisma/schema.prisma,schema.sql,migrations/,drizzle.config.ts,models/. - API Definitions:
routes/,api/,openapi.yaml,swagger.json,schema.graphql,trpc/. - Environment / Configuration:
.env.example,config/,src/env.ts,settings.py.
- Database / ORM:
- Trace "One Lifecycle Path":
- Trace one representative flow from entry point to persistent layer:
Incoming Request / Event ──→ Router/Handler ──→ Business Service ──→ DB Query / Outbound API
- Trace one representative flow from entry point to persistent layer:
Phase 4: Operational Quality Harness (Executable Truth)
Extract exact, runnable commands rather than guessing tool syntax.
- Document Mandatory Commands:
- Install:
pnpm install|npm ci|uv sync|cargo build|go mod download - Dev Server:
npm run dev|uvicorn app.main:app --reload|cargo run - Build:
npm run build|cargo build --release|go build ./... - Test:
npm test|pytest -v|cargo test|go test ./... - Typecheck & Lint:
npx tsc --noEmit|npm run lint|ruff check .|golangci-lint run
- Install:
- Inspect CI/CD & Infrastructure Files:
.github/workflows/*.yml,.gitlab-ci.yml(these contain the definitive ground truth for builds and tests).Dockerfile,docker-compose.yml(service dependencies like Redis, Postgres, Kafka).
Phase 5: Synthesis, REPO_MAP & Memory Persistence
Consolidate findings so that future interactions do not need to re-read the repository from scratch.
- Generate or Update
REPO_MAP.md:- Create or update a concise
REPO_MAP.mdin the project root or memory directory using the template inresources/repo-map-template.md.
- Create or update a concise
- MemPalace Long-Term Memory Filing:
- When MemPalace is active, write the extracted facts:
mempalace_add_drawer: SubjectProject: <Name>, TitleCodebase Architecture & Commands, content formatted in AAAK.mempalace_kg_add: Relate project name to primary stack, key directories, and test framework.
- When MemPalace is active, write the extracted facts:
3. Strict Context Conservation Directives
- NO FULL FILE DUMPS: Never call
view_fileon large files (>150 lines) withoutStartLineandEndLineslicing. - PRECISION GREP FIRST: Use
grep_searchwith specific identifiers (export function,class,router.,struct) rather than reading whole directories. - EXCLUDE NOISE: Always ignore lockfiles (
package-lock.json,pnpm-lock.yaml,Cargo.lock), minified bundles, sourcemaps, and build outputs (dist/,build/,.next/).
4. Best Practices Reference for AI Project Standards
Writing AGENTS.md (For Projects)
When creating or recommending an AGENTS.md for a project, structure it as follows:
- Tech Stack: Exact runtime and framework versions.
- Key Commands: Full copy-pasteable build, test, lint, and run commands.
- Architectural Invariants: Strict rules (e.g., "Never import DB models directly inside React components").
- Definition of Done: Required gates before committing code (e.g.,
tscpass, tests pass, no lint warnings).
Writing llms.txt (For Web Services & Docs)
- Place at
/llms.txt. - Use single H1 for project name.
- Blockquote summary.
- Group curated Markdown doc links under H2 sections with short semantic descriptions.
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.

