Skip to content
Skills Library
Programming · Learning & explanation

code-explainer

/code-explainer

**UTILITY SKILL** - Explain code snippets, functions, and algorithms in plain language. USE FOR: explain code, what does this code do, break down this function, help me understand this, walk through this algorithm, clarify this logic, explain this snippet, describe what happens here. DO NOT USE FOR: writing new code (use code generation), fixing bugs (use debugging), refactoring (use refactoring skills), code review with action items. INVOKES: file reading tools to access code, language detection for tailored explanations. FOR SINGLE OPERATIONS: If the user just needs to see file contents, use

Repository
waza ↗
Licence
MIT
Last repository change
26.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
13
Scripts
4
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 26.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What to check before installing
  • 4 scripts in this package. Review them before installing, as Claude may execute them.

Scripts: fixtures/factorial.py, fixtures/fetch_user.js, fixtures/squares.py, graders/explanation_quality.py

What it does and when to use it

**UTILITY SKILL** - Explain code snippets, functions, and algorithms in plain language. USE FOR: explain code, what does this code do, break down this function, help me understand this, walk through this algorithm, clarify this logic, explain this snippet, describe what happens here. DO NOT USE FOR: writing new code (use code generation), fixing bugs (use debugging), refactoring (use refactoring skills), code review with action items. INVOKES: file reading tools to access code, language detection for tailored explanations. FOR SINGLE OPERATIONS: If the user just needs to see file contents, use

Original author description

**UTILITY SKILL** - Explain code snippets, functions, and algorithms in plain language. USE FOR: explain code, what does this code do, break down this function, help me understand this, walk through this algorithm, clarify this logic, explain this snippet, describe what happens here. DO NOT USE FOR: writing new code (use code generation), fixing bugs (use debugging), refactoring (use refactoring skills), code review with action items. INVOKES: file reading tools to access code, language detection for tailored explanations. FOR SINGLE OPERATIONS: If the user just needs to see file contents, use

How it works

  1. Skill Activation Triggers
  2. Quick Reference
  3. Explanation Guidelines
  4. Examples
  5. Error Cases
  6. Integration Notes
Original SKILL.md headings · 133 lines, 661 words
SKILL.md preview
---
name: code-explainer
description: |
  **UTILITY SKILL** - Explain code snippets, functions, and algorithms in plain language.
  USE FOR: explain code, what does this code do, break down this function,
  help me understand this, walk through this algorithm, clarify this logic,
  explain this snippet, describe what happens here.
  DO NOT USE FOR: writing new code (use code generation), fixing bugs (use debugging),
  refactoring (use refactoring skills), code review with action items.
  INVOKES: file reading tools to access code, language detection for tailored explanations.
  FOR SINGLE OPERATIONS: If the user just needs to see file contents, use file reading tools directly.
---

# Code Explainer

A skill that explains code snippets in clear, educational language. Helps developers understand unfamiliar code, algorithms, and programming patterns.

## Skill Activation Triggers

**Use this skill immediately when the user asks to:**
- "Explain this code"
- "What does this function do?"
- "Break down this algorithm"
- "Help me understand this snippet"
- "Walk me through this code"
- "What's happening in this file?"

**Key Indicators:**
- User shares a code snippet and asks for explanation
- User is confused about existing code
- User wants to learn how something works
- User asks "what does X do?" about code

**Do NOT use when:**
- User wants to write new code
- User wants to fix a bug
- User wants code review with suggestions
- User wants refactoring recommendations

## Quick Reference

| Property | Value |
|----------|-------|
| Input | Code snippet + optional language hint |
| Output | Plain language explanation |
| Best for | Learning, onboarding, code comprehension |

## Explanation Guidelines

### Structure

A good code explanation should include:

1. **Overview** - One sentence summary of what the code does
2. **Step-by-step breakdown** - Walk through the logic
3. **Key concepts** - Explain any patterns or techniques used
4. **Example** - Show sample input/output if applicable

### Tone

- Educational and approachable
- Avoid jargon unless explaining it
- Use analogies when helpful
- Assume the reader is smart but unfamiliar with this specific code

### Language-Specific Tips

| Language | Focus On |
|----------|----------|
| Python | List comprehensions, decorators, generators |
| JavaScript | Async/await, closures, callbacks |
| SQL | JOINs, subqueries, aggregations |
| Java | OOP patterns, generics, streams |

## Examples

### Example 1: Python Recursion

**User prompt:**
```
Explain this code:
```python
def factorial(n):
    if n <= 1:
        return 1
    return n * factorial(n - 1)
```

**Good response:**
> This is a **recursive function** that calculates the factorial of a number.
>
> **Overview:** It multiplies a number by all positive integers less than it (e.g., 5! = 5 × 4 × 3 × 2 × 1 = 120).
>
> **Step by step:**
> 1. **Base case** (`if n <= 1`): If n is 0 or 1, return 1 (since 0! and 1! both equal 1)
> 2. **Recursive case**: Otherwise, multiply n by factorial(n-1)
>
> **Example:** `factorial(4)` → 4 × factorial(3) → 4 × 3 × factorial(2) → 4 × 3 × 2 × factorial(1) → 4 × 3 × 2 × 1 = 24

### Example 2: JavaScript Async/Await

**User prompt:**
```
What does this code do?
```javascript
async function fetchUserData(userId) {
  try {
    const response = await fetch(`/api/users/${userId}`);
    if (!response.ok) throw new Error('User not found');
    return await response.json();
  } catch (error) {
    console.error('Failed:', error);
    return null;
  }
}
```

**Good response:**
> This is an **async function** that fetches user data from an API.
>
> **Overview:** It makes an HTTP request to get a user's data, handles errors gracefully, and returns the result as JSON.
>
> **Step by step:**
> 1. `async function` - Declares this function will use await for promises
> 2. `await fetch(...)` - Makes HTTP GET request, waits for response
> 3. `if (!response.ok)` - Checks if request succeeded (status 200-299)
> 4. `await response.json()` - Parses response body as JSON
> 5. `catch` block - If anything fails, logs error and returns null
>
> **Key pattern:** This is the standard async/await pattern for API calls with error handling.

## Error Cases

If the user provides:
- **No code**: Ask them to share the code they want explained
- **Incomplete code**: Explain what you can see and note what's missing
- **Non-code text**: Clarify you need actual code to explain

## Integration Notes

This skill works well with:
- File reading tools (to access code from files)
- Language detection (to tailor explanations)
- Search tools (to find related documentation)
Files in this package (13)
  • README.md 4 KB
  • SKILL.md 5 KB
  • eval.yaml 2 KB
  • trigger_tests.yaml 2 KB
  • fixtures/factorial.py 1 KB
  • fixtures/fetch_user.js 1 KB
  • fixtures/squares.py 1 KB
  • fixtures/user_orders.sql 1 KB
  • graders/explanation_quality.py 6 KB
  • tasks/explain-js-async.yaml 1 KB
  • tasks/explain-list-comprehension.yaml 1 KB
  • tasks/explain-python-recursion.yaml 1 KB
  • tasks/explain-sql-join.yaml 1 KB

Versions

RepositoryScoreLicence
This page · microsoft/waza100MIT
vibe-md/vibe.md100MIT
kumaran-is/claude-code-onboarding100MIT

Database snapshot: 13.11.2026 · package version bd29fa46830b (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 90explain-code
    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".
  • 100code-explanation
    Explains complex code through clear narratives, visual diagrams, and step-by-step breakdowns. Use when user asks to explain code, understand algorithms, analyze design patterns, wants code walkthroughs, or mentions "explain this code", "how does this work", "code breakdown", or…
  • 90st-explain
    Explain how a piece of code works, why it is built that way, and what that means, in plain language a person can follow. Use for 'how does X work', 'why is it like this', 'teach me this', onboarding to a subsystem, or /st-explain.
  • 95how
    Explain how the current project, a feature, or a code path works in plain language for a beginner. Use when the user wants to understand an existing codebase or how its parts work together.
  • 90ds-explain
    Explain how a piece of code works, why it is built that way, and what that means, in plain language a person can follow. Use for 'how does X work', 'why is it like this', 'teach me this', onboarding to a subsystem, or /ds-explain.
  • 90logic-explain
    Explain what a specific piece of code actually does for a given input by producing a step-by-step execution trace (interprocedural, with name resolution and type transitions). Trigger when the user is confused about behavior or asks why code produces X instead of Y — "walk me…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.