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:
- Find entry points and deployables:
package.json/workspaces,Dockerfiles, compose/k8s/terraform files, CI deploy jobs,main/serverfiles. - Find what each one talks to: database clients and ORMs, queue producers and consumers, HTTP clients and SDKs, env var names (not values).
- 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. - Group by tier or deployment boundary; mark the main request path with
tone: "main". - Add 1–3
viewsfor the questions a newcomer would ask. - Never copy secrets, hostnames or IPs from config: name things by role (
Orders DB), not by connection string.
Evidence
Section titled “Evidence”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:
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