agentsclimarketplace

Learn codebase

Skill magnusrodseth/dotfiles/.claude/skills/learn-codebase

⚙️ There are many like them, but these dotfiles are mine. A stow-managed macOS setup: Zsh, Neovim, tmux, Ghostty, and a pile of Claude Code tooling.

Install
npx -y skills add magnusrodseth/dotfiles --skill learn-codebase

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 2 stars2 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

Understand a codebase by reading its actual source, on GitHub or on disk: how a pattern is really implemented, an org's conventions, how two things are wired. Use for "how does <repo> do X". For published API docs prefer find-docs.

SKILL.md

3.8 KB, 926 tokens by cl100k_base, as published. Nobody here has run it

Learn a Codebase

A targeted search for one contextual answer inside a repo's real source — not an onboarding. The job is to find the needle in the haystack: how to do X in framework Y, how to share state across X and Y, how self-service security is wired inside Gjensidige — whatever the surrounding task needs. Read only enough to trust the find.

find-docs covers a named library's published docs (Context7). Use this for the source itself: internal patterns, org conventions, cross-repo how-X-is-really-done, and private repos with no docs.

The spine

1. Pin the question

State the one question the search must answer, in a sentence — the north-star question. If the surrounding task already implies it, use that. If you were handed a bare URL with no goal, ask one sharp question first; do not start a generic survey.

This question is your completion criterion: you are done when you can answer it with citations, never when you "understand the repo."

2. Locate the code — check local first

Cheapest source wins. In order:

  1. Working tree / open session sources — already in front of you? Use it.
  2. Already on disk. Org and work repos usually live at ~/dev/<owner>/<repo> (e.g. ~/dev/gjensidige/<repo>). Search, then confirm identity (a same-named dir is not the same repo):
    fd -t d -d 2 "^<repo>$" ~/dev
    git -C <hit> remote get-url origin   # must match <owner>/<repo>
    
  3. Learn cache at ~/.learn-codebase/<owner>/<repo>. If present, freshen before trusting it — fast-forward to the remote default branch; if offline, use it but flag staleness in your answer:
    git -C <dir> fetch --quiet --depth 1 origin && git -C <dir> reset --hard FETCH_HEAD
    
  4. Absent everywhere → shallow-clone into the cache. gh is authed over SSH for public and org repos alike:
    gh repo clone <owner>/<repo> ~/.learn-codebase/<owner>/<repo> -- --depth 1
    

The cache lives in $HOME, outside every git repo, so it never clutters dotfiles or the current project. Never clone into the working project or the dotfiles tree.

3. Hunt the needle

Do not read the repo into your own context. For anything past a single precise rg, fan out a read-only subagent (Explore, or general-purpose for big sweeps): hand it the pinned question verbatim plus the repo path, and have it report back file:line locations and the surrounding pattern, not file dumps. Keep the main context clean.

Orient only as much as you need to navigate to the needle — entry points, directory shape, build/run, naming conventions around the target. Skip the rest of the repo.

What to look for is contextual. For the menu keyed by intent (use a library's API, replicate a pattern across X↔Y, org infra / self-service / security, debug an integration, evaluate a dependency, match house style), read WHAT-TO-LOOK-FOR.md — it maps each intent to where the answer usually hides and the signal that confirms it.

4. Verify it's idiomatic

A single hit can be a one-off or a dead legacy path. Confirm it's the way this repo does it: used in more than one place, the current (not deprecated) approach, consistent with the repo's house style. Done = you can answer the question with concrete file:line citations and a copyable pattern you trust is idiomatic.

5. Answer inline

Give the focused answer to the pinned question: the pattern, file:line citations, and a minimal example adapted to our task. No notes file by default — if the user later wants it kept, hand off to the vault skill.

Gives 0 of the 12 instructions most architecture codebase skills give in 926 tokens

Counted across 811 of the 1,134 authors here whose files we hold, read 2026-08-07

  • ask the user which candidate to explorein 45 of 811, across 15 files
  • apply the deletion test to suspected shallow modulesin 43 of 811, across 15 files
  • read any relevant architecture decision records firstin 31 of 811, across 8 files
  • use exact glossary terms in every suggestionin 30 of 811, across 10 files
  • accept dependencies instead of creating themin 24 of 811, across 5 files
  • include before and after visualisations for each candidatein 24 of 811, across 5 files
  • read the domain glossary before exploringin 24 of 811, across 6 files
  • return results instead of producing side effectsin 23 of 811, across 4 files
  • explore the codebase for shallow modules and frictionin 23 of 811, across 3 files
  • introduce seams only where things varyin 22 of 811, across 3 files
  • reduce the number of methodsin 21 of 811, across 2 files
  • design deep modules with small interfacesin 21 of 811, across 3 files

Said here and by no other author read

  • state one specific question to answer
  • check local sources before cloning
  • freshen cached repositories before trusting them
  • shallow-clone absent repositories into the cache
  • clone repositories outside the working project
  • use a read-only subagent for broad searches

Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.