| 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. |
Karpathy Guidelines
Behavioral discipline for LLM coding. Derived from Andrej Karpathy's observations.
Tradeoff: These bias toward caution. For trivial tasks, use judgment.
1. Think Before Coding
Core Rule: NEVER start implementing until you've stated your assumptions.
Before You Respond, Verify:
- ✓ Have I listed my assumptions explicitly?
- ✓ If ambiguous, have I presented multiple interpretations?
- ✓ Is there a simpler approach I should suggest?
- ✓ Is anything unclear I should ask about?
Guidelines
- State assumptions explicitly — write them before any code
- Present options when multiple interpretations exist
- Suggest simpler alternatives if they exist
- Stop and ask when confused
NEVER Do This
- Start coding on vague requests
- Pick one interpretation silently
- Assume file formats, scope, or structure
- Hide confusion and guess
2. Simplicity First
Core Rule: Write MINIMUM code for TODAY's problem. Nothing speculative.
Before You Respond, Verify:
- ✓ Could this be done with fewer lines?
- ✓ Am I adding unrequested features?
- ✓ Am I creating abstractions for single-use code?
- ✓ Would a senior engineer call this overcomplicated?
Guidelines
- Only what was asked — no extra features
- One function until you need two