agentleFS
jamestorrevillasjamestorrevillas/dev-skills/.github/skills/code-reading/SKILL.md

code-reading

Skill4 starsChanged 9 months agoMITView on GitHub

Use this skill when navigating unfamiliar codebases, understanding legacy code, onboarding to a new project, or reverse-engineering how something works. Trigger on keywords: unfamiliar code, legacy code, understand this codebase, how does this work, new project, onboarding, read code, trace through, what does this do.

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    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:

    Always explore a new codebase in this order:

    line 15
  2. Distinctive:

    No tests — higher risk, be extra careful when modifying

    line 83

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “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

Code Reading

Core Principle

Code is read 10x more than it's written. Reading code is a skill you actively develop — not a passive activity.


Codebase Onboarding Order

Always explore a new codebase in this order:

  1. README — What does it do? How do I run it?
  2. Package/dependency files — What tools and frameworks are used?
  3. Entry point — Where does execution start? (main.ts, index.js, app.py)
  4. Core domain models — What are the main data structures?
  5. Key user flows — Trace one important feature end-to-end
  6. Tests — Tests reveal intended behavior and edge cases
  7. Config/env files — What is configurable? What are the environments?

Code Tracing Method

For understanding a specific flow:

1. Start from the trigger (user action, API call, scheduled job)
2. Follow the execution path step by step
3. Note: what data flows in? what comes out?
4. Identify where external systems are called
5. Mark where business logic lives vs. infrastructure

Questions to Ask While Reading

  • What is this component responsible for? (single responsibility check)
  • What does it need to run? (dependencies)
  • What does it produce/return?
  • What could make it fail?
  • Why was it written this way? (check git blame/history for context)

Using AI for Code Reading

"Explain what this function does, including:
- What it takes as input
- What it returns  
- Any side effects
- Non-obvious behavior I should know about"

"Walk me through how [feature] works, 
starting from [entry point] to [output]"

"What would I need to understand to safely 
modify [specific part] of this code?"

Navigating Large Codebases

  • Search patterns — use grep/ripgrep to find usages of a function/class
  • Git blame — who changed this and why?
  • Git log — when was this introduced? what changed over time?
  • Tests — run tests while reading to see what behavior is expected
  • Dependency graph — which modules depend on what?

Warning Signs While Reading

  • Functions longer than 50 lines (doing too much)
  • Deep nesting (> 3 levels) — logic is hard to follow
  • Many parameters (> 4) — likely needs refactoring
  • Comments explaining WHAT (should be obvious) vs WHY (actually useful)
  • No tests — higher risk, be extra careful when modifying

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.