karpathy-guidelines

Applies behavioral coding guidelines to reduce common LLM coding errors during implementation and review.

Updated Jul 31, 2026
One-click install
npx skills add https://github.com/shengmingzhishu/LeeCommonVideoCut --skill karpathy-guidelines-shengmingzhishu
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: karpathy-guidelines
Source: https://github.com/shengmingzhishu/LeeCommonVideoCut/tree/main/.trae/skills/shared/karpathy-guidelines
Command: npx skills add https://github.com/shengmingzhishu/LeeCommonVideoCut --skill karpathy-guidelines-shengmingzhishu

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? LLM-generated code often suffers from over-engineering, unrequested features, hidden assumptions, and unverified changes. This Skill provides a set of behavioral guidelines, based on Andrej Karpathy's observations of LLM coding pitfalls, that keep AI-assisted coding focused, minimal, and verifiable. ## Core Features & Use Cases - Think Before Coding: Forces explicit statement of assumptions, presentation of alternative interpretations, and pausing to ask questions when requirements are unclear. - Simplicity First: Enforces minimal code for the problem, rejecting speculative abstractions, unrequested flexibility, and unnecessary error handling. - Surgical Edits & Goal-Driven Execution: Restricts changes to only what was requested, cleans up only self-created dead code, and converts tasks into verifiable success criteria with test-driven loops. - Use Case: When asking an AI to fix a bug or add a feature in an existing codebase, activate these guidelines so the AI writes a reproducing test first, touches only the necessary lines, and matches existing code style instead of refactoring unrelated code. ## Quick Start Apply the karpathy guidelines while implementing this feature so the code stays minimal, assumptions are stated, and every change is verified against a test.

Frequently Asked Questions about karpathy-guidelines

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

FAQPage Schema
How do I reduce over-engineering in AI-generated code?▼

Apply simplicity-first guidelines that reject speculative abstractions, unrequested configurability, and error handling for impossible scenarios. A useful test is whether a senior engineer would call the solution too complex; if 200 lines can be 50, rewrite it.

How to make an AI coding assistant make minimal code changes?▼

Use surgical edit rules: touch only lines traceable to the user's request, match existing style, and never refactor adjacent working code. Remove only imports or variables orphaned by your own change, and mention pre-existing dead code instead of deleting it.

What are Karpathy's guidelines for LLM coding?▼

They are four behavioral principles: think before coding by stating assumptions, prefer the simplest solution, make surgical edits only where needed, and execute with goal-driven verification using tests. They trade speed for caution on non-trivial tasks.

When should I not use strict coding guidelines like these?▼

Skip them for simple, one-off tasks where the overhead of stating assumptions and defining test criteria exceeds the risk of error. The guidelines themselves note they favor caution over speed, so judgment applies for trivial changes.

How do I turn a vague coding task into verifiable success criteria?▼

Convert the request into a testable goal: 'add validation' becomes 'write tests for invalid input and make them pass', and 'fix bug' becomes 'write a reproducing test and make it pass'. For multi-step work, state a brief plan with a verification check per step.