Overview
Structured codebase exploration that produces a navigable architecture overview and a "Start Here" guide. Designed for the first hour on a new project.
When to Use
- First session in a repository nobody on the current task has worked in.
- Joining a team, or picking up a take-home, an external repository, or untrusted source that needs the Phase 0 trust scan before anything else runs.
- Refreshing a mental model of a project whose structure moved since it was last read.
- For one file or function, use
/explain; for a quality score, use /assessment; for a single diff, use /review.
Arguments
- No arguments: onboard the current working directory. Phase 0 prompts before running the trust scan.
<path>: onboard the specified path as the project root.
--trust: I trust this project. Skip the trust scan and the prompt. Recorded in the final Start Here guide as a deliberate skip.
--verify: I do not trust this project. Run the trust scan without prompting. Useful for take-homes, external repos, and untrusted source.
- Passing both
--trust and --verify together is a conflict. Reject with an error.
Process
Phase 0: Trust decision (asked first)
Before any other action, ask the user whether to trust the project. The trust scan is opt-in per invocation.
Decision flow:
| Invocation |
Behavior |
/onboard <path> with no flag |
AskUserQuestion fires. Two options below. Default focus is "No, scan it first" |
/onboard <path> --trust |
Skip the prompt. Skip the scan. Continue to Step 1. The Start Here guide records Safety verdict: SKIPPED (--trust) |
/onboard <path> --verify |
Skip the prompt. Run the scan. Continue per the verdict-to-action table below |
/onboard <path> --trust --verify |
Reject with error: conflicting flags |
Prompt wording:
Do you trust this project? Picking "No, scan it first" runs a read-only scan for install-time hooks, credential-theft patterns, and known supply-chain attack signatures. Takes under 30 seconds on most projects.
Options:
| Option |
Effect |
| Yes, trust it (skip scan) |
Skip scan. Continue to Step 1. Start Here guide records Safety verdict: SKIPPED (user trusts project) |
| No, scan it first (default focus, Recommended for new or external projects) |
Call the Skill tool with audit and the arguments trust --json against the project root. Apply the verdict mapping below |
When the scan runs, map the verdict to action:
| Verdict |
/onboard action |
| SAFE |
Continue to Step 1 silently. Note the verdict in the final Start Here guide |
| SUSPICIOUS |
Present the findings to the user. Ask "Continue with onboarding?" with default no. If yes, proceed to Step 1. If no, abort |
| HIGH-RISK |
Block. Present the findings. Require the user to type the literal phrase I accept the risk before continuing |
| MALICIOUS |
Block. Present the findings. Refuse to continue. Recommend running the project inside a Docker sandbox or deleting the directory. Do not proceed to Step 1 under any circumstance |
Phase 0 constraints, apply when the scan runs:
- Never install dependencies. Never run any command defined in the project.
- Never read
.env, .env.local, or .env.production. Only .env.example.
- Never reveal actual secret values found during the scan. Show file, line, and pattern name only.
- The scan is read-only. The user's trust choice is recorded in the Start Here guide either way.
Step 1: Detect the project
Read the manifest file to determine language, framework, and runtime version. Check in order: package.json, go.mod, Cargo.toml, pyproject.toml, pom.xml, build.gradle, mix.exs, Gemfile. Record:
- Language and version
- Framework and version
- Package manager
- Runtime constraints
Step 2: Map directory structure
Run ls on the project root and each top-level directory. Classify each directory by purpose:
| Directory type |
Examples |
| Source code |
src/, lib/, app/, pkg/, internal/ |
| Tests |
test/, tests/, __tests__/, spec/ |
| Configuration |
config/, .github/, .husky/ |
| Build output |
dist/, build/, .next/, out/ |
| Documentation |
docs/, doc/ |
| Infrastructure |
infra/, terraform/, k8s/, docker/ |
| Database |
prisma/, migrations/, db/ |
| Scripts |
scripts/, bin/, tools/ |
| Static assets |
public/, static/, assets/ |
Step 3: Identify entry points
Find the files where execution begins:
main field in package.json
- Files named
main.ts, index.ts, app.ts, server.ts, main.go, main.rs
- Route definitions: search for router setup, controller decorators, API route files
- CLI entry points:
bin field in package.json, files with shebang lines
- Worker or job entry points: queue consumers, cron handlers
Step 4: Read configuration
Read these files in parallel when they exist:
- TypeScript config:
tsconfig.json
- Linter config:
.eslintrc*, biome.json, .prettierrc*
- Docker:
Dockerfile, docker-compose.yml
- CI:
.github/workflows/*.yml, .gitlab-ci.yml, Jenkinsfile
- Environment:
.env.example
- Database:
prisma/schema.prisma, migration files
Step 5: Generate architecture diagram
Produce a Mermaid diagram showing:
- Modules and their responsibilities
- Dependencies between modules
- External services and integrations
- Data flow direction
Use graph TD for layered architectures, graph LR for pipeline architectures. Label edges with the type of interaction: HTTP, event, import, query.
Step 6: Identify patterns
Search the codebase for structural patterns:
| Pattern |
How to detect |
| Repository |
Files named *.repository.ts, *.repo.go, data access abstractions |
| Service layer |
Files named *.service.ts, *.svc.go, business logic classes |
| Controller |
Files named *.controller.ts, route handlers |
| Middleware |
Files in middleware/ directories, request interceptors |
| Event handlers |
Files subscribing to events, queue consumers |
| State machines |
Enum-based state transitions, status fields with defined flows |
| DTOs |
Files named *.dto.ts, input/output shapes at boundaries |
| Guards/interceptors |
Auth guards, validation interceptors, logging interceptors |
Step 7: Read existing documentation
Read in parallel: README.md, CONTRIBUTING.md, ARCHITECTURE.md, docs/ directory contents, CLAUDE.md. Note what is documented and what is missing.
Step 8: Detect conventions
Identify the project's conventions by sampling 5-10 source files:
- Naming: camelCase vs snake_case, file naming patterns
- File structure: one export per file, barrel files, feature-based vs layer-based
- Test patterns: co-located tests vs separate test directory, naming convention
- Import style: relative vs absolute, path aliases
- Error handling: exceptions vs Result types, error classes
Step 9: Output the Start Here guide
Produce a structured guide with these sections:
- What This Project Does: one paragraph summary of the project's purpose
- Tech Stack: language, framework, database, key dependencies
- Architecture: the Mermaid diagram from Step 5 with a brief explanation
- Key Patterns: list each pattern found in Step 6 with an example file
- How to Run: commands to install, configure, and start the project
- How to Test: test commands, test database setup, coverage commands
- Where to Start Reading: the 3-5 most important files to read first, ordered
- Conventions to Follow: the conventions detected in Step 8
Step 10: Suggest next steps
Recommend running /retro discover to capture the detected conventions as durable rules in the project's configuration.
Rules
- Phase 0 prompts the user before any scan runs. The default option in the prompt is "No, scan it first", aligned with the protective intent for unknown projects.
- The user can pre-decide non-interactively with
--trust, skip scan or --verify, run scan. Passing both is a conflict.
- When the scan runs and returns HIGH-RISK or MALICIOUS, abort onboarding even if the user pressures to continue. The HIGH-RISK override path requires the explicit phrase. MALICIOUS has no override.
- Never modify any project files during onboarding. This is a read-only exploration.
- Do not install dependencies or run build commands unless the user asks.
- When documentation is incomplete or contradicts the code, trust the code.
- Flag discrepancies between docs and code as findings.
- Keep the Start Here guide under 200 lines. Link to files instead of inlining code.
- The Start Here guide must include a "Safety verdict" line near the top, summarizing the trust decision and the scan result if applicable.
Common Rationalizations
- "The repository comes from a well-known organization, the trust question is noise": Phase 0 asks on every run without a flag, and the default focus is the scan.
- "An install would let me read the generated types": onboarding installs nothing and runs no project command unless the user asks.
- "The README says the service uses X, so it does": when the docs and the code disagree, the code wins, and the mismatch becomes a finding.
- "Inlining the key functions saves the reader a click": the guide links to files and stays under 200 lines.
- "The user insists, so the MALICIOUS verdict can be waived": MALICIOUS has no override, and HIGH-RISK continues only on the literal phrase
I accept the risk.
Red Flags
- Stop and ask the trust question when no flag was passed and no other step has run.
- Stop and reject the invocation when both
--trust and --verify were passed.
- Stop and wait for the literal phrase
I accept the risk when the scan returns HIGH-RISK.
- Stop onboarding and recommend a Docker sandbox or deleting the directory when the scan returns MALICIOUS.
- Stop and read
.env.example instead when the next read targets .env, .env.local, or .env.production.
Verification
- The Start Here guide carries a
Safety verdict line near the top that matches the Phase 0 outcome.
- The guide has all eight sections from Step 9 and stays under 200 lines.
- Every file named under Where to Start Reading exists on disk.
- The Mermaid diagram labels every edge with its interaction type.
git status shows no project file modified by the onboarding run.
- Every mismatch found between the docs and the code is listed as a finding.
Related skills
/audit trust -- Untrusted-project safety scan. Runs automatically as Phase 0. Can also be invoked standalone before adding a new dependency or considering a third-party project.
/explain -- Deep explanation of a specific file or function.
/assessment -- Full quality assessment of the codebase.
/retro discover -- Capture conventions as rules.
/review -- Review specific code changes.
1---2name: onboard3description: Onboard to a new codebase with structured exploration. Scans the project, generates an architecture map with Mermaid diagrams, identifies entry points, explains the tech stack, lists key patterns and conventions, and produces a "start here" guide. Use when user says "onboard", "new project", "understand this codebase", "what does this project do", "walk me through the project", "project overview", or joins a new team or repository. For explaining a single file, use /explain; for code review, use /review; for assessment, use /assessment.4argument-hint: "/onboard | /onboard <path> --verify | /onboard <path> --trust"5allowed-tools: "Read, Grep, Glob, Bash, AskUserQuestion, Skill"6metadata:7 source: https://skillmd.com/skills/gufranco/onboard8---910## Overview1112Structured codebase exploration that produces a navigable architecture overview and a "Start Here" guide. Designed for the first hour on a new project.1314## When to Use1516- First session in a repository nobody on the current task has worked in.17- Joining a team, or picking up a take-home, an external repository, or untrusted source that needs the Phase 0 trust scan before anything else runs.18- Refreshing a mental model of a project whose structure moved since it was last read.19- For one file or function, use `/explain`; for a quality score, use `/assessment`; for a single diff, use `/review`.2021## Arguments2223- No arguments: onboard the current working directory. Phase 0 prompts before running the trust scan.24- `<path>`: onboard the specified path as the project root.25- `--trust`: I trust this project. Skip the trust scan and the prompt. Recorded in the final Start Here guide as a deliberate skip.26- `--verify`: I do not trust this project. Run the trust scan without prompting. Useful for take-homes, external repos, and untrusted source.27- Passing both `--trust` and `--verify` together is a conflict. Reject with an error.2829## Process3031### Phase 0: Trust decision (asked first)3233Before any other action, ask the user whether to trust the project. The trust scan is opt-in per invocation.3435**Decision flow:**3637| Invocation | Behavior |38|------------|----------|39| `/onboard <path>` with no flag | AskUserQuestion fires. Two options below. Default focus is "No, scan it first" |40| `/onboard <path> --trust` | Skip the prompt. Skip the scan. Continue to Step 1. The Start Here guide records `Safety verdict: SKIPPED (--trust)` |41| `/onboard <path> --verify` | Skip the prompt. Run the scan. Continue per the verdict-to-action table below |42| `/onboard <path> --trust --verify` | Reject with error: conflicting flags |4344**Prompt wording:**4546> Do you trust this project? Picking "No, scan it first" runs a read-only scan for install-time hooks, credential-theft patterns, and known supply-chain attack signatures. Takes under 30 seconds on most projects.4748Options:4950| Option | Effect |51|--------|--------|52| Yes, trust it (skip scan) | Skip scan. Continue to Step 1. Start Here guide records `Safety verdict: SKIPPED (user trusts project)` |53| No, scan it first (default focus, Recommended for new or external projects) | Call the Skill tool with `audit` and the arguments `trust --json` against the project root. Apply the verdict mapping below |5455**When the scan runs**, map the verdict to action:5657| Verdict | `/onboard` action |58|---------|-------------------|59| SAFE | Continue to Step 1 silently. Note the verdict in the final Start Here guide |60| SUSPICIOUS | Present the findings to the user. Ask "Continue with onboarding?" with default no. If yes, proceed to Step 1. If no, abort |61| HIGH-RISK | Block. Present the findings. Require the user to type the literal phrase `I accept the risk` before continuing |62| MALICIOUS | Block. Present the findings. Refuse to continue. Recommend running the project inside a Docker sandbox or deleting the directory. Do not proceed to Step 1 under any circumstance |6364**Phase 0 constraints, apply when the scan runs:**6566- Never install dependencies. Never run any command defined in the project.67- Never read `.env`, `.env.local`, or `.env.production`. Only `.env.example`.68- Never reveal actual secret values found during the scan. Show file, line, and pattern name only.69- The scan is read-only. The user's trust choice is recorded in the Start Here guide either way.7071### Step 1: Detect the project7273Read the manifest file to determine language, framework, and runtime version. Check in order: `package.json`, `go.mod`, `Cargo.toml`, `pyproject.toml`, `pom.xml`, `build.gradle`, `mix.exs`, `Gemfile`. Record:7475- Language and version76- Framework and version77- Package manager78- Runtime constraints7980### Step 2: Map directory structure8182Run `ls` on the project root and each top-level directory. Classify each directory by purpose:8384| Directory type | Examples |85|---------------|----------|86| Source code | `src/`, `lib/`, `app/`, `pkg/`, `internal/` |87| Tests | `test/`, [`tests/`](../../tests), `__tests__/`, `spec/` |88| Configuration | `config/`, [`.github/`](../../.github), `.husky/` |89| Build output | `dist/`, `build/`, `.next/`, `out/` |90| Documentation | [`docs/`](../../docs), `doc/` |91| Infrastructure | `infra/`, `terraform/`, `k8s/`, `docker/` |92| Database | `prisma/`, `migrations/`, `db/` |93| Scripts | [`scripts/`](../../scripts), `bin/`, [`tools/`](../../tools) |94| Static assets | `public/`, `static/`, `assets/` |9596### Step 3: Identify entry points9798Find the files where execution begins:99100- `main` field in package.json101- Files named `main.ts`, `index.ts`, `app.ts`, `server.ts`, `main.go`, `main.rs`102- Route definitions: search for router setup, controller decorators, API route files103- CLI entry points: `bin` field in package.json, files with shebang lines104- Worker or job entry points: queue consumers, cron handlers105106### Step 4: Read configuration107108Read these files in parallel when they exist:109110- TypeScript config: `tsconfig.json`111- Linter config: `.eslintrc*`, `biome.json`, `.prettierrc*`112- Docker: `Dockerfile`, `docker-compose.yml`113- CI: `.github/workflows/*.yml`, `.gitlab-ci.yml`, `Jenkinsfile`114- Environment: `.env.example`115- Database: `prisma/schema.prisma`, migration files116117### Step 5: Generate architecture diagram118119Produce a Mermaid diagram showing:120121- Modules and their responsibilities122- Dependencies between modules123- External services and integrations124- Data flow direction125126Use `graph TD` for layered architectures, `graph LR` for pipeline architectures. Label edges with the type of interaction: HTTP, event, import, query.127128### Step 6: Identify patterns129130Search the codebase for structural patterns:131132| Pattern | How to detect |133|---------|--------------|134| Repository | Files named `*.repository.ts`, `*.repo.go`, data access abstractions |135| Service layer | Files named `*.service.ts`, `*.svc.go`, business logic classes |136| Controller | Files named `*.controller.ts`, route handlers |137| Middleware | Files in `middleware/` directories, request interceptors |138| Event handlers | Files subscribing to events, queue consumers |139| State machines | Enum-based state transitions, status fields with defined flows |140| DTOs | Files named `*.dto.ts`, input/output shapes at boundaries |141| Guards/interceptors | Auth guards, validation interceptors, logging interceptors |142143### Step 7: Read existing documentation144145Read in parallel: [`README.md`](../../README.md), `CONTRIBUTING.md`, `ARCHITECTURE.md`, [`docs/`](../../docs) directory contents, [`CLAUDE.md`](../../CLAUDE.md). Note what is documented and what is missing.146147### Step 8: Detect conventions148149Identify the project's conventions by sampling 5-10 source files:150151- Naming: camelCase vs snake_case, file naming patterns152- File structure: one export per file, barrel files, feature-based vs layer-based153- Test patterns: co-located tests vs separate test directory, naming convention154- Import style: relative vs absolute, path aliases155- Error handling: exceptions vs Result types, error classes156157### Step 9: Output the Start Here guide158159Produce a structured guide with these sections:1601611. **What This Project Does**: one paragraph summary of the project's purpose1622. **Tech Stack**: language, framework, database, key dependencies1633. **Architecture**: the Mermaid diagram from Step 5 with a brief explanation1644. **Key Patterns**: list each pattern found in Step 6 with an example file1655. **How to Run**: commands to install, configure, and start the project1666. **How to Test**: test commands, test database setup, coverage commands1677. **Where to Start Reading**: the 3-5 most important files to read first, ordered1688. **Conventions to Follow**: the conventions detected in Step 8169170### Step 10: Suggest next steps171172Recommend running `/retro discover` to capture the detected conventions as durable rules in the project's configuration.173174## Rules175176- Phase 0 prompts the user before any scan runs. The default option in the prompt is "No, scan it first", aligned with the protective intent for unknown projects.177- The user can pre-decide non-interactively with `--trust`, skip scan or `--verify`, run scan. Passing both is a conflict.178- When the scan runs and returns HIGH-RISK or MALICIOUS, abort onboarding even if the user pressures to continue. The HIGH-RISK override path requires the explicit phrase. MALICIOUS has no override.179- Never modify any project files during onboarding. This is a read-only exploration.180- Do not install dependencies or run build commands unless the user asks.181- When documentation is incomplete or contradicts the code, trust the code.182- Flag discrepancies between docs and code as findings.183- Keep the Start Here guide under 200 lines. Link to files instead of inlining code.184- The Start Here guide must include a "Safety verdict" line near the top, summarizing the trust decision and the scan result if applicable.185186## Common Rationalizations187188- "The repository comes from a well-known organization, the trust question is noise": Phase 0 asks on every run without a flag, and the default focus is the scan.189- "An install would let me read the generated types": onboarding installs nothing and runs no project command unless the user asks.190- "The README says the service uses X, so it does": when the docs and the code disagree, the code wins, and the mismatch becomes a finding.191- "Inlining the key functions saves the reader a click": the guide links to files and stays under 200 lines.192- "The user insists, so the MALICIOUS verdict can be waived": MALICIOUS has no override, and HIGH-RISK continues only on the literal phrase `I accept the risk`.193194## Red Flags195196- Stop and ask the trust question when no flag was passed and no other step has run.197- Stop and reject the invocation when both `--trust` and `--verify` were passed.198- Stop and wait for the literal phrase `I accept the risk` when the scan returns HIGH-RISK.199- Stop onboarding and recommend a Docker sandbox or deleting the directory when the scan returns MALICIOUS.200- Stop and read `.env.example` instead when the next read targets `.env`, `.env.local`, or `.env.production`.201202## Verification203204- The Start Here guide carries a `Safety verdict` line near the top that matches the Phase 0 outcome.205- The guide has all eight sections from Step 9 and stays under 200 lines.206- Every file named under Where to Start Reading exists on disk.207- The Mermaid diagram labels every edge with its interaction type.208- `git status` shows no project file modified by the onboarding run.209- Every mismatch found between the docs and the code is listed as a finding.210211## Related skills212213- `/audit trust` -- Untrusted-project safety scan. Runs automatically as Phase 0. Can also be invoked standalone before adding a new dependency or considering a third-party project.214- `/explain` -- Deep explanation of a specific file or function.215- `/assessment` -- Full quality assessment of the codebase.216- `/retro discover` -- Capture conventions as rules.217- `/review` -- Review specific code changes.