Open Source 开源项目 2h ago Updated 1h ago 更新于 1小时前 58

[GitHub] multica-ai/andrej-karpathy-skills GitHub开源项目:Andrej Karpathy编程技能指南

Andrej Karpathy identified systematic LLM coding pitfalls: making unchecked assumptions, overcomplicating solutions, touching unrelated code, and failing to manage confusion A single CLAUDE.md file encodes four principles (Think Before Coding, Simplicity First, Surgical Changes, Goal-Driven Execution) to directly address these issues The guidelines transform imperative instructions into verifiable success criteria, enabling LLMs to loop independently until goals are met Implementation is availab Andrej Karpathy总结LLM编码四大核心缺陷:错误假设、过度复杂化、无关代码修改、缺乏目标驱动 提出四原则框架:Think Before Coding、Simplicity First、Surgical Changes、Goal-Driven Execution 核心方法论:将指令式任务转化为可验证的目标,通过测试驱动实现自主循环 开源实现:提供Claude Code插件和Cursor规则,可直接集成到现有工作流

65
Hot 热度
70
Quality 质量
60
Impact 影响力

Analysis 深度分析

TL;DR

  • Andrej Karpathy identified systematic LLM coding pitfalls: making unchecked assumptions, overcomplicating solutions, touching unrelated code, and failing to manage confusion
  • A single CLAUDE.md file encodes four principles (Think Before Coding, Simplicity First, Surgical Changes, Goal-Driven Execution) to directly address these issues
  • The guidelines transform imperative instructions into verifiable success criteria, enabling LLMs to loop independently until goals are met
  • Implementation is available as both a Claude Code plugin and a per-project CLAUDE.md file, with Cursor support included
  • Success is measured by fewer unnecessary diffs, simpler first-pass code, clarifying questions before implementation, and clean minimal PRs

Why It Matters

This addresses a critical pain point for AI practitioners: LLM coding agents consistently produce overengineered, scope-creep code that requires extensive human review and correction. By encoding Karpathy's observed failure modes into actionable principles, developers can significantly reduce the cost of AI-assisted coding and improve the reliability of autonomous agent workflows.

Technical Details

  • Think Before Coding: Forces explicit reasoning before implementation—state assumptions, present multiple interpretations, push back on overcomplication, and stop to ask for clarification when confused
  • Simplicity First: Combats overengineering with hard constraints: no features beyond what was asked, no abstractions for single-use code, no speculative error handling, and a senior-engineer review test
  • Surgical Changes: Limits edits to only what is necessary—no "improving" adjacent code or comments, match existing style, remove only imports/variables your changes made unused, and mention unrelated dead code without deleting it
  • Goal-Driven Execution: Transforms tasks into verifiable goals (e.g., "write tests that reproduce the bug, then make them pass") rather than imperative instructions, leveraging LLMs' strength in iterative goal-reaching loops
  • Deployment: Available as a Claude Code marketplace plugin (forrestchang/andrej-karpathy-skills), a per-project CLAUDE.md file, and a Cursor project rule (.cursor/rules/karpathy-guidelines.mdc)

Industry Insight

  • The rise of reusable "skill" files for coding agents signals a shift toward standardized behavioral guardrails—expect similar pattern libraries to emerge for other agent frameworks and tools
  • Prompting LLMs with success criteria rather than step-by-step instructions is a practical technique that practitioners should adopt immediately, as it aligns with how these models actually perform best
  • The bias toward "caution over speed" reflects an industry maturation: as AI coding agents become more prevalent, reducing costly mistakes on non-trivial work will matter more than marginal speed gains on simple tasks

TL;DR

  • Andrej Karpathy总结LLM编码四大核心缺陷:错误假设、过度复杂化、无关代码修改、缺乏目标驱动
  • 提出四原则框架:Think Before Coding、Simplicity First、Surgical Changes、Goal-Driven Execution
  • 核心方法论:将指令式任务转化为可验证的目标,通过测试驱动实现自主循环
  • 开源实现:提供Claude Code插件和Cursor规则,可直接集成到现有工作流

为什么值得看

这篇文章直击当前AI编程助手的核心痛点——模型倾向于过度工程化和擅自修改无关代码。为AI开发者提供了可落地的prompt工程框架,显著提升编码agent的可靠性和代码质量。

技术解析

  • 四原则架构:Think Before Coding(显式假设、澄清疑问)、Simplicity First(最小可行代码、拒绝过度抽象)、Surgical Changes(仅修改必要部分、保持风格一致)、Goal-Driven Execution(测试驱动、可验证目标)
  • 实现方式:通过CLAUDE.md配置文件或Claude Code插件部署,支持多项目复用
  • 验证机制:将模糊指令转化为明确的测试用例和成功标准,建立闭环验证流程
  • 工具集成:提供Claude Code插件和Cursor规则两种集成路径,适配不同开发环境

行业启示

  • AI编程范式转变:从"告诉模型做什么"转向"定义成功标准",推动编程交互从命令式向声明式演进
  • 工程纪律重要性:LLM编码需要建立严格的变更管理和代码审查机制,防止过度工程化和无关修改
  • 工具链标准化:开源技能库的出现表明AI编程工具正在形成标准化框架,为后续开发奠定基础

Disclaimer: The above content is generated by AI and is for reference only. 免责声明:以上内容由 AI 生成,仅供参考。

Open Source 开源 LLM 大模型 Agent Agent Programming 编程 Code Generation 代码生成