Creates and maintains a Karpathy-style docs/index.md for any codebase — a compact, agent-readable wiki that enables progressive disclosure. Use this skill when the user invokes /doc-init, /doc-update, /doc-audit, or mentions "initialise la doc", "mets à jour l'index", "scanne la codebase", "crée un index de la codebase". Also trigger when docs/index.md is missing or stale. Slash commands /doc-init, /doc-update, /doc-audit are the primary entry points — this skill provides the detailed instructions for each.
This skill creates a docs/index.md — a compact Karpathy-style wiki index that lets any LLM agent navigate a codebase without scanning everything every session. Think of it as replacing RAG with a human-maintained, structured map.
The architecture mirrors how Claude Code skills work:
CLAUDE.md → always loaded, contains project conventions + pointer to the indexdocs/index.md → loaded on demand, one-line summary per component/docRead references/file-conventions.md before creating or editing any doc files.
/doc init — Initialize the wiki (three depths)Choose the depth based on codebase size and available time.
--quick (fastest, ~1-2 min)Use when: large codebase, just want an arborescence, first pass.
Steps:
node_modules.gitCLAUDE.md / README.md at each levelCLAUDE.md you find (for status/description)docs/index.md with: arborescence table + status column (active / legacy / archive / unknown)<!-- todo -->Use when: medium codebase, starting a new project, first real working session.
Steps:
CLAUDE.md or README.md (first 20 lines max)docs/ (excluding archive/): read its frontmatter only (first 5 lines)docs/index.md with descriptions filled in from what you readdocs/ file that doesn't have one yet (see references/file-conventions.md)@docs/index.md import to root CLAUDE.md if it's not already there--deep (comprehensive, ~15-30 min)Use when: onboarding to an unfamiliar codebase, doing a full audit, creating the definitive index.
Steps:
CLAUDE.md and the first 30 lines of its main entry point (e.g., index.ts, app.tsx, main.py)docs/ (excluding archive/): read the full filedocs/index.md — add a "notes" column with key architectural decisions or gotchas/doc update — Update the wiki after a sessionUse when: end of a working session, after adding/modifying files, when the user asks to "update the index".
Steps:
git diff --name-only HEAD or recall from session context)docs/index.md: update its description and last_updatedarchiveddocs/index.md header line: Last updated: YYYY-MM-DDCLAUDE.md was changed: verify the @docs/index.md import is still presentKeep the update scoped — don't rescan the whole codebase. Only touch what changed.
Always use this exact structure:
# Codebase Index
Last updated: YYYY-MM-DD
## Active
| Path | Description | Status |
|------|-------------|--------|
| `web/` | Next.js app, main product surface | active |
| `server-analyzer/` | TikTok scraping + GPT analysis | active |
| `docs/superpowers/specs/2026-04-11-*.md` | Product spec, read first | reference |
## Sub-project docs
| Path | Description | Status |
|------|-------------|--------|
| `web/CLAUDE.md` | Web conventions, routing, i18n rules | active |
| `server-analyzer/CLAUDE.md` | API endpoints, LLM model config | active |
## Legacy / Archive
| Path | Description | Status |
|------|-------------|--------|
| `server-primary/` | Old backend, do not extend | legacy |
| `editia-core/` | Shared package, migrating to Convex | legacy |
| `docs/archive/` | Previous pivot docs | archive |
Rules:
## Legacy / Archive section — it tells agents what NOT to touchAfter running /doc init, add this line near the top of the root CLAUDE.md, right after the project description:
For codebase navigation: @docs/index.md
This uses Claude Code's @import syntax — the index is pulled into context on demand, not always. The root CLAUDE.md stays minimal (conventions, commands, gotchas only — see best practices below).
Based on Claude Code best practices — use this when creating or reviewing any CLAUDE.md, GEMINI.md, or AGENTS.md:
Include:
Exclude:
docs/index.md is forThe test: for each line in CLAUDE.md, ask: "Would removing this cause the agent to make mistakes?" If not, cut it.
Size: if CLAUDE.md is over ~100 lines, critical rules get lost. Use @import to split into topic files. Never put the codebase map in CLAUDE.md — keep it in docs/index.md.
See references/file-conventions.md for the frontmatter spec and naming rules.