1---2name: codebase-onboarding3description: Auto-generate onboarding documentation from codebase analysis, tailored to the reader's experience level. TRIGGER when: user asks to onboard someone to a codebase, document this codebase, generate project documentation for new team members, write a codebase walkthrough or tour, create a getting-started guide, or explain a codebase to a specific audience. DO NOT TRIGGER when: user wants API reference docs (use language-specific tooling), or wants to understand a single file (just read it).4---56# codebase-onboarding78Auto-generate onboarding documentation from codebase analysis. Audience-aware9output for junior developers, senior engineers, and contractors.1011## What You Get1213- Architecture overview derived from actual code structure14- Key entry points and control flow15- Testing strategy and deployment process16- Domain glossary extracted from code and comments17- Audience-tailored depth and focus1819## Workflow20211. **Analyze** -- Scan the codebase to discover stack, structure, and patterns222. **Capture signals** -- Identify entry points, config files, CI/CD, test23 patterns, dependency graph, domain terms243. **Fill template** -- Populate the output format sections254. **Tailor** -- Adjust depth and emphasis for the target audience2627## Analysis signals2829| Signal | Where to look |30| ------------------ | -------------------------------------------------- |31| Language/framework | package.json, mix.exs, go.mod, Cargo.toml, pyproject.toml |32| Entry points | main files, router definitions, CLI entry points |33| Config | .env.example, config/, settings files |34| CI/CD | .github/workflows/, Makefile, Dockerfile |35| Tests | test/, spec/, __tests__/, *_test.go |36| Database | migrations/, schema files, ORM models |37| API surface | OpenAPI specs, GraphQL schema, route definitions |38| Domain terms | README, doc comments, module names, type names |39| Dependencies | Lock files, vendor/, package manifests |40| Dev setup | Makefile, docker-compose.yml, devcontainer.json |4142## Rules43441. Derive everything from the actual codebase -- do not fabricate452. Flag gaps explicitly ("No CI/CD configuration found")463. Keep the glossary to terms a newcomer would not know474. Link to actual files using relative paths485. If the audience is not specified, ask before generating4950## Reference5152| File | Topic |53|------|-------|54| [audience-profiles.md](audience-profiles.md) | Junior/Senior/Contractor focus areas |55| [output-template.md](output-template.md) | Markdown template for the onboarding doc |