repo-onboarding
Skill1 starsChanged 20 days agoApache-2.0View on GitHub
Build and maintain a persistent, commit-tracked structural map of any codebase in .claude/repo-map/ and answer codebase questions using verified file:line evidence. Use when the user asks how something works in this codebase, where to make a change, for an architecture overview, or when onboarding to an unfamiliar repo.
10 other projects use a version of this.
Adopted by
Most recently taken up by
- KhaiTrang1995/nexus-kbtheir own version, first seen Nov 8, 2026
- salmandev/everything-geminitheir own version, first seen Oct 17, 2026
- dss-time/repo-doctor-skillstheir own version, first seen Oct 15, 2026
- nhat092005/skillstheir own version, first seen Oct 13, 2026
- exerias21/brainstorm-toolkittheir own version, first seen Oct 4, 2026
- RichardGeorgeDavis/Codex-Workspacetheir own version, first seen Sep 18, 2026
Used with
Projects with it also use mcp-maintainer and release-guard.
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.
KhaiTrang1995Skillmcp-maintainer
Operate and maintain the local MCP server for this repository. Use for MCP tool updates, policy-guard changes, host configuration, and MCP runtime troubleshooting.
Also in 3 projects that use this
KhaiTrang1995Skillrelease-guard
Run release-readiness checks for this repository. Use when validating docs, scripts, verification coverage, and operational safety before merge or release.
Also in 3 projects that use this
Other versions10 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 10
- hoangsonww/Claude-Code-Agent-Monitor★ 1.2ksame name
- caiaffa/claude-code-ultimate-engineering-system★ 17same name
- ldilov/harness-forge★ 4same name
- RichardGeorgeDavis/Codex-Workspace★ 2same name
- salmandev/everything-gemini★ 2same name
- dss-time/repo-doctor-skills★ 1same name
- KhaiTrang1995/nexus-kb★ 1same name
- nhat092005/skills★ 1same name
- exerias21/brainstorm-toolkit★ 0same name
- MrZarrar/Jarvis-Sub-Agent-Dashboard★ 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.
The file
Show its rules and text
We split this skill into the rules it gives an agent
26 rules. 0 are common, 10 are distinctive, and 16 are very specific to this project.
0
Common
Most of the 10 edited versions we read keep these.
10
Distinctive
This author's own choices. Worth a look.
16
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Use when onboarding to an unfamiliar repository or when the user asks for an architecture overview, tour, or module breakdown.
- Distinctive: line 13
Use when the user asks "how does X work here?", "where is Y implemented?", or "what calls Z?".
- Distinctive: line 14
Use when the user asks "where do I change Y?" or "how do I add a new route, command, job, or test?" so changes follow the repository's real …
- Very specific: line 15
Use when .claude/repo-map/ already exists and needs an incremental refresh after new commits before answering structural questions.
- Distinctive: line 23
Run the incremental diff checker from the skill directory against the target repository root:
- Very specific: line 33
UP_TO_DATE_WITH_UNCOMMITTED_CHANGES: Use the existing map for routing, but note the dirty files listed under UNCOMMITTED WORKING TREE … - Distinctive: line 38
When creating the map for the first time (or after a history rewrite), collect raw structural evidence before writing any map files.
- Very specific: line 42
Pattern-based convention discovery: Use ripgrep (rg -n) or the bundled discovery helper to locate concrete file:line examples of error …
- Very specific: line 43
Entry-point detection: Check standard entry locations (main.*, cmd/*/main.go, src/index.*, src/main.*, manage.py, app.py, server.*, CLI …
- Distinctive: line 45
Run the bundled discovery script to gather these raw findings in a single pass:
- Very specific: line 57
Treat scripts/scan.sh as a discovery helper, not a replacement for reading code.
- Very specific: line 61
Create .claude/repo-map/ inside the target repository and write five coordinated files.
- Distinctive: line 65
Document the high-level system shape so an engineer or agent can grasp how the components fit together in under two minutes:
- Very specific: line 92
Document inferred, real codebase patterns so any future code modification looks native to the repository.
- Very specific: line 102
Write a valid, compact JSON routing map that records the current Git HEAD hash and maps domain topics, features, and module names to …
- Very specific: line 128
Verify that .claude/repo-map/index.json parses cleanly with python3 -m json.tool .claude/repo-map/index.json.
- Very specific: line 132
When scripts/diff-check.sh --from-index <repo-root> reports STATUS: INCREMENTAL_UPDATE_NEEDED:
- Distinctive: line 141
Read the modified or newly added files in those directories to understand what changed (new routes, renamed symbols, updated dependencies, …
- Very specific: line 143
Update topics, modules, and last_built_commit (to the new CURRENT_HEAD hash) in .claude/repo-map/index.json.
- Distinctive: line 147
Follow this grounding protocol whenever answering a question about the repository:
- Very specific: line 149
Route via
index.jsonfirst: Read .claude/repo-map/index.json (and relevant sections of architecture.md, modules.md, entry-points.md, or … - Distinctive: line 150
Read the actual source files before answering: Always open and inspect the candidate source files directly.
- Very specific: line 151
Reconcile staleness in favor of live code: If a source file disagrees with the map (for example, due to uncommitted working-tree edits or …
- Very specific: line 152
Fall back to direct exploration for unmapped topics: If a question asks about a brand-new, uncommitted, or niche symbol not covered in …
- Very specific: line 159
Keep incremental updates surgical: When last_built_commit differs from HEAD by only a few files, do not rewrite untouched module …
- Very specific: line 160
Handle repositories without ripgrep (
rg): If rg is not installed in the environment, use ./scripts/scan.sh (which uses Python 3 standard …
“Common” is measured: kept by at least 6 in 10 of the 10 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-onboarding
Give the agent an accurate, persistent mental map of any codebase stored under .claude/repo-map/ (architecture.md, modules.md, entry-points.md, conventions.md, and index.json), updating incrementally via Git commit diffs and grounding every architectural or code-level answer in verified file:line references.
When to Use
- Use when onboarding to an unfamiliar repository or when the user asks for an architecture overview, tour, or module breakdown.
- Use when the user asks "how does X work here?", "where is Y implemented?", or "what calls Z?".
- Use when the user asks "where do I change Y?" or "how do I add a new route, command, job, or test?" so changes follow the repository's real conventions.
- Use when
.claude/repo-map/already exists and needs an incremental refresh after new commits before answering structural questions.
Steps
Step 1: Check Existing Map State and Git Freshness
Determine whether .claude/repo-map/index.json exists and whether its recorded commit matches the current Git HEAD.
- Run the incremental diff checker from the skill directory against the target repository root:
./scripts/diff-check.sh --from-index <repo-root>- Branch based on the reported
STATUS:
FULL_SCAN_NEEDEDorNO_GIT_REPO: Proceed to Step 2 (Full Structural Scan) to build.claude/repo-map/from scratch.UP_TO_DATE: Skip rescanning and proceed directly to Step 5 (Answer Questions Using the Map and Source Files).UP_TO_DATE_WITH_UNCOMMITTED_CHANGES: Use the existing map for routing, but note the dirty files listed underUNCOMMITTED WORKING TREE CHANGESand always read those files directly from disk before making claims about them.INCREMENTAL_UPDATE_NEEDED: Proceed to Step 4 (Incremental Diff-Driven Update) to rescan only the affected directories and patch the map files in place.
Step 2: Run the Language-Agnostic Structural Discovery Pass
When creating the map for the first time (or after a history rewrite), collect raw structural evidence before writing any map files. Do not hardcode assumptions for a single language. Follow this strict discovery priority order:
- Directory and file topology: Inspect how directories, packages, and filenames partition domain logic, interfaces, tests, and configuration.
- Manifest files: Parse present manifests (
package.json,go.mod,pyproject.toml,requirements.txt,Cargo.toml,composer.json,Gemfile,pom.xml,build.gradle,Makefile,Dockerfile) to extract declared dependencies, binary targets, and runnable scripts. - Pattern-based convention discovery: Use ripgrep (
rg -n) or the bundled discovery helper to locate concretefile:lineexamples of error handling, logging, test organization, import ordering, and configuration loading. - Entry-point detection: Check standard entry locations (
main.*,cmd/*/main.go,src/index.*,src/main.*,manage.py,app.py,server.*, CLI definitions, API routers, and job schedulers) alongside manifest-declaredscriptsorbinentries.
Run the bundled discovery script to gather these raw findings in a single pass:
./scripts/scan.sh <repo-root> --format markdownFor machine-parsable symbol, manifest, and topic-routing data, run:
./scripts/scan.sh <repo-root> --format jsonTreat scripts/scan.sh as a discovery helper, not a replacement for reading code. Open and read the primary entry points, core domain modules, and configuration files surfaced by the scan so your synthesized map reflects real control flow rather than filename guesses.
Step 3: Synthesize the Persistent Map in .claude/repo-map/
Create .claude/repo-map/ inside the target repository and write five coordinated files. Every claim in the markdown files must cite real file paths or file:line locations verified in the repository.
1. .claude/repo-map/architecture.md
Document the high-level system shape so an engineer or agent can grasp how the components fit together in under two minutes:
- System Purpose and Runtime Stack: Primary language(s), framework(s), runtime version, and external backing services declared in manifests.
- Major Components: Each core subsystem, its root directory, and its single-sentence responsibility.
- Component Connections and Data Flow: Trace how a typical request, command, or job enters the system, traverses middleware/services/domain layers, interacts with storage or external APIs, and returns a result, citing concrete
file:linehandoff points. - Cross-Cutting Concerns: Authentication, configuration loading, database/session lifecycle, and background processing.
2. .claude/repo-map/modules.md
Provide a per-directory/module reference table and breakdown covering every logical module in the repository:
- Module Path: Directory or package path (for example,
src/auth/,internal/billing/,pkg/storage/). - Purpose: What domain or technical responsibility the module owns and what it intentionally excludes.
- Key Files and Symbols: The 2 to 5 most important files in the module with
file:linereferences to primary classes, structs, or functions. - Inbound and Outbound Dependencies: Which internal modules depend on this module (inbound) and which internal modules or external packages this module imports (outbound).
3. .claude/repo-map/entry-points.md
List every place where execution starts so the agent knows where to trace runtime behavior:
- Application Bootstraps and Binaries: Main functions, server startups, and WSGI/ASGI/HTTP listeners with a one-line description and exact
file:linereference. - API Routes and Controllers: HTTP, GraphQL, gRPC, or WebSocket route registration points with HTTP method/path patterns and
file:linereferences. - CLI Commands and Scripts: CLI subcommands, management commands, and manifest
scripts/Makefiletargets withfile:linereferences. - Background Workers and Scheduled Jobs: Queue consumers, cron definitions, and event listeners with
file:linereferences.
4. .claude/repo-map/conventions.md
Document inferred, real codebase patterns so any future code modification looks native to the repository. Never assert a convention without backing it by 1 to 2 concrete file:line examples pulled from actual code:
- Error Handling Style: How errors are defined, wrapped, propagated, and translated into API/CLI responses (cite 1 to 2
file:lineexamples). - Test Structure and Location: Where unit/integration tests live, naming conventions (
test_*.py,*.test.ts,*_test.go), fixture/mocking patterns, and how tests are invoked (cite 1 to 2file:lineexamples). - Naming Conventions: File naming (
snake_case,kebab-case,PascalCase), symbol naming for classes/functions/constants, and interface/type prefixes (cite 1 to 2file:lineexamples). - Import Ordering and Module Boundaries: Relative vs. absolute/alias imports, grouping order (standard library, third-party, internal), and layer boundary rules (cite 1 to 2
file:lineexamples). - Logging and Observability Approach: Logger initialization, structured vs. formatted logging fields, and log levels used in practice (cite 1 to 2
file:lineexamples).
5. .claude/repo-map/index.json
Write a valid, compact JSON routing map that records the current Git HEAD hash and maps domain topics, features, and module names to relevant file paths:
{
"schema_version": "1.0",
"repo_name": "example-repo",
"last_built_commit": "4b825dc642cb6eb9a060e54bf8d69288fbee4904",
"last_built_branch": "main",
"generated_at": "2026-10-23T10:00:00Z",
"topics": {
"authentication": ["src/auth/service.py", "src/middleware/auth.py"],
"routing": ["src/api/routes.py", "src/app.py"],
"database": ["src/db/connection.py", "src/db/models.py"],
"cli": ["src/cli.py"],
"testing": ["tests/conftest.py", "tests/test_api.py"]
},
"modules": {
"src/api": {
"summary": "HTTP route handlers and request validation",
"key_files": ["src/api/routes.py", "src/api/schemas.py"],
"depends_on": ["src/auth", "src/services"]
}
}
}Verify that .claude/repo-map/index.json parses cleanly with python3 -m json.tool .claude/repo-map/index.json.
Step 4: Incremental Diff-Driven Update (Subsequent Invocations)
When scripts/diff-check.sh --from-index <repo-root> reports STATUS: INCREMENTAL_UPDATE_NEEDED:
- Inspect the
DIFF STAT,CHANGED FILES, andAFFECTED MODULES / DIRECTORIESsections emitted byscripts/diff-check.sh. - Re-scan only the affected directories rather than regenerating the entire repository map from scratch:
./scripts/scan.sh <repo-root> --paths <affected-dir-1> <affected-dir-2>- Read the modified or newly added files in those directories to understand what changed (new routes, renamed symbols, updated dependencies, or shifted line numbers).
- Patch only the affected sections in
architecture.md,modules.md,entry-points.md, andconventions.md, updating any shiftedfile:linereferences in the touched files. - Update
topics,modules, andlast_built_commit(to the newCURRENT_HEADhash) in.claude/repo-map/index.json.
Step 5: Answer Codebase Questions ("How does X work?", "Where do I change Y?")
Follow this grounding protocol whenever answering a question about the repository:
- Route via
index.jsonfirst: Read.claude/repo-map/index.json(and relevant sections ofarchitecture.md,modules.md,entry-points.md, orconventions.md) to identify the candidate files for the user's topic without scanning the whole repo. - Read the actual source files before answering: Always open and inspect the candidate source files directly. The map is a routing aid and high-level summary, never the sole authority for a code-level claim.
- Reconcile staleness in favor of live code: If a source file disagrees with the map (for example, due to uncommitted working-tree edits or line drift), trust the actual source file, cite its current
file:linenumbers, and flag or patch the stale map section immediately. - Fall back to direct exploration for unmapped topics: If a question asks about a brand-new, uncommitted, or niche symbol not covered in
index.json, run targeted search (rg -n/grep -rn/ file globbing) and read the matching files directly rather than guessing or saying "I don't know." - Cite concrete
file:linereferences: Every explanation of how a feature works or checklist of where to make a change must include exactfile:linecitations and point out the relevant patterns fromconventions.md(such as how to handle errors, write tests, and register routes) so changes stay consistent.
Gotchas
- Never answer from the map alone: Summarized markdown can miss subtle conditionals or recent uncommitted edits. Always verify against the underlying source files before stating how a function behaves or where to edit.
- Never assert conventions without
file:lineproof: Generic advice like "use standard Python logging" is unhelpful if the repo actually uses a custom structured logger wrapper atsrc/core/logger.py:18. Every entry inconventions.mdrequires 1 to 2 realfile:lineexamples. - Keep incremental updates surgical: When
last_built_commitdiffers fromHEADby only a few files, do not rewrite untouched module descriptions inmodules.mdorconventions.md. Patch only the sections impacted bygit diff <last-hash>..HEAD --stat. - Handle repositories without ripgrep (
rg): Ifrgis not installed in the environment, use./scripts/scan.sh(which uses Python 3 standard library) orgrep -rnEso discovery remains zero-dependency.
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.

