关于 karpathy-education-first
karpathy-education-first 是一项将技术项目和概念转化为初学者教学材料的 Skill,强调小型易读的实现、示例和对代码原理的解释。
主要功能
- 01生成项目的教学版本
- 02创建可运行的小型示例项目
- 03用具体示例讲解概念
- 04将参考文档改写为教程
- 05检查代码是否易于教学
适用场景
- 01通过最小项目讲解复杂概念
- 02将已完成的工作整理成入门文档
- 03让技术文档更适合学习
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ learnprompt/ andrej-karpathy-skills --skill karpathy-education-first安装后在 Claude Code 中输入/karpathy-education-first确认已加载。
详细介绍
技能 12:教育至上
来源:https://x.com/karpathy/status/2021694437152157847 | https://x.com/karpathy/status/2056753169888334312 243 行纯 Python GPT | 即使在 Anthropic,“教育热情不变”
核心原则
如果你不能教会别人,就说明你还没有真正掌握它。把一切都做成纳米项目。
Karpathy 的标志性做法:从头重新实现复杂系统,使用精简、易读的代码,并尽可能充分地讲解。不是为了投入生产,而是为了理解。
这个 243 行的 GPT 并不是最快的实现,而是最容易理解的实现。这才是目标。
教学版提示词
完成任何项目后,都生成它的教学版:
I just built [PROJECT/CONCEPT]. Now create a teaching version of it.
[PASTE CODE OR DESCRIBE PROJECT]
Teaching version requirements:
1. Target audience: curious beginner who knows [PREREQUISITE LEVEL]
2. Start with: "Here's what we're building and why it matters" (2 paragraphs)
3. Walk through the code line-by-line in the most important sections
4. For every non-obvious decision: add a comment explaining WHY, not just WHAT
5. Add a "Try this yourself" section at the end with 3 small exercises
6. Maximum complexity rule: if a beginner would say "wait, what?" — add an explanation
Output: the teaching version as a complete annotated script or tutorial.
纳米项目模式
Karpathy 让任何事物都变得易于理解的方法:
Create a nano-project that demonstrates [COMPLEX CONCEPT].
Rules:
- Under 200 lines of code (pure Python / stdlib preferred)
- Zero external dependencies
- Every line earns its place
- Annotated: inline comments explain the key insight of each section
- Complete: runs from scratch, shows meaningful output
- Pedagogical: the code's structure mirrors the concept's structure
The concept to demonstrate: [CONCEPT]
What should the reader understand after running this? [LEARNING GOAL]
Also provide:
- 3-sentence explanation at the top of the file
- What to try next (3 suggestions for extending it)
“像 Karpathy 一样解释”提示词
用于解释任何技术概念:
Explain [CONCEPT] the way Karpathy would explain it — clear, direct, minimal jargon, example-first.
Format:
1. The one-sentence intuition (what it IS, not what it does)
2. The simplest possible concrete example (with actual numbers or code)
3. Why it matters (1-2 sentences, no hype)
4. The common misconception most people have about it
5. If you want to go deeper: [3 resources, ordered by accessibility]
Audience: [DESCRIBE YOUR READER]
能教会读者的文档
将技术文档从参考资料改造成教程:
Rewrite this documentation to be educational, not just informational.
Current docs:
[PASTE DOCUMENTATION]
Rewrite rules:
1. Lead with a concrete example, not with definitions
2. Explain each parameter with: what it does + why you'd change it + what the default is and why
3. Add a "Common patterns" section showing 3 real use cases
4. Add a "Common mistakes" section showing 3 errors people make and how to fix them
5. Keep all technical accuracy; only improve pedagogical structure
6. Add: "After reading this, you should be able to [LEARNING GOAL]" at the top
博文生成器
将任何项目转化为可分享的教学内容:
Write a technical blog post about [PROJECT/INSIGHT].
Style: Karpathy-style — direct, precise, example-driven, opinionated.
Structure:
1. Hook: why does this matter RIGHT NOW? (1-2 punchy sentences)
2. The core insight: one thing that changes how you think about [topic]
3. Show, don't tell: working code example that demonstrates the insight
4. What I tried that didn't work (builds credibility + saves readers time)
5. What I learned: 3-5 concrete takeaways, actionable
6. What's next: 2-3 things worth exploring
Tone:
- First person, direct
- Specific (exact line counts, benchmark numbers, actual errors)
- Skeptical of hype, enthusiastic about substance
- Never say "in conclusion" or "in summary" — just end when you're done
Audience: [WHO WILL READ THIS]
Length: [~1000 words for blog / ~500 for Twitter thread / ~300 for Gist]
让复杂研究通俗易懂
将论文或研究提炼为可用于教学的内容:
Distill this [paper/research/concept] into a teachable explainer.
Source: [PASTE ABSTRACT OR KEY SECTIONS]
Output:
1. ELI5 version: explain to a smart non-expert in 3 sentences
2. Key insight: what's the one thing this paper figured out?
3. The method in plain language: how did they do it? (no equations, just logic)
4. Why it matters: what does this enable that wasn't possible before?
5. The catch: what are the limitations or assumptions?
6. Nano-project idea: how could someone understand this by building a tiny version?
教学型代码审查清单
以教育至上的视角审查代码时:
Is this code teachable?
- [ ] Can a motivated beginner understand what it does in 5 minutes?
- [ ] Does each function have a comment explaining WHY, not just what?
- [ ] Are variable names descriptive enough to read like documentation?
- [ ] Is there a README that explains how to run it from scratch?
- [ ] Does it have at least one worked example in the comments?
- [ ] Are the non-obvious parts explained?
If any box is unchecked: the code isn't done yet.
工作流
属于工作流:研究到发布(终点)+ 工作流:月度体检(终点)
| 位置 | 上游 | 下游 |
|---|---|---|
| B 的第 4 步 | karpathy-output-evolution(包装完成后) | 发布/分享 |
| D 的第 4 步 | karpathy-practice-environments(练习后) | 教程输出 |
研究到发布链路:autoresearch → llm-wiki → output-evolution → education-first 月度体检链路:meta-reflection → understanding-first → practice-environments → education-first
提示词约定
Convert <PROJECT_OR_CONCEPT> into a teaching version for beginners. Produce: 1) Core concept in one sentence, 2) Minimal runnable example (< 300 lines, no hidden deps), 3) Step-by-step walkthrough (explain WHY not just WHAT), 4) 3-5 progressive exercises (easy→hard), 5) Common misconceptions and how to check if you fell into them.
验证清单
- 能用一句话讲清核心概念
- 最小可运行示例确实能运行(< 300 行,无隐藏依赖)
- walkthrough 解释了 WHY,而不只是 WHAT
- 练习题难度循序渐进
- 常见误区提供了自检方法
- 零基础读者能在 5 分钟内理解第一步
评论
支持 Markdown