agentleFS
marinvchmarinvch/Cortex/skills/repo-map/SKILL.md

repo-map

Skill1 starsChanged 18 days agoMITView on GitHub

Render the repo as one offline HTML page — state overview, import graph, context tree, files, areas and gaps. Triggers — "show me the graph", "visualise this repo", "open the map", "cortex view".

13 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 12 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    No server, no CDN, no runtime: the data is inlined, so the page works offline and copies anywhere.

    line 23
  2. Very specific:

    Check the index: If .cortex/index/index.json is missing or older than the working tree, re-run node …

    line 34
  3. Distinctive:

    An orphan is a question: Import resolution is regex-based (ADR 0004 rules out a parser), so a dynamically loaded or framework-discovered …

    line 68

“Common” is measured: kept by at least 6 in 10 of the 12 edited versions of this file we could read. “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-map — see the repo instead of reading about it

The findings report is prose and the index is JSON. Neither answers "what shape is this codebase" in the two seconds a picture takes. This renders the index Cortex already built into one page.

node "${CLAUDE_PLUGIN_ROOT}/index/cortex-view.mjs" .

This skill exists because that command does not work when a user types it themselves. ${CLAUDE_PLUGIN_ROOT} is set inside a skill and nowhere else, so a plugin user in their own terminal has to know a version-pinned path into the plugin cache — one that changes on every update. /repo-map is the address they can actually remember.

No server, no CDN, no runtime: the data is inlined, so the page works offline and copies anywhere.

Before the first write

If .cortex/ does not exist, ask before running anything — the index comes first, and that is the write ADR 0005 gates. Generated and gitignored is not the same as invisible. The .gitignore entry is written for you at creation time; the asking is not.

How to run it

  1. Check the index. If .cortex/index/index.json is missing or older than the working tree, re-run node "${CLAUDE_PLUGIN_ROOT}/index/cortex-index.mjs" . first — a picture of a stale index is worse than no picture, because it looks current.
  2. Run the viewer. It writes .cortex/view/repo.html and opens it in the default browser. Pass --no-open when the user is on a headless machine or has said not to open windows.
  3. Print the path. The browser may not surface on every setup, and the file is the deliverable.
  4. Say what the numbers mean, using the summary line the CLI prints — files, import edges, areas, orphans, files in cycles, modules with no test found. Do not re-count anything yourself.

What is on the page

TabHolds
Overviewopens first: index freshness, profile, memory age and version; vitals (files, edges, test coverage, 30-day churn, findings by severity) and the top 3 findings; the import graph as a turning particle cloud; next-step commands to copy; a timeline of memory entries and commits
Mapevery code file as a dot in one box per cluster, on the full width. Imports between two boxes are one line carrying their count. The bar regroups by area or by import depth
Structurethe context layer as a tree — root AGENTS.md, the docs beside it, each code area with its scoped brief, busiest files and tests, and what Cortex generates. A dashed box is missing and names the command that writes it
Fileseach file with who imports it and what it imports, both clickable
Areasthe top-level shape, which areas already have a scoped brief, the clusters, and the graph report under them: hubs, bridges, import cycles, clusters with no test found
Gapsorphans, files in import cycles, and the busiest code with no test found
Next stepswhere this repo is in the Cortex sequence, each ✓ traced to a file on disk

Any Overview fact that could not be read — no git, no memory yet, no findings pass — says not available and why. Report it that way; never read a missing value as zero. Churn and the timeline end at the indexed commit, not at today, so the page is the same on every machine.

A red outline on a node means no test was found. Pointing at a file lights its imports and importers, and a click keeps them lit. Click a row in the legend to hide that box; / focuses search; scroll zooms and drag pans. On the Map, arrow keys pan, plus and minus zoom, and zero resets. On the Overview, drag turns the cloud and a click opens the file. The theme follows the OS; the button in the top bar overrides it and is remembered.

What you must not claim about the picture

A graph is persuasive in a way prose is not, so the hedges matter more here, not less.

  • An orphan is a question. Import resolution is regex-based (ADR 0004 rules out a parser), so a dynamically loaded or framework-discovered file looks exactly like a dead one. Never present the Gaps tab as a delete list.
  • "No test found" is a floor. Coverage uses three signals — a test named for the file, importing it, or naming it in a quoted string — so a file exercised only through a subprocess reads as untested. Wrong in the safe direction, and say so.
  • Markdown and config are not drawn. They have no imports; on one repo 171 isolated nodes buried the 98 connected ones. They are still in the Files tab, and the legend says how many.
  • A bridge is a link worth a look, not a defect. The score ranks imports between clusters by how unexpected they look, and its reasons say why. Every hub's link count is a floor. The same report prints as text with node "${CLAUDE_PLUGIN_ROOT}/index/cortex-graph.mjs" .. For one file's neighbours, its cluster, or the import path between two files, ask the graph MCP tool (or node "${CLAUDE_PLUGIN_ROOT}/mcp/ai-os.js" graph <op>) instead of opening the page.
  • Depth is a floor too. An unresolved import makes a file look shallower than it is, so the layer count is the smallest honest answer rather than a verdict on the architecture.

Related

  • /setup-repo builds the index this renders; run it first on a repo Cortex has never seen.
  • /summarize-files adds a summary to every file card — what the file does, not just how it is wired. Optional and costs tokens.
  • /resume-work answers the same "where am I" question in text, and is what the Next steps tab shows.

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.