Onboarding
Generate a comprehensive developer onboarding guide for an unfamiliar codebase and write it to docs/ONBOARDING.md.
Instructions
Use Read on README.md, then attempt to read whichever of the following exist: package.json, pyproject.toml, go.mod, CLAUDE.md, docs/assumptions.md.
Use Glob to map the top-level directory structure (*). For each top-level folder found, describe its purpose based on its name and contents (e.g., src/ → application source, scripts/ → automation scripts, docs/ → project documentation).
Use Glob to find entry points matching: index.*, main.*, server.*, app.*, cmd/**/*. Read the primary entry point to understand how the application starts.
Use Read on any Makefile, package.json (scripts section), or Taskfile.yml to identify key commands: install, run, test, build, lint.
Use Glob to find .env.example or any env var documentation files. List all required environment variables with their descriptions.
SECURITY: Read .env.example only — never read .env or any file containing real credential values, and never include actual secret values in the generated guide. Document variable names and descriptions only.
Use Bash to count files by detected language type. Adapt the command to the language detected:
- TypeScript/JavaScript:
find . -name "*.ts" -o -name "*.js" | grep -v node_modules | wc -l
- Python:
find . -name "*.py" | grep -v __pycache__ | wc -l
- Go:
find . -name "*.go" | wc -l
Generate architecture diagram.
a. Use Read on the primary entry point file identified in step 3 to understand how the application initializes and what it connects to.
b. Use Glob to find configuration files that reveal infrastructure: docker-compose.yml, *.env.example, infrastructure/**, terraform/**, serverless.yml, .github/workflows/**.
c. Use Grep to identify major inter-module dependencies: import/require/use statements at the top of the entry point and primary route/handler files.
d. Generate a Mermaid diagram using the most appropriate type:
- For web apps with a request flow:
sequenceDiagram showing Client → Load Balancer → App Server → Database/Cache/Queue
- For microservices or modular apps:
graph LR showing service dependencies
- For simple single-module apps:
graph TD showing function/module call flow
e. Include the diagram in the generated docs/ONBOARDING.md under a "## Architecture" section, wrapped in a fenced code block with mermaid syntax tag.
f. Add a note: "This diagram was auto-generated and may not capture all relationships. Review and update as the architecture evolves."
Example output to include in ONBOARDING.md:
## Architecture
```mermaid
sequenceDiagram
Client->>+ALB: HTTPS Request
ALB->>+AppServer: Forward
AppServer->>+PostgreSQL: Query
PostgreSQL-->>-AppServer: Result
AppServer->>+Redis: Cache write
AppServer-->>-ALB: Response
ALB-->>-Client: HTTPS Response
```
> This diagram was auto-generated and may not capture all relationships. Review and update as the architecture evolves.
Use Glob to check for docs/agentRoster.md. If it exists, read it and include the agent roster section in the guide.
Write the completed onboarding guide to docs/ONBOARDING.md using Write, following the output structure below.
Output Structure
Write the following document to docs/ONBOARDING.md:
# Developer Onboarding Guide — <Project Name>
## What This Project Does
<1-2 sentence summary from README>
## Tech Stack
| Layer | Technology |
|-------|-----------|
| Language | ... |
| Framework | ... |
| Database | ... |
| CI/CD | ... |
## Directory Map
| Path | Purpose |
|------|---------|
| `src/` | ... |
## Getting Started
```bash
# 1. Install dependencies
npm install
# 2. Configure environment
cp .env.example .env
# Edit .env: fill in ...
# 3. Run locally
npm run dev
Key Entry Points
src/index.ts:1 — Application bootstrap
src/routes/ — API route definitions
Environment Variables
| Variable |
Required |
Description |
| DATABASE_URL |
Yes |
PostgreSQL connection string |
Key Commands
| Command |
What it does |
npm run dev |
Start dev server with hot reload |
npm test |
Run test suite |
Architecture Overview
<brief description of the main data/request flow>
Agent Roster
<include only if docs/agentRoster.md exists>
How to Contribute
<derive from the target project's own conventions — see note below>
For the "How to Contribute" section: read the target project's `CONTRIBUTING.md`, `CLAUDE.md`, or `.github/PULL_REQUEST_TEMPLATE.md` and summarize *that project's* branching, review, and merge rules. Do not assume any particular branch-prefix or approval policy. If no convention docs exist, fall back to generic guidance: "Create a branch, open a PR, and request review — confirm the team's specific conventions with a maintainer."
After writing the file, confirm to the user that `docs/ONBOARDING.md` has been created and summarize the key sections included.
1---2name: onboarding3description: Generates a comprehensive developer onboarding guide (ONBOARDING.md) by reading the codebase: directory map, entry points, environment variables, key commands, and architecture overview.4---56# Onboarding78Generate a comprehensive developer onboarding guide for an unfamiliar codebase and write it to `docs/ONBOARDING.md`.910## Instructions11121. Use Read on `README.md`, then attempt to read whichever of the following exist: `package.json`, `pyproject.toml`, `go.mod`, `CLAUDE.md`, `docs/assumptions.md`.13142. Use Glob to map the top-level directory structure (`*`). For each top-level folder found, describe its purpose based on its name and contents (e.g., `src/` → application source, `scripts/` → automation scripts, `docs/` → project documentation).15163. Use Glob to find entry points matching: `index.*`, `main.*`, `server.*`, `app.*`, `cmd/**/*`. Read the primary entry point to understand how the application starts.17184. Use Read on any Makefile, `package.json` (scripts section), or `Taskfile.yml` to identify key commands: install, run, test, build, lint.19205. Use Glob to find `.env.example` or any env var documentation files. List all required environment variables with their descriptions.2122 > **SECURITY:** Read `.env.example` only — never read `.env` or any file containing real credential values, and never include actual secret values in the generated guide. Document variable names and descriptions only.23246. Use Bash to count files by detected language type. Adapt the command to the language detected:25 - TypeScript/JavaScript: `find . -name "*.ts" -o -name "*.js" | grep -v node_modules | wc -l`26 - Python: `find . -name "*.py" | grep -v __pycache__ | wc -l`27 - Go: `find . -name "*.go" | wc -l`28297. **Generate architecture diagram.**3031 a. Use Read on the primary entry point file identified in step 3 to understand how the application initializes and what it connects to.3233 b. Use Glob to find configuration files that reveal infrastructure: `docker-compose.yml`, `*.env.example`, `infrastructure/**`, `terraform/**`, `serverless.yml`, `.github/workflows/**`.3435 c. Use Grep to identify major inter-module dependencies: import/require/use statements at the top of the entry point and primary route/handler files.3637 d. Generate a Mermaid diagram using the most appropriate type:38 - For web apps with a request flow: `sequenceDiagram` showing Client → Load Balancer → App Server → Database/Cache/Queue39 - For microservices or modular apps: `graph LR` showing service dependencies40 - For simple single-module apps: `graph TD` showing function/module call flow4142 e. Include the diagram in the generated `docs/ONBOARDING.md` under a "## Architecture" section, wrapped in a fenced code block with `mermaid` syntax tag.4344 f. Add a note: "This diagram was auto-generated and may not capture all relationships. Review and update as the architecture evolves."4546 Example output to include in ONBOARDING.md:4748 ````markdown49 ## Architecture5051 ```mermaid52 sequenceDiagram53 Client->>+ALB: HTTPS Request54 ALB->>+AppServer: Forward55 AppServer->>+PostgreSQL: Query56 PostgreSQL-->>-AppServer: Result57 AppServer->>+Redis: Cache write58 AppServer-->>-ALB: Response59 ALB-->>-Client: HTTPS Response60 ```6162 > This diagram was auto-generated and may not capture all relationships. Review and update as the architecture evolves.63 ````64658. Use Glob to check for `docs/agentRoster.md`. If it exists, read it and include the agent roster section in the guide.66679. Write the completed onboarding guide to `docs/ONBOARDING.md` using Write, following the output structure below.6869## Output Structure7071Write the following document to `docs/ONBOARDING.md`:7273```markdown74# Developer Onboarding Guide — <Project Name>7576## What This Project Does77<1-2 sentence summary from README>7879## Tech Stack80| Layer | Technology |81|-------|-----------|82| Language | ... |83| Framework | ... |84| Database | ... |85| CI/CD | ... |8687## Directory Map88| Path | Purpose |89|------|---------|90| `src/` | ... |9192## Getting Started93```bash94# 1. Install dependencies95npm install9697# 2. Configure environment98cp .env.example .env99# Edit .env: fill in ...100101# 3. Run locally102npm run dev103```104105## Key Entry Points106- `src/index.ts:1` — Application bootstrap107- `src/routes/` — API route definitions108109## Environment Variables110111| Variable | Required | Description |112|----------|----------|-------------|113| DATABASE_URL | Yes | PostgreSQL connection string |114115## Key Commands116117| Command | What it does |118|---------|-------------|119| `npm run dev` | Start dev server with hot reload |120| `npm test` | Run test suite |121122## Architecture Overview123<brief description of the main data/request flow>124125## Agent Roster126<include only if docs/agentRoster.md exists>127128## How to Contribute129<derive from the target project's own conventions — see note below>130```131132For the "How to Contribute" section: read the target project's `CONTRIBUTING.md`, `CLAUDE.md`, or `.github/PULL_REQUEST_TEMPLATE.md` and summarize *that project's* branching, review, and merge rules. Do not assume any particular branch-prefix or approval policy. If no convention docs exist, fall back to generic guidance: "Create a branch, open a PR, and request review — confirm the team's specific conventions with a maintainer."133134After writing the file, confirm to the user that `docs/ONBOARDING.md` has been created and summarize the key sections included.