$npx -y skills add tobihagemann/turbo --skill map-codebaseDeep architecture report that fans out parallel inspections across different aspects of the codebase (structure, tech stack, APIs, patterns, data flow, dependencies, testing) and synthesizes findings into a comprehensive document at .turbo/codebase-map.md and .turbo/codebase-map.
| 1 | # Map Codebase |
| 2 | |
| 3 | Deep architecture report. Fans out parallel inspections across different aspects of the codebase, synthesizes their findings, and writes `.turbo/codebase-map.md` and `.turbo/codebase-map.html`. Analysis-only. |
| 4 | |
| 5 | ## Task Tracking |
| 6 | |
| 7 | At the start, use `TaskCreate` to create a task for each phase: |
| 8 | |
| 9 | 1. Scope |
| 10 | 2. Launch inspection agents |
| 11 | 3. Synthesize and generate markdown report |
| 12 | 4. Generate HTML report |
| 13 | |
| 14 | ## Step 1: Scope |
| 15 | |
| 16 | If `$ARGUMENTS` specifies paths, use those directly (skip the question). |
| 17 | |
| 18 | Otherwise, use `AskUserQuestion` to confirm scope: |
| 19 | |
| 20 | - **Entire codebase** — inspect everything |
| 21 | - **Specific paths** — user provides directories or file patterns |
| 22 | |
| 23 | Once scope is determined, glob for source files in the selected scope. Exclude generated and vendored directories (`node_modules/`, `dist/`, `build/`, `vendor/`, `__pycache__/`, `.build/`, `DerivedData/`, `target/`, `.tox/`, and others appropriate to the project). |
| 24 | |
| 25 | Build a file manifest grouped by top-level source directory. This manifest is shared with all agents as a starting point. Agents may explore beyond it based on what they discover. |
| 26 | |
| 27 | ## Step 2: Launch Inspection Agents |
| 28 | |
| 29 | Use the Agent tool to launch all 7 agents below in a single assistant message so they run concurrently. Run them in the foreground so all their results return in this turn. Each Agent call uses `model: "opus"`. Each agent receives the scoped file manifest and its exploration brief, and its prompt directs it to treat the shared working tree and its git index as read-only — any empirical check runs in an isolated `git worktree` the agent discards afterward. |
| 30 | |
| 31 | ### Dimensions |
| 32 | |
| 33 | Launch one agent per dimension. Each agent's prompt provides the file manifest and the exploration brief below. Agents explore adaptively: go deeper where complexity warrants it, stay high-level where things are straightforward. Findings should be concrete (reference specific files and directories) rather than generic. |
| 34 | |
| 35 | | # | Dimension | Exploration Brief | |
| 36 | |---|---|---| |
| 37 | | 1 | Project Structure | Map directory layout, module organization, naming conventions, and file roles. Identify the organizing principle (feature-based, layer-based, hybrid). Note generated or build output directories. | |
| 38 | | 2 | Tech Stack and Build System | Identify languages, frameworks, package managers, build tools, and runtime requirements. Note version constraints and compatibility targets. | |
| 39 | | 3 | Entry Points and Public API | Find how the system is invoked: CLI commands, HTTP endpoints, event handlers, exported modules, main functions. Map the public surface area. | |
| 40 | | 4 | Core Abstractions and Patterns | Identify key types, classes, interfaces, and design patterns. Note architectural patterns (MVC, plugin system, pipeline, etc.) and how they shape the code. | |
| 41 | | 5 | Data Flow and State | Trace how data enters, transforms, persists, and exits the system. Identify state management approaches, storage layers, and data boundaries. | |
| 42 | | 6 | External Dependencies and Integrations | Map third-party services, APIs, databases, and system boundaries. Note how external dependencies are abstracted or coupled. | |
| 43 | | 7 | Testing and Quality Infrastructure | Describe the test strategy: frameworks, coverage approach, test organization, CI/CD pipeline. Note gaps or unusual patterns. | |
| 44 | |
| 45 | Each agent writes its findings as structured markdown with sections and subsections. |
| 46 | |
| 47 | ## Step 3: Synthesize and Generate Markdown Report |
| 48 | |
| 49 | After all agents complete: |
| 50 | |
| 51 | 1. Read all agent reports. |
| 52 | 2. Identify cross-cutting themes, connections between dimensions, and architectural trade-offs. |
| 53 | 3. Write a brief executive summary (3-5 sentences) capturing the system's essential character. |
| 54 | 4. Resolve contradictions or overlaps between dimension reports. |
| 55 | 5. Write `.turbo/codebase-map.md` using the report template. Output the executive summary as text before writing the file. |
| 56 | |
| 57 | ### Report Template |
| 58 | |
| 59 | ```markdown |
| 60 | # Codebase Map |
| 61 | |
| 62 | **Date:** <date> |
| 63 | **Scope:** <what was inspected> |
| 64 | |
| 65 | ## Executive Summary |
| 66 | |
| 67 | <3-5 sentences: what the system is, how it's organized, what architectural choices define it> |
| 68 | |
| 69 | ## Project Structure |
| 70 | |
| 71 | <from dimension 1> |
| 72 | |
| 73 | ## Tech Stack |
| 74 | |
| 75 | <from dimension 2> |
| 76 | |
| 77 | ## Entry Points and API |
| 78 | |
| 79 | <from dimension 3> |
| 80 | |
| 81 | ## Core Abstractions |
| 82 | |
| 83 | <from dimension 4> |
| 84 | |
| 85 | ## Data Flow |
| 86 | |
| 87 | <from dimension 5> |
| 88 | |
| 89 | ## External Dependencies |
| 90 | |
| 91 | <from dimension 6> |
| 92 | |
| 93 | ## Testing and Quality |
| 94 | |
| 95 | <from dimension 7> |
| 96 | |
| 97 | ## Cross-Cutting Observations |
| 98 | |
| 99 | <themes, trade-offs, and connections identified during synthesis> |
| 100 | ``` |