/codebase-mentor:codebase-mentorfrom Codebase Mentor
Use repository design context when implementing changes, explaining code, or checking documentation. Read the relevant subsystem guide, verify current source, and respect design constraints. Works with or without ONBOARDING.md.
Ships in Codebase Mentor. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Activate this skill for repository changes where design context matters, architecture questions, change planning, claim checks, and freshness scans. For ordinary coding tasks, prepare relevant context and then do the requested work; do not force a separate mentoring report. The skill works in Claude Code, Codex, IBM Bob, and other agents that support the open SKILL.md format.
Start in any repository, with or without an ONBOARDING.md. When a map exists, use it to find the relevant code, then verify its claims. Without a map, work directly from source. Live source is the truth.
Tool mapping: where the protocol says "read", use your file-reading tool (Read in Claude Code); where it says "search", use your code-search tool (Grep in Claude Code).
Companions: use onboard to set up a repository, draft a map and subsystem guides, check setup status, or remove managed context entries (/codebase-mentor:onboard in a Claude Code plugin install). The authoring references sit alongside this SKILL.md: ONBOARDING.template.md, SUBSYSTEM_GUIDE.md, and AUTHORING_GUIDE.md. Resolve these files relative to this skill's directory, not the user's repository. Installing the skill alone does not configure automatic use; ask to set up the repo.
Every architecture or change-guidance claim you make must be backed by a symbol or file read in the current session.
Do not answer from pre-training knowledge about what a codebase "typically" looks like. Do not assume a class or method exists because a similar pattern is common. Read the source first, then answer from what you found.
Answers are regenerated from current source, not from a persistent index. If a relevant source artifact cannot be located, say so explicitly — do not fill the gap with inference.
Distinguish observed behavior, documented decisions, developer-confirmed rationale, and unresolved assumptions. A proposed new name is not an existing symbol. Attribute rationale to its document or the developer who confirmed it; code alone cannot establish historical intent. Source reads establish what the checked-out code says, not what is deployed or enabled at runtime. If a documented constraint conflicts with current behavior, identify both and resolve the relevant uncertainty before relying on either as settled.
Source is the truth. ONBOARDING.md is the map.
Use symbol anchors with file paths: functions, classes, methods, workflow jobs, or configuration keys. For documents and declarative projects, cite the file and relevant heading or key. Names need not be globally unique, so include enough path context to locate the evidence.
Correct citation format: "This is handled in ResolverClass.resolveCommand() in path/to/ResolverClass.java."
For a workflow: "The deploy job in .github/workflows/docs.yml publishes the site."
Do not rely on bare line numbers as durable anchors. A current file link with a line number is useful navigation when the agent supports it, but include the symbol, heading, or key as well. If a method is long, name the relevant inner call or block.
For an ordinary implementation, debugging, or review request, use the following preparation quietly, then carry out the requested work:
Scale preparation to the task. An isolated edit needs only its relevant context; do not run a full scan, read every guide, or reread unchanged evidence before each action. Existing maps without subsystem links work as before. Missing context does not prevent supported source-based work.
The explicit modes below remain available when the developer requests their output.
Trigger: Developer asks an architecture question ("How does X work?", "What handles Y?", "Why does Z exist?", "Walk me through the pipeline for…").
Your job: Read ONBOARDING.md to orient yourself, locate the relevant source, read it, then answer with symbol-anchored citations.
Steps:
Locate and read ONBOARDING.md using the discovery rules below. Identify the relevant section and follow any explicitly listed subsystem guides whose scope matches the question. If no map exists, locate entry points directly in source.
From the relevant ONBOARDING.md section, extract one to three symbol or file anchors that point toward the answer.
Open each symbol in the live source. Read the file directly, or search for the class name if the path is unknown — whichever resolves the symbol fastest. Read the body if the question requires understanding behavior, not just structure.
If the ONBOARDING.md pointer leads to a dead end (symbol does not exist, class has been renamed, method is gone), do not guess. Declare the pointer stale and fall back to searching the source directory for a plausible replacement (see Evidence-Missing Protocol below).
Compose the answer using only what you read in steps 2–4. Structure the answer as:
If the question requires tracing a full request path, follow the chain: read each layer in turn, do not skip ahead from ONBOARDING.md summary to a final answer.
Trigger: Developer requests guidance for a change ("Where do I start to implement Z?", "Plan how to add X"). For a request to implement the change, use Everyday Work and continue through implementation rather than stopping at a checklist.
Your job: Find the nearest existing example of the same type of change in the live source, then produce an ordered checklist of files and methods to touch.
Steps:
Read ONBOARDING.md and the relevant explicitly linked subsystem guides, especially their change recipes and constraints. Extract the recipe that most closely matches the requested change.
If a matching recipe exists, use its symbol anchors to locate the relevant files and classes. Open them in the live source.
If no matching recipe exists in ONBOARDING.md, search the source for the nearest existing example of the same pattern. For example, if the task is "add a new command", find one existing command resolver and read it to understand the pattern.
From the live source, identify the existing symbols and files the change touches and the new artifacts you propose. Order them by dependency. State the scope you checked and any unresolved dependencies instead of claiming the list is exhaustive without evidence.
Produce the checklist in this format:
1. Proposed: create `NewResolver` implementing `CommandResolver<NewCommand>` in `path/to/resolvers/`
— Model on: `ExistingResolver.resolveCollectionCommand()` in `path/to/ExistingResolver.java`
2. Existing: update `ResolverRegistry.register()` in `path/to/ResolverRegistry.java`
— Verified registration point for the proposed resolver
3. ...
After the checklist, note any gotchas called out in the ONBOARDING.md "known gotchas" section that apply to this change type. If ONBOARDING.md has no entry for this change type, say so — do not invent gotchas.
Anchor every actionable step to an existing symbol, file, or configuration key read this session. Label new names Proposed and cite the verified example or extension point that supports them. Put doc-only suggestions and missing evidence under Unresolved questions, not in the verified checklist. Explain what must be inspected or clarified before those steps can be recommended.
Include the relevant tests, exact verification command and working directory, and prerequisites. Distinguish a command identified from project configuration from a command actually run successfully.
Trigger: Developer asks whether a specific claim is still true ("Is it still the case that X?", "Does Y still work like this?", "ONBOARDING.md says Z — is that right?").
Your job: Read the relevant source and compare it against the claim. Report what the source actually says.
Steps:
Identify the specific claim to check. Extract any class or method names embedded in the claim — these are your starting anchors.
Locate each anchor in live source. If the anchor does not exist, report that the class or method could not be found at that name and describe what you found nearby.
Read the relevant source body. Focus on the behavior described in the claim (not adjacent behavior).
Compare source behavior to the claim. Produce one of three verdicts:
If the claim is Stale, follow Focused Maintenance: propose a small correction with evidence, including any affected root routing entry. Apply it only when the developer has authorized that correction.
Trigger: Developer asks for a freshness check ("Is the ONBOARDING.md still accurate?", "Has anything drifted?", "Run a scan").
Your job: Verify the entry map and the subsystem guides it explicitly lists against current source, and report divergences and coverage.
Steps:
Establish the document set: by default, the entry map plus every subsystem guide explicitly listed by it, including reused guides at custom paths. A request explicitly limited to one document checks only that document. Do not recursively crawl every linked document. List missing or inaccessible guides as uninspected, rather than silently excluding them.
Read the selected documents in full. Extract every structural or behavioral claim, including routing paths, examples, test commands, and cross-subsystem contracts. Attribute rationale and human context separately; do not claim source proves historical intent.
Group the claims by source area (e.g., "resolver layer claims", "pipeline claims", "error handling claims"), retaining each document and section.
For each group, open the relevant source files and verify the claims. Read the file to check class structure efficiently before reading bodies. Read bodies when a claim is about behavior, not just existence.
Classify each claim:
Produce a scan report in this format:
## ONBOARDING.md Freshness Scan
**Scanned:** <date or "current session">
**Source root:** <path>
**Source revision:** <commit and working-tree changes, when available>
**Documents:** <checked, skipped, missing, or inaccessible documents>
**Coverage:** <claims checked / claims identified, plus any areas not inspected>
### Divergences
| Document / section | Claim summary | Status | Evidence |
|---|---|---|---|
| Execution Lifecycle | "sort validation runs in SortClause.validate() before the resolver" | ⚠️ Stale | Source: `FindOneCommandResolver.resolveCollectionCommand()` calls `sortClause.validate()` inside the resolver, not before it |
| ... | ... | ... | ... |
### All-Clear Items
<count> claims verified as current. [List section names only, not individual claims, to keep the report readable.]
### Recommended Updates
For each ⚠️ Stale entry, describe the corrected statement in one sentence.
Report incomplete coverage and unverifiable claims explicitly, including any document whose claims could not be enumerated. Only call the scan fully current when every document in scope was read and every identified claim was checked and confirmed. State the scope of any all-clear result. Apply corrections when already requested by the developer; otherwise present the report and proposed updates for approval.
While using context, verify claims relevant to the task. At completion, compare the consulted root and subsystem entries with the source affected by the work. A stale anchor should trigger a source search, not repetition of an unverified claim.
When relevant drift exists:
Stay quiet when no relevant drift is found. Do not create a routine freshness report for every task. Comprehensive checks remain available through Scan mode.
When you cannot locate source evidence for a claim you need to make, follow this protocol exactly. Do not improvise or fill the gap with inference.
Step 1 — Declare the gap:
"I cannot find
ClassNameat the expected path. I'll search for it."
Step 2 — Search:
Search for the class or method name across the source directory. If ONBOARDING.md references a path, verify the path exists.
Step 3a — If found under a different name or path: Report the discrepancy, then proceed with the located symbol. Mark the ONBOARDING.md pointer as stale in your answer.
"I found
UpdatedClassNameatnew/path/UpdatedClassName.java— the ONBOARDING.md pointer is stale. Proceeding from current source."
Step 3b — If not found anywhere in the source: Report the unresolved claim honestly. Continue with other supported parts of the question, without treating the missing claim as true.
"I cannot find evidence for this claim in current source. The class or method may have been removed or renamed. I cannot confirm or describe this behavior without source evidence. The ONBOARDING.md entry should be reviewed."
Never say "typically", "likely", "probably" or similar hedges when you mean "I have not read the source." Use the explicit evidence-missing declaration instead.
Use an explicit document path supplied by the developer. Otherwise, use the map selected by the project's effective Mentor setup instructions, including a custom path. If neither selects a map, check these locations relative to the selected project root:
./ONBOARDING.md./docs/ONBOARDING.md./doc/ONBOARDING.mdIf more than one exists, identify the alternatives and use the one whose scope matches the question. Ask which is authoritative if that remains unclear. Do not merge competing maps silently.
If none exist, tell the developer: "No ONBOARDING.md found. I can still answer questions from live source, but the doc's rationale and gotcha context is unavailable. Generate a draft with the companion onboard skill if your agent supports skills, or use the template at https://github.com/jestatsio/codebase-mentor/blob/main/template/ONBOARDING.md."
Proceed in source-only mode: read and search the source to explore structure before answering, and rely on ONBOARDING.md guidance only when the file exists.
The entry map is the index. Follow its explicit subsystem-guide links and scope descriptions for relevant paths and kinds of changes. Resolve relative links from the document containing them. Existing useful documentation and custom guide locations are valid; new guides conventionally live at docs/mentor/<subsystem>.md.
If a relevant guide link is broken, search existing documentation for a moved or renamed guide before editing. Use the intended scope and path to keep the search focused. Verify a replacement's scope and source anchors before relying on it, and propose corrections for both the root routing entry and any stale claims in the recovered guide. If no replacement can be identified, state the context gap and continue from available source without claiming the guide was checked.
Do not discover arbitrary nested maps or treat a nested guide as overriding broader guidance by its location. Root and subsystem context complement the project's effective instructions and never override the user's instructions. When guidance conflicts, verify the relevant source and ask for clarification if the design decision remains unresolved.
Keep the entry map short and use guides for local detail. Existing longer maps and the seven-section format remain supported without migration.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
2 skills in this plugin
npx claudepluginhub jestatsio/codebase-mentor --plugin codebase-mentor