karpathy-guidelines

v2026.09.24

Behavioral checklist for disciplined LLM coding. Use when starting non-trivial tasks to enforce assumption surfacing, minimal changes, and verifiable goals. Derived from Andrej Karpathy's observations on LLM coding pitfalls.

GitHub
安装命令
npx skhub add blacktop/karpathy-guidelines
Markdown
SKILL.md

Karpathy Guidelines

Four behavioral rules for non-trivial coding tasks. Trivial one-liners don't need the full rigor.

1. Surface Assumptions

Before implementing, state your assumptions explicitly. When several interpretations exist, name the one you chose and why rather than picking silently; stop and ask only when the choice is hard to reverse or fixes an interface, data model or architecture. If something is unclear, name it.

Test: Can you trace every design choice to something the user said? If not, you assumed.

2. Minimum Viable Change

Write the least code that solves the problem. No speculative abstractions, no configurable hooks for single-use logic, no error handling for impossible scenarios. If 200 lines could be 50, rewrite.

Test: Would a senior engineer say "this is overcomplicated"? If yes, simplify.

3. Surgical Edits

Every changed line traces to the user's request. Don't improve adjacent code, comments, or formatting. Match existing style. If your changes orphan imports or variables, clean those up — but don't touch pre-existing dead code unless asked.

Test: Can every diff hunk be justified by the request? If not, revert the extras.

4. Verifiable Goals

Transform tasks into goals with success criteria:

VagueVerifiable
"Add validation"Write tests for invalid inputs, make them pass
"Fix the bug"Write a reproducing test, make it pass
"Refactor X"Tests pass before and after

For multi-step work, state a plan with verification at each step:

1. [Step] → verify: [check]
2. [Step] → verify: [check]

Working Indicators

These rules are working when: diffs contain only requested changes, code is simple on the first attempt, assumptions are stated before implementation, and PRs have no drive-by refactoring.

发现
标签

此技能尚未发布标签。

版本
最新版本元数据

版本

v2026.09.24

发布时间

2026年9月24日

分类

未分类

许可证

未指定

源路径

ai/skills/karpathy-guidelines

默认分支

master

最新提交

7a45f0c

Tree SHA

775c40e