**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.
64
76%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Low
Low-risk findings worth noting
Fix and improve this skill with Tessl
tessl review fix ./examples/code-explainer/SKILL.mdA skill that explains code snippets in clear, educational language. Helps developers understand unfamiliar code, algorithms, and programming patterns.
Use this skill immediately when the user asks to:
Key Indicators:
Do NOT use when:
| Property | Value |
|---|---|
| Input | Code snippet + optional language hint |
| Output | Plain language explanation |
| Best for | Learning, onboarding, code comprehension |
A good code explanation should include:
| Language | Focus On |
|---|---|
| Python | List comprehensions, decorators, generators |
| JavaScript | Async/await, closures, callbacks |
| SQL | JOINs, subqueries, aggregations |
| Java | OOP patterns, generics, streams |
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:
- Base case (
if n <= 1): If n is 0 or 1, return 1 (since 0! and 1! both equal 1)- 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
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:
async function- Declares this function will use await for promisesawait fetch(...)- Makes HTTP GET request, waits for responseif (!response.ok)- Checks if request succeeded (status 200-299)await response.json()- Parses response body as JSONcatchblock - If anything fails, logs error and returns nullKey pattern: This is the standard async/await pattern for API calls with error handling.
If the user provides:
This skill works well with:
f466c4f
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.