agentleFS
dmzoneilldmzoneill/skills/explain-code/SKILL.md

explain-code

Skill2 starsChanged 19 days agoApache-2.0View on GitHub

Explain a piece of code using project knowledge and context. Use to understand unfamiliar code, get architecture context, learn patterns and gotchas, find similar implementations.

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

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

  • 0

    Common

    Most of the 41 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read file from project path

    line 28
  2. Very specific:

    If lines provided: parse range (e.g., "10-50") and extract those lines

    line 29
  3. Very specific:

    If "index not found": learn_tool_fix("code_search", "index not found", "Vector index not created", "Run skill_run('bootstrap_knowledge')")

    line 54

“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

Explains code using semantic search and project knowledge for comprehensive context.

Inputs

InputTypeDefaultPurpose
filestringrequiredFile path (relative to project root)
linesstring-Line range (e.g., "10-50")
projectstringautoProject from config
depthstring"normal""brief", "normal", or "detailed"

Workflow

1. Check Known Issues

  • check_known_issues(tool_name="code_search", error_text="")

2. Detect Project

  • Infer from cwd if not provided; default automation-analytics-backend

3. Read File Content

  • Read file from project path
  • If lines provided: parse range (e.g., "10-50") and extract those lines
  • Build file_content: path, content, start_line, end_line, exists

4. Search Related Code

  • code_search(query=file_content.content[:200], project=project, limit=5)
  • Parse results, exclude the file itself

5. Get Architecture Context

  • knowledge_query(project=project, section="architecture.key_modules")
  • Match file path to module purpose

6. Get Gotchas & Patterns

  • knowledge_query(project=project, section="gotchas") — filter by file path keywords
  • knowledge_query(project=project, section="patterns.coding")

7. Build Explanation

Output markdown with:

  • Architecture Context: module and purpose
  • Code: selected lines (with line numbers)
  • Related Code: similar implementations
  • Gotchas: relevant gotchas
  • Coding Patterns: patterns to follow
  • Next step: find_similar_code for more

8. Error Handling

  • If "index not found": learn_tool_fix("code_search", "index not found", "Vector index not created", "Run skill_run('bootstrap_knowledge')")

9. Log

  • memory_session_log("Explained code in {file}", "Project: {project}, Lines: {lines}")

Key MCP Tools

  • code_search — find related code
  • knowledge_query — architecture, gotchas, patterns
  • check_known_issues, learn_tool_fix — error handling
  • memory_session_log — session logging

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.

Reviews can't be read right now.

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.