map-architecture
Skill2 starsChanged 15 days agoMITView on GitHub
Use when starting in an unfamiliar codebase or asked to document how a system works, to produce one architecture document with diagrams where every fact points at the code.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- fernandoxavier02/engineering-contexttheir own version, first seen Nov 22, 2026
- azalio/map-frameworktheir own version, first seen Sep 15, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- azalio/map-framework★ 143same name
- fernandoxavier02/engineering-context★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository10 other files it gives its agents.
- claude/CLAUDE.mdCLAUDE.md
- skills/setup-home-repo/template/CLAUDE.mdCLAUDE.md
- apple-containerSkill
- benchmarkSkill
- codebase-designSkill
- diagnoseSkill
- prototypeSkill
- setup-home-repoSkill
- specSkill
- unslopSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 5 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 9
Every node, edge, state and transition carries a path:line reference read at one pinned commit.
- Distinctive: line 13
Never run migrations, deploys, or anything that touches a shared database or real credentials.
- Distinctive: line 18
When the user wants a page to look at or share, publish the same content as a page instead of a second format.
- Distinctive: line 23
Orient from cheap signals: Read the README, the manifests, the CI file (the one build recipe known to work), and the entry points: mains, …
- Distinctive: line 24
Write the one-paragraph purpose now, before reading more.
- Distinctive: line 53
Keep each diagram to what one screen holds: about 12 nodes, about 8 states on the main path.
- Very specific: line 64
Run it by its path in this skill's folder.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Map architecture
Produce one Markdown document with Mermaid diagrams.
Every node, edge, state and transition carries a path:line reference read at one pinned commit.
A wrong map is worse than none, so nothing goes in that was not seen in code or in a run.
Work read-only on the code. Never run migrations, deploys, or anything that touches a shared database or real credentials.
Where it goes
Unless the user names a path: .claude/architecture/<repo>.md in the home repo when the workspace has one, otherwise .claude/architecture.md in the repo, left uncommitted.
When the user wants a page to look at or share, publish the same content as a page instead of a second format.
Method
- Pin the commit. Record
git rev-parse --short HEADin the document'sCommit:line and read everything at that commit. - Orient from cheap signals. Read the README, the manifests, the CI file (the one build recipe known to work), and the entry points: mains, servers, routes, CLI commands, jobs. Write the one-paragraph purpose now, before reading more.
- Read the data model before the logic. Migrations or schema files, or the main data shapes when there is no database. Name the three to seven core entities and how they relate.
- Follow a connected slice. From entry points and registrations, follow imports and call sites until each responsibility reaches its input, its output or its side effect. An edge is a real call or write site and the condition that permits it. A function that is exported but never called on the normal path is not an edge.
- Trace one real request by running it. Pick the user action that matters most, get it running the way CI does, put a stack dump or breakpoint at the final write or response, trigger it once, and read the stack from the bottom up.
Stub paid or external services at the edge.
Record each hop as
path:lineand what happens there. - Draw state machines from a table, never from memory. For each entity with a status field, search for every assignment and update of that field.
List each write as a row: from, to, guard,
path:line. Draw the diagram from the table. A state with no inbound transition, a state with no way out that is not terminal, and a status value the schema allows but no code writes are findings: list them. Retry and recovery appear only when they are real transitions in the code.
The document
Follow template.md. Include a section only when the code has something to show for it.
| Section | Diagram | Drawn from |
| System context | flowchart: the system, its users, external services | Manifests, entry points, outbound clients, config |
| Components | flowchart with boundaries by ownership, trust and deployment | Module layout, imports, registrations |
| Request trace | sequenceDiagram of one real request | The run in step 5 |
| State machines | one stateDiagram-v2 per stateful entity | The transition table in step 6 |
| Data model | erDiagram with keys and cardinality | Migrations or schema files |
| Data flow | flowchart of stages where data changes form or owner | Call and write sites |
Keep each diagram to what one screen holds: about 12 nodes, about 8 states on the main path. Split by subsystem or entity instead of shrinking. Mark what you saw happen as ran, and what you concluded without confirming as inferred. End with what was not traced.
Check it
python3 check_refs.py <document> --repo <repo>Run it by its path in this skill's folder.
It fails when a path:line does not resolve at the pinned commit, when a state diagram and its transition table disagree, or when a Mermaid block does not parse (checked only if mmdc is installed).
Fix every failure and rerun.
Report
Give the path and a five-line summary, then say what kind of confidence each part has: references checked by script, behavior read or run by you, diagrams rendered or not.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

