karpathy-guidelines

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

1|Updated Mar 27, 2026
One-click install
npx skills add https://github.com/lrstanley/skills --skill karpathy-guidelines-lrstanley
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: karpathy-guidelines
Source: https://github.com/lrstanley/skills/tree/main/karpathy-guidelines
Command: npx skills add https://github.com/lrstanley/skills --skill karpathy-guidelines-lrstanley

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? LLM-generated code often suffers from overcomplication, unrequested features, silent assumptions, and sprawling edits that touch unrelated code. This Skill provides a set of behavioral guidelines, derived from Andrej Karpathy's observations on LLM coding pitfalls, that keep AI-assisted coding focused, minimal, and verifiable. ## Core Features & Use Cases - Think Before Coding: Surfaces assumptions, ambiguities, and simpler alternatives before implementation instead of silently picking an interpretation. - Simplicity First: Enforces minimum-code solutions with no speculative abstractions, configurability, or unrequested error handling. - Surgical Changes: Restricts edits to only what the task requires, matching existing style and avoiding drive-by refactors. - Goal-Driven Execution: Converts vague tasks into verifiable success criteria with test-driven loops and explicit step plans. - Use Case: When asking an AI to fix a bug or add a feature, activate these guidelines so the agent writes a failing test first, makes the minimal change to pass it, and avoids reformatting unrelated code. ## Quick Start Apply the karpathy guidelines while refactoring this function, keeping changes minimal and defining verifiable success criteria first.

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?▼

Use simplicity-first guidelines that forbid speculative abstractions, unrequested configurability, and error handling for impossible scenarios. The skill instructs the agent to rewrite any solution that could be substantially shorter.

How to make AI code edits surgical and minimal?▼

Require that every changed line traces directly to the user's request. The guidelines prohibit improving adjacent code, reformatting, or refactoring unrelated code, and only allow removing dead code that the agent's own changes orphaned.

What are Karpathy's guidelines for LLM coding?▼

They are behavioral rules derived from Andrej Karpathy's observations on LLM coding pitfalls: think before coding, prefer simplicity, make surgical changes, and execute against verifiable goals. They bias toward caution over speed.

When should I not use these coding guidelines?▼

For trivial tasks where the caution-over-speed tradeoff adds unnecessary overhead, use judgment and skip the full process. The guidelines themselves note they bias toward caution, which can slow down very simple changes.

How do I define verifiable success criteria for AI coding tasks?▼

Transform vague tasks into testable goals, such as writing a failing test that reproduces a bug and then making it pass. For multi-step work, state a brief plan where each step has an explicit verification check.