这是一套专业的 Claude Skills,帮助开发者真正理解源代码,而不只是"看懂"。基于认知科学研究,融合精细询问法、自我解释测试和应用迁移验证,确保深度学习而非产生流畅幻觉。
核心理念: 理解为什么 (WHY) > 知道是什么 (WHAT)
- 🎯 精细询问法 - 每个概念强制回答 3 个 WHY
- 🧪 自我解释测试 - 验证真实理解程度
- 🔗 概念网络构建 - 建立知识连接,而非孤立记忆
- 🚀 应用迁移测试 - 检验能否在不同场景应用
- 📚 学术研究支撑 - 基于 Dunlosky, Chi, Karpicke 等认知科学研究
- ⚡ 三种模式 - Quick/Standard/Deep 满足不同需求
- 🤖 智能并行 - Deep Mode 大型项目自动使用并行处理
code-reader-skills/
├── code-reader-zh/ # 中文版 🇨🇳
│ ├── SKILL.md # Skill 源文件
│ └── code-reader-zh.skill # Skill 包
│
├── code-reader-en/ # 英文版 🇺🇸
│ ├── SKILL.md # Skill source file
│ └── code-reader-en.skill # Skill package
│
├── README.md # 项目说明(本文件)
└── LICENSE # 开源许可证
# 克隆仓库
git clone https://github.com/notlate-cn/code-reader-skills.git
cd code-reader-skills支持三种分析深度,根据场景自动选择:
| 模式 | 耗时 | 适用场景 | 触发词示例 |
|---|---|---|---|
| Quick | 5-10 分钟 | 快速浏览、代码审查 | "快速看一下"、"这段代码干嘛的" |
| Standard | 15-20 分钟 | 学习理解、技术调研 ⭐ | "分析一下"、"帮我理解"、"解释一下" |
| Deep | 30+ 分钟 | 深度掌握、大型项目 🚀 | "彻底分析"、"完全掌握"、"深入研究" |
默认使用 Standard Mode
🚀 Deep Mode 内部智能策略:代码 ≤ 2000 行使用渐进式生成,代码 > 2000 行自动启用并行处理。
方式一:复制到 Claude 目录(推荐)
# 中文版
mkdir -p ~/.claude/skills
cp -r code-reader-zh ~/.claude/skills
# 英文版
mkdir -p ~/.claude/skills
cp -r code-reader-en ~/.claude/skills方式二:直接在对话中使用
# 在分析代码前,直接粘贴 skill 内容
cat code-reader-zh/SKILL.md | pbcopy # macOS
# 或者在对话中输入 @文件路径方式三:使用 API 的开发者
如果你通过 Claude API 调用,可以将 skill 内容作为 System Prompt:
import anthropic
# 读取 skill 内容(中文版)
with open('code-reader-zh/SKILL.md', 'r', encoding='utf-8') as f:
skill_content = f.read()
client = anthropic.Anthropic()
message = client.messages.create(
model="claude-sonnet-4-20250514", # 或使用最新可用模型
system=skill_content, # 将 skill 作为系统提示
messages=[
{"role": "user", "content": "深入分析这段代码:\n\n[你的代码]"}
]
)Quick Mode 触发示例:
你:/code-reader-v2-cn 快速分析这段代码
[上传或粘贴代码]
Standard Mode 触发示例:
你:/code-reader-v2-cn 深入分析这段代码,我想理解它的设计原理
[上传或粘贴代码]
Deep Mode 触发示例:
你:/code-reader-v2-cn 我需要彻底掌握这个算法,准备面试用
[上传或粘贴代码]
大型项目自动触发并行处理:
你:/code-reader-v2-cn 彻底分析这个项目
[上传或粘贴代码,系统检测到 >2000 行时自动使用并行处理]
- 👀 快速概览
- 📝 功能说明
- 📐 核心算法/设计
- 💻 关键代码段
- 📦 依赖关系
- 🎯 快速使用示例
- 🧪 理解验证状态
- 👀 快速概览
- 🎯 背景与动机(精细询问)
- 📌 核心概念说明
- 📐 算法与理论
- 🏗️ 设计模式
- 💻 关键代码深度解析(场景化注释)
- 📦 依赖与使用示例
[包含 Standard Mode 所有内容,加上]
- 🔗 概念网络图
- 📊 完整执行示例(多场景追踪)
- 🧪 测试用例分析(如有测试,通过测试反向理解代码)
- 🚀 应用迁移场景(至少 2 个)
- ✅ 质量验证清单
- 🤖 智能策略选择:代码 ≤ 2000 行使用渐进式生成,代码 > 2000 行自动启用并行处理
- 并行处理时:主协调 Agent + 并行子 Agents + 自动汇总
- 确保每个章节都有充分深度
点击查看完整示例
输入:
def authenticate_user(username, password):
user = db.find_user(username)
if not user:
return None
if verify_password(password, user.password_hash):
return generate_token(user.id)
return None输出(节选):
## 背景与动机分析
**WHY 需要这段代码?**
- 系统需要验证用户身份,保护未授权访问
**WHY 选择 JWT 方案?**
- 无状态认证,服务器不需要存储 Session
**WHY 不用 Session?**
- Session 需要服务器存储,不利于水平扩展基于以下认知科学研究:
- Dunlosky et al. (2013) - 精细询问法显著优于被动阅读
- Chi et al. (1994) - 自我解释者获得正确心智模型的概率更高
- Karpicke & Roediger (2008) - 检索练习优于重复阅读 250%
欢迎贡献!以下是参与方式:
- 报告问题 - 通过 Issues 反馈
- 提出建议 - 分享你的使用体验和改进想法
- 提交 PR - 改进文档或添加新功能
- 分享案例 - 展示你的使用案例
Q: 三种模式有什么区别?
A:
- Quick:快速了解代码结构和功能,5-10 分钟
- Standard:理解 WHY 和设计思路,15-20 分钟(推荐)
- Deep:应用迁移测试 + 质量验证,30+ 分钟
Q: 支持哪些编程语言?
A: 支持所有主流语言:
- Python, JavaScript, TypeScript, Java, C++, Go, Rust
- 以及各种框架和库
Q: 如何判断我真正理解了?
A: 使用 Deep Mode 的"四能"测试:
- ✅ 能否不看代码解释设计思路?
- ✅ 能否独立实现类似功能?
- ✅ 能否应用到不同场景?
- ✅ 能否向他人清晰解释?
重构优化:
- 🔄 合并 Parallel Deep Mode 到 Deep Mode,作为内部策略
- ⚡ 优化触发词系统,丰富各模式触发词
- 🤖 Deep Mode 内部智能选择:≤2000 行渐进式,>2000 行自动并行
- 📖 简化为三种模式:Quick/Standard/Deep
- 🧪 新增测试用例反向理解功能(Step 6.5)
改进:
- 🎯 用户体验更友好,无需手动选择并行模式
- 📝 更新中英文 SKILL.md 和 README 文档
- 🔬 支持通过测试用例反向验证和深化理解
- 🛠️ 支持 C++、MLIR/LLVM 等多种语言测试格式
解决问题:
- ✅ 解决模式过于冗余的问题
- ✅ 自动策略选择降低使用门槛
- ✅ 通过测试发现代码中隐藏的行为和边界条件
新增功能:
- ✨ 场景化注释风格(场景 N / 步骤 N)
- ✨ Token 优化策略(直接写入文件)
- ✨ 渐进式生成(Deep Mode 专用)
- ✨ 多语言注释支持规范
改进:
- 📦 优化文档结构,删除重复内容
- 📖 统一章节深度自检标准
- 🎯 完善执行流示例格式
优化:
- 🔧 文件大小:1500 → 1342 行 (-10.5%)
- ⚡ 删除子 Agent 使用规范
- 📝 合并重复的模式选择说明
新增功能:
- ✨ Quick/Standard/Deep 三种分析模式
- ✨ 智能模式选择机制
- ✨ 优化输出结构
改进:
- 📦 独立中英文目录结构
- 📖 更新 README 说明
- 🎯 精简触发词
本项目采用 MIT License 开源。
如果这个项目对你有帮助,请给个 Star ⭐
- 问题反馈:GitHub Issues
- 讨论交流:GitHub Discussions
A professional Claude Skills set that helps developers truly understand source code, not just "get it." Based on cognitive science research, integrating elaborative interrogation, self-explanation testing, and application transfer verification to ensure deep learning rather than fluency illusion.
Core Philosophy: Understanding WHY > Knowing WHAT
- 🎯 Elaborative Interrogation - Force answering 3 WHYs for each concept
- 🧪 Self-Explanation Test - Verify true understanding
- 🔗 Concept Network Construction - Build knowledge connections, not isolated memories
- 🚀 Application Transfer Test - Examine if applicable in different scenarios
- 📚 Academic Research Support - Based on Dunlosky, Chi, Karpicke's cognitive science research
- 🌐 Bilingual Support - Complete Chinese and English versions
- ⚡ Four Modes - Quick/Standard/Deep/Parallel Deep for different needs
- 🤖 Parallel Analysis - Sub-agents process chapters in parallel, ensuring depth for large projects
code-reader-skills/
├── code-reader-zh/ # Chinese version 🇨🇳
│ ├── SKILL.md # Skill source file
│ └── code-reader-zh.skill # Skill package
│
├── code-reader-en/ # English version 🇺🇸
│ ├── SKILL.md # Skill source file
│ └── code-reader-en.skill # Skill package
│
├── README.md # Project documentation (this file)
└── LICENSE # Open source license
# Clone repository
git clone https://github.com/notlate-cn/code-reader-skills.git
cd code-reader-skills| Mode | Duration | Use Case | Trigger Examples |
|---|---|---|---|
| Quick | 5-10 min | Quick browse, code review | "quick look", "what does this do" |
| Standard | 15-20 min | Learning, research ⭐ | "analyze", "help me understand", "explain" |
| Deep | 30+ min | Deep mastery, large projects 🚀 | "thoroughly analyze", "completely master", "in-depth research" |
Default: Standard Mode
🚀 Deep Mode internal smart strategy: Code ≤ 2000 lines uses progressive generation, code > 2000 lines auto-enables parallel processing.
Method 1: Copy to Claude directory (Recommended)
# English version
mkdir -p ~/.claude/skills
cp -r code-reader-en ~/.claude/skills
# Chinese version
mkdir -p ~/.claude/skills
cp -r code-reader-zh ~/.claude/skillsMethod 2: Use directly in conversation
# Paste skill content before analyzing code
cat code-reader-en/SKILL.md | pbcopy # macOS
# Or use @file-path in conversationMethod 3: For API Users
If you're using Claude API, pass skill content as System Prompt:
import anthropic
# Read skill content (English version)
with open('code-reader-en/SKILL.md', 'r', encoding='utf-8') as f:
skill_content = f.read()
client = anthropic.Anthropic()
message = client.messages.create(
model="claude-sonnet-4-20250514",
system=skill_content, # Use skill as system prompt
messages=[
{"role": "user", "content": "Deeply analyze this code:\n\n[Your code]"}
]
)Quick Mode Trigger Example:
You: /code-reader-v2-en Quickly analyze this code
[Upload or paste code]
Standard Mode Trigger Example:
You: /code-reader-v2-en Deeply analyze this code, I want to understand its design principles
[Upload or paste code]
Deep Mode Trigger Example:
You: /code-reader-v2-en I need to thoroughly master this algorithm for interview preparation
[Upload or paste code]
Parallel Deep Mode Trigger Example:
You: /code-reader-v2-en Thoroughly analyze this large project
[Upload or paste code, system will auto-use parallel processing when >2000 lines detected]
- Quick Overview
- Functionality Description
- Core Algorithm/Design
- Key Code Segments
- Dependencies
- Quick Usage Example
- Understanding Verification Status
- Quick Overview
- Background & Motivation (Elaborative Interrogation)
- Core Concepts
- Algorithm & Theory
- Design Patterns
- Key Code Deep Analysis (Scenario-based comments)
- Dependencies & Usage Examples
[All Standard Mode content, plus]
- Concept Network Diagram
- Complete Execution Examples (Multi-scenario tracking)
- Test Case Analysis (if tests exist, reverse-understand code through tests)
- Application Transfer Scenarios (at least 2)
- Quality Verification Checklist
- Smart Strategy Selection: Code ≤ 2000 lines uses progressive, code > 2000 lines auto-enables parallel processing
- Parallel processing: Master coordinator Agent + parallel sub-agents + auto-aggregation
- Ensures sufficient depth for each chapter
Based on the following cognitive science research:
- Dunlosky et al. (2013) - Elaborative interrogation significantly outperforms passive reading
- Chi et al. (1994) - Self-explainers achieve correct mental models with higher probability
- Karpicke & Roediger (2008) - Retrieval practice outperforms re-reading by 250%
Contributions are welcome! Here's how to participate:
- Report Issues - Provide feedback via Issues
- Suggest Improvements - Share your experience and ideas
- Submit PRs - Improve documentation or add new features
- Share Cases - Showcase your use cases
Q: What's the difference between three modes?
A:
- Quick: Fast understanding of structure and functionality, 5-10 min
- Standard: Understand WHY and design rationale, 15-20 min (Recommended)
- Deep: Application transfer testing + quality verification, 30+ min. Auto-uses parallel processing for large projects (>2000 lines)
Q: Which programming languages are supported?
A: All mainstream languages:
- Python, JavaScript, TypeScript, Java, C++, Go, Rust
- And various frameworks and libraries
Q: How do I know if I truly understand?
A: Use Deep Mode's "four abilities" test:
- ✅ Can you explain the design rationale without looking at code?
- ✅ Can you independently implement similar functionality?
- ✅ Can you apply it to different scenarios?
- ✅ Can you clearly explain it to others?
Refactor:
- 🔄 Merge Parallel Deep Mode into Deep Mode as internal strategy
- ⚡ Optimize trigger word system, enrich trigger words for each mode
- 🤖 Deep Mode smart selection: ≤2000 lines progressive, >2000 lines auto-parallel
- 📖 Simplify to 3 modes: Quick/Standard/Deep
- 🧪 Add test case reverse understanding feature (Step 6.5)
Improvements:
- 🎯 Better UX, no manual parallel mode selection needed
- 📝 Updated Chinese/English SKILL.md and README
- 🔬 Support reverse-understanding code through test cases
- 🛠️ Support C++, MLIR/LLVM and other language test formats
Problems Solved:
- ✅ Fixed redundant modes issue
- ✅ Auto strategy selection lowers usage barrier
- ✅ Discover hidden behaviors and boundary conditions through tests
New Features:
- ✨ Scenario-based comment style (Scenario N / Step N)
- ✨ Token optimization strategy (direct file writing)
- ✨ Progressive generation (Deep Mode only)
- ✨ Multi-language comment support standards
Improvements:
- 📦 Optimized document structure, removed duplicates
- 📖 Unified chapter depth self-check standards
- 🎯 Enhanced execution flow example format
Optimizations:
- 🔧 File size: 1500 → 1342 lines (-10.5%)
- ⚡ Removed Sub-Agent usage guidelines
- 📝 Merged duplicate mode selection sections
New Features:
- ✨ Quick/Standard/Deep analysis modes
- ✨ Smart mode selection mechanism
- ✨ Optimized output structure
Improvements:
- 📦 Separate Chinese/English directory structure
- 📖 Updated README documentation
- 🎯 Refined trigger words
This project is open-sourced under the MIT License.
If this project helps you, please give it a Star ⭐
- Bug Reports: GitHub Issues
- Discussions: GitHub Discussions