agentleFS
ricardodantasricardodantas/skills/skills/learn-codebase/SKILL.md

learn-codebase

Skill3 starsChanged 4 months agoMITView on GitHub

Learn and explain an unfamiliar codebase by first discovering which agent skills are installed, then applying the ones relevant to this repo's stack to map its architecture, modules, data flow, conventions, and how to build/run/test it. Produces an in-conversation briefing and a saved docs/CODEBASE_OVERVIEW.md, and creates a README.md and AGENTS.md/CLAUDE.md when the repo has none. Use when the user asks to "understand/learn/explain this repo", "onboard me to this codebase", "give me an overview of the project", "how does this codebase work", "this repo has no README/AGENTS.md", or when starting work in a repo you have not seen before.

15 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use oh-my-issues, what-the and 10 more.

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.
  • tuliosalustiano27Skill

    oh-my-issues

    Cluster a GitHub issue backlog by root cause into a small set of plan-master issues, redirect children with a standardized comment, and bundle architectural-fix PRs that close clusters atomically. Use when an issue tracker has accumulated dozens of reports that share underlying defects, when asked to triage / consolidate / cluster / dedupe issues, when asked to build a plan series or roadmap from open issues, or when routing a new incoming bug into an existing plan.

    Also in 4 projects that use this

  • tuliosalustiano27Skill

    what-the

    What the? Use when the user wants a plain-English breakdown of something technical — the who, what, where, why, and when.

    Also in 4 projects that use this

  • thedotmackSkill

    pathfinder

    Map a codebase into feature-grouped flowcharts, identify duplicated concerns across features, and propose a unified architecture. Use when asked to "find the ideal path," unify duplicated systems, or audit architecture before a refactor. Emits a proposed unified flowchart plus per-system /make-plan prompts.

    Also in 6 projects that use this

  • vikas8520-coderSkill

    cli-health

    Check server health, component status, and live metrics from the CLI. Run `health`, `health components`, and `health watch` for a real-time dashboard of circuit breakers and provider status.

    Also in 3 projects that use this

  • tunnckoCoreSkill

    how-it-works

    Use for 'how does X work', code walkthroughs before changing something, and placement / ownership / layering questions ('where should this live', 'which package owns this', 'is this the right layer'). Explains subsystem architecture, runtime flow, onboarding mental models. Can critique architecture. Use why for motivation.

    Also in 4 projects that use this

  • TrecekSkill

    make-plan

    Create implementation plans through deep codebase understanding. Use when user asks to create, devise, or write a plan. Leverages subagents to explore approaches, understand systems, and design aligned solutions.

    Also in 4 projects that use this

  • +1 more from tuliosalustiano27

The file

We split this skill into the rules it gives an agent

12 rules. 0 are common, 6 are distinctive, and 6 are very specific to this project.

  • 0

    Common

    Most of the 15 edited versions we read keep these.

  • 6

    Distinctive

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Do not hardcode a skill catalog — always read the live list, since installed skills change.

    line 39
  2. Very specific:

    Read only what's cheap and decisive before committing to skills:

    line 43
  3. Very specific:

    Monorepo?: check for workspaces (pnpm/yarn/npm workspaces, packages/*, apps/*, Cargo/Go workspaces) and analyze each package, not just the …

    line 52
  4. Very specific:

    When a skill fits, read its SKILL.md and apply its guidance during analysis.

    line 77
  5. Distinctive:

    Check the repo root (and, in a monorepo, only the root unless the user asks for per-package docs).

    line 107
  6. Distinctive:

    Use the templates in references/bootstrap-docs.md.

    line 108
  7. Very specific:

    README: if no README* file exists (any case or extension, e.g.

    line 110
  8. Very specific:

    Agent guidance: if none of these exist, create AGENTS.md plus a CLAUDE.md that imports it: AGENTS.md, CLAUDE.md, GEMINI.md, …

    line 112
  9. Distinctive:

    If only some exist, leave them alone.

    line 115
  10. Distinctive:

    Only create files that are missing.

    line 119
  11. Distinctive:

    If an existing one looks stale or thin, say so in the briefing and don't edit it.

    line 120
  12. Distinctive:

    Write the report and any bootstrapped files but do not commit them automatically — leave that to the user.

    line 126

“Common” is measured: kept by at least 6 in 10 of the 15 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Learn Codebase

Overview

Orchestrate the other installed skills to understand a codebase. First find out what skills exist, pick the ones that fit this repo, then use them to produce a briefing plus a saved docs/CODEBASE_OVERVIEW.md. If the repo has no README or no agent guidance file, create them from the same analysis.

Workflow

  1. Discover skills — see what's available.
  2. Detect the stack — cheap signals reveal languages/frameworks/tooling.
  3. Select relevant skills — match stack + task to skills.
  4. Analyze — apply the selected skills to learn the repo.
  5. Output — deliver a briefing and write docs/CODEBASE_OVERVIEW.md.
  6. Bootstrap missing docs — create README.md and AGENTS.md + CLAUDE.md if absent.

1. Discover available skills

The agent's injected <available_skills> list is the primary source — read it first. It is frequently truncated ("Additional skills available…"), so when full descriptions are needed for selection, run the bundled scanner to recover complete name: description pairs:

scripts/list_skills.py            # scans ~/.agents/skills, ~/.claude/skills, ./.claude/skills, ./skills
scripts/list_skills.py /path/to/skills   # add a non-standard location

Invoke it by its full path in this skill's directory — your cwd is usually the target repo, not the skill folder.

Do not hardcode a skill catalog — always read the live list, since installed skills change.

2. Detect the stack

Read only what's cheap and decisive before committing to skills:

  • Docs first: README, AGENTS.md / CLAUDE.md, CONTRIBUTING, docs/ — the highest-signal source for purpose, conventions, and the real build/run/test commands. Note which of these are missing. Step 6 needs that list.
  • Manifests / lockfiles: package.json, pyproject.toml, go.mod, Cargo.toml, *.csproj, Gemfile, pom.xml, Package.swift, *.xcodeproj.
  • Config: framework configs (next.config, vite, tailwind, astro), Dockerfile, compose files, CI under .github/, Makefile.
  • Monorepo?: check for workspaces (pnpm/yarn/npm workspaces, packages/*, apps/*, Cargo/Go workspaces) and analyze each package, not just the root.
  • Shape: top-level dirs, file-extension histogram, entry points, test dirs.

Skip vendored/generated dirs (node_modules, .git, dist, build, target, vendor, .venv) — they skew signals and waste effort.

3. Select relevant skills

Match stack signals and the user's goal to skills from step 1. Selection is category-based — map signals to the kind of skill, then pick whatever concrete skills in the live list fit. Only pick skills that clearly apply; ignore the rest.

Signal / goalSkill category to look forExamples often present
Any codebaseStructure & design comprehensioncodebase-design, code-review
Understanding tests / adding themTesting practicetdd, swift-testing-pro
Bug or unclear failureDebuggingdiagnosing-bugs
TypeScript / JSLanguage deep-divestypescript-advanced-types
React / Next / VercelFramework guidancevercel-react-best-practices
Swift / Apple platformsFramework guidanceswiftui-pro, swiftui-expert-skill, apple-design
Frontend / UIDesign & UXfrontend-design
Docs to read/produceSummarization & writingsummarize, writing-for-agents
"Find a skill for X" gapSkill discoveryfind-skills

When a skill fits, read its SKILL.md and apply its guidance during analysis. Prefer one or two high-leverage skills over loading many.

4. Analyze

Apply the selected skills to trace the repo end to end and capture:

  • Purpose — what the project does and who uses it.
  • Architecture — major components/modules and their responsibilities and boundaries.
  • Data & control flow — request/render/job lifecycles; where state lives.
  • Entry points — how execution starts (main, server, CLI, routes).
  • Build / run / test — the exact commands, from manifests and CI.
  • Conventions — patterns, naming, error handling, folder structure the repo follows.
  • Risks / rough edges — TODOs, dead code, fragile spots, missing tests.

For large repos, dispatch parallel explore sub-agents on independent areas (e.g. backend, frontend, infra) and merge findings. Verify claims against the code — don't infer from names.

5. Output

Deliver both:

  1. A concise briefing in the conversation (lead with purpose + architecture).
  2. A written report at docs/CODEBASE_OVERVIEW.md in the analyzed repo, following references/report-template.md. Create the docs/ folder if it doesn't exist. Anchor the report with the current date and commit SHA. If the file already exists, reconcile/update it rather than blindly overwriting.

6. Bootstrap missing docs

Check the repo root (and, in a monorepo, only the root unless the user asks for per-package docs). Use the templates in references/bootstrap-docs.md.

  • README: if no README* file exists (any case or extension, e.g. readme.md, README.rst, README.txt), create README.md.
  • Agent guidance: if none of these exist, create AGENTS.md plus a CLAUDE.md that imports it: AGENTS.md, CLAUDE.md, GEMINI.md, .github/copilot-instructions.md, .github/instructions/, .cursorrules, .cursor/rules/, .windsurfrules, .clinerules. If only some exist, leave them alone. Don't add a second, parallel set.

Rules:

  • Only create files that are missing. Never overwrite, rename, or restructure an existing file. If an existing one looks stale or thin, say so in the briefing and don't edit it.
  • Build the content from the step 4 analysis, not from assumptions. Take commands from manifests and CI. Leave out any section you couldn't verify.
  • Link both new files to docs/CODEBASE_OVERVIEW.md instead of copying the architecture into them.
  • In the briefing, list which files were created and which already existed.

Write the report and any bootstrapped files but do not commit them automatically — leave that to the user.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.