explaining-code
Skill7 starsChanged 9 months agoMITView on GitHub
Explains code with diagrams and analogies. Use when explaining how code works, teaching about a codebase, or when asked "how does this work?
6 other projects use a version of this, 4 of them edited.
Adopted by
Most recently taken up by
- bostonaholic/skillstheir own version, first seen Oct 2, 2026
- bartstc/vite-ts-react-templateedited, first seen Jul 25, 2026
- vigo/claude-skillsedited, first seen May 25, 2026
- kamilerman/YetAnotherAgentSkillstheir own version, first seen Apr 29, 2026
- nunomen/claude-skillsedited, first seen Mar 18, 2026
- r123singh/claude-code-skillsedited, first seen Jan 5, 2026
Other versions6 projects use a version of this.
Word for word · 0
None found.
Edited · 4
- bartstc/vite-ts-react-template★ 12216% same
- vigo/claude-skills★ 416% same
- nunomen/claude-skills★ 115% same
- r123singh/claude-code-skills★ 113% same
Wrote their own version · 2
- bostonaholic/skills★ 1same name
- kamilerman/YetAnotherAgentSkills★ 0same name
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
- templates/CLAUDE.mdCLAUDE.md
- atlas-completeSkill
- atlas-executeSkill
- atlas-initSkill
- atlas-planSkill
- atlas-reviewSkill
- atlas-statusSkill
- atlas-syncSkill
- atlas-triageSkill
- brainstormingSkill
- committingSkill
- creating-prSkill
- debuggingSkill
- frontend-designSkill
- mcp-builderSkill
- receiving-feedbackSkill
- refactoringSkill
- scaffoldingSkill
- security-auditSkill
- skill-creatorSkill
- testingSkill
- verifyingSkill
- webapp-testingSkill
- web-artifacts-builderSkill
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 6 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
- Distinctive: line 51
Start wide, then zoom in:
- Distinctive: line 94
Use ASCII diagrams for structure and flow:
“Common” is measured: kept by at least 6 in 10 of the 6 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
Explaining Code Skill
Explain code clearly using multiple techniques for different learning styles.
Workflow
1. Understand the Context
Before explaining, understand:
- What is the user's knowledge level?
- What specifically do they want to understand?
- What's the scope? (single function, module, system)
2. Choose Explanation Strategy
| If they ask... | Start with... |
| "How does X work?" | High-level flow, then details |
| "What does this code do?" | Purpose, then step-by-step |
| "Why is it written this way?" | Problem it solves, alternatives |
| "I'm confused about..." | Clarify specific concept |
3. Build the Explanation
Layer your explanation:
- One sentence summary - What is the core purpose?
- Analogy - Relate to something familiar
- Visual diagram - Show structure/flow
- Walk through - Step by step with code
- Key concepts - Highlight important patterns
4. Use Multiple Representations
Different people learn differently:
- Visual learners: Diagrams, flowcharts
- Sequential learners: Step-by-step walkthrough
- Conceptual learners: Analogies, mental models
- Hands-on learners: Example usage, experiments to try
Explanation Techniques
The Zoom Technique
Start wide, then zoom in:
System Level: "This app handles user authentication"
↓
Module Level: "This module manages sessions"
↓
Function Level: "This function validates tokens"
↓
Line Level: "This line checks expiration"The Analogy Technique
Connect to familiar concepts:
| Code Concept | Real-world Analogy |
| API | Restaurant menu + waiter |
| Cache | Sticky notes on your desk |
| Database | Filing cabinet |
| Queue | Line at a store |
| Stack | Stack of plates |
| Hash table | Library index cards |
| Middleware | Security checkpoint |
| Event loop | Receptionist handling calls |
| Promise | IOU note |
| Closure | Backpack carrying supplies |
The Story Technique
Narrate the code as a story:
"When a user clicks login, our function wakes up.
First, it grabs the username and password from the form.
Then it sends them to the server and waits for a response.
If the server says 'OK', it saves the token and lets the user in.
If not, it shows an error message."The Diagram Technique
Use ASCII diagrams for structure and flow:
┌─────────┐ ┌─────────┐ ┌─────────┐
│ Browser │────▶│ API │────▶│ DB │
└─────────┘ └─────────┘ └─────────┘
│ │ │
│ 1. Request │ 2. Query │
│ │ │
│ 4. Response │ 3. Data │
│◀──────────────│◀──────────────│Quick Reference
Explaining Functions
Purpose: [What problem does it solve?]
Inputs: [What does it receive?]
Process: [What steps does it take?]
Output: [What does it return?]
Side effects: [What else does it change?]Example:
function calculateDiscount(price, percentage) {
return price * (1 - percentage / 100);
}Purpose: Calculate price after applying a percentage discount
Inputs:
- price: The original price (e.g., 100)
- percentage: The discount percentage (e.g., 20 for 20%)
Process:
1. Divide percentage by 100 to get decimal (20 → 0.20)
2. Subtract from 1 to get remaining fraction (1 - 0.20 = 0.80)
3. Multiply by price to get discounted price (100 × 0.80 = 80)
Output: The discounted price (80)
Side effects: NoneExplaining Classes
Responsibility: [What is this class in charge of?]
Data it holds: [What state does it maintain?]
Actions it can: [What can you ask it to do?]
Collaborators: [What other classes does it work with?]Explaining Systems
Purpose: [What business problem does this solve?]
Components: [What are the major parts?]
Data flow: [How does information move through?]
Entry points: [How do users/systems interact with it?]Common Patterns to Explain
Callback Pattern
// "Do this task, and when you're done, call me back"
fetchData(url, function(result) {
// This runs LATER, when data arrives
});
// Code here runs IMMEDIATELY, before data arrivesAnalogy: Like ordering food and giving your number - you don't stand at the counter waiting.
Promise Pattern
// "I promise to give you a result eventually"
fetchData(url)
.then(result => { /* handle success */ })
.catch(error => { /* handle failure */ });Analogy: Like a claim ticket at dry cleaning - you'll get your clothes, but not right now.
Observer Pattern
// "Tell me whenever something happens"
button.addEventListener('click', handleClick);Analogy: Like subscribing to a newsletter - you get notified when new content arrives.
Middleware Pattern
// "Check this before passing it on"
app.use(authMiddleware); // Runs first
app.use(loggingMiddleware); // Runs second
app.get('/api', handler); // Runs lastAnalogy: Like airport security - multiple checkpoints before you board.
See Also
- diagrams.md - ASCII diagram patterns for code visualization
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.

