agentleFS
HotakusHotakus/hotakus-useful-skills/karpathy-guidelines/SKILL.md

karpathy-guidelines

Skill2 starsChanged 5 months agoMITView on GitHub

减少常见 LLM 编码错误的行为准则。在编写、审查或重构代码时使用,以避免过度复杂化、进行外科手术式修改、明确假设并定义可验证的成功标准。

73 other projects use a version of this, 1 of them edited.

Adopted by

Most recently taken up by

Used with

Projects with it also use stitch-design-taste, design-taste-frontend and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • Jonathan0823Skill

    stitch-design-taste

    Semantic Design System Skill for Google Stitch. Generates agent-friendly DESIGN.md files that enforce premium, anti-generic UI standards — strict typography, calibrated color, asymmetric layouts, perpetual micro-motion, and hardware-accelerated performance.

    Also in 4 projects that use this

  • Jonathan0823Skill

    design-taste-frontend

    Senior UI/UX Engineer. Architect digital interfaces overriding default LLM biases. Enforces metric-based rules, strict component architecture, CSS hardware acceleration, and balanced design engineering.

    Also in 8 projects that use this

  • KubementatSkill

    ponytail

    Forces the laziest solution that actually works, simplest, shortest, most minimal. Channels a senior dev who has seen everything: question whether the task needs to exist at all (YAGNI), reach for the standard library before custom code, native platform features before dependencies, one line before fifty. Supports intensity levels: lite, full (default), ultra. Use on ANY coding task: writing, adding, refactoring, fixing, reviewing, or designing code, and choosing libraries or dependencies. Also use whenever the user says "ponytail", "be lazy", "lazy mode", "simplest solution", "minimal solution", "yagni", "do less", or "shortest path", or complains about over-engineering, bloat, boilerplate, or unnecessary dependencies. Do NOT use for non-coding requests (general knowledge, prose, translation, summaries, recipes).

    Also in 5 projects that use this

  • SentrySkill

    diagnosing-bugs

    A discipline for hard bugs, flaky tests, CI hangs, and performance regressions in this SDK. Use when the user says "diagnose" or "debug this", reports something broken/throwing/failing/hanging/slow, or a test is flaky. Builds a tight, red-capable feedback loop before hypothesizing.

    Also in 7 projects that use this

  • VercelSkill

    web-design-guidelines

    Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".

    Also in 10 projects that use this

  • AWSSkill

    codebase-design

    Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.

    Also in 6 projects that use this

  • +2 more from Jonathan0823

The file

Files
SKILL.md

Karpathy 编码准则

减少常见 LLM 编码错误的行为准则,源自 Andrej Karpathy 对 LLM 编码陷阱的观察。

权衡取舍: 这些准则偏向谨慎而非速度。对于简单任务,请自行判断。

1. 先思考再编码

不要假设。不要隐藏困惑。明确权衡取舍。

在实现之前:

  • 明确陈述你的假设。如果不确定,请提问。
  • 如果存在多种解释,请列出它们——不要默默选择一种。
  • 如果存在更简单的方案,请说出来。在有充分理由时提出反对意见。
  • 如果某件事不清楚,停下来。指出困惑之处。提问。

2. 简单优先

用最少的代码解决问题。不要做投机性工作。

  • 不添加超出需求的功能。
  • 不为只使用一次的代码创建抽象。
  • 不添加未被要求的"灵活性"或"可配置性"。
  • 不为不可能发生的场景添加错误处理。
  • 如果你写了 200 行代码而 50 行就能解决,重写它。

扪心自问:"资深工程师会不会说这过度复杂了?"如果是,那就简化。

3. 外科手术式修改

只触碰必须改的。只清理你自己造成的混乱。

在编辑现有代码时:

  • 不要"改进"相邻的代码、注释或格式。
  • 不要重构没有坏的东西。
  • 匹配现有风格,即使你会有不同的写法。
  • 如果你注意到无关的死代码,提出来——但不要删除它。

当你的改动产生了孤立代码时:

  • 删除因你的改动而不再使用的导入/变量/函数。
  • 不要删除预先存在的死代码,除非被明确要求。

检验标准:每一行改动都应该能直接追溯到用户的请求。

4. 目标驱动执行

定义成功标准。循环执行直至验证通过。

将任务转化为可验证的目标:

  • "添加验证" → "为无效输入编写测试,然后让它们通过"
  • "修复 bug" → "编写一个能复现 bug 的测试,然后让它通过"
  • "重构 X" → "确保重构前后测试都通过"

对于多步骤任务,给出简要计划:

1. [步骤] → 验证: [检查项]
2. [步骤] → 验证: [检查项]
3. [步骤] → 验证: [检查项]

强有力的成功标准能让你独立循环推进。薄弱的成功标准("让它能跑")则需要不断澄清。

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.