PluginBench
Skill
Pass
Audit score 90

karpathy-guidelines

multica-ai/andrej-karpathy-skills

Behavioral guidelines to reduce common LLM coding mistakes through explicit assumptions, simplicity, surgical changes, and verifiable success criteria.

What is karpathy-guidelines?

A set of behavioral guidelines derived from Andrej Karpathy's observations on LLM coding pitfalls. Use when writing, reviewing, or refactoring code to avoid overcomplication, hidden assumptions, and unmeasurable goals. These guidelines bias toward caution and clarity over speed.

  • Surface assumptions explicitly before implementing rather than assuming silently
  • Enforce simplicity by removing speculative features, unnecessary abstractions, and over-engineered error handling
  • Make surgical edits that touch only what's necessary and match existing code style
  • Define verifiable success criteria and loop until goals are confirmed
  • Push back on unclear requirements and present multiple interpretations when they exist
  • Identify and remove only the dead code your changes created, not pre-existing issues

How to install karpathy-guidelines

npx skills add https://github.com/multica-ai/andrej-karpathy-skills --skill karpathy-guidelines
Claude Code
Cursor
Windsurf
Cline

How to use karpathy-guidelines

  1. 1.Before coding, state your assumptions explicitly and surface any confusion or tradeoffs
  2. 2.Write the minimum code needed to solve the problem—remove speculative features and unnecessary abstractions
  3. 3.When editing existing code, match the style and only touch lines directly related to the request
  4. 4.Define verifiable success criteria for your task (e.g., 'write tests for invalid inputs, then make them pass')
  5. 5.Loop through your changes and verify each criterion is met before considering the task complete

Use cases

Good for
  • Code review: Apply guidelines to catch overcomplicated solutions before merging
  • Refactoring tasks: Ensure changes are surgical and don't introduce unrelated improvements
  • Bug fixes: Write a test that reproduces the issue, then verify the fix passes
  • Feature implementation: Define success criteria upfront to avoid scope creep and ambiguity
  • Multi-step coding tasks: Break down into steps with explicit verification checkpoints
Who it's for
  • Software engineers reviewing LLM-generated code
  • Developers using AI coding assistants like Claude Code or Cursor
  • Teams wanting to reduce common pitfalls in AI-assisted development
  • Code reviewers enforcing quality standards on AI-generated changes

karpathy-guidelines FAQ

When should I ignore these guidelines?

For trivial tasks, use judgment. These guidelines bias toward caution over speed, so they're most valuable for complex changes, refactoring, and code review where mistakes are costly.

What's the difference between 'surgical changes' and 'simplicity first'?

Simplicity first applies when writing new code—minimize features and abstractions. Surgical changes apply when editing existing code—don't refactor unrelated code or 'improve' adjacent lines unless asked.

How do I define good success criteria?

Transform vague goals into testable outcomes. Instead of 'make it work,' write 'write tests for invalid inputs, then make them pass.' Include verification steps for multi-step tasks.

Should I remove dead code I find while editing?

Only if your changes made it dead. If it was pre-existing dead code, mention it but don't delete it unless explicitly asked.

What if the existing code style conflicts with best practices?

Match the existing style anyway. The guideline is to avoid introducing inconsistency. If the style is problematic, raise it separately—don't fix it as part of an unrelated change.

Full instructions (SKILL.md)

Source of truth, from multica-ai/andrej-karpathy-skills.


name: karpathy-guidelines description: Behavioral guidelines to reduce common LLM coding mistakes. Use when writing, reviewing, or refactoring code to avoid overcomplication, make surgical changes, surface assumptions, and define verifiable success criteria. license: MIT

Karpathy Guidelines

Behavioral guidelines to reduce common LLM coding mistakes, derived from Andrej Karpathy's observations on LLM coding pitfalls.

Tradeoff: These guidelines bias toward caution over speed. For trivial tasks, use judgment.

1. Think Before Coding

Don't assume. Don't hide confusion. Surface tradeoffs.

Before implementing:

  • State your assumptions explicitly. If uncertain, ask.
  • If multiple interpretations exist, present them - don't pick silently.
  • If a simpler approach exists, say so. Push back when warranted.
  • If something is unclear, stop. Name what's confusing. Ask.

2. Simplicity First

Minimum code that solves the problem. Nothing speculative.

  • No features beyond what was asked.
  • No abstractions for single-use code.
  • No "flexibility" or "configurability" that wasn't requested.
  • No error handling for impossible scenarios.
  • If you write 200 lines and it could be 50, rewrite it.

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

3. Surgical Changes

Touch only what you must. Clean up only your own mess.

When editing existing code:

  • Don't "improve" adjacent code, comments, or formatting.
  • Don't refactor things that aren't broken.
  • Match existing style, even if you'd do it differently.
  • If you notice unrelated dead code, mention it - don't delete it.

When your changes create orphans:

  • Remove imports/variables/functions that YOUR changes made unused.
  • Don't remove pre-existing dead code unless asked.

The test: Every changed line should trace directly to the user's request.

4. Goal-Driven Execution

Define success criteria. Loop until verified.

Transform tasks into verifiable goals:

  • "Add validation" → "Write tests for invalid inputs, then make them pass"
  • "Fix the bug" → "Write a test that reproduces it, then make it pass"
  • "Refactor X" → "Ensure tests pass before and after"

For multi-step tasks, state a brief plan:

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

Strong success criteria let you loop independently. Weak criteria ("make it work") require constant clarification.