Skip to content
Agentmart
Submit a tool

karpathy-guidelines

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

Skill by ymxc152

IndexedMIT
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/ymxc152-karpathy-guidelines

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

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

Use cases: ml

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/karpathy-guidelines

What's inside

Skill name
karpathy-guidelines
Description
减少常见 LLM 编码错误的行为准则。在编写、审查或重构代码时使用,以避免过度复杂化、进行精准修改、明确假设并定义可验证的成功标准。
License
MIT
Instructions
63 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

# Karpathy Guidelines(Karpathy 准则)

减少常见 LLM 编码错误的行为准则,源自 [Andrej Karpathy 对 LLM 编码陷阱的观察](https://x.com/karpathy/status/2015883857489522876)。

**权衡:** 这些准则偏向谨慎而非速度。对于琐碎任务,自行判断。

## 1. 编码前先思考

**不要假设。不要隐藏困惑。明确展示权衡。**

在实现之前:
- 明确陈述你的假设。如果不确定,询问。
- 如果存在多种解释,展示它们——不要默默选择。
- 如果存在更简单的方案,说出来。在必要时提出反对。
- 如果某事不清楚,停下来。说出困惑之处。询问。

## 2. 简洁优先

**解决问题所需的最少代码。不做任何投机。**

- 不要添加超出要求的功能。
- 不要为单次使用的代码做抽象。
- 不要添加未被要求的"灵活性"或"可配置性"。
- 不要为不可能发生的场景做错误处理。
- 如果你写了 200 行而它可以只有 50 行,重写它。

问自己:"资深工程师会说这过度复杂了吗?" 如果是,简化。

## 3. 精准修改

**只碰必须碰的。只清理你自己的烂摊子。**

编辑现有代码时:
- 不要"改进"相邻代码、注释或格式。
- 不要重构没坏的东西。
- 匹配现有风格,即使你的做法不同。
- 如果你注意到无关的死代码,提及它——但不要删除。

当你的更改产生孤儿代码时:
- 移除你的更改导致未使用的 imports/变量/函数。
- 不要删除预先存在的死代码,除非被要求。

测试标准:每一行更改都应能直接追溯到用户的请求。

## 4. 目标驱动执行

**定义成功标准。循环直到验证通过。**

将任务转化为可验证的目标:
- "添加验证" → "为无效输入编写测试,然后让它们通过"
- "修复 Bug" → "编写能复现它的测试,然后让它通过"
- "重构 X" → "确保测试在重构前后都通过"

对于多步骤任务,陈述简要计划:
```
1. [步骤] → 验证: [检查]
2. [步骤] → 验证: [检查]
3. [步骤] → 验证: [检查]
```

强大的成功标准让你能独立循环。弱标准("让它工作")需要不断澄清。

From ymxc152/dotfiles-skills, MIT.

More from ymxc152/dotfiles-skills

Signals

Stars
0
Forks
0
Open issues
0
Last commit (this folder)
May 24, 2026 (5 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from ymxc152

Cite this page

karpathy-guidelines skill. Agent Mart. https://agentmart.dev/skills/ymxc152-karpathy-guidelines (last updated 2026-10-24)