map
Skill4 starsChanged 4 months agoMITView on GitHub
Structural codebase index generator. Builds a compact JSON map of files, exports, imports, dependency graph, and roles. Queryable by keyword. Injected into fleet agents as context slices to reduce token usage on code navigation.
31 other projects use a version of this.
Adopted by
Most recently taken up by
- Yeachan-Heo/oh-my-claudecodetheir own version, first seen Nov 8, 2026
- SethGammon/Citadelword for word, first seen Nov 4, 2026
- uwonu606/claude-skillstheir own version, first seen Nov 1, 2026
- vidit19sharma/neogentstheir own version, first seen Nov 1, 2026
- duthaho/skillhubtheir own version, first seen Oct 31, 2026
- ES-92/esctheir own version, first seen Oct 20, 2026
Used with
Projects with it also use ultragoal, recover and 5 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
Yeachan-HeoSkillultragoal
Create and execute durable repo-native multi-goal plans over Codex goal mode artifacts.
Also in 3 projects that use this
marylinSkillrecover
Recover work from a crashed or interrupted session. Use when Claude crashed mid-task, after an unexpected exit, when you see 'stale sessions detected', or when you lost context and need to figure out what was happening.
Also in 3 projects that use this
thoughtbotSkilltrace
Run a scenario and record what actually happened.
Also in 4 projects that use this
POSTTTTSkilltidy
Clean up and organize a project's file structure — group loose files into logical folders (images/, scripts/, styles/, etc.), remove empty directories, and delete genuinely unnecessary files. Use when the user asks to "clean up the project", "organize the files", "tidy the directory", "sort these into folders", "remove empty folders", or "get rid of junk files". Always understands the project and updates references BEFORE moving anything, never deletes load-bearing files, and gets approval before changing the file tree.
Also in 3 projects that use this
bradtraversySkillfeature
Manage current feature workflow - start, review, explain or complete
Also in 4 projects that use this
LangChainSkillremember
Review the current conversation and capture valuable knowledge — best practices, coding conventions, architecture decisions, workflows, and user feedback — into persistent memory (AGENTS.md) or reusable skills. Use when the user says: (1) remember this, (2) save what we learned, (3) update memory, (4) capture learnings.
Also in 4 projects that use this
Other versions31 projects use a version of this.
Word for word · 1
- SethGammon/Citadel★ 927100% same
Edited · 0
None found.
Wrote their own version · 30
- Yeachan-Heo/oh-my-claude-sisyphus★ 41ksame name
- Yeachan-Heo/oh-my-claudecode★ 41ksame name
- baojie/shiji-kb★ 3.4ksame name
- zeuikli/claude-code-workspace★ 155same name
- mbwsims/claude-universe★ 71same name
- yha9806/academic-writing-toolkit★ 54same name
- sea-gold/skills★ 26same name
- myclaude-sh/myclaude-creator-engine★ 25same name
- ilanbm/kpopper★ 12same name
- Megaprompting/torque-loop★ 10same name
20 more not listed
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 repository50 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- architectSkill
- archonSkill
- ascii-diagramSkill
- autopilotSkill
- costSkill
- create-appSkill
- create-skillSkill
- daemonSkill
- dashboardSkill
- decision-mapSkill
- deploy-stewardSkill
- designSkill
- doc-genSkill
- doSkill
- evolveSkill
- experimentSkill
- fleetSkill
- grillSkill
- housecleanSkill
- improveSkill
- infra-auditSkill
- learnSkill
- live-previewSkill
- loopSkill
- marshalSkill
- merge-reviewSkill
- organizeSkill
- postmortemSkill
- prdSkill
- pr-watchSkill
- qaSkill
- refactorSkill
- research-fleetSkill
- researchSkill
- reviewSkill
- scaffoldSkill
- scheduleSkill
- session-handoffSkill
- setupSkill
- systematic-debuggingSkill
- telemetrySkill
- test-genSkill
- triageSkill
- unharnessSkill
- verifySkill
- watchSkill
- wikiSkill
- workspaceSkill
The file
We split this skill into the rules it gives an agent
12 rules. 0 are common, 8 are distinctive, and 4 are very specific to this project.
0
Common
Most of the 21 edited versions we read keep these.
8
Distinctive
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
- Very specific: line 31
Do not use /map for:
- Distinctive: line 51
Run the index generator:
- Very specific: line 57
Add --force if the user requested a fresh rebuild or if the index is stale.
- Very specific: line 73
If .planning/map/ does not exist, the generator creates it automatically.
- Distinctive: line 102
When another skill or orchestrator needs a map slice for agent injection:
- Distinctive: line 125
Before injecting an existing map into a long-running campaign, run:
- Very specific: line 142
Before spawning each wave, Fleet checks if .planning/map/index.json exists
- Distinctive: line 143
If it exists: Fleet runs a slice scoped to each agent's assigned domain
- Distinctive: line 146
If the index does not exist: Fleet proceeds without a map slice (no error)
- Distinctive: line 180
Windows paths: All stored paths use forward slashes for cross-platform consistency.
- Distinctive: line 199
After stats: print the full statistics block.
- Distinctive: line 201
After slice: output the formatted slice block ready for injection.
“Common” is measured: kept by at least 6 in 10 of the 21 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.
Files
/map -- Codebase Intelligence
Orientation
Use /map when:
- Starting work on an unfamiliar codebase (build the index first)
- A fleet or archon campaign needs agents to know "what files matter for X"
- You want a quick structural overview (stats, roles, dependency graph)
- You need to find files related to a keyword without exploratory reads
Do not use /map for:
- Reading file contents (use Read)
- Searching for string patterns inside files (use Grep)
- Single-file edits where you already know the path
Commands
| Command | Behavior |
/map | Generate or refresh the index (skips if cache is fresh) |
/map --force | Rebuild the index even if cache is fresh |
/map query <terms> | Search the index for files matching keywords |
/map stats | Print summary statistics (files, lines, languages, roles) |
/map slice <terms> | Output a compact context slice for agent injection |
/map stale | Detect added, changed, or removed indexed source files |
Protocol
Step 1: GENERATE INDEX
Run the index generator:
node scripts/map-index.js --generate --root .Add --force if the user requested a fresh rebuild or if the index is stale.
The generator:
- Walks the project tree (respects
.gitignore, skipsnode_modules,dist, etc.) - Extracts exports, imports, and symbols from each source file
- Infers a role for each file (component, hook, store, route, test, config, etc.)
- Builds a dependency graph from resolved import paths
- Records per-file SHA-256 hashes plus a whole-index source signature
- Extracts route-like paths and package verification scripts
- Writes the index to
.planning/map/index.json
Supported languages: TypeScript, JavaScript, Python, Go, Rust.
Cache behavior: The index is cached for 5 minutes. Subsequent runs within
that window exit immediately unless --force is passed.
If .planning/map/ does not exist, the generator creates it automatically.
Step 2: QUERY (when user provides search terms)
node scripts/map-index.js --query "<terms>"The query engine scores files by:
- Path match: +3 per term
- Export match: +5 per term
- Symbol match: +2 per term
- Role match: +1 per term
Results are sorted by score and capped at 20 files (configurable with --max-files).
Output is budget-capped at 8000 characters to stay injection-safe.
Step 3: STATS (structural overview)
node scripts/map-index.js --statsOutputs: file count, line count, export count, dependency edge count, route count, package script count, verification command count, breakdown by language, and breakdown by role.
Step 4: SLICE (agent context injection)
When another skill or orchestrator needs a map slice for agent injection:
- Run
node scripts/map-index.js --slice "<scope terms>" --max-files 15 - Inject the generated compact block:
=== MAP SLICE: <terms> ===
Generated: <timestamp>
Verification: npm run test | npm run typecheck
<score> <role> <path> [<top exports>] (<lines>L)
...
=== END MAP SLICE ===- The calling skill injects this block into the agent's prompt alongside CLAUDE.md and rules-summary.md
Token budget: A 15-file slice is typically 800-1200 tokens. This replaces 2000-5000 tokens of exploratory Glob/Grep results that agents would otherwise spend finding relevant files.
Step 5: STALENESS CHECK
Before injecting an existing map into a long-running campaign, run:
node scripts/map-index.js --staleThe command exits 0 when the map is current and 2 when indexed source files
were added, changed, or removed. Refresh with:
node scripts/map-index.js --generate --force --root .Fleet Integration
Fleet agents receive map slices automatically when /map index exists:
- Before spawning each wave, Fleet checks if
.planning/map/index.jsonexists - If it exists: Fleet runs a slice scoped to each agent's assigned domain
- The generated slice is prepended to the agent's context alongside CLAUDE.md and rules-summary.md
- If the index does not exist: Fleet proceeds without a map slice (no error)
Context injection order:
- CLAUDE.md content
.claude/agent-context/rules-summary.md- Map slice (scoped to agent's domain/direction)
- Campaign-specific direction and scope
- Discovery briefs from previous waves
Contextual Gates
Disclosure: "Generating codebase map. Creates .planning/map/index.json."
Reversibility: green — creates .planning/map/index.json only; undo by deleting .planning/map/.
Trust gates:
- Any: generate index, query, stats, slice.
Quality Gates
- Index must generate without errors on any supported project
- Query must return results sorted by relevance score
- Stats output must be human-scannable in under 5 seconds
- Slice output must stay under 2000 tokens for a 15-file result
- Index must handle 100K+ line repos without hanging (iterative walker, no recursion limits)
- Cache must prevent redundant regeneration within the TTL window
- Stale checks must detect added, changed, and removed indexed source files
- Slice output must include relevant verification commands when package scripts exist
Fringe Cases
- No source files found: Generator writes an empty index (
fileCount: 0). Query returns no results. Not an error. .planning/does not exist: Generator creates.planning/map/automatically viamkdirSync({ recursive: true }).- Index file missing when querying: Error message: "Index not found. Run
node scripts/map-index.js --generatefirst." - Binary or unsupported files: Silently skipped. Only files with recognized language extensions are indexed.
- Very large repos (10K+ files): The walker is iterative (stack-based), not recursive. No stack overflow risk. May take 5-10 seconds on first run.
- Windows paths: All stored paths use forward slashes for cross-platform consistency.
Exit Protocol
After generation:
Index written: <path>
<file count> files, <edge count> dependency links
<route count> routes, <verification command count> verification commandsAfter query:
Results for "<terms>" (<count> matches):
Score Role Path
-----------------------------------------------
<results>After stats: print the full statistics block.
After slice: output the formatted slice block ready for injection.
After stale check:
Map index is current.or:
Map index is stale.
Changed: <paths>
Added: <paths>
Removed: <paths>Reversibility: green — delete .planning/map/ to remove all generated artifacts; no source files modified.
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.

