map-codebase
Skill16 starsChanged 7 months agoMITView on GitHub
Analyzes the project codebase and builds a detailed code-map.md organized by feature flow. Shows entry point → routing → logic → DB for every major feature. Run once to bootstrap navigation; re-run after major structural changes. Triggers on "map the codebase", "build code map", "create code map", "map my project", "analyze codebase structure", "create a roadmap of the code", "where does everything live".
6 other projects use a version of this.
Adopted by
Most recently taken up by
- danielvm-git/bigpowerstheir own version, first seen Nov 6, 2026
- buildomator/buildomatortheir own version, first seen Nov 4, 2026
- Steelwool9925/claude-skillstheir own version, first seen Oct 11, 2026
- AliOsm/skillstheir own version, first seen Aug 19, 2026
- julienlegoux/skillstheir own version, first seen Aug 8, 2026
- gclm/super-stacktheir own version, first seen Mar 29, 2026
Other versions6 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 6
- danielvm-git/bigpowers★ 288same name
- buildomator/buildomator★ 102same name
- julienlegoux/skills★ 4same name
- AliOsm/skills★ 1same name
- gclm/super-stack★ 0same name
- Steelwool9925/claude-skills★ 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 repository45 other files it gives its agents.
- AGENTS.mdAGENTS.md
- docs/agents.mdAGENTS.md
- .claude/CLAUDE.mdCLAUDE.md
- CLAUDE.mdCLAUDE.md
- actSkill
- security-checkSkill
- environment-checkSkill
- run-verificationSkill
- refactorSkill
- debug-session-archivedSkill
- generate-guardsSkill
- check-anthropicSkill
- code-reviewerSkill
- code-reviewSkill
- debug-sessionSkill
- end-sessionSkill
- evolve-checkSkill
- evolveSkill
- fix-bugSkill
- forgetSkill
- frontend-designSkill
- guardSkill
- kit-healthSkill
- learnSkill
- modeSkill
- parallel-prototypesSkill
- planSkill
- powershell-safeSkill
- product-riskSkill
- progress-reportSkill
- prototype-hypothesisSkill
- recallSkill
- refactoring-uiSkill
- scan-codebaseSkill
- scan-conventionsSkill
- search-firstSkill
- search-memorySkill
- shadow-codeSkill
- skill-creatorSkill
- smart-resumeSkill
- start-sessionSkill
- strategic-compactSkill
- tourSkill
- ux-heuristicsSkill
- verification-loopSkill
The file
We split this skill into the rules it gives an agent
6 rules. 0 are common, 1 is distinctive, and 5 are very specific to this project.
0
Common
Most of the 6 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 93
Use Grep for function names and Read with offset to confirm logic without loading whole files.
- Very specific: line 105
Write to .claude/rules/code-map.md (create .claude/rules/ if it doesn't exist).
- Very specific: line 141
Ask the user: "Add @rules/code-map.md to CLAUDE.md so it auto-loads each session?"
- Very specific: line 143
If yes: Edit .claude/CLAUDE.md to add @rules/code-map.md in the @rules/ block.
- Very specific: line 145
If no: Tell them they can read it manually anytime or re-run map-codebase to refresh it.
- Distinctive: line 154
Lite version: if the codebase is very large (50+ files), do Step 7 only for the top 2 files and summarize the rest as a file-path table.
“Common” is measured: kept by at least 6 in 10 of the 6 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
Skill: map-codebase
Purpose: Scan the codebase, identify all major features/flows, and produce a code-map.md that traces each feature from entry point → routing → logic → DB. Makes any codebase immediately navigable without grepping.
Trigger Phrases
- "map the codebase"
- "build code map" / "create code map"
- "map my project"
- "analyze codebase structure"
- "create a roadmap of the code"
- "where does everything live"
Steps
Step 1 — Detect Tech Stack
Glob and read top-level files to identify the stack and project layout:
Glob("**/{package.json,pom.xml,build.gradle,requirements.txt,setup.py,*.sln,web.xml}", limit=20)Then read the top-level directory listing to understand the folder structure. Identify:
- Language: Java, JavaScript/Node, Python, .NET, Go, Ruby, etc.
- Frontend type: HTML + vanilla JS, React, Vue, JSP templates, etc.
- Routing pattern: Servlet if/else chain, Express routes, Django urlpatterns, Flask decorators, Rails routes
- DB access pattern: Raw SQL, JPA/Hibernate, Sequelize, SQLAlchemy, ActiveRecord
Step 2 — Find Entry Points
Scan for where requests come in:
| Stack | Where to look |
| Java Servlet | *Webservice.java, *Controller.java, routing if/else chains |
| Express/Node | routes/, app.get(, router.post( |
| Django/Flask | urls.py, @app.route(, urlpatterns |
| Rails | routes.rb, config/routes.rb |
| HTML pages | Glob **/*.html — each page is a user entry point |
Also look for:
- API spec files (
openapi.yaml,swagger.json) — pre-mapped routes - URL pattern files (
.claude/rules/url-patterns.mdif it exists)
Step 3 — Find Major Logic Files
Identify the heavy files that contain most of the business logic:
Bash: find files > 300 lines
Grep: look for files imported/required by many othersFiles > 500 lines in services/, utils/, jobs/, lib/ are almost always key logic files. Read their method list (grep for public , def , function , const .*=.*=>) to understand their surface area.
Step 4 — Find DB Access
Grep: "FROM ", "INSERT INTO", "UPDATE ", "CREATE TABLE" → extract table names
Grep: "models.Model", "@Entity", "@Table", "Schema(" → extract model names
Glob: "migrations/", "*.sql", "*_install.sql", "*schema*" → schema filesBuild a list of all DB tables/models referenced in the logic files.
Step 5 — Identify Feature Groups
Group entry points + logic + DB by feature domain. Look for naming patterns:
user,auth,login,session→ Auth/User floworder,cart,checkout,payment→ Commerce flowadmin,dashboard,manage→ Admin flowcourse,lesson,session,email,scheduler→ Course/content flowapi,webhook,export→ Integration flow
Aim for 5–15 feature groups depending on codebase size. Don't try to map every file — focus on the flows a developer actually needs to navigate.
Step 6 — Trace Each Flow
For each identified feature group, read 2–3 key files to trace the full chain. Document:
Entry (URL / route / page)
→ Frontend (HTML element / JS function)
→ Endpoint / Route handler
→ Service / Logic method [file:approxLine]
→ DB tables read/writtenUse Grep for function names and Read with offset to confirm logic without loading whole files.
Step 7 — Build the Line Reference
For the 1–2 largest logic files (the ones developers will need to navigate most), build a method → line number table:
Grep: "public |def |function | async " in the file → capture method names + line numbersThis is the highest-value part of the map for large files (500+ lines).
Step 8 — Write code-map.md
Write to .claude/rules/code-map.md (create .claude/rules/ if it doesn't exist).
Format:
# [Project Name] — Code Map
> Generated by map-codebase. Re-run after major structural changes.
> `[Abbreviation]` = `path/to/main/logic/file`
---
## [Feature Name]
- **Entry** `URL or route`
- **Frontend** `file.js` → `functionName()` → `callbackName()`
- **Endpoint** `routeName` → `HandlerClass.method()`
- **Logic** `ServiceClass.method()` [L####]
- **DB** tables/models read and written
## [Feature Name 2]
...
---
## Key File Paths
| Layer | Path |
|---|---|
| [description] | `path/to/file` |
---
## [MainLogicFile] — Line Reference
| Method | Line | Purpose |
|---|---|---|
| `methodName` | #### | one-line description |Step 9 — Wire Into CLAUDE.md
Ask the user: "Add @rules/code-map.md to CLAUDE.md so it auto-loads each session?"
If yes: Edit .claude/CLAUDE.md to add @rules/code-map.md in the @rules/ block.
If no: Tell them they can read it manually anytime or re-run map-codebase to refresh it.
Notes
- Line numbers drift — they're navigation hints, not guarantees. The function names are what matters.
- Focus on the dominant paths — a flow that's touched in 10 places is more important than one that's touched in 1.
- Largest logic files first — if one file has 5000+ lines, the line reference table for that file is worth more than tracing all the smaller flows.
- Re-run when: new major feature added, large refactor done, new developer joining.
- Lite version: if the codebase is very large (50+ files), do Step 7 only for the top 2 files and summarize the rest as a file-path table.
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.

