karpathy-guidelines

Applies behavioral guidelines to reduce common LLM coding mistakes during code writing and review.

Updated Apr 13, 2026
One-click install
npx skills add https://github.com/Unity-UPM-Packages/Antigravity-skills --skill karpathy-guidelines-unity-upm-packages
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: karpathy-guidelines
Source: https://github.com/Unity-UPM-Packages/Antigravity-skills/tree/main/.agents/skills/karpathy-guidelines
Command: npx skills add https://github.com/Unity-UPM-Packages/Antigravity-skills --skill karpathy-guidelines-unity-upm-packages

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? LLM-generated code often suffers from overcomplication, unrequested features, silent assumptions, and sweeping changes that touch unrelated code. This Skill provides behavioral guidelines that keep AI coding assistants focused, surgical, and verifiable when writing, reviewing, or refactoring code. ## Core Features & Use Cases - Think Before Coding: Surfaces assumptions, presents alternative interpretations, and stops to ask when requirements are unclear instead of guessing silently. - Simplicity First: Enforces minimum-code solutions with no speculative abstractions, unrequested configurability, or impossible-scenario error handling. - Surgical Changes: Restricts edits to lines that trace directly to the user's request, matching existing style and leaving unrelated code untouched. - Goal-Driven Execution: Transforms vague tasks into verifiable success criteria, such as writing a failing test before fixing a bug. - Use Case: When asking an AI to fix a bug in a large codebase, these guidelines ensure it writes a reproduction test first, changes only the relevant lines, and avoids refactoring adjacent code. ## Quick Start Ask the AI to fix a bug or implement a feature while following the karpathy guidelines to keep changes minimal and verifiable.

Frequently Asked Questions about karpathy-guidelines

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I stop an AI coding assistant from overcomplicating code?▼

Apply simplicity-first guidelines that forbid speculative abstractions, unrequested features, and error handling for impossible scenarios. The rule of thumb is that if a solution could be written in 50 lines instead of 200, it should be rewritten.

How to make AI code changes surgical and minimal?▼

Require that every changed line traces directly to the user's request. The AI should match existing style, avoid refactoring unrelated code, and only remove dead code that its own changes orphaned.

What are Karpathy's guidelines for LLM coding mistakes?▼

They are behavioral rules derived from Andrej Karpathy's observations on LLM coding pitfalls: think before coding, keep solutions simple, make surgical changes, and define verifiable success criteria for every task.

When should I not use these coding guidelines?▼

These guidelines bias toward caution over speed, so they may slow down trivial tasks. For quick throwaway scripts or obvious one-line fixes, use judgment rather than applying the full process.

How do I turn vague coding tasks into verifiable goals?▼

Restate each task as a testable outcome, such as writing a failing test that reproduces a bug before fixing it. For multi-step work, list each step with its verification check so progress can be confirmed independently.