agentleFS
renzrollonrenzrollon/interlock/skills/explain-code/SKILL.md

explain-code

Skill17 starsChanged 3 months agoMITView on GitHub

Explain code to a beginner in that stack — either a module walkthrough (what each function does, how calls link, where data flows, which patterns recur) or a commit teach-in (why each file changed, what changed, blast radius, what would break if it were left out). Use when asked to explain code, walk through a directory, or explain the last commit.

25 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use write-tests, teach and 7 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.
  • SentrySkill

    write-tests

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

    Also in 4 projects that use this

  • AWSSkill

    teach

    Teach the user a new skill or concept, within this workspace.

    Also in 4 projects that use this

  • GitHubSkill

    refactor

    Surgical code refactoring to improve maintainability without changing behavior. Covers extracting functions, renaming variables, breaking down god functions, improving type safety, eliminating code smells, and applying design patterns. Less drastic than repo-rebuilder; use for gradual improvements.

    Also in 3 projects that use this

  • NVIDIASkill

    deep-research

    Queue deep, multi-step research and analysis tasks to the DeepAgents worker. Supports execution depth presets, request-specific rubrics, SubAgent delegation, and RubricMiddleware cross-validation.

    Also in 3 projects that use this

  • AnthropicSkill

    debug

    Structured debugging session — reproduce, isolate, diagnose, and fix. Trigger with an error message or stack trace, "this works in staging but not prod", "something broke after the deploy", or when behavior diverges from expected and the cause isn't obvious.

    Also in 3 projects that use this

  • MicrosoftSkill

    handoff

    Compact the current conversation into a handoff document for another agent to pick up.

    Also in 5 projects that use this

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 23 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:

    When ambiguous, prefer the module walkthrough unless the user mentioned a commit or "what changed".

    line 23
  2. Distinctive:

    Write the full explanation to the resolved path (overwrite), then tell the user the file is ready with a 5–10 line summary.

    line 41

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

Teach code to someone new to this stack. Not reviewing, not judging — teaching.

Calibrate to a reader who knows programming fundamentals but is new to this project's language and framework. Explain the idioms that stack takes for granted, one short aside each. Do not explain what a function is.

Modes

ModeWhenLoad
Module walkthrough (default)A file or directory is named, or the user asks how an area works${CLAUDE_SKILL_DIR}/module-walkthrough.md
Commit teach-inLast commit, a hash or range, "what changed", --commit / --commits N${CLAUDE_SKILL_DIR}/commit-teachin.md

When ambiguous, prefer the module walkthrough unless the user mentioned a commit or "what changed".

After choosing a mode, read the matching sibling file and follow it for steps, structure, and output format. This file only routes.

Output path

Resolve the destination before writing. Both modes use the same rule:

SituationWrite to
Scoped to an OpenSpec change — a change name was passed, or one resolves via openspec status --jsonopenspec/changes/<change-name>/code-explanation.md
No change context (ad-hoc walkthrough)docs/CODE_EXPLANATION.md

Do not "simplify" this back to a single path. A change-scoped explanation belongs beside manual-test-plan.md in its own change directory. Writing every run to docs/CODE_EXPLANATION.md overwrites the previous change's explanation — and because docs/ is the corpus /interlock:docs-digest indexes, each rewrite permanently marks .claude/graph/DOCS_DIGEST.md stale through its source_hashes.

Shared rules

  • Single agent, no fan-out. Understanding builds sequentially; parallel investigators produce four disconnected fragments, which is the opposite of a walkthrough.
  • Write the full explanation to the resolved path (overwrite), then tell the user the file is ready with a 5–10 line summary.
  • Pull domain context on demand: .claude/graph/DOCS_DIGEST.md first, then interlock-graph context / docs. Never preload all of docs/ — see ${CLAUDE_PLUGIN_ROOT}/shared/TOOL-ECONOMY.md Rule 0.5.

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.