Guided project onboarding for new codebases. Helps agents understand project structure, build systems, test commands, and development workflows by creating persistent knowledge memories.
Invoke this skill when:
check_onboarding_performed indicates no memories existFirst, check if onboarding was already performed:
List files in: .claude/context/memory/
Look for: project-structure.md, build-commands.md, test-commands.md
If memories exist, read them and skip to Step 6 (Validation).
First, classify the project:
| Indicator | Present? | Classification |
|---|---|---|
.git directory with history |
Yes | Brownfield |
Package manifest (package.json, requirements.txt, etc.) |
Yes | Brownfield |
Source directories (src/, app/, lib/) with code |
Yes | Brownfield |
| Dirty git status (uncommitted changes) | Yes | Brownfield (warn user) |
| Empty or only README.md | None of above | Greenfield |
For Brownfield Projects:
.gitignore and .claudeignore BEFORE scanninggit ls-files to list tracked files (respects .gitignore)# Efficient file listing (respects .gitignore)
git ls-files --exclude-standard -co | head -100
# For non-git projects with manual ignores
find . -type f \
-not -path '*/node_modules/*' \
-not -path '*/.git/*' \
-not -path '*/dist/*' \
-not -path '*/build/*' \
| head -100
For Greenfield Projects:
Analyze the project root to identify:
Package Manager & Language:
package.json - Node.js/JavaScript/TypeScriptpyproject.toml, requirements.txt - PythonCargo.toml - Rustgo.mod - Gopom.xml, build.gradle - Javacomposer.json - PHPProject Type:
Framework Detection:
Identify how to build/run the project:
Check package.json scripts (Node.js):
{
"scripts": {
"dev": "...",
"build": "...",
"start": "...",
"test": "..."
}
}
Check Makefiles (Python, Go, Rust):
build:
test:
lint:
Check pyproject.toml (Python):
[tool.poetry.scripts]
[tool.poe.tasks]
Document discovered commands:
npm run dev, uv run devnpm run build, cargo buildnpm test, pytestnpm run lint, ruff checkMap key directories:
| Directory | Purpose |
|---|---|
src/ |
Source code |
lib/ |
Library code |
test/, tests/, __tests__/ |
Test files |
docs/ |
Documentation |
scripts/ |
Utility scripts |
config/ |
Configuration files |
Identify:
index.ts, main.py, app.py)Save discovered information to persistent memories:
Memory: project-structure.md
# Project Structure
## Overview
- Project Type: [fullstack/backend/frontend/library]
- Primary Language: [TypeScript/Python/Go/Rust]
- Framework: [Next.js/FastAPI/Express/etc.]
## Key Directories
- Source: `src/`
- Tests: `test/`
- Config: `.claude/`
## Entry Points
- Main: `src/index.ts`
- API: `src/api/`
## Important Files
- Configuration: `package.json`, `tsconfig.json`
- Environment: `.env.example`
Memory: build-commands.md
# Build Commands
## Development
- Start dev server: `npm run dev`
- Watch mode: `npm run watch`
## Build
- Production build: `npm run build`
- Type check: `npm run typecheck`
## Clean
- Clean build: `npm run clean`
Memory: test-commands.md
# Test Commands
## Unit Tests
- Run all: `npm test`
- Watch mode: `npm test -- --watch`
- Coverage: `npm test -- --coverage`
## E2E Tests
- Run: `npm run test:e2e`
## Linting
- Lint: `npm run lint`
- Fix: `npm run lint:fix`
Validate discovered information:
Test Commands (if safe):
npm --version or equivalent to verify package managernpm run --silent to list available scriptsVerify Paths:
Output a concise summary:
## Onboarding Complete
**Project**: [name]
**Type**: [fullstack/backend/etc.]
**Framework**: [Next.js/FastAPI/etc.]
**Quick Commands**:
- Dev: `npm run dev`
- Test: `npm test`
- Build: `npm run build`
**Key Locations**:
- Source: `src/`
- Tests: `test/`
- API: `src/api/`
**Memories Created**:
- .claude/context/memory/project-structure.md
- .claude/context/memory/build-commands.md
- .claude/context/memory/test-commands.md
Agent Actions:
.claude/context/memory/Output:
## Onboarding Complete
**Project**: agent-studio
**Type**: Multi-agent orchestration framework
**Framework**: Claude Code + Custom agents
**Quick Commands**:
- Validate: `node .claude/tools/cli/validate-agents.mjs`
- Test hooks: `node .claude/hooks/routing/router-enforcer.cjs` (uses `.claude/lib/routing/routing-table.cjs`)
**Key Locations**:
- Agents: `.claude/agents/`
- Skills: `.claude/skills/`
- Memory: `.claude/context/memory/`
**Memories Created**: 3 files
| Anti-Pattern | Why It Fails | Correct Approach |
|---|---|---|
| Assuming standard conventions without checking | Every project has unique build/test/lint commands; wrong assumptions cause silent failures | Read package.json, Makefile, or pyproject.toml and run --version to confirm |
| Skipping verification of discovered commands | Documented-but-wrong commands mislead every future agent session | Run each command with a safe no-op or --help flag to confirm it works |
| Storing onboarding only in session context | Context resets on every new conversation; discoveries are permanently lost | Write all findings to named memory files in .claude/context/memory/named/ |
| Treating onboarding as a one-time event | Projects evolve; stale commands fail silently and waste agent time | Update onboarding memories after any significant project structure change |
| Over-documenting without prioritizing key commands | Long files with low-priority info bury the critical build/test commands | Structure memories with Quick Start commands at the top, details below |
Before starting:
Read .claude/context/memory/learnings.md
After completing:
.claude/context/memory/learnings.md.claude/context/memory/issues.md.claude/context/memory/decisions.mdASSUME INTERRUPTION: If it's not in memory, it didn't happen.