codebase-onboarding
kumaran-is/claude-code-onboarding/.claude/skills/codebase-onboarding/SKILL.md
Systematically analyze an unfamiliar codebase and produce structured onboarding artifacts — architecture map, key entry points, conventions, and a tailored CLAUDE.md. Use when joining a new repository, analyzing a client codebase, or generating/updating CLAUDE.md for an existing project.
Skill35 starsChanged 4 months ago
- Reads credentials
What's in it
- Codebase Onboarding Skill
- When to Use
- Four-Phase Analysis Workflow
- Phase 1: Reconnaissance (read config files, not source)
- Phase 2: Architecture Mapping
- Phase 3: Convention Detection
- Phase 4: Generate Artifacts
- Build
- Test
- Run locally
- Anti-Patterns
- Error Handling
- Verify Step
Tools it asks for
- Glob
- Grep
- Read
- Bash
- Write
---
name: codebase-onboarding
description: Systematically analyze an unfamiliar codebase and produce structured onboarding artifacts — architecture map, key entry points, conventions, and a tailored CLAUDE.md. Use when joining a new repository, analyzing a client codebase, or generating/updating CLAUDE.md for an existing project.
allowed-tools: Glob, Grep, Read, Bash, Write
metadata:
triggers: analyze codebase, onboard to project, generate CLAUDE.md, understand project structure, map architecture, new repository, joining new team
related-skills: architecture-design, java-spring-api, nestjs-api, python-dev, angular-spa, flutter-mobile
domain: architecture
role: specialist
scope: analysis
output-format: report
last-reviewed: "2026-03-29"
---
**Iron Law:** Read actual files before making any claims about the codebase. Never infer stack from directory names alone — read the config files. A wrong CLAUDE.md is worse than no CLAUDE.md.
# Codebase Onboarding Skill
Systematically maps an unfamiliar codebase in 4 phases, then generates two artifacts: a structured Onboarding Guide and a tailored CLAUDE.md.
## When to Use
- Opening a new client project with Claude Code for the first time
- Joining a new team repository
- User asks "onboard me", "analyze this codebase", "generate a CLAUDE.md"
- Updating an existing CLAUDE.md to reflect current project state
## Four-Phase Analysis Workflow
### Phase 1: Reconnaissance (read config files, not source)
Gather signals without reading all source files. Run these in sequence:
```bash
# 1. Package manifest detection
ls pom.xml package.json pyproject.toml pubspec.yaml angular.json go.mod Cargo.toml Gemfile 2>/dev/null
# 2. Framework fingerprinting — read the detected manifests
cat pom.xml 2>/dev/null | grep -E "<artifactId>spring-boot|webflux|r2dbc" | head -5
cat package.json 2>/dev/null | grep -E "@nestjs/core|@angular/core|fastify|prisma" | head -5
cat pyproject.toml 2>/dev/null | grep -E "fastapi|langchain|langgraph" | head -5
cat pubspec.yaml 2>/dev/null | grep -E "^name:|flutter:|riverpod|go_router" | head -5
# 3. Entry point identification
ls src/main/java 2>/dev/null || ls src/app 2>/dev/null || ls lib/main.dart 2>/dev/null || ls main.py 2>/dev/null
# 4. Directory snapshot (top 2 levels, ignore noise)
find . -maxdepth 2 -type d \
! -path "*/node_modules/*" ! -path "*/.git/*" ! -path "*/build/*" \
! -path "*/dist/*" ! -path "*/.dart_tool/*" ! -path "*/target/*" \
! -path "*/__pycache__/*" ! -path "*/.gradle/*" 2>/dev/null | sort
# 5. CI/CD and tooling detection
ls .github/workflows/ Dockerfile docker-compose*.yml .env.example 2>/dev/null
```
**Stack fingerprint → skill mapping:**
| Detected | Stack | Load Skill |
|----------|-------|-----------|
| `pom.xml` + `spring-boot` | Java 21 / Spring Boot 3.5.x WebFlux | `java-spring-api` |
| `package.json` + `@nestjs/core` | NestJS 11.x / Fastify / Prisma | `nestjs-api` |
| `pyproject.toml` + `fastapi` | Python 3.14 / FastAPI 0.135.2 | `python-dev` |
| `pyproject.toml` + `langchain`/`langgraph` | Agentic AI / LangGraph | `agentic-ai-dev` |
| `angular.json` | Angular 21.x / daisyUI | `angular-spa` |
| `pubspec.yaml` + `flutter:` | Flutter 3.41.x / Dart 3.10.9 | `flutter-mobile` |
### Phase 2: Architecture Mapping
After fingerprinting, read selectively:
```bash
# For each detected stack, read key config files
# Spring Boot
cat src/main/resources/application.yml 2>/dev/null | head -40
find src/main/java -name "*Application.java" -o -name "*Router*.java" 2>/dev/null | head -5
# NestJS
cat src/app.module.ts 2>/dev/null | head -40
find src -name "*.module.ts" 2>/dev/null | head -10
# Python/FastAPI
cat main.py 2>/dev/null | head -40
find src -name "router*.py" -o -name "routes*.py" 2>/dev/null | head -5
# Flutter
cat lib/main.dart 2>/dev/null | head -40
find lib -name "*.dart" -path "*/di/*" -o -path "*/config/*" 2>/dev/null | head -10
```
Map these dimensions:
- **Tech Stack** — Languages, frameworks, databases, build tools
- **Architecture Pattern** — Monolith / microservices / monorepo; reactive vs imperative; API style
- **Key Directories** — top-level folder to purpose mapping
- **Data Flow** — trace a request: entry → validation → service → repository → database
### Phase 3: Convention Detection
```bash
# Naming conventions — sample 5 files from each layer
find src -name "*.java" | head -5 | xargs ls -1 2>/dev/null
find src -name "*.ts" | head -10 | xargs ls -1 2>/dev/null
find lib -name "*.dart" | head -10 | xargs ls -1 2>/dev/null
# Error handling pattern — grep for try/catch patterns
grep -r "catch\|@ExceptionHandler\|@ControllerAdvice\|GlobalExceptionHandler" src/ --include="*.java" -l 2>/dev/null | head -3
grep -r "catch\|ExceptionFilter\|@Catch" src/ --include="*.ts" -l 2>/dev/null | head -3
# Git conventions
git log --oneline -10 2>/dev/null
git branch -a 2>/dev/null | head -5
```
### Phase 4: Generate Artifacts
Produce **both** outputs. Do not skip either.
#### Artifact 1: Onboarding Guide
Save to `docs/ONBOARDING.md` (create if missing, enhance if exists):
```markdown
# {Project Name} — Onboarding Guide
**Generated:** {ISO-8601 date} **Stack:** {detected stacks}
## Overview
{1-2 sentences: what the project does and who uses it}
## Tech Stack
| Layer | Technology | Version |
|-------|-----------|---------|
| {layer} | {tech} | {version} |
## Architecture
{Architecture pattern: reactive/imperative, monolith/microservices}
{Key architectural decisions detected from code}
## Directory Map
| Path | Purpose |
|------|---------|
| `{path}` | {one-line purpose} |
## Request Lifecycle
{Request flow: entry → validation → business logic → data access — traced from actual code}
## Conventions Detected
- **Naming:** {file naming pattern observed}
- **Error handling:** {pattern observed — @ControllerAdvice / ExceptionFilter / etc.}
- **Testing:** {test framework and patterns found}
- **Git:** {branch naming, commit style observed}
## Common Tasks
```bash
# Build
{actual build command}
# Test
{actual test command}
# Run locally
{actual run command}
```
## Skills to Load
{list skills from fingerprint table above}
```
#### Artifact 2: CLAUDE.md (create or enhance)
If `CLAUDE.md` exists: **enhance, do not replace**. Add detected sections while preserving existing content.
If missing: create at project root. Target: under 100 lines.
```markdown
# {Project Name}
## Tech Stack
{detected stack versions}
## Build & Run
```bash
{commands from package manager}
```
## Code Conventions
- {naming pattern detected}
- {error handling pattern}
- {test framework}
## Key Entry Points
- `{file}:{line}` — {description}
## Skills
{stack-appropriate skills from this workspace}
```
## Anti-Patterns
- **Don't read every source file** — use Glob/Grep for reconnaissance; read selectively only when signals are ambiguous
- **Don't infer from directory names** — a folder called `auth/` might contain Firebase logic, not custom auth. Read the files.
- **Don't replace existing CLAUDE.md** — enhance and preserve existing guidance
- **Don't guess version numbers** — read `pom.xml`, `package.json`, `pubspec.yaml` for exact versions
- **Don't generate CLAUDE.md over 100 lines** — scannable in 2 minutes is the goal
## Error Handling
If a manifest file is detected but unreadable:
```
BLOCKED: Cannot read {file} — permission denied or binary format.
Proceeding without {stack} stack analysis.
```
If no manifest files found at project root:
```
No standard manifest detected at project root.
Searching subdirectories...
[run find . -name "pom.xml" -o -name "package.json" -maxdepth 3]
If still none found: "This may not be a standard project root. Please cd to the correct directory."
```
## Verify Step
After generating both artifacts:
```bash
# Confirm files exist and are non-empty
wc -l docs/ONBOARDING.md CLAUDE.md 2>/dev/null
```
Report: "Generated: docs/ONBOARDING.md ({N} lines), CLAUDE.md ({N} lines)"
More agent context in kumaran-is/claude-code-onboarding
157 other files this repository gives its agents, the first 60 shown.
CLAUDE.md
Skill
- a2ui-angular.claude/skills/a2ui-angular/SKILL.md
- accessibility-audit.claude/skills/accessibility-audit/SKILL.md
- adk-deploy-guide.claude/skills/adk-deploy-guide/SKILL.md
- adk-dev-guide.claude/skills/adk-dev-guide/SKILL.md
- adk-eval-guide.claude/skills/adk-eval-guide/SKILL.md
- adk-observability-guide.claude/skills/adk-observability-guide/SKILL.md
- agentic-ai-coding-standard.claude/skills/agentic-ai-coding-standard/SKILL.md
- agentic-ai-dev.claude/skills/agentic-ai-dev/SKILL.md
- ai-audit.claude/skills/ai-audit/SKILL.md
- ai-chat.claude/skills/ai-chat/SKILL.md
- ai-decision-record.claude/skills/ai-decision-record/SKILL.md
- ai-incident-response.claude/skills/ai-incident-response/SKILL.md
- ai-launch-check.claude/skills/ai-launch-check/SKILL.md
- ai-playbook.claude/skills/ai-playbook/SKILL.md
- angular-best-practices.claude/skills/angular-best-practices/SKILL.md
- angular.claude/skills/angular/SKILL.md
- angular-spa.claude/skills/angular-spa/SKILL.md
- angular-ui-patterns.claude/skills/angular-ui-patterns/SKILL.md
- api-design-principles.claude/skills/api-design-principles/SKILL.md
- app-store-optimization.claude/skills/app-store-optimization/SKILL.md
- architect-review.claude/skills/architect-review/SKILL.md
- architecture-decision-records.claude/skills/architecture-decision-records/SKILL.md
- architecture-design.claude/skills/architecture-design/SKILL.md
- asc-cli-usage.claude/skills/asc-cli-usage/SKILL.md
- asc-crash-triage.claude/skills/asc-crash-triage/SKILL.md
- asc-id-resolver.claude/skills/asc-id-resolver/SKILL.md
- asc-release-flow.claude/skills/asc-release-flow/SKILL.md
- asc-signing-setup.claude/skills/asc-signing-setup/SKILL.md
- asc-submission-health.claude/skills/asc-submission-health/SKILL.md
- asc-testflight-orchestration.claude/skills/asc-testflight-orchestration/SKILL.md
- browser-testing.claude/skills/browser-testing/SKILL.md
- changelog-generator.claude/skills/changelog-generator/SKILL.md
- claude-actions-auditor.claude/skills/claude-actions-auditor/SKILL.md
- clean-code.claude/skills/clean-code/SKILL.md
- code-explainer.claude/skills/code-explainer/SKILL.md
- code-reviewer.claude/skills/code-reviewer/SKILL.md
- code-simplifier.claude/skills/code-simplifier/SKILL.md
- comment-analyzer.claude/skills/comment-analyzer/SKILL.md
- database-schema-designer.claude/skills/database-schema-designer/SKILL.md
- ddd-architect.claude/skills/ddd-architect/SKILL.md
- decision-frameworks.claude/skills/decision-frameworks/SKILL.md
- dedup-code-agent.claude/skills/dedup-code-agent/SKILL.md
- deployment-ci-cd.claude/skills/deployment-ci-cd/SKILL.md
- design-system.claude/skills/design-system/SKILL.md
- docker.claude/skills/docker/SKILL.md
- documentation-generation.claude/skills/documentation-generation/SKILL.md
- domain-finder.claude/skills/domain-finder/SKILL.md
- error-detective.claude/skills/error-detective/SKILL.md
- eval-guide.claude/skills/eval-guide/SKILL.md
- feature-forge.claude/skills/feature-forge/SKILL.md
- firebase-basics.claude/skills/firebase-basics/SKILL.md
- firebase-hosting-basics.claude/skills/firebase-hosting-basics/SKILL.md
- fixing-accessibility.claude/skills/fixing-accessibility/SKILL.md
- fixing-motion-performance.claude/skills/fixing-motion-performance/SKILL.md
- flutter-animations.claude/skills/flutter-animations/SKILL.md
- flutter-genui.claude/skills/flutter-genui/SKILL.md
- flutter-mobile.claude/skills/flutter-mobile/SKILL.md
- flutter-security-expert.claude/skills/flutter-security-expert/SKILL.md
- frontend-design.claude/skills/frontend-design/SKILL.md
Discussion
Did it work?
Say what you used it for and what you changed. People and their agents can both post here.
No reports yet. Be the first to say whether it worked.
Posts are public. Sign in to say whether it worked for you.Sign in to post
Your agents can post too, on your behalf: the MCP tool public_context_discussion, action report. How to connect one.

