agentleFS
electronxelectronx/wiredkits-free/skills/explain-code/SKILL.md

explain-code

Skill5 starsChanged 21 days agoMITView on GitHub

Explain how a piece of code works (a function, file, module, or a flow like "what happens when a user signs up") with file and line references, traced from the actual code. Use when asked "explain this", "how does X work", "what does this function do", "walk me through", or "where is X handled".

48 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use explore-codebase, write-tests 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.
  • srclightSkill

    explore-codebase

    This skill should be used when the user asks to "explore this codebase", "understand this project", "give me an overview", "how does this work", "onboard me", "walk me through the architecture", "map the codebase", or any request to understand a codebase's structure, architecture, or design.

    Also in 3 projects that use this

  • SentrySkill

    write-tests

    Write tests following project conventions. Use when adding new tests or modifying existing ones.

    Also in 6 projects that use this

  • silvainfmSkill

    copy-editing

    When the user wants to edit, review, or improve existing marketing copy. Also use when the user mentions 'edit this copy,' 'review my copy,' 'copy feedback,' 'proofread,' 'polish this,' 'make this better,' or 'copy sweep.' This skill provides a systematic approach to editing marketing copy through multiple focused passes.

    Also in 3 projects that use this

  • silvainfmSkill

    pricing-strategy

    When the user wants help with pricing decisions, packaging, or monetization strategy. Also use when the user mentions 'pricing,' 'pricing tiers,' 'freemium,' 'free trial,' 'packaging,' 'price increase,' 'value metric,' 'Van Westendorp,' 'willingness to pay,' or 'monetization.' This skill covers pricing research, tier structure, and packaging strategy.

    Also in 3 projects that use this

  • SentrySkill

    marketing-psychology

    When the user wants to apply psychological principles, mental models, or behavioral science to marketing. Also use when the user mentions 'psychology,' 'mental models,' 'cognitive bias,' 'persuasion,' 'behavioral science,' 'why people buy,' 'decision-making,' or 'consumer behavior.' This skill provides 70+ mental models organized for marketing application.

    Also in 3 projects that use this

  • Google CloudSkill

    open-pr

    Commits local changes to a new Git branch and opens a GitHub pull request through the configured GitHub MCP server. Use when proposing code changes in a new pull request. Don't use for local-only commits without a remote GitHub repository.

    Also in 3 projects that use this

  • +1 more from getsentry

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 41 edited versions we read keep these.

  • 6

    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:

    If you find several matches, say which one you picked and why.

    line 18
  2. Distinctive:

    Read the code; don't guess from names.

    line 22
  3. Distinctive:

    Stop where the code leaves the repo (a library or service) and say what is called and with what.

    line 26
  4. Distinctive:

    If something can't be traced statically (dynamic dispatch, reflection, generated code, config chosen at runtime), say so instead of …

    line 29
  5. Distinctive:

    Use this shape, sized to the question:

    line 33
  6. Distinctive:

    Add a small ASCII diagram only if the flow branches or crosses several services.

    line 39

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

Explain code

You explain code the way a senior teammate would at a whiteboard: the short answer first, then the path through the code, with every claim pointing at a file and line. You only state what you read.

1. Pin down the question

Work out what to explain:

  • A symbol or file named in the request: find it (rg -n "def name|function name|class Name|name =", or by path).
  • A behavior ("what happens when a user resets their password"): find the entry point first: the route, CLI command, event handler, job or UI action. Search for the URL path, command name, event name or user-facing text.
  • Something vague ("explain the backend"): ask one question to narrow it, or explain only the top-level layout and offer to go deeper on one part.

If you find several matches, say which one you picked and why.

2. Trace it

Read the code; don't guess from names. Starting at the entry point, follow the calls that matter:

  • Open each function you're going to describe. If a call goes through an interface, dependency injection, a decorator, middleware, an event bus or config, find the implementation that actually runs and say how you know.
  • Note where data is read or written (database, cache, files, external APIs), where errors are caught or turned into responses, and anything async (queues, background jobs, retries).
  • Stop where the code leaves the repo (a library or service) and say what is called and with what.
  • Skip logging, metrics and boilerplate unless asked.

If something can't be traced statically (dynamic dispatch, reflection, generated code, config chosen at runtime), say so instead of guessing. If running it is cheap and safe (a test, a REPL line), do that to confirm.

3. Explain it

Use this shape, sized to the question:

  1. Short answer: 1 to 3 sentences in plain words.
  2. The path: numbered steps in the order things happen, each one sentence with a path/to/file.ext:line reference. Usually 3 to 10 steps.
  3. Worth knowing: up to 4 bullets for things that surprise people: side effects, hidden state, error behavior, performance traps, a known bug you spotted, or a comment that no longer matches the code.

Add a small ASCII diagram only if the flow branches or crosses several services. Quote code only when the exact line matters, and keep quotes under 10 lines.

Match the user's level: if they're new to the language or framework, explain its idioms briefly where they appear.

4. Follow-ups

End with one line offering the obvious next step ("Want me to trace the error path?" or "I can add a test that pins this behavior"). Don't change any code unless asked.

For a whole repository rather than one part, the Legacy Code Pack's map-codebase skill writes a full ONBOARDING.md.

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.