100k stars,如何像Karpathy一样AI写代码
推荐一个AI写代码纠错工具andrej-karpathy-skills,接近100k stars图1
起因:
2026年1月份,Andrej Karpathy推了一篇自己的AI coding心得体会,他认为AI编程存在一些缺陷,比如:
"The models make wrong assumptions on your behalf and just run along with them without checking. They don't manage their confusion, don't seek clarifications, don't surface inconsistencies, don't present tradeoffs, don't push back when they should. 模型会代你做错误假设,然后不假思索地执行。它们不管理自身的困惑,不寻求澄清,不呈现矛盾,不展示权衡,在应该提出异议时也不反驳。"
"They really like to overcomplicate code and APIs, bloat abstractions, don't clean up dead code... implement a bloated construction over 1000 lines when 100 would do. 它们真的很喜欢把代码和API搞复杂,堆砌抽象概念,不清理死代码……明明100行能搞定的事情,非要实现成1000行的臃肿架构。"
"They still sometimes change/remove comments and code they don't sufficiently understand as side effects, even if orthogonal to the task.它们有时仍会改动或删除自己理解不足的代码和注释,即使这些内容与任务本身无关。"
有位佬基于Karpathy的心得,给出了4条纠正AI编码常见坏习惯的原则:
1️⃣编码前思考,解决错误假设、隐藏困惑、缺少权衡
2️⃣简洁优先,解决过度复杂、臃肿抽象
3️⃣精准修改,解决无关编辑、触碰不应碰的代码
4️⃣目标驱动执行,解决通过测试优先、可验证的成功标准
🔥同时,包装了一个可运用的CLAUDE.md文件,纠正Claude Code、Cursor编码常见坏习惯:
✅Claude Code中使用CLAUDE.md
/plugin marketplace add forrestchang/andrej-karpathy-skills
/plugin install andrej-karpathy-skills@karpathy-skills
✅在Cursor中使用
https://github.com/forrestchang/andrej-karpathy-skills/blob/main/CURSOR.md
🔥推荐阅读-
2026可视化工具TOP3
《保姆级R可视化教程》来了!
Python matplotlib保姆级教程
嫌Matplotlib繁琐?试试Seaborn!
复现Nature子刊上3张图,换数据即可用!
复现Nature正刊上3张图,换数据即可用!
复现IF50.0期刊上6张图,换数据即可用!