explain-code
Skill1 starsChanged 7 months agoMITView on GitHub
Explain current code behavior, structure, runtime flow, data flow, and component ownership. Use for ordinary walkthroughs, line-by-line explanations, subsystem mental models, and questions about what code does or how it works. Use teach, when explicitly invoked and available, for progressive learning; technical-writing, when available, for substantial standalone documentation; clarify for expectation mismatches or historical intent; code-review for finding problems; refactor-code for structural changes; brainstorm for unresolved future design; and architect, when explicitly invoked and available, for implementation-ready structural design.
25 other projects use a version of this.
Adopted by
Most recently taken up by
- LuisUrrutia/skillstheir own version, first seen Oct 4, 2026
- koach08/claude-code-skillstheir own version, first seen Sep 12, 2026
- Enrikkk/claude-skillstheir own version, first seen Sep 10, 2026
- renzrollon/interlocktheir own version, first seen Sep 10, 2026
- Fedgutcor/explain-code-skilltheir own version, first seen Sep 5, 2026
- dmzoneill/skillstheir own version, first seen Sep 3, 2026
Used with
Projects with it also use refactor, deep-research and 6 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.
GitHubSkillrefactor
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
NVIDIASkilldeep-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
AnthropicSkilldebug
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
SentrySkillcommit
Create commit messages following Sentry conventions. Use when committing code changes, writing commit messages, or formatting git history. Follows conventional commits with Sentry-specific issue references.
Also in 4 projects that use this
MicrosoftSkillhandoff
Compact the current conversation into a handoff document for another agent to pick up.
Also in 5 projects that use this
AWSSkillprototype
Build a throwaway prototype to answer a design question. Use when the user wants to sanity-check whether a state model or logic feels right, or explore what a UI should look like.
Also in 3 projects that use this
Other versions25 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 25
- AgnosticUI/agnosticui★ 826same name
- renzrollon/interlock★ 17same name
- zbruhnke/claude-code-starter★ 17same name
- helderberto/agent-skills★ 16same name
- sidkh/skills★ 8same name
- viknesh20-20/claude-code-tool-kit★ 7same name
- zeon-kun/claude-skills★ 6same name
- Akindu23/my-agent-skills★ 4same name
- Arcadi4/skills★ 4same name
- koach08/claude-code-skills★ 4same name
15 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository26 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- architectSkill
- arenaSkill
- autopilotSkill
- blast-radiusSkill
- brainstormSkill
- clarifySkill
- code-reviewSkill
- debug-errorSkill
- diagram-designSkill
- java-coderSkill
- owasp-securitySkill
- pdfSkill
- pretty-mermaidSkill
- refactor-codeSkill
- reflectSkill
- skill-hunterSkill
- teachSkill
- technical-writingSkill
- test-coverageSkill
- typesafe-aiSkill
- typescript-coderSkill
- unslopSkill
- write-testsSkill
- wrongSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
20 rules. 0 are common, 12 are distinctive, and 8 are very specific to this project.
0
Common
Most of the 23 edited versions we read keep these.
12
Distinctive
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 23
Use clarify when observed behavior differs from expectations, the user asks whether behavior is wrong, or the question concerns historical …
- Very specific: line 24
Use code-review when the user asks for defects, risks, architectural criticism, security findings, or improvement recommendations.
- Very specific: line 25
Use refactor-code when the user wants code changed while preserving behavior.
- Very specific: line 26
Use brainstorm when the user wants to explore unresolved future behavior, alternative ownership, or substantive design options.
- Very specific: line 27
Use architect, when explicitly invoked and available, when an understood problem needs caller-first types, signatures, data structures, and …
- Very specific: line 28
Use teach, when explicitly invoked and available, for a progressive learning conversation.
- Very specific: line 29
Use technical-writing, when available, when the deliverable is a substantial standalone document such as an architecture guide.
- Distinctive: line 31
Do not turn an explanation into an unsolicited review or redesign.
- Distinctive: line 35
Read the actual implementation and relevant context.
- Distinctive: line 50
Read references/exploration-playbook.md for multi-file features, subsystem architecture, cross-component flows, or unclear entry points.
- Distinctive: line 51
Read references/explanation-patterns.md when choosing a structure for algorithms, requests, events, asynchronous work, database operations, …
- Distinctive: line 52
Read references/language-notes.md only when language semantics are central to the explanation.
- Distinctive: line 64
If the target is ambiguous, use available context when one interpretation is clearly most likely.
- Distinctive: line 68
Use the smallest evidence set that can answer the question:
- Distinctive: line 72
Follow calls and data transformations through the requested boundary.
- Distinctive: line 73
Read central types, interfaces, configuration, and dependencies.
- Distinctive: line 75
Check tests or call sites when they clarify contracts or edge cases.
- Distinctive: line 85
Key concepts: only the types or abstractions needed to follow the flow.
- Very specific: line 92
Use concrete language: “OrderService.submit() writes the record, then publishes OrderCreated” is better than “the service delegates …
- Distinctive: line 94
Use a diagram only when it makes a multi-stage or cross-component relationship easier to understand.
“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.
Files
Explain code
Build an accurate mental model of the code at the depth the question requires. Explain current mechanics from evidence in the repository, not from names, conventions, or plausible assumptions.
Boundaries
This skill owns neutral explanation:
- what code does;
- how control and data flow through it;
- which types and components participate;
- where responsibilities currently live;
- which behavior is non-obvious.
Route other intents explicitly:
- Use
clarifywhen observed behavior differs from expectations, the user asks whether behavior is wrong, or the question concerns historical design rationale. - Use
code-reviewwhen the user asks for defects, risks, architectural criticism, security findings, or improvement recommendations. - Use
refactor-codewhen the user wants code changed while preserving behavior. - Use
brainstormwhen the user wants to explore unresolved future behavior, alternative ownership, or substantive design options. - Use
architect, when explicitly invoked and available, when an understood problem needs caller-first types, signatures, data structures, and module boundaries. Use this skill to supply its current-code mechanics and evidence. - Use
teach, when explicitly invoked and available, for a progressive learning conversation. Use this skill to supply its current-code mechanics and evidence. - Use
technical-writing, when available, when the deliverable is a substantial standalone document such as an architecture guide. Use this skill to establish the document's current-code mechanics and evidence.
Do not turn an explanation into an unsolicited review or redesign. Mention a likely defect only when it is necessary to explain the observed flow, and label it as unverified unless the evidence establishes it.
Evidence rules
Read the actual implementation and relevant context. Never infer HTTPS, validation, sanitization, authorization, indexes, pooling, caching, complexity, error recovery, or other properties merely because they would be conventional.
Distinguish:
- Observed mechanics: established by code, tests, configuration, or runtime evidence.
- Documented contract: established by public interfaces, specifications, or documentation.
- Historical intent: requires explicit rationale evidence and belongs to
clarify. - Unknown: a connection or behavior that available evidence does not establish.
Cite relevant paths, symbols, and line ranges. State gaps rather than filling them with a plausible story.
Load references only when needed
Routine function and module explanations should use this file alone.
- Read references/exploration-playbook.md for multi-file features, subsystem architecture, cross-component flows, or unclear entry points.
- Read references/explanation-patterns.md when choosing a structure for algorithms, requests, events, asynchronous work, database operations, or diagrams.
- Read references/language-notes.md only when language semantics are central to the explanation.
Assess scope and audience
Determine what the user wants to understand and how much context they need.
- Narrow: a line, expression, function, or small class. Explain directly.
- Module: several related functions or one component. Trace its entry points, state, dependencies, and outputs.
- Subsystem: multiple files, packages, services, or processes. Load the exploration playbook and build a component and flow map.
Infer the audience from the request and conversation. Default to a technically competent reader who is unfamiliar with this part of the codebase. Explain language basics only when they are relevant or requested.
If the target is ambiguous, use available context when one interpretation is clearly most likely. Ask one focused question when choosing the wrong target would produce a materially different explanation.
Explore
Use the smallest evidence set that can answer the question:
- Locate the target and its role in the project.
- Find the entry point or caller that triggers it.
- Follow calls and data transformations through the requested boundary.
- Read central types, interfaces, configuration, and dependencies.
- Identify inputs, outputs, state changes, side effects, and error paths.
- Check tests or call sites when they clarify contracts or edge cases.
- Record anything unresolved, surprising, or easy to misunderstand.
For complex subsystems, divide exploration into independent slices only when that reduces uncertainty. Parallel exploration is optional when the host supports it; never require named models, tools, or subagent types.
Explain
Adapt the response rather than completing a fixed checklist. A subsystem explanation commonly includes:
- Overview: what the component does and where it fits.
- Key concepts: only the types or abstractions needed to follow the flow.
- How it works: the trigger, sequence, decisions, transformations, boundaries, and result.
- Where things live: a short map of important files and symbols.
- Gotchas and gaps: non-obvious behavior and anything the evidence did not resolve.
For a narrow request, skip unnecessary sections. If the user asks for line-by-line analysis, group obvious lines and spend detail on non-obvious behavior. For an algorithm, explain its invariant and steps before discussing complexity. State complexity only when it can be derived from the implementation and relevant data structures.
Use concrete language: “OrderService.submit() writes the record, then publishes OrderCreated” is better than “the service delegates processing.” Include short code excerpts only when they clarify a specific point.
Use a diagram only when it makes a multi-stage or cross-component relationship easier to understand. Choose a portable text or Mermaid representation supported by the environment. Skip decorative diagrams and do not duplicate clear prose.
Final check
Before answering, verify:
- Did I answer the requested scope and audience level?
- Did I trace actual code rather than infer from names?
- Are mechanics separate from contract and historical intent?
- Did I cite the important files and symbols?
- Did I disclose unresolved gaps?
- Did I avoid unsolicited review, refactoring, and speculative claims?
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
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.

