repo-map
Skill0 starsChanged 46 days agoMITView on GitHub
Generate or incrementally update a REPO_MAP.md with the full project structure, shared components, an exhaustive API inventory, and chunked request-flow tracing for each API. Tracks a baseline_commit so later runs only re-document what changed. Works out of the box for Java/Kotlin Spring, JAX-RS and GraphQL; other stacks via the file-glob parameter. Trigger on phrases like "create a repo map", "generate REPO_MAP", "update the repo map", "scan the workspace", "document this codebase", "map all APIs", "trace request flows", or "build an API inventory".
13 other projects use a version of this.
Adopted by
Most recently taken up by
- PeanutGT/NutsSkillstheir own version, first seen Nov 8, 2026
- jocarrd/crux-agentstheir own version, first seen Nov 8, 2026
- idaibin/skillstheir own version, first seen Nov 8, 2026
- Tcuzzo/backs-aios-skillstheir own version, first seen Nov 3, 2026
- marinvch/Cortextheir own version, first seen Nov 1, 2026
- AnastasiyaW/codex-claude-code-configtheir own version, first seen Oct 30, 2026
Other versions13 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 13
- AnastasiyaW/claude-code-config★ 214same name
- AnastasiyaW/codex-claude-code-config★ 214same name
- ejboy/agent-scripts★ 116same name
- idaibin/skills★ 6same name
- yeaight7/agent-powerups★ 6same name
- jocarrd/crux-agents★ 4same name
- PeanutGT/NutsSkills★ 3same name
- mmaripanguec/dev-sdd-kit★ 2same name
- Tcuzzo/backs-aios-skills★ 2same name
- David-Florian2013/Stop-trusting-made-it-faster-here-is-5-best-skills-for-Claude-★ 1same name
3 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 repository10 other files it gives its agents.
- examples/CLAUDE.mdCLAUDE.md
- claude-md-generatorSkill
- sql-migration-repo-explorerSkill
- guided-implementationSkill
- springboot-upgradeSkill
- flow-reconstructionSkill
- incident-investigationSkill
- living-flow-mapSkill
- pr-reviewSkill
- secondary-pr-reviewSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
39 rules. 0 are common, 22 are distinctive, and 17 are very specific to this project.
0
Common
Most of the 12 edited versions we read keep these.
22
Distinctive
This author's own choices. Worth a look.
17
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Use this skill when:
- Very specific: line 50
If REPO_MAP.md does not exist in the workspace root → FULL REGENERATION (STEP 2 onwards).
- Very specific: line 53
Read the first 10 lines and extract the baseline_commit value:
- Very specific: line 95
Use this workflow when REPO_MAP.md exists AND has a valid baseline_commit AND files have changed.
- Very specific: line 114
Search REPO_MAP.md for APIs that reference this class
- Very specific: line 118
Read the existing REPO_MAP.md
- Distinctive: line 120
Update SHARED COMPONENTS with the Edit tool if needed
- Very specific: line 121
Update baseline_commit to CURRENT_COMMIT (git rev-parse "$DEFAULT_BRANCH"), generated_at and total_apis in the METADATA HEADER with the …
- Very specific: line 154
Search the workspace recursively (every source file matching FILE_GLOBS) for files containing ANY of:
- Distinctive: line 167
Do NOT skip any file
- Distinctive: line 183
Do NOT assume similar endpoints — each must be documented
- Distinctive: line 184
Do NOT skip versioned endpoints (v1, v2, v3, v4)
- Distinctive: line 185
Do NOT skip similar-looking methods
- Distinctive: line 203
COUNT CHECK: If the API count looks low relative to the controller files found (e.g.
- Very specific: line 204
Versioning CHECK: Verify all versioned endpoints included (v1/v2/v3/v4 if present)
- Very specific: line 205
HTTP Methods CHECK: Verify all HTTP methods represented (GET/POST/PUT/DELETE/PATCH if used)
- Distinctive: line 207
CRITICAL: Do NOT proceed to STEP 3 until all APIs are discovered and verified.
- Very specific: line 249
ACTION: Write REPO_MAP.md (create new file, overwrite if exists) with the Write tool
- Very specific: line 264
All service classes (*Service, *Manager)
- Very specific: line 265
All repository classes (*Repository, *Dao)
- Very specific: line 266
All utility classes (*Util, *Helper)
- Distinctive: line 267
All model/DTO classes
- Distinctive: line 299
Follow the Chunked Flow Tracing Engine below.
- Distinctive: line 328
All failure scenarios documented
- Distinctive: line 336
If documentation of one API fails: Log error with API details
- Distinctive: line 338
After all APIs processed, list any failed APIs and offer retry
- Distinctive: line 349
RULE B: After 3 classes, write the current chunk's results
- Distinctive: line 351
RULE D: Stop only when no further calls exist for current API
- Very specific: line 356
Write everything documented so far to REPO_MAP.md
- Distinctive: line 358
Wait for the user's "Continue", then resume exactly where the previous chunk ended
- Distinctive: line 369
ALL direct method calls inside the method body
- Distinctive: line 407
When resuming after "Continue this API flow":
- Distinctive: line 416
Never stop recursion after scanning a controller.
- Distinctive: line 430
After documenting all APIs:
- Very specific: line 458
CRITICAL: All output must be written to REPO_MAP.md, not just printed to console.
- Very specific: line 466
Do NOT write REPO_MAP.md with shell commands (cat, echo, tee, heredocs).
- Distinctive: line 468
After each write, confirm in conversation.
- Distinctive: line 486
Always search files before answering.
- Very specific: line 505
Exhaustive: Every source file matching FILE_GLOBS is scanned.
“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.
Files
Repo Map Generator
A deterministic static code analysis engine that generates and incrementally maintains a REPO_MAP.md file documenting the complete project structure, shared components, and all APIs with their request flows.
Your role: a deterministic static code analysis engine. Operate ONLY on the real files in the workspace. Never guess, infer, or hallucinate.
When to Use This Skill
Use this skill when:
- Scanning a Java/Spring/JAX-RS/GraphQL codebase for complete API documentation
- Creating a REPO_MAP.md that doesn't exist
- Updating REPO_MAP.md after code changes (incremental, based on
baseline_commit) - Generating exhaustive API inventory with request-flow tracing
- Documenting complex multi-service request flows
- Building project documentation for onboarding or architecture reference
Parameters
Resolve these once at the start and reuse them in every command below.
DEFAULT_BRANCH — never hardcode main:
DEFAULT_BRANCH=$(git symbolic-ref --short refs/remotes/origin/HEAD 2>/dev/null | sed 's@^origin/@@')
DEFAULT_BRANCH=${DEFAULT_BRANCH:-main}FILE_GLOBS — the files whose changes affect the map. Pick per stack; the default is the Java/Kotlin set:
| Stack | FILE_GLOBS |
| Java / Kotlin (default) | FILE_GLOBS=('*.java' '*.kt' '*.xml' '*.yml' '*.yaml' '*.properties') |
| Other | Ask the user, or derive from the build files (source extensions + config extensions) |
The same globs define which source files are scanned in STEP 2.
Core Workflow
This skill operates as a deterministic state machine following exactly these steps in order. Do not deviate from this sequence.
STEP 1: Regeneration Decision
1.1 Check if REPO_MAP.md exists. If REPO_MAP.md does not exist in the workspace root → FULL REGENERATION (STEP 2 onwards).
1.2 Extract the baseline commit from the existing REPO_MAP.md.
Read the first 10 lines and extract the baseline_commit value:
grep "baseline_commit:" REPO_MAP.md | head -1 | awk '{print $2}'1.3 Determine the update mode.
# Current default-branch commit
CURRENT_COMMIT=$(git rev-parse "$DEFAULT_BRANCH")
# Baseline commit from REPO_MAP.md (extracted in 1.2)
BASELINE_COMMIT=<extracted value>
# Check if baseline exists and is valid
if [ -z "$BASELINE_COMMIT" ] || ! git cat-file -e "$BASELINE_COMMIT" 2>/dev/null; then
echo "FULL_REGEN: Invalid or missing baseline commit"
else
# Files changed since baseline
CHANGED_FILES=$(git diff --name-only "$BASELINE_COMMIT".."$DEFAULT_BRANCH" -- "${FILE_GLOBS[@]}")
if [ -z "$CHANGED_FILES" ]; then
echo "NO_CHANGES: Repo map is up to date"
else
echo "INCREMENTAL: $(echo "$CHANGED_FILES" | wc -l) files changed"
fi
fiDECISION MATRIX:
| Condition | Action |
| REPO_MAP.md missing | FULL REGENERATION (STEP 2 onwards) |
| baseline_commit missing/invalid | FULL REGENERATION (STEP 2 onwards) |
| No files changed since baseline | Ask user: "No changes since baseline <sha>. Regenerate REPO_MAP.md anyway?" — YES → FULL REGENERATION, NO → exit gracefully |
| Files changed since baseline | INCREMENTAL UPDATE (STEP 1A) |
| User requests full regen | FULL REGENERATION (STEP 2 onwards) |
STEP 1A: Incremental Update Workflow
Use this workflow when REPO_MAP.md exists AND has a valid baseline_commit AND files have changed.
- Identify Changed Files:
git diff --name-only "$BASELINE_COMMIT".."$DEFAULT_BRANCH" -- "${FILE_GLOBS[@]}" - Categorize Changes:
- Controller files changed → Re-document affected APIs
- Service/Repository files changed → Update flows that reference them
- DTO files changed → Update DTO documentation in affected APIs
- Config files changed → Update SHARED COMPONENTS if needed
Identify Affected APIs: For each changed controller file:
- Extract all mapping-annotated methods (see STEP 2, Pass 3)
- These APIs need re-documentation
For each changed service/repository:
- Search REPO_MAP.md for APIs that reference this class
- These APIs need flow re-documentation
- Update Process:
- Read the existing REPO_MAP.md
- For each affected API, re-document it with fresh analysis (STEP 4 rules) and replace its old section in place with the Edit tool
- Update SHARED COMPONENTS with the Edit tool if needed
- Update
baseline_committoCURRENT_COMMIT(git rev-parse "$DEFAULT_BRANCH"),generated_atandtotal_apisin the METADATA HEADER with the Edit tool
- Output:
INCREMENTAL UPDATE COMPLETE: - Baseline: <old_commit> → <new_commit> - Files changed: X - APIs updated: Y - APIs unchanged: Z
WHEN TO FALL BACK TO FULL REGEN:
- More than 50% of APIs affected
- Core shared components changed (affects most APIs)
- Package structure changed
- User explicitly requests full regen
STEP 2: Complete API Discovery (Mandatory Multi-Pass Scan)
NEVER START DOCUMENTATION UNTIL ALL APIs ARE DISCOVERED.
Output tracking: As you work, maintain a discovery log showing:
API DISCOVERY IN PROGRESS:
- Pass 1: Scanning for controller files...
- Pass 2: Reading controller file contents...
- Pass 3: Extracting method signatures...
- Pass 4: Identifying mapping annotations...Pass 1: Find All Controller Files
Search the workspace recursively (every source file matching FILE_GLOBS) for files containing ANY of:
@RestController@Controller@RequestMapping(at class level)- JAX-RS
@Path(at class level) - Any Spring/JAX-RS controller annotations
Output: List all controller files found with paths
Pass 2: Open and Read Each Controller File
For EACH controller file identified in Pass 1:
- Open the complete file
- Read all content
- Do NOT skip any file
Pass 3: Extract All Methods with Mapping Annotations
From each controller file, extract ALL methods with:
@GetMapping,@PostMapping,@PutMapping,@DeleteMapping,@PatchMapping@RequestMapping(with or without method specification)- JAX-RS:
@GET,@POST,@PUT,@DELETE,@PATCH,@Path - GraphQL:
@QueryMapping,@MutationMapping,@SchemaMapping - Any custom routing annotations
For each method, capture:
- Full method signature (including annotations)
- File path and line number
- HTTP method and path (combining class-level + method-level mappings)
Rules:
- Do NOT assume similar endpoints — each must be documented
- Do NOT skip versioned endpoints (v1, v2, v3, v4)
- Do NOT skip similar-looking methods
Pass 4: Build Complete API Inventory
Output API Discovery Results:
API DISCOVERY COMPLETE:
- Total Controller Files: [X]
- Total API Endpoints Found: [Y]
- Controller Files Scanned: [list all paths]
- APIs by Controller: [count per file]
- Complete API List:
* [HTTP_METHOD] [FULL_PATH] (File: ..., Line: ...)
* [HTTP_METHOD] [FULL_PATH] (File: ..., Line: ...)
* ... (all APIs)Pass 5: Verification
- COUNT CHECK: If the API count looks low relative to the controller files found (e.g. a controller with no extracted endpoints, or far fewer endpoints than mapping annotations in the file), output
"Low API count detected. Rescanning..."and repeat Pass 1-4 - Versioning CHECK: Verify all versioned endpoints included (v1/v2/v3/v4 if present)
- HTTP Methods CHECK: Verify all HTTP methods represented (GET/POST/PUT/DELETE/PATCH if used)
CRITICAL: Do NOT proceed to STEP 3 until all APIs are discovered and verified.
STEP 3: Write Metadata, Project Structure & Shared Components
The sections of REPO_MAP.md are always written in this canonical order:
- METADATA HEADER
- PROJECT STRUCTURE
- SHARED COMPONENTS
- APIs (one section per API)
Section 3A: METADATA HEADER (MANDATORY)
The FIRST content in REPO_MAP.md must be the metadata block:
---
baseline_commit: <full 40-char SHA from `git rev-parse "$DEFAULT_BRANCH"`>
generated_at: <ISO 8601 timestamp>
default_branch: <DEFAULT_BRANCH>
total_apis: <count>
last_updated_by: claude-code
---Example:
---
baseline_commit: 04af7fdd8abc123def456789abcdef1234567890
generated_at: 2025-05-25T10:30:00Z
default_branch: main
total_apis: 47
last_updated_by: claude-code
---This metadata enables:
- Incremental updates (compare against baseline_commit)
- Staleness detection (compare generated_at with last commit date)
- API count verification
ACTION: Write REPO_MAP.md (create new file, overwrite if exists) with the Write tool
- Confirm: "METADATA HEADER written to REPO_MAP.md"
Section 3B: PROJECT STRUCTURE
Generate complete directory tree of the workspace:
- Full directory structure
- Use absolute paths
- Include ALL files
- Organize hierarchically
ACTION: Append to REPO_MAP.md with the Edit tool
- Confirm: "PROJECT STRUCTURE appended to REPO_MAP.md"
Section 3C: SHARED COMPONENTS
Scan workspace for and list:
- All service classes (
*Service,*Manager) - All repository classes (
*Repository,*Dao) - All utility classes (
*Util,*Helper) - All model/DTO classes
- All configuration classes
- All interceptors/filters
For each component, include:
- Full class name
- File path
- Brief purpose (if obvious from name/annotations)
ACTION: Append to REPO_MAP.md with the Edit tool
- Confirm: "SHARED COMPONENTS appended to REPO_MAP.md"
STEP 4: Document All APIs (Automatic Continuation)
State tracking: Maintain progress counter: "API [X of Y]: [METHOD] [PATH]"
For EACH API in the inventory (in discovery order):
Per-API Documentation Structure
API heading format: ## [HTTP_METHOD] [PATH]
For API [X of Y], document:
1. Entry Point
- File path and line number
- Full controller method signature with all annotations
- HTTP method and path
2. Request Flow (Chunked Recursive Tracing)
Follow the Chunked Flow Tracing Engine below. Document each step with file + line references.
3. DTO Documentation
- Input/request DTO (if applicable)
- Output/response DTO
- Field mappings
4. Dependencies
- Services called
- Repositories accessed
- External clients used
5. Database Operations
- Query types (SELECT, INSERT, UPDATE, DELETE)
- Tables affected
- Transaction scope
6. External Calls
- HTTP calls to other services
- RPC/gRPC calls
- Third-party integrations
7. Error Handling
- Exception types caught
- Error responses returned
- Fallback logic
8. Success and Failure Paths
- Happy path flow
- All failure scenarios documented
After Documenting Each API
ACTION: Append to REPO_MAP.md with the Edit tool
- Confirm: "API [X of Y]: [METHOD] [PATH] appended to REPO_MAP.md"
- Automatically proceed to the next API (see "Continuation Policy" below)
Error Recovery
- If documentation of one API fails: Log error with API details
- Continue immediately to next API
- After all APIs processed, list any failed APIs and offer retry
Chunked Recursive Call Flow Tracing Engine
For each API, trace the complete request flow through all downstream classes.
Tracing Rules
RULE A: Process maximum 3 downstream classes per chunk RULE B: After 3 classes, write the current chunk's results RULE C: Then continue automatically with the next chunk (see "Continuation Policy") RULE D: Stop only when no further calls exist for current API
Continuation Policy
Chunks keep each step small; they are not a reason to stop. After each chunk (and after each API), continue automatically with the next chunk or API unless the context budget is running low. Only in that case:
- Write everything documented so far to REPO_MAP.md
- Output "Continue this API flow" together with the "Next Classes to Process" list
- Wait for the user's "Continue", then resume exactly where the previous chunk ended
Recursive Class Loading Process
For each downstream class identified:
- Open the file for that class
- Locate the method using full-text search
- Extract:
- Exact method signature
- File path and line numbers
- ALL direct method calls inside the method body
- Treat each direct method call as a new downstream step
- Include in output for next chunk
Chunk Output Format
### Request Flow - Chunk [N]
**Processing Classes:** [Class 1], [Class 2], [Class 3]
**Class 1: [ClassName]**
- Method: [methodName] (File: path/to/File.java, Line: XX)
- Method Signature: [full signature]
- Calls: [method1], [method2], [method3]
- Details: [what this method does]
**Class 2: [ClassName]**
- Method: [methodName] (File: path/to/File.java, Line: XX)
- Method Signature: [full signature]
- Calls: [method1], [method2], [method3]
- Details: [what this method does]
**Class 3: [ClassName]**
- Method: [methodName] (File: path/to/File.java, Line: XX)
- Method Signature: [full signature]
- Calls: [method1], [method2], [method3]
- Details: [what this method does]
**Next Classes to Process:** [Class A], [Class B], [Class C], [Class D]...
**Status:**
- If more calls exist: next chunk follows (or "Continue this API flow" if the context budget is low)
- If complete: "Request flow complete for this API"Continuation Handling
When resuming after "Continue this API flow":
- Preserve all context from previous chunk
- Load previous chunk's "Next Classes to Process" list
- Resume exactly where you left off
- Process next 3 classes
- Repeat until all reachable logic is exhausted
Continuation Recursion Depth
Never stop recursion after scanning a controller. Continue through:
- Service classes
- Manager classes
- Helper classes
- Utility classes
- Repository classes
- Client classes
Until all reachable logic for current API is exhausted.
STEP 5: Verification & Completion
After documenting all APIs:
Verification Checklist:
- Total APIs documented matches discovery count
total_apisin the METADATA HEADER matches the documented count- All controller files represented
- All HTTP methods included
- All versioned endpoints included
- No APIs skipped
Output completion message:
ALL APIS DOCUMENTED:
- Total APIs: [Y]
- All [Y] APIs written to REPO_MAP.md
- Baseline commit: [sha]
- File location: [path to REPO_MAP.md]If mismatch found:
- Output: "WARNING: Expected Y APIs, documented X APIs"
- List undocumented APIs
- Offer to continue with remaining APIs
File Writing Rules (Mandatory)
CRITICAL: All output must be written to REPO_MAP.md, not just printed to console.
File Operations
One method only:
- Write tool — creates/overwrites REPO_MAP.md with the METADATA HEADER (STEP 3A). Used once per full regeneration.
- Edit tool — every later change: appending PROJECT STRUCTURE, SHARED COMPONENTS and each API section (append after the current last line), and, during incremental updates, replacing individual API sections and metadata fields in place.
Do NOT write REPO_MAP.md with shell commands (cat, echo, tee, heredocs).
After each write, confirm in conversation.
Output Confirmation Messages
Throughout execution, output these confirmations:
- "METADATA HEADER written to REPO_MAP.md"
- "PROJECT STRUCTURE appended to REPO_MAP.md"
- "SHARED COMPONENTS appended to REPO_MAP.md"
- "API [X of Y]: [METHOD] [PATH] appended to REPO_MAP.md"
- "All [N] APIs written to REPO_MAP.md"
Verification-First Rule
Always search files before answering.
- Positive match → return exact file + line.
- Negative match → list searched files + confirm absence.
Framework Support
This skill supports:
- Spring Framework: @GetMapping, @PostMapping, @RequestMapping, etc.
- JAX-RS: @GET, @POST, @PUT, @DELETE, @PATCH, @Path
- GraphQL: @QueryMapping, @MutationMapping, @SchemaMapping
- Custom annotations: Any routing annotations detected in workspace
Important Notes
- Deterministic: This skill operates based only on real files in workspace. Never guess, infer, or hallucinate.
- Exhaustive: Every source file matching FILE_GLOBS is scanned. No files skipped.
- Incremental: REPO_MAP.md builds section by section, and later runs only re-document what changed since
baseline_commit. - Resilient: Errors in one API don't stop the entire process.
- Traceable: Complete request flows traced through all downstream classes.
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.

