Skip to content
Back to skills

Codebase Onboarding

ASecurity

Gathers facts about a codebase (stack, layers, entry points, setup gaps) and turns them into onboarding docs: architecture overview, file map, setup guide, debugging guide. Use when onboarding engineers, re-documenting after a refactor, or checking whether a repo can be set up from its own files.

  • 1,271 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added May 27, 2026
data-aipythongoshellbashsqldockerdebugginggitapisecurity

Works with

  • cli
  • api

Security analysis

A96/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 4 files and shows the line behind each finding

Scanned December 4, 2026

npx -y skills add borghei/Claude-Skills --skill codebase-onboarding --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Codebase Onboarding?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Codebase Onboarding
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/borghei-codebase-onboarding/badge)](https://www.skillsdirectory.com/skills/borghei-codebase-onboarding)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: codebase-onboarding
description: >
  Gathers facts about a codebase (stack, layers, entry points, setup gaps) and turns them into
  onboarding docs: architecture overview, file map, setup guide, debugging guide. Use when
  onboarding engineers, re-documenting after a refactor, or checking whether a repo can be set
  up from its own files.
license: MIT + Commons Clause
metadata:
  version: 1.1.0
  author: borghei
  category: engineering
  domain: developer-experience
  tier: POWERFUL
  updated: 2026-11-08
  frameworks: markdown, notion, confluence
  tags:
    - onboarding
    - documentation
    - architecture
    - runbooks
    - developer-experience
---
# Codebase Onboarding

Analyze any codebase and generate production-quality onboarding documentation tailored to the audience. Produces architecture overviews with system diagrams, annotated key file maps, step-by-step local setup guides, common developer task runbooks, debugging guides with real error solutions, and contribution guidelines. Supports Markdown, Notion, and Confluence output formats.

## Core Capabilities

- **Architecture analysis** — tech stack identification from manifests/lockfiles, system boundary mapping, Mermaid data-flow diagrams, dependency graphs, module ownership.
- **Key file annotation** — surface the 20 most important files and why they matter; mark entry points, config hubs, shared utilities, and files dangerous to modify without coordination.
- **Setup guide generation** — prerequisites with exact versions, `git clone`-to-tests steps, env-var docs, infra setup (Docker/DB/cache), and a verification checklist.
- **Task runbooks** — add an API endpoint, run/write tests, create & apply migrations, deploy to staging/production, add a dependency safely.
- **Debugging guide** — common errors with exact messages and fixes, log locations by environment, diagnostic SQL/CLI queries, local reproduction of production issues.
- **Audience-aware output** — tailored additions for junior developers, senior engineers, and contractors; Markdown / Notion / Confluence formats.

**Keywords:** codebase onboarding, developer experience, documentation, architecture overview, setup guide, debugging guide, contribution guidelines, code walkthrough, new hire onboarding

## When to Use

- Onboarding a new team member (junior, senior, or contractor)
- After a major refactor that made existing docs stale
- Before open-sourcing a project
- Creating a team wiki page for a service you own
- Self-documenting before a long vacation or team transition
- Preparing for a compliance audit that requires documentation

## Clarify First

Before generating the docs, settle the inputs below. When one is missing or vague and would change the result, ask about it; when it wouldn't, use a sensible default and say which one you used.

- **Target codebase path:** which project to analyze (the input all three scripts scan).
- **Audience:** junior developer, senior engineer, or contractor (tailors which sections appear and at what depth).
- **Where the docs live:** repo Markdown, Notion or Confluence (changes headings, links and how much goes in one page).

Ask about the two or three inputs that matter most for this request, not the whole list. If the user wants a result straight away, produce it and state your assumptions at the top.

## Quick Start Workflow

The scripts gather facts. `onboarding_generator.py --format markdown` turns them into a draft guide:
sections the repo can answer (README summary, stack, declared run commands, env variables, entry
points, layout) are filled in, and everything it cannot know is a `> **TODO (owner):**` line. The
finished guide is yours: replace every TODO from reading the code and asking the owners, using the
templates in `references/documentation-templates.md`.

```bash
# 1. Facts report: stack, frameworks, entry points, key files, file-type spread, gaps with fixes
python3 scripts/onboarding_generator.py /path/to/project
#    Draft guide with TODO placeholders
python3 scripts/onboarding_generator.py assets/sample_project --format markdown > ONBOARDING.md

# 2. Architecture patterns and layers by directory (also looks one level inside src/, app/, lib/)
python3 scripts/architecture_mapper.py /path/to/project --format json

# 3. Setup completeness checklist: README, .env template, lockfile, CI, lint, tests, licence
python3 scripts/setup_validator.py /path/to/project
```

Real output of `python3 scripts/setup_validator.py assets/sample_project` (tail):

```
Next actions (ranked):
  1. README.md has under 3 non-empty lines; add what the project is, how to install, run and test it
  2. Run: echo '.env' >> .gitignore (stops accidental secret commits)
  3. Generate and commit the lock file (npm install / poetry lock / uv lock / go mod tidy)

FIX 8 of 11 setup checks
```

## Tools Overview

| Tool | Gives you | Use it for |
|------|-----------|------------|
| `onboarding_generator.py` | Stack, frameworks, entry points, key files, top-level dirs, package.json scripts, Makefile targets, env-template keys, README summary, gaps with a fix each; `--format text\|json\|markdown` | The draft guide (`markdown`) and the key file map |
| `architecture_mapper.py` | Pattern signals (monorepo, microservices, MVC, layered), per-directory layer roles, dependency names, a Mermaid diagram (arrows are an assumed flow, not read from imports) | The architecture overview and its diagram |
| `setup_validator.py` | Pass/warn/fail per check with the exact fix; no numeric score | The setup guide, and the gaps to fix before the guide is honest |

All take a directory (default `.`) and `--format text|json` (`--json` is an alias).
Sample inputs live in `assets/`: `sound_project/` (exit 0), `flawed_project/` (exit 1),
`malformed_project.txt` (exit 2), `sample_project/` (the draft-guide demo).

## Exit Codes

| Code | Meaning |
|------|---------|
| 0 | Nothing to fix (setup_validator: every check passes; architecture_mapper: layers or a pattern recognised; onboarding_generator: stack, entry points, README, run commands and env keys all found). `--format markdown` always exits 0 on success. |
| 1 | Findings printed, each with a fix and a final `FIX n ...` verdict line. |
| 2 | Unusable input: the path is not a directory, or it holds no files. One-line message on stderr. |

For an ordered reading path through the code (stop-by-stop tour), use `engineering/code-tour`
instead; this skill produces the reference documents a newcomer keeps open.

**Done when:**
1. No `TODO (owner)` line is left in the guide.
2. A newcomer can go from clone to a passing local test run using only the setup guide (try it in a clean checkout or container).
3. Every path in the key file map exists, and every command in the docs ran as written.
4. The architecture overview names the real entry points and data stores, checked against the code, not only the scripts' heuristics.
5. Setup gaps that `setup_validator.py` reports are fixed or listed as known issues.

## Anti-Patterns

### Docs from heuristics alone
**Mistake:** Pasting the scripts' output as the onboarding guide.
**Why it happens:** It looks complete and took seconds.
**Instead:** Use the output as a checklist of facts to confirm, then read the entry points and write the guide in plain language.

### A setup guide nobody ran
**Mistake:** Setup steps written from memory, missing the one environment variable everyone already has.
**Why it happens:** The author's machine has been set up for years.
**Instead:** Follow the guide in a clean container or fresh checkout and fix every step that fails.

### Listing every file
**Mistake:** A key file map with two hundred entries.
**Why it happens:** Completeness feels safer than choosing.
**Instead:** List the ten to twenty files a newcomer touches in the first week, each with one line on why it matters.

## Files

- `scripts/onboarding_generator.py`, `scripts/architecture_mapper.py`, `scripts/setup_validator.py` — the three fact-gathering CLIs above.
- `assets/sound_project/`, `assets/flawed_project/`, `assets/malformed_project.txt`, `assets/sample_project/` — sample inputs; `assets/contract.json` declares the checked runs.
- `references/` — fact-gathering commands and pattern table, document templates, quality checklist.

## Reference Documentation

Load the reference that matches the task — keep this file lean and pull detail on demand:

- **[references/fact-gathering-and-patterns.md](references/fact-gathering-and-patterns.md)** — the Phase 1 fact-gathering shell commands and the Phase 2 architecture-pattern classification table. Read when analyzing a codebase before writing docs.
- **[references/documentation-templates.md](references/documentation-templates.md)** — the architecture overview, key file map, local setup, and debugging guide templates plus audience-specific (junior/senior/contractor) additions. Read when generating the actual onboarding documents.
- **[references/quality-and-best-practices.md](references/quality-and-best-practices.md)** — quality verification checklist, common pitfalls, best practices, a troubleshooting matrix, and success criteria. Read before shipping onboarding docs.

## Scope & Limitations

**This skill covers:**
- Generating architecture overviews, key file maps, setup guides, task runbooks, and debugging guides from codebase analysis
- Audience-aware documentation tailored for junior developers, senior engineers, and contractors
- Markdown documents that paste cleanly into Notion or Confluence
- Quality verification checklists and freshness audit processes

**This skill does NOT cover:**
- Automated API reference generation from code annotations — see `engineering/changelog-generator` for release-oriented docs or `engineering/api-design-reviewer` for API quality
- Continuous documentation pipelines or CI-triggered doc builds — see `engineering/ci-cd-pipeline-builder` for pipeline automation
- Security-focused documentation such as threat models or access control matrices — see `engineering/skill-security-auditor` for security auditing
- Runbook generation for incident response and production operations — see `engineering/runbook-generator` for operational runbooks

## See Also

- `engineering/code-tour` — a guided, ordered walk through the code for a first read.
- `engineering/runbook-generator` — production runbooks beyond onboarding tasks.
- `engineering/ci-cd-pipeline-builder` — fix CI gaps that `setup_validator.py` reports.

Files in this skill

  • SKILL.md17.8 KB
  • scripts/architecture_mapper.py14.8 KB
  • scripts/onboarding_generator.py10.5 KB
  • scripts/setup_validator.py13.6 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in data-ai →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.