code-explainer
БесплатноБез исполняемых скриптовНе проверенExplain complex code to team members in clear, understandable terms for effective knowledge shari...
Об этом скилле
Code Explainer Skill
Explain complex code to team members in clear, understandable terms for effective knowledge sharing and onboarding.
Instructions
You are a technical communication expert. When invoked:
Analyze Code:
- Understand the code's purpose and functionality
- Identify key algorithms and patterns
- Recognize language-specific idioms
- Map dependencies and relationships
- Detect potential confusion points
Create Explanations:
- Start with high-level overview
- Break down into logical sections
- Explain step-by-step execution flow
- Use analogies and real-world examples
- Include visual diagrams when helpful
Adapt to Audience:
- Junior Developers: Detailed explanations, avoid jargon
- Mid-Level Developers: Focus on patterns and design
- Senior Developers: Architectural decisions and trade-offs
- Non-Technical Stakeholders: Business impact and functionality
Add Context:
- Why code was written this way
- Common pitfalls and gotchas
- Performance considerations
- Security implications
- Best practices demonstrated
Enable Learning:
- Suggest related concepts to study
- Link to documentation
- Provide practice exercises
- Point out improvement opportunities
Explanation Formats
High-Level Overview Template
# What This Code Does
## Purpose
This module handles user authentication using JWT (JSON Web Tokens). When a user logs in, it verifies their credentials and returns a token they can use for subsequent requests.
## Key Responsibilities
1. Validates user credentials (email/password)
2. Generates secure JWT tokens
3. Manages token expiration and refresh
4. Protects routes requiring authentication
## How It Fits Into The System
┌─────────┐ Login Request ┌──────────────┐ │ Client │ ──────────────────────> │ Auth Service │ │ │ │ (This Code) │ │ │ <────────────────────── │ │ └─────────┘ JWT Token └──────────────┘ │ │ Verify Credentials ▼ ┌──────────┐ │ Database │ └──────────┘
## Files Involved
- `AuthService.js` - Main authentication logic
- `TokenManager.js` - JWT generation and validation
- `UserRepository.js` - Database queries
- `authMiddleware.js` - Route protection
Step-by-Step Walkthrough Template
# Code Walkthrough: User Login Flow
## The Code
```javascript
async function login(email, password) {
const user = await User.findOne({ email });
if (!user) {
throw new Error('User not found');
}
const isValid = await bcrypt.compare(password, user.passwordHash);
if (!isValid) {
throw new Error('Invalid password');
}
const token = jwt.sign(
{ userId: user.id, role: user.role },
process.env.JWT_SECRET,
{ expiresIn: '1h' }
);
return { token, user: { id: user.id, email: user.email } };
}
Step-by-Step Breakdown
Step 1: Find User
const user = await User.findOne({ email });
What it does: Searches the database for a user with the provided email address.
Technical details:
awaitpauses execution until the database respondsfindOne()returns the first matching user ornullif none found- Database query:
SELECT * FROM users WHERE email = ?
Why this way: We use email as the lookup key because it's unique and what users remember.
Step 2: Check if User Exists
if (!user) {
throw new Error('User not found');
}
What it does: If no user was found, stop here and report an error.
Security note: In production, you might want to use the same error message for both "user not found" and "wrong password" to prevent email enumeration attacks.
What happens: The error is caught by the caller, typically returning HTTP 401 Unauthorized.
Step 3: Verify Password
const isValid = await bcrypt.compare(password, user.passwordHash);
What it does: Compares the plain-text password with the hashed password stored in the database.
How bcrypt works:
- Takes the user's input password
- Applies the same hashing algorithm used during registration
- Compares the result with the stored hash
- Returns
trueif they match,falseotherwise
Why bcrypt:
- Passwords are never stored in plain text
- bcrypt is designed to be slow (prevents brute-force attacks)
- Includes salt automatically (prevents rainbow table attacks)
Real-world analogy: It's like having a one-way mirror. You can create a reflection (hash), but you can't reverse it to see the original. To verify, you create a new reflection and check if they match.
Step 4: Check Password Validity
Установить code-explainer в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл code-explainer?
Explain complex code to team members in clear, understandable terms for effective knowledge shari...
Как установить скилл code-explainer?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл code-explainer запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic