18.2 Creating a system-level map (modules, dependencies, entrypoints)

Overview and links for this section of the guide.

Goal: a system map you can use repeatedly

A system map is a compact artifact that lets you:

  • choose safe places to change code,
  • find the right files quickly,
  • avoid breaking hidden contracts,
  • keep context small in future prompts.

It’s the “index” of the repo.

Map once, reuse forever

The map is a high-leverage artifact. Update it as the repo evolves, and your future vibe loops become faster and safer.

What a “system map” includes

A practical system map includes:

  • Entrypoints: how the system starts (CLI/server/jobs)
  • Modules: major subsystems and their responsibilities
  • Dependencies: which modules call which; which external services exist
  • Data flow: how data moves through the system
  • Risk areas: brittle code paths, high complexity, heavy coupling
  • Verification: test commands and deployment checks

Entrypoints (how execution starts)

Entrypoints are the fastest way to understand a system. Identify:

  • primary startup command(s)
  • main server startup file
  • CLI entry module
  • background worker/job entrypoints
  • configuration bootstrapping

Then trace: entrypoint → router/dispatcher → core modules.

Modules and responsibilities

For each major directory/module, write:

  • its purpose
  • its public interfaces
  • what it depends on
  • who depends on it

Keep it to 1–2 sentences per module. The map is not a novel.

Dependencies and boundaries

Good maps identify boundaries:

  • where API calls happen
  • where DB access happens
  • where business logic lives
  • where serialization/deserialization happens

Boundaries tell you where to put tests and where to extract seams for safe refactors.

Data flow and critical paths

Capture at least one critical path:

  • an HTTP request path from input → processing → response
  • or a CLI command from args → core function → output
  • or a job pipeline from message → processing → persistence

This gives you a backbone for debugging and refactoring.

Copy-paste mapping prompts

Prompt A: build a system map

Create a system-level map of this repo.

Context:
- File tree: (paste)
- Entrypoints: (paste)
- Key configs: (paste)

Output:
1) Entrypoints and run/test commands
2) Module map (1–2 sentences per module)
3) Dependency sketch (who calls whom)
4) Data flow for one critical path
5) Risk areas + why
6) Questions/unknowns (if any)

No code changes yet.

Prompt B: update the map after changes

Update the system map given these changes:
(paste diff summary or commit summary)

Keep the map concise and consistent with the original format.

The map deliverable (template)

SYSTEM MAP

Entrypoints:
- ...

Run/test:
- Run: ...
- Tests: ...

Modules:
- module_a: ...
- module_b: ...

Dependencies:
- module_a → module_b

Critical path:
- input → ... → output

Risk areas:
- ...

Open questions:
- ...

Where to go next