agentleFS
wenshuocui50-droidwenshuocui50-droid/repo-cartographer/SKILL.md

repo-cartographer

Skill1 starsChanged 54 days agoMITView on GitHub

Maps an unfamiliar codebase into a visual onboarding document (docs/architecture.md) with Mermaid diagrams — system layers, module dependencies, a traced core data flow — plus an opinionated 5-file reading order. Use when the user asks to understand, explain, map, diagram, or onboard onto a repository, or says things like "how is this project organized", "where do I start reading", "draw the architecture", or "/map".

2 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions2 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 2

    1. Henrique-All/skills★ 4same name
    2. ArcQian-bit/codex-real-engineer-skills★ 1same 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.

The file

We split this skill into the rules it gives an agent

10 rules. About 0 are common, 6 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If docs/architecture.md already exists, overwrite it and say so.

    line 21
  2. Very specific:

    Read the manifest first: package.json / pyproject.toml / go.mod / Cargo.toml / pom.xml / *.csproj, etc.

    line 31
  3. Very specific:

    Read the README (and the docs/ index if present) for the project's own self-description.

    line 32
  4. Distinctive:

    Follow it through the actual code: open each file the flow touches, in call order.

    line 54
  5. Very specific:

    Write docs/architecture.md per the output contract.

    line 61
  6. Distinctive:

    Keep the document ≤ ~200 lines.

    line 69
  7. Distinctive:

    Do not read exhaustively — sample.

    line 73
  8. Distinctive:

    Use search tools for "where is X handled" / "who imports Y".

    line 74
  9. Distinctive:

    Prefer a depth-2 directory listing.

    line 75
  10. Distinctive:

    If the repo has multiple independent subsystems, draw the System Map at subsystem level and trace a flow in only the primary one.

    line 76

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Repo Cartographer

Turn any repository into a map a newcomer can read in 10 minutes: docs/architecture.md.

Output contract

One file: docs/architecture.md, with exactly these sections in this order:

  1. TL;DR — what the project does (2–3 sentences) + tech stack in one line + the archetype you classified (see Phase 2).
  2. System Map — Mermaid flowchart of top-level components/layers and how they connect.
  3. Module Dependencies — Mermaid flowchart of who imports/calls whom. Core modules only.
  4. Core Flow — one Mermaid sequenceDiagram of the most representative runtime flow (e.g. a request from entry to response, a command from argv to output).
  5. Reading Order — exactly 5 files, in order, each with a one-line reason. This is the most valuable section: be opinionated.
  6. Conventions — small table: build command, test command + where tests live, error-handling style, naming style, anything surprising.

If docs/architecture.md already exists, overwrite it and say so.

Method

Work in four phases. Do not skip phases; each feeds the next.

Phase 1 — Scout (breadth, not depth)

Goal: build an inventory, not an understanding.

  • Read the manifest first: package.json / pyproject.toml / go.mod / Cargo.toml / pom.xml / *.csproj, etc. Note entry points (main, bin, scripts), major dependencies, module/workspace declarations.
  • Read the README (and the docs/ index if present) for the project's own self-description.
  • List the top 2 directory levels. For monorepos, list each package once.
  • Identify entry points: HTTP server bootstrap, CLI main, library public API (__init__.py, index.ts, lib.rs).

Phase 2 — Classify

Decide the repo archetype. This determines which flow is "most representative":

ArchetypeRepresentative flow to trace
Web/backend serviceone HTTP request: route → handler → service → data store → response
CLI toolone command: argv → parse → execute → output
Library/SDKone public API call: export → implementation → internals
Frontend appone user interaction: event → state change → render
Data pipelineone record: ingest → transform → store
Monorepopick the package the README leads with; note inter-package deps

State the archetype in the TL;DR.

Phase 3 — Trace (now go deep, but only along one line)

  • Pick the representative flow from Phase 2.
  • Follow it through the actual code: open each file the flow touches, in call order. Verify each hop exists — never assume a call from a file name.
  • Collect the real module boundaries you crossed; these become your dependency-graph nodes.
  • While tracing, note the 5 files that mattered most → seeds of the Reading Order.
  • For anything you could not verify (dynamic dispatch, DI, reflection, config-driven wiring), mark the node name (?) in diagrams and add one line below the diagram saying why.

Phase 4 — Draw & write

Write docs/architecture.md per the output contract. Rules:

  • ≤ 15 nodes per diagram. Merge or omit; a map that shows everything shows nothing. Put detail in prose below the diagram if it matters.
  • Every edge has a label naming the real relationship (calls, imports, publishes to, reads from), not a bare arrow.
  • Mermaid must be valid: quote node labels containing special characters; verify mentally that it parses.
  • Direction: flowchart TD for layers, flowchart LR for dependencies/pipelines.
  • Never invent modules, files, or relationships you did not see. Uncertainty is marked (?), not guessed away.
  • Reading Order entries use real relative paths that exist in the repo.
  • Keep the document ≤ ~200 lines. It is a map, not a book.

Large repos (>500 files)

  • Do not read exhaustively — sample. Manifest + entry points + one traced flow is enough signal.
  • Use search tools for "where is X handled" / "who imports Y". Prefer grep over opening files at random.
  • Prefer a depth-2 directory listing; go deeper only into directories the traced flow enters.
  • If the repo has multiple independent subsystems, draw the System Map at subsystem level and trace a flow in only the primary one; describe the others in one line each.

After writing

Reply with: the file path created, the archetype you classified, and a 3-line summary of the architecture. Nothing else — the document is the deliverable.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.