Skip to content

Repository maps

Ask: “Make an architecture map of this repository, backed by evidence from the code.” The agent follows these steps:

When mapping a real codebase:

  1. Find entry points and deployables: package.json/workspaces, Dockerfiles, compose/k8s/terraform files, CI deploy jobs, main/server files.
  2. Find what each one talks to: database clients and ORMs, queue producers and consumers, HTTP clients and SDKs, env var names (not values).
  3. Make a node per deployable or store; an edge per call path you can point to. Add evidence (file and line) to each node you can.
  4. Group by tier or deployment boundary; mark the main request path with tone: "main".
  5. Add 1–3 views for the questions a newcomer would ask.
  6. Never copy secrets, hostnames or IPs from config: name things by role (Orders DB), not by connection string.

Each node can carry evidence: { file, line?, note? }. The viewer lists it in the details panel. Set source.url at the top of the map (for example https://github.com/acme/shop/blob/main) to turn every entry into a link.

Before delivering, the agent checks that each cited file exists, from the repo root. The check works with or without git:

Terminal window
node -e 'const fs = require("fs"), d = require(require("path").resolve(process.argv[1])); const miss = [...new Set(d.nodes.flatMap((n) => (n.evidence ?? []).map((e) => e.file)))].filter((f) => !fs.existsSync(f)); miss.forEach((f) => console.log("missing:", f)); process.exit(miss.length ? 1 : 0)' .schemap/<slug>/map.json