agentleFS
gurinderugurinderu/craft/skills/codebase-onboarding/SKILL.md

codebase-onboarding

Skill1 starsChanged 39 days agoMITView on GitHub

Quickly understand an unfamiliar codebase before changing it — map the structure, find entry points and seams, trace one real flow end to end, and confirm by building/testing. Use when dropped into a new or large repo, or before changing code you don't know. Language-agnostic. Triggers: where do I start, how does this work, trace the flow, get oriented, onboard.

63 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use nuxt4-patterns, pytorch-patterns 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.
  • loulanyueSkill

    nuxt4-patterns

    Nuxt 4 app patterns for hydration safety, performance, route rules, lazy loading, and SSR-safe data fetching with useFetch and useAsyncData.

    Also in 5 projects that use this

  • Yog-SothoSkill

    pytorch-patterns

    PyTorch deep learning patterns and best practices for building robust, efficient, and reproducible training pipelines, model architectures, and data loading. Always activate when the user is writing PyTorch models or training scripts, reviewing deep learning code, debugging training loops or data pipelines, optimizing GPU memory or training speed, setting up reproducible experiments, implementing transfer learning or fine-tuning, or asks anything about nn.Module, DataLoader, autograd, AMP, or torch.compile.

    Also in 7 projects that use this

  • junimnjwSkill

    continuous-agent-loop

    Patterns for continuous autonomous agent loops with quality gates, evals, and recovery controls.

    Also in 7 projects that use this

  • junimnjwSkill

    perl-security

    Comprehensive Perl security covering taint mode, input validation, safe process execution, DBI parameterized queries, web security (XSS/SQLi/CSRF), and perlcritic security policies.

    Also in 5 projects that use this

  • royaluniondesign-sysSkill

    content-hash-cache-pattern

    Cache expensive file processing results using SHA-256 content hashes — path-independent, auto-invalidating, with service layer separation.

    Also in 6 projects that use this

  • Arnav-0Skill

    api-test-suite-builder

    Use when the user asks to generate API tests, create integration test suites, test REST endpoints, or build contract tests.

    Also in 3 projects that use this

  • +3 more from junimnjw

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 59 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Don't start editing code you don't understand — you'll fight conventions you can't see.

    line 9
  2. Distinctive:

    Read breadth-first, not line-by-line: skim to build the map, then go deep only on the path you need to change.

    line 31

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

Codebase Onboarding

Don't start editing code you don't understand — you'll fight conventions you can't see. Spend the first hour building a map, not patches. The goal: know where things are, how one real request flows, and how to run it, before you touch anything.

When to Use

  • Dropped into a new or large repository
  • About to change a part of the system you don't know
  • Reviewing a big PR in unfamiliar code

The orientation pass (outside-in)

1. ORIENT   — README, docs/, CONTRIBUTING, the build/run commands. How is it meant to be used?
               Plus what was already decided about the part you'll touch: `memory` recall.
2. SHAPE    — top-level layout: where's the entry point, the modules, the tests, the config?
3. ENTRY    — find main()/lib root and the public surface; that's the spine.
4. TRACE    — pick ONE real flow (a request, a command, a job) and follow it end to end.
5. SEAMS    — note the boundaries: where it talks to DB/network/other services.
6. CONFIRM  — build it, run the tests, run it. Understanding you can't execute is a guess.

Read breadth-first, not line-by-line: skim to build the map, then go deep only on the path you need to change.

Let the tools draw the map

  • Structure: git ls-files | head, the dependency manifest (Cargo.toml workspace members), directory tree. The folder names are the architecture's first claim.
  • Entry points: main.rs/lib.rs, [[bin]]/[lib] targets; for a service, the router/route table is the index of features.
  • Activity & hotspots: git log --oneline -20 (what's changing now), git log --format= --name-only | sort | uniq -c | sort -rn | head (the files that change most — usually the core).
  • Navigation: rust-analyzer / your LSP — go-to-definition and find-references to follow a symbol instead of grepping blindly (the operations and the no-LSP fallbacks → rust-navigation). cargo doc --open renders the public API as a browsable map.
  • Find a flow: grep an endpoint string / CLI subcommand / log message, then follow the calls.

Trace one real flow

Pick a single concrete behavior and follow it through every layer — request → handler → service → repository → DB, or CLI arg → command → work → output. One full trace teaches more than reading ten files in isolation: it reveals the layering, the error handling, and the conventions all at once. (In a craft-style codebase that's the inbound adapter → domain → outbound adapter path of rust-architecture.)

Confirm by running

You don't understand it until you can build and exercise it:

cargo build           # does it compile as-is?
cargo test            # do the tests pass? (they're also runnable documentation)
cargo run -- ...      # run a real path
cargo tree            # what does it actually depend on?

(non-Rust: substitute the project's build/test/run/dependency commands — npm/go/make, etc.)

The tests are the best spec of intended behavior (→ specs, rust-testing) — read a few to see how the authors expect the code to be used.

Anti-patterns

  • Editing before mapping — changing code whose conventions you haven't seen.
  • Reading top-to-bottom — drowning in detail before you have the shape.
  • Trusting names/comments over behavior — verify against a run; comments rot.
  • Skipping the build — assuming it works the way you read it.

Boundaries

  • Once you need to change it: structural moves → rust-architecture/refactoring; a bug to chase → debugging.
  • For a persistent, queryable knowledge map of a very large codebase, dedicated indexing/knowledge-graph tooling goes deeper than this first-hour pass.

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.