From serena-wiki
This skill should be used when the user asks to "scan the codebase", "build the wiki", "populate the wiki", "deep scan", "document the codebase", "generate wiki pages", "analyze the codebase for the wiki", "fill in the wiki", "wiki scan", or "wiki build". Also use after wiki-setup when the user wants to populate the wiki with codebase knowledge. Performs a deep semantic analysis of the entire codebase using Serena and writes all wiki pages as Serena memories. Dispatches parallel agents for maximum speed.
How this skill is triggered — by the user, by Claude, or both
Slash command
/serena-wiki:wiki-scanThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Perform a comprehensive scan of the codebase using Serena's semantic analysis tools and
Perform a comprehensive scan of the codebase using Serena's semantic analysis tools and write all wiki pages as Serena memories. Uses parallel agents to scan multiple areas of the codebase simultaneously for maximum speed.
All operations use Serena — both code analysis AND wiki storage. Check that Serena MCP tools
are available (prefixed mcp__plugin_serena_serena__).
If Serena is NOT available — STOP. Tell the user:
"Serena is required. Install it first:
/plugin install serena@claude-plugins-official"
mcp__plugin_serena_serena__read_memory with
memory_name: "wiki/schema". If it doesn't exist, tell the user to run wiki-setup first.wiki/schema before generating any pages — follow its conventions exactly.Before doing any analysis, you MUST ask the user these two questions:
How deep should I scan?
Full Scan — Every module, every pattern, every decision. Reads deeply into every corner of the codebase. Produces the most comprehensive wiki possible. Uses more tokens but gives you a complete knowledge base. No caps on pages.
Partial Scan — Focuses on the most important parts: main architecture, core modules, dominant patterns. Skips peripheral utilities, test helpers, and minor modules. Faster and lighter. Caps at ~15 module pages, ~5 pattern pages, ~3 decision pages.
Any specific areas to prioritize or skip?
For example: "Focus on the API and auth modules" or "Skip the test utilities" or "Everything, don't skip anything"
Wait for the user's answers before proceeding.
get_symbols_overview at depth 2-3, not just depth 1read_file when needed for deeper understandingget_symbols_overview at depth 1Goal: Map the project structure and identify module boundaries. This must be done in the main context because the results determine how to split work across agents.
mcp__plugin_serena_serena__list_dir with relative_path: ".", max_depth: 2src/, lib/, packages/*/, apps/*/__init__.py, src/*/.go files, cmd/*/, internal/*/src/, crates/*/src/main/java/*/, Gradle/Maven modulesnode_modules/, vendor/, dist/, build/, .git/, test fixturesThis is where the speed comes from. After discovery, dispatch multiple agents in parallel using the Agent tool. Each agent works independently — they can all write Serena memories concurrently without conflicts because each writes to a different memory name.
Launch up to 5 agents in a single message (all Agent tool calls in one response). Split the work like this:
Prompt the agent with:
mcp__plugin_serena_serena__get_symbols_overview on each top-level modulemcp__plugin_serena_serena__find_referencing_symbols to trace cross-module dependencieswiki/architecture/system-design via mcp__plugin_serena_serena__write_memorywiki/architecture/data-flow and pages for every significant
concern (auth, state, deployment, testing, database, etc.)Prompt the agent with:
mcp__plugin_serena_serena__get_symbols_overview (Full: depth 2-3, Partial: depth 1)mcp__plugin_serena_serena__find_referencing_symbols on key exportsmcp__plugin_serena_serena__read_file on key files for deeper understandingwiki/modules/{module-name} via mcp__plugin_serena_serena__write_memorySame as Agent 2 but with the second half of the module list.
Prompt the agent with:
mcp__plugin_serena_serena__search_for_pattern for each pattern category:
error handling, logging, auth, API, config, testing, state management, DIwiki/patterns/{name} via mcp__plugin_serena_serena__write_memorywiki/patterns/code-conventions for naming and style patternsPrompt the agent with:
mcp__plugin_serena_serena__search_for_pattern for decision markers:
WHY:, DECISION:, NOTE:, RATIONALE:, HACK:, TRADEOFF:docs/adr/, docs/decisions/ directorieswiki/decisions/{slug} via mcp__plugin_serena_serena__write_memory| Codebase size | Agents | Split strategy |
|---|---|---|
| Small (< 10 modules) | 3 | Architecture + Modules (1 agent) + Patterns & Decisions (1 agent) |
| Medium (10-25 modules) | 4 | Architecture + 2 Module batches + Patterns & Decisions combined |
| Large (25+ modules) | 5 | Architecture + 2 Module batches + Patterns + Decisions |
For small codebases, combine work into fewer agents — don't spawn 5 agents for 5 modules.
Each agent prompt MUST include:
wiki/{category}/{name} pattern to useCRITICAL: Tell each agent the exact Serena tool names with the full prefix
mcp__plugin_serena_serena__. Agents won't know the prefix unless you tell them.
After all agents complete, collect their reports. Each agent returns a list of pages created.
Use mcp__plugin_serena_serena__list_memories with topic: "wiki" to verify all memories.
Use mcp__plugin_serena_serena__write_memory to overwrite memory_name: "wiki/index":
# Wiki Index
> Last rebuilt: YYYY-MM-DD
> Total pages: N
## Overview
- wiki/overview — [summary]
## Architecture
- wiki/architecture/system-design — [summary]
[... all architecture pages from Agent 1, alphabetically]
## Modules
- wiki/modules/{name} — [summary]
[... all module pages from Agents 2+3, alphabetically]
## Patterns
- wiki/patterns/{name} — [summary]
[... all pattern pages from Agent 4, alphabetically]
## Decisions
- wiki/decisions/{slug} — [summary]
[... all decision pages from Agent 5, alphabetically]
## External
_No pages yet. Run wiki-enrich to add external context._
Use mcp__plugin_serena_serena__edit_memory on wiki/log, mode "regex", needle \Z:
## [YYYY-MM-DD HH:MM] SCAN | [Full/Partial] codebase scan completed
- Scan mode: [Full/Partial]
- Agents dispatched: N
- Generated N architecture pages
- Generated N module pages
- Generated N pattern pages
- Inferred N architectural decisions
- Total: N pages indexed
Report:
Code analysis (all prefixed mcp__plugin_serena_serena__):
list_dir — recursive directory listing with depth controlget_symbols_overview — catalog classes, functions, interfaces, types in a filefind_symbol — locate specific symbols by name pathfind_referencing_symbols — trace who calls/imports a symbol (dependency chains)search_for_pattern — regex search across the codebaseread_file — read file contents with optional line rangesWiki CRUD (all prefixed mcp__plugin_serena_serena__):
write_memory — create a wiki page: memory_name: "wiki/{category}/{name}"read_memory — read a wiki pageedit_memory — update a wiki page by pattern matchinglist_memories — browse wiki pages by topicdelete_memory — remove a wiki pagereferences/scan-strategy.md for ecosystem-specific guidancenpx claudepluginhub snowtumb/karpathy-serena-wiki --plugin serena-wikiAnalyzes code repositories to generate hierarchical wiki catalogs and onboarding guides for contributors, staff engineers, executives, and more.
Generates structured JSON wiki catalogues and onboarding guides from codebases, including principal-level overviews, zero-to-hero paths, architecture diagrams, and deep subsystem dives.
Generates wiki-style documentation for any codebase using phased workflow: repo scan, TOC design, doc generation, Mermaid validation, summary, and incremental updates. Useful for new projects, overviews, or post-change syncs.