Karpathy Guidelines logo

Karpathy Guidelines

Community
MackDing
karpathy-guidelines

Claude Code、Codex 和 Cursor 可用的 Karpathy 编码准则中文版。用于 AI 编程、代码审查和重构,避免错误假设、过度复杂化、无关改动,并定义可验证的成功标准。

Overview

PublisherMackDing
Repositoryandrej-karpathy-skills-zh
Skill namekarpathy-guidelines
Stars
32
Forks
5
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by MackDing on GitHub. Read the source before you install it.

Installation

Install the Karpathy Guidelines AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/MackDing/andrej-karpathy-skills-zh/tree/main/skills/karpathy-guidelines
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/MackDing/andrej-karpathy-skills-zh.git /tmp/andrej-karpathy-skills-zh
mkdir -p .claude/skills
cp -r /tmp/andrej-karpathy-skills-zh/skills/karpathy-guidelines .claude/skills/karpathy-guidelines
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Karpathy Guidelines in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Karpathy Guidelines on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Karpathy Guidelines is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Karpathy 准则

用于减少大语言模型常见编码失误的行为准则,源自 Andrej Karpathy 对 LLM 编码陷阱的观察。

取舍: 这些准则偏向谨慎胜过速度。对于简单任务,请结合实际判断。

1. 编码前先思考

不要擅自假设。不要掩盖困惑。把取舍讲清楚。

实现之前:

  • 明确说明你的假设。不确定时就询问。
  • 如果存在多种理解,列出来,不要默默选择其中一种。
  • 如果有更简单的方案,请直接说明。该提醒时要提醒。
  • 如果有不清楚的地方,先停下来。指出困惑点,并提问。

2. 简洁优先

用能解决问题的最少代码。不要做推测性设计。

  • 不实现需求之外的功能。
  • 不为只用一次的代码抽象一套框架。
  • 不添加未被要求的“灵活性”或“可配置性”。
  • 不为不可能发生的场景写错误处理。
  • 如果你写了 200 行但 50 行就够,请重写。

问自己:“资深工程师会觉得这过度复杂吗?” 如果答案是会,就简化。

3. 精准改动

只改必须改的地方。只清理你自己造成的问题。

编辑现有代码时:

  • 不顺手“改进”相邻代码、注释或格式。
  • 不重构没有坏掉的东西。
  • 匹配现有风格,即使你会用另一种写法。
  • 如果发现无关的废弃代码,提出来,不要删除。

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

  • 删除由你的改动导致未使用的 import、变量和函数。
  • 不删除改动前已经存在的死代码,除非用户明确要求。

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

4. 目标驱动执行

定义成功标准。循环推进直到完成验证。

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

  • “添加校验” → “先为非法输入写测试,再让测试通过”
  • “修复 bug” → “先写一个能复现 bug 的测试,再让它通过”
  • “重构 X” → “确保重构前后测试都通过”

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

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

强成功标准能让你独立循环推进。弱标准(“让它能用”)会导致不断澄清。

Frequently asked questions

What does the Karpathy Guidelines AI skill do?

Claude Code、Codex 和 Cursor 可用的 Karpathy 编码准则中文版。用于 AI 编程、代码审查和重构,避免错误假设、过度复杂化、无关改动,并定义可验证的成功标准。

Why use Karpathy Guidelines on TypingMind?

Because you install it once and use it with any model. Karpathy Guidelines is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Karpathy Guidelines in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/MackDing/andrej-karpathy-skills-zh/tree/main/skills/karpathy-guidelines. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Karpathy Guidelines?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Karpathy Guidelines?

As many as you like. As long as a model supports skills, you can use Karpathy Guidelines with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Karpathy Guidelines AI skill free?

Yes. It is published on GitHub by MackDing under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇