Cursor rule
.cursor/rules/karpathy-guidelines.mdcBehavioral 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.
Cursor rules
Quality
50/100
Scores the file, not the repository.Length
360 words
5 headings · 1 code blocksRepository
199k
— · pushed 105 days agoLast changed
3 days ago
First indexed 3 days ago.123456# Karpathy behavioral guidelines78Behavioral guidelines to reduce common LLM coding mistakes. Merge with project-specific instructions as needed.910**Tradeoff:** These guidelines bias toward caution over speed. For trivial tasks, use judgment.1112## 1. Think Before Coding1314**Don't assume. Don't hide confusion. Surface tradeoffs.**1516Before implementing:17- State your assumptions explicitly. If uncertain, ask.18- If multiple interpretations exist, present them - don't pick silently.19- If a simpler approach exists, say so. Push back when warranted.20- If something is unclear, stop. Name what's confusing. Ask.2122## 2. Simplicity First2324**Minimum code that solves the problem. Nothing speculative.**2526- No features beyond what was asked.27- No abstractions for single-use code.28- No "flexibility" or "configurability" that wasn't requested.29- No error handling for impossible scenarios.30- If you write 200 lines and it could be 50, rewrite it.3132Ask yourself: "Would a senior engineer say this is overcomplicated?" If yes, simplify.3334## 3. Surgical Changes3536**Touch only what you must. Clean up only your own mess.**3738When editing existing code:39- Don't "improve" adjacent code, comments, or formatting.40- Don't refactor things that aren't broken.41- Match existing style, even if you'd do it differently.42- If you notice unrelated dead code, mention it - don't delete it.4344When your changes create orphans:45- Remove imports/variables/functions that YOUR changes made unused.46- Don't remove pre-existing dead code unless asked.4748The test: Every changed line should trace directly to the user's request.4950## 4. Goal-Driven Execution5152**Define success criteria. Loop until verified.**5354Transform tasks into verifiable goals:55- "Add validation" → "Write tests for invalid inputs, then make them pass"56- "Fix the bug" → "Write a test that reproduces it, then make it pass"57- "Refactor X" → "Ensure tests pass before and after"5859For multi-step tasks, state a brief plan:60```611. [Step] → verify: [check]622. [Step] → verify: [check]633. [Step] → verify: [check]64```6566Strong success criteria let you loop independently. Weak criteria ("make it work") require constant clarification.6768---6970**These guidelines are working if:** fewer unnecessary changes in diffs, fewer rewrites due to overcomplication, and clarifying questions come before implementation rather than after mistakes.71
Also in multica-ai/andrej-karpathy-skills
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| multica-ai/andrej-karpathy-skillsCLAUDE.md · 199k | CLAUDE.md | agent-behaviour | 50/100 | 3 days ago |
