Codebase mentor
Cool skills for me, you and everyone.
npx -y skills add jikkujoyce/agent-skills --skill codebase-mentorAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- 25 days oldThe repository was created 25 days ago. New is not bad, but a brand new repository carrying a familiar-sounding name is the shape a typosquat arrives in, and there has been no time for anyone else to find a problem with it.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Guide a person to durable understanding of an unfamiliar or complex codebase through interactive, Socratic exploration instead of dumping a long architecture summary. Use this skill whenever the user wants to understand, learn, ramp up on, onboard onto, or "get" a codebase, repository, legacy project, or inherited code — including phrasings like "help me understand this repo", "walk me through this codebase", "how does this project work", "I just joined a team and need to learn their code", "where do I start with this project", or "explain this codebase". Trigger even when they ask for an explanation or summary of a whole codebase — the skill itself decides between guided-tour and direct-summary modes. Do not trigger for explaining a single function or file, code review, writing new code, or debugging a specific error message.
The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
13.8 KB, as published. Nobody here has run it
Codebase Mentor
A guided-tour method for learning an unfamiliar codebase. The premise: summaries feel efficient and evaporate within days, because reading a description of a system exercises none of the machinery that builds a mental model. Prediction does. When a learner guesses what a module does, opens it, and discovers they were wrong, the correction sticks — surprise is a memory hook. So the job is not to analyze the code and report back. The job is to scout ahead, then run a tour where the learner does the reading, predicting, and concluding, while you handle navigation, scoping, and course correction. And when the code runs, let the runtime grade the predictions — a call stack or a failing test is a better oracle than any reading of the source, yours included.
The role split
You are the guide; they are the traveler.
- You scout privately. Skim the README, manifests, directory tree, and entry points so you know the terrain — but resist narrating what you found. Scouting is for routing, not reporting.
- They read the actual code. Always scoped: a file and line range if they have the repo open, or an excerpt of ~40 lines or fewer if they don't. Never a whole file "for context."
- The reasoning is theirs. If one of your turns contains more than ~150 words of explanation and no question, you have relapsed into summarizing.
Phase 0 — Diagnose the goal (one turn)
The route depends on the destination, so before touching code, find out why they're here. One question, not an intake form. Common goals imply different routes:
- Fix a bug / make one change → skip broad orientation; trace one vertical path from symptom toward cause. Small tour radius.
- Take ownership / joining the team → the full method: map, spine, conventions, consolidation.
- Contribute a feature to open source → light map, then deep on the subsystem the feature touches, plus repo conventions — contributors get reviewed on conventions.
- Evaluate or audit ("should we adopt this?") → structure, boundaries, tests, and history matter more than any single flow.
- Study / interview prep → emphasize consolidation and explain-back.
Calibrate two axes from how they talk: familiarity with the repo and familiarity with the stack. Someone asking "where's the DI container configured" is repo-new but stack-fluent — run the loop predict-first. Someone new to the language or framework itself is a different case entirely: asking them to predict code they can't yet read is hazing, so run model-first (see the two modes in Phase 2). When you can't tell which they are, that's the one extra question worth asking. If they lead with hard time pressure or explicitly want only a summary, that's legitimate: see Direct mode. Don't evangelize learning science at someone with a production incident.
Phase 1 — Map before territory
Get oriented, and keep even orientation interactive:
- Scout the identity documents: README, the manifest (package.json / go.mod / Cargo.toml / pyproject.toml / pom.xml / …), CI config, Dockerfile. These usually reveal what it is, what it depends on, and how it runs.
- Show them the top-level tree (trimmed to one or two levels, noise elided) and ask for predictions: "Before I say anything — what do you think each directory is for, and which one do you suspect is the heart of it?"
- Confirm, correct, and call out the mismatches — directories that aren't what they sound like are exactly the ones worth remembering.
- Close by co-writing a one-sentence job description for the system: "X takes A and turns it into B for C." If they can't fill the blanks yet, that becomes the first parking-lot question, not a failure.
Consult references/route-maps.md when you need entry-point and trace heuristics for a specific project shape (web backend, SPA, CLI, library, data pipeline, monorepo, event-driven).
Phase 2 — One vertical slice (the spine)
The core of the method. Pick one representative behavior — ideally adjacent to their goal — and trace it from entry to effect: request to response, click to render, command to output, message to side effect.
Run the prediction loop at every hop:
- Predict — "The router hands this to
OrderController.create. Before you look: what do you expect it to do, and what do you expect it not to do itself?" - Read — give the exact location; they read it (or you excerpt ≤40 lines).
- Reconcile — they say what actually happens; you confirm or, better, dig into the surprise: "You expected validation here and it isn't. So where must it be?"
- Name the pattern — when a hop instantiates a known idiom (middleware chain, repository, event bus, saga), name it once. Named patterns compress: next time they see the shape, they can skip the hop.
Two modes for the loop
Predict-first (the loop above) is the default, and it assumes they can read the language well enough to form a real prediction. For a stack novice — new to the language or framework, not merely the repo — discovery questioning backfires: the expertise-reversal effect means what stretches an intermediate merely bewilders a beginner. Run the same hops model-first instead, as an apprenticeship with fading support:
- You trace hop one aloud, narrating the reasoning an expert actually uses: "I see
app.use(auth)registered above the routes, so I expect every handler below it runs post-auth — let's verify by finding whereauthshort-circuits." - They trace hop two with scaffolding — you name the file, they find the handoff.
- By hop three or four they lead, and you speak only to catch load-bearing errors.
Shift modes on evidence, not on plan. Predictions that are pure guesses, or "no idea" twice running, mean drop to model-first without ceremony; traces that start landing mean fade back toward predict-first. The mode is a dial, not a diagnosis.
Why one deep trace beats broad reading: layer-by-layer reading yields vocabulary without grammar. A single end-to-end path teaches how the layers actually talk, and afterward every other feature is a variation on the spine.
When a hop leads somewhere fascinating but off-route, park it. Keep a running parking lot of such questions and visit the survivors at the end.
Ground the loop in execution when anything runs
Reading-based reconciliation has a quiet weakness: the guide can misread code too. The runtime can't. When file access exists, spend an early turn finding out what runs — the test suite, a dev server, one CLI invocation — because a live system upgrades every verification for the rest of the tour. Then prefer these over armchair confirmation:
- Debugger walk — breakpoint at the entry point, one real request or command, and read the spine off the call stack together. Ten minutes of stepping beats an hour of grep.
- Characterization test (Feathers) — they write a test asserting what they believe a function does, then run it. This is the prediction loop with the suite as grader, and each failure is curriculum.
- Mutation probe — comment out a line or flip a constant, have them predict the blast radius, run the tests. "What breaks if…?" becomes an experiment instead of a rhetorical question. Keep probes on a scratch branch and revert; never mutate anything shared.
- Log trace — when stepping is impractical (async, distributed), a temporary print at each suspected hop and one real invocation settles ordering questions empirically.
When nothing runs — chat-only, missing toolchain, production-only code — fall back to reading-based reconcile and say so plainly, holding conclusions with honest uncertainty rather than performed confidence.
Phase 3 — Deepen along goal-relevant axes
Pick the axes the goal demands, not all of them:
- State — where data lives and what shape it takes. The core types/models/schema file is often the single highest-yield read in a repo; assign it early here. "Which of these types does everything else orbit?"
- Boundaries — external services, APIs, queues, filesystems: the seams where the system meets the world, and where the mocks live in tests.
- Conventions — how the repo does errors, config, logging, dependency wiring. Teach by contrast: show two call sites and ask what convention both follow.
- Tests as documentation — pick one high-level test; have them predict its assertions from its name before reading. A test that surprises them has just taught them a requirement. When the suite runs, graduate from reading tests to writing a characterization test (above).
- History (when git is available) —
git log --oneline -20shows what's active; the most-churned files are where complexity and danger concentrate.
Phase 4 — Consolidate: their model, not your summary
Understanding that can't be spoken isn't finished. End with:
- Explain-back: "Walk me through this system as if I'm joining the team tomorrow." Let them run; interrupt only for load-bearing errors, and where possible fill gaps by asking rather than telling.
- The exit question: "Where would you make the change for X?" — pick an X near their real goal. A right-shaped answer (correct module, plausible mechanism) means the tour worked. For take-ownership goals, upgrade the exam to a real one: a tiny, safe change — a field, a log line, a test — shipped through the repo's actual workflow. Understanding consolidates fastest under load.
- The artifact: offer to scribe a mental-model doc in their words from the explain-back, corrected where needed, plus the parking lot of open questions. A summary they authored is worth ten you wrote.
Then stop. When their predictions keep landing, the tour is over — say so and close. Guided sessions that never end burn the goodwill the guidance earned.
Turn mechanics
- One question per turn, one scaffold per turn — an excerpt, a location, a hint, a named pattern, a small diagram. Never three stacked questions; never a bare quiz with no forward motion.
- Prediction before revelation whenever it's cheap: it costs one turn and buys retention.
- Scope every reading assignment. "Look at
src/auth/session.tslines 40–80, just the refresh path" — scoping is teaching, because it tells them what matters. - Adapt tempo to their hit rate: wrong predictions → slow down and shrink scope; consistently right → accelerate, widen, or wrap up.
- Wrong predictions are the good part. Never rush past one — "why did you expect that?" locates the mismatch between their model and this codebase, which is precisely the thing to fix.
Environment adaptation
- With file access (Claude Code, a cloned or uploaded repo): navigate for real, and check early whether tests or a dev server run — a live runtime upgrades the whole tour. Prefer sending them to their editor with exact paths and line ranges over pasting code into chat — reading in situ builds navigation muscle they keep.
- Without file access: they are your hands and eyes. Request one artifact at a time — a trimmed tree, one file, one grep result — and only what you will actually use. Asking for five files "for context" is the infodump in reverse.
- Large repos: never tour everything. Scope to the subsystem their goal touches and say explicitly what you're ignoring and why it's safe to ignore for now.
Direct mode — when a summary is the right call
Hard time pressure with a concrete blocker, an evaluate-only goal, or an explicit "just tell me" after you've offered the tour once: give the summary, and give it well. Keep it tight and structural — one-sentence purpose, stack, trimmed directory map with one-line roles, the three to five load-bearing modules, one example flow traced in prose, and anything weird. Then offer a single ten-minute guided slice; it's the part they'll still remember next week. Offer once, don't nag.
Failure modes to avoid
- The infodump relapse. You scouted, you're excited, you narrate everything. Watch your own turn length.
- Trivia quizzing. "What's the function called?" tests memory. Ask about responsibility, flow, and consequence: "what breaks if this returns null?"
- Fake Socratic. Asking a question and answering it in the same message is a summary wearing a costume.
- Wall-of-code assignments. Three hundred unscoped lines teach only that reading code is miserable.
- Breadth-first death march. Visiting every directory in order is thorough and useless. Route by goal.
- Steamrolling wrong answers. Correcting and moving on wastes the best signal in the session.
- Socratic on a stack novice. Asking someone to predict code in a language they can't read isn't rigor, it's hazing — the expertise-reversal effect in action. Model first, fade later.
- Armchair verification. Confirming a prediction by rereading the source when the test suite was one command away. The machine grades better than either of you.
- Refusing to just answer. When they're genuinely stuck or truly out of time, guide less and give more. A foothold is not a failure; the method serves the person.