explain

GitHub

提供代码、概念或系统行为的解释,支持按文件、函数、概念等范围及简单、标准、深度三个层级进行结构化输出,帮助用户理解实现细节、设计决策与权衡。

examples/skills/explain/SKILL.md FlorianBruniaux/claude-code-ultimate-guide

Trigger Scenarios

需要解释代码逻辑或功能 询问架构设计或技术选型原因

Install

npx skills add FlorianBruniaux/claude-code-ultimate-guide --skill explain -g -y
More Options

Non-standard path

npx skills add https://github.com/FlorianBruniaux/claude-code-ultimate-guide/tree/main/examples/skills/explain -g -y

Use without installing

npx skills use FlorianBruniaux/claude-code-ultimate-guide@explain

指定 Agent (Claude Code)

npx skills add FlorianBruniaux/claude-code-ultimate-guide --skill explain -a claude-code -g -y

安装 repo 全部 skill

npx skills add FlorianBruniaux/claude-code-ultimate-guide --all -g -y

预览 repo 内 skill

npx skills add FlorianBruniaux/claude-code-ultimate-guide --list

SKILL.md

Frontmatter
{
    "name": "explain",
    "effort": "low",
    "description": "Explain code, concepts, or system behavior with adjustable depth levels",
    "when_to_use": "Use when asking Claude to explain code, a function, an algorithm, or a concept.",
    "argument-hint": "<file_or_concept>"
}

Code Explainer

Explain code, concepts, or system behavior with adjustable depth levels.

Purpose

Get clear explanations of:

  • How specific code works
  • Why certain patterns are used
  • What a system/module does
  • Architectural decisions and trade-offs

Instructions

Step 1: Determine Scope

Identify what needs explanation:

  • File: Entire file structure and purpose
  • Function/Method: Specific implementation details
  • Concept: Architectural pattern or design decision
  • Flow: How data/control moves through the system

Step 2: Assess Complexity

Simple (1-2 min read)     → Quick summary, key points only
Standard (3-5 min read)   → Purpose, how it works, key decisions
Deep (10+ min read)       → Full breakdown, alternatives, trade-offs

Step 3: Gather Context

# For file explanations
head -50 "$FILE"  # See imports and structure

# For function explanations
grep -A 30 "function $NAME\|def $NAME\|fn $NAME" "$FILE"

# For module explanations
ls -la "$DIR"
cat "$DIR/index.ts" 2>/dev/null || cat "$DIR/__init__.py" 2>/dev/null

Step 4: Structure the Explanation

Output Format


📖 Explanation: [Target]

Scope: [file/function/concept/flow] Depth: [simple/standard/deep]

What It Does

[1-3 sentences describing the purpose]

How It Works

[Step-by-step breakdown appropriate to depth level]

Key Decisions

Decision Why Alternative
[choice made] [reasoning] [what else could work]

Example Usage

// How to use this correctly

Related Code

  • path/to/related.ts - [relationship]
  • path/to/dependency.ts - [relationship]

💡 Learning Notes (if --learn flag)

[Additional context for understanding the broader pattern]


Depth Levels

Simple (/explain --simple)

**validateUser()** checks if the user object has required fields
(email, password) and returns a boolean. Uses regex for email format.

Standard (/explain - default)

**validateUser(user: User): ValidationResult**

**Purpose**: Validates user input before database operations.

**Flow**:
1. Check required fields exist (email, password)
2. Validate email format with regex
3. Check password meets requirements (8+ chars, special char)
4. Return { valid: boolean, errors: string[] }

**Used by**: signup(), updateProfile()

Deep (/explain --deep)

[All of standard, plus:]

**Design Decisions**:
- Returns ValidationResult instead of throwing to allow batch validation
- Regex chosen over library for zero dependencies
- Password rules configurable via config.ts

**Trade-offs**:
- Pro: Fast, no dependencies
- Con: Regex email validation isn't RFC-compliant

**Alternatives Considered**:
- Zod schema: More powerful but adds 50KB
- Class-validator: Better for decorators but OOP-heavy

Usage Examples

Explain a file:

/explain src/auth/middleware.ts

Explain a function:

/explain the handleWebhook function in payments.ts

Explain a concept:

/explain how our event sourcing works

Explain with specific depth:

/explain --deep the authentication flow
/explain --simple what useCallback does

Explain for learning:

/explain --learn the repository pattern used here

Tips

  1. Be specific: "Explain line 45-60" > "Explain this file"
  2. State your level: "I'm new to TypeScript" helps calibrate
  3. Ask follow-ups: "Why not use X instead?" deepens understanding
  4. Request analogies: "Explain like I'm familiar with Python but not TS"

$ARGUMENTS

Version History

  • fa57065 Current 2026-07-25 10:18

Same Skill Collection

.agents/skills/guide-recap/SKILL.md
.agents/skills/self-assessment/SKILL.md
.agents/skills/source-command-audit-prose/SKILL.md
.agents/skills/source-command-audit-whitepapers/SKILL.md
.agents/skills/source-command-ccguide-daily/SKILL.md
.agents/skills/source-command-ccguide-diff-docs/SKILL.md
.agents/skills/source-command-ccguide-init-docs/SKILL.md
.agents/skills/source-command-ccguide-refresh-docs/SKILL.md
.agents/skills/source-command-methodology-advisor/SKILL.md
.agents/skills/source-command-track-mentions/SKILL.md
.agents/skills/source-command-update-infos-release/SKILL.md
.claude/skills/self-assessment/SKILL.md
examples/skills/audit-agents-skills/SKILL.md
examples/skills/audit-codebase/SKILL.md
examples/skills/autoresearch/SKILL.md
examples/skills/canary/SKILL.md
examples/skills/catchup/SKILL.md
examples/skills/ccboard/SKILL.md
examples/skills/check-cache-bugs/SKILL.md
examples/skills/ci-all/SKILL.md
examples/skills/ci-pipeline/SKILL.md
examples/skills/ci-status/SKILL.md
examples/skills/ci-tests/SKILL.md
examples/skills/commit/SKILL.md
examples/skills/cyber-defense-team/SKILL.md
examples/skills/design-patterns/SKILL.md
examples/skills/diagnose/SKILL.md
examples/skills/eval-agents/SKILL.md
examples/skills/eval-hooks/SKILL.md
examples/skills/eval-rules/SKILL.md
examples/skills/eval-skills/SKILL.md
examples/skills/git-ai-archaeology/SKILL.md
examples/skills/git-worktree-clean/SKILL.md
examples/skills/git-worktree-remove/SKILL.md
examples/skills/git-worktree-status/SKILL.md
examples/skills/git-worktree/SKILL.md
examples/skills/guide-recap/SKILL.md
examples/skills/handoff-create/SKILL.md
examples/skills/handoff-resume/SKILL.md
examples/skills/handoff-update/SKILL.md
examples/skills/investigate/SKILL.md
examples/skills/issue-triage/SKILL.md
examples/skills/land-and-deploy/SKILL.md
examples/skills/landing-page-generator/SKILL.md
examples/skills/learn-alternatives/SKILL.md
examples/skills/learn-quiz/SKILL.md
examples/skills/learn-teach/SKILL.md
examples/skills/mcp-integration-reference/SKILL.md
examples/skills/methodology-advisor/SKILL.md

Metadata

Files
0
Version
a8d88fe
Hash
c30dc3ef
Indexed
2026-07-25 10:18

Главная - Вики-сайт
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-20 08:06
浙ICP备14020137号-1 $Гость$