用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/majiayu000/claude-skill-registry --skill explain-like-senior命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | explain-like-senior |
| description | Senior-level code explanations with deep technical insights and context |
| disable-model-invocation | false |
I'll explain this code as a senior developer would, focusing on the why behind decisions.
Target Reduction: 60% (4,000-6,000 → 1,500-2,500 tokens) Optimization Status: ✅ Optimized (Phase 2 Batch 3B, 2026-01-26)
Problem: Reading entire codebase for context wastes tokens Solution: Laser-focus on specified file/function only
# ❌ AVOID: Exploring entire codebase
Glob **/*.ts # 500+ tokens
Read all related files # 2,000+ tokens
# ✅ PREFER: Targeted analysis
Grep "class UserService" --output_mode files_with_matches # 50 tokens
Read src/services/UserService.ts # 300 tokens
Token impact: 2,500 → 350 tokens (86% reduction)
Problem: Re-analyzing project architecture each time
Solution: Leverage cached /understand results
# ❌ AVOID: Fresh architecture analysis
Glob src/** # 400 tokens
Read package.json, tsconfig.json # 500 tokens
Analyze framework patterns # 800 tokens
# ✅ PREFER: Reuse cached architecture
Read .claude/cache/understand/architecture.json # 100 tokens
# Contains: framework, patterns, conventions, tech stack
Token impact: 1,700 → 100 tokens (94% reduction)
Problem: Reading multiple files to find similar implementations Solution: Grep for code patterns before reading files
# ❌ AVOID: Speculative file reads
Read src/services/*.ts # 2,000+ tokens across 10 files
# ✅ PREFER: Grep-then-read approach
Grep "implements Repository" --output_mode files_with_matches # 30 tokens
Grep "async.*transaction" --output_mode content -A 3 -B 1 # 150 tokens
Read only the 2-3 most relevant files # 600 tokens
Token impact: 2,000 → 780 tokens (61% reduction)
Problem: Providing deep technical details when overview suffices Solution: Start with overview, dive deeper only on request
# Initial explanation (quick overview)
- High-level architecture explanation: 400 tokens
- Key design decisions: 300 tokens
- Trade-offs summary: 200 tokens
Total: 900 tokens
# Only if user requests --deep flag
- Alternative approaches analysis: 600 tokens
- Performance implications: 400 tokens
- Scalability considerations: 400 tokens
Additional: 1,400 tokens
Token impact: 2,300 → 900 tokens base (61% reduction)
Problem: Re-reading code context in follow-up questions Solution: Track explained code in session state
# First explanation
Read src/auth/AuthService.ts # 400 tokens
Explain implementation # 800 tokens
# Follow-up question: "Why did they use JWT instead of sessions?"
# ❌ AVOID: Re-reading file (400 tokens)
# ✅ PREFER: Use session state (0 tokens - already in context)
Reference previous explanation, focus on JWT rationale # 300 tokens
Token impact: Per follow-up: 700 → 300 tokens (57% reduction)
Problem: Over-analyzing straightforward implementations Solution: Detect simple patterns and provide concise explanation
# Detection criteria for early exit:
- Single-purpose utility function (< 20 lines)
- Standard CRUD operations following framework conventions
- Simple data transformations without business logic
- Obvious design patterns (Factory, Singleton, etc.)
# ❌ AVOID: Deep analysis of simple utility
Read context files: 600 tokens
Analyze alternatives: 500 tokens
Performance considerations: 400 tokens
Total: 1,500 tokens
# ✅ PREFER: Concise explanation
Brief overview: 200 tokens
Key insight: 150 tokens
Total: 350 tokens (77% reduction)
Token impact: 1,500 → 350 tokens (77% reduction)
Cache Location: .claude/cache/explain-like-senior/
Cached Data:
Cache Sharing:
/understand architecture analysis (saves 800-1,200 tokens)/refactor for consistency (saves 400-600 tokens)/review code patterns cache (saves 300-500 tokens)Cache Validity:
| Scope | Token Range | Use Case |
|---|---|---|
| Single function | 600-1,200 | Explain specific function logic |
| Single file | 800-1,500 | Explain module/class implementation |
| Related files | 1,200-2,000 | Explain feature across 2-3 files |
| Deep analysis | 1,500-2,500 | Comprehensive analysis with alternatives |
Comparison with unoptimized approach:
# Minimal explanation (600-1,200 tokens)
explain-like-senior src/utils/formatDate.ts
# File-level explanation (800-1,500 tokens)
explain-like-senior src/services/UserService.ts
# Function-specific explanation (600-1,200 tokens)
explain-like-senior src/services/UserService.ts:createUser
# Deep analysis with alternatives (1,500-2,500 tokens)
explain-like-senior --deep src/core/auth/JWTStrategy.ts
# Multi-turn conversation (leverages session state)
explain-like-senior src/api/PaymentController.ts # Initial: 1,200 tokens
# Follow-up: "Why Stripe over PayPal?" # Follow-up: 300 tokens (57% savings)
Before explanation:
/understand cache exists (reuse architecture context)During explanation:
After explanation:
I'll analyze the code using native tools:
Technical Context:
Business Context:
Senior-Level Insights:
Experience-Based Guidance:
Mentoring Approach:
Code Evolution Perspective:
Important: I will NEVER:
This provides the kind of contextual, experience-driven explanation that helps developers grow from junior to senior level thinking.