Apply the Karpathy Guidelines for LLM coding
mainThe Karpathy Guidelines are behavioral principles designed to reduce common LLM coding mistakes such as overcomplication, silent assumptions, and unnecessary refactoring. These guidelines bias toward caution over speed. Use them when writing, reviewing, or refactoring code to ensure changes are surgical, simple, and goal-driven.
Core Principles:
- Think Before Coding: Explicitly state assumptions, surface tradeoffs, and ask for clarification instead of making silent decisions.
- Simplicity First: Write the minimum code required. Avoid speculative abstractions, unrequested configurability, or error handling for impossible scenarios.
- Surgical Changes: Touch only what is necessary. Do not refactor adjacent code or change formatting unless it is part of the task. Match the existing style.
- Goal-Driven Execution: Transform vague tasks into verifiable success criteria (e.g., instead of "fix the bug", use "write a test that reproduces the bug, then make it pass").