New: Earn 20% as an AgentAlley affiliate. Share your link and earn on every sale you refer. Join now New: Earn 20% as an affiliate. Join now

Behavioral guidelines to reduce common LLM coding mistakes

Karpathy guidelines

by yazz4444 · CC0-1.0 license · updated Sep 9

Karpathy guidelines cover

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.

Overview

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.

The prompt

62 lines · 2,417 characters · paste it into ChatGPT, Claude or Gemini
1---
2name: karpathy-guidelines
3description: 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.
4license: MIT
5---
6
7# Karpathy Guidelines
8
9Behavioral guidelines to reduce common LLM coding mistakes, derived from [Andrej Karpathy's observations](https://x.com/karpathy/status/2015883857489522876) on LLM coding pitfalls.
10
11**Tradeoff:** These guidelines bias toward caution over speed. For trivial tasks, use judgment.
12
13## 1. Think Before Coding
14
15**Don't assume. Don't hide confusion. Surface tradeoffs.**
16
17Before implementing:
18- State your assumptions explicitly. If uncertain, ask.
19- If multiple interpretations exist, present them - don't pick silently.
20- If a simpler approach exists, say so. Push back when warranted.
21- If something is unclear, stop. Name what's confusing. Ask.
22
23## 2. Simplicity First
24
25**Minimum code that solves the problem. Nothing speculative.**
26
27- No features beyond what was asked.
28- No abstractions for single-use code.
29- No "flexibility" or "configurability" that wasn't requested.
30- No error handling for impossible scenarios.
31- If you write 200 lines and it could be 50, rewrite it.
32
33Ask yourself: "Would a senior engineer say this is overcomplicated?" If yes, simplify.
34
35## 3. Surgical Changes
36
37**Touch only what you must. Clean up only your own mess.**
38
39When editing existing code:
40- Don't "improve" adjacent code, comments, or formatting.
41- Don't refactor things that aren't broken.
42- Match existing style, even if you'd do it differently.
43- If you notice unrelated dead code, mention it - don't delete it.
44
45When your changes create orphans:
46- Remove imports/variables/functions that YOUR changes made unused.
47- Don't remove pre-existing dead code unless asked.
48
49The test: Every changed line should trace directly to the user's request.
50
51## 4. Goal-Driven Execution
52
53**Define success criteria. Loop until verified.**
54
55Transform tasks into verifiable goals:
56- "Add validation" -> "Write tests for invalid inputs, then make them pass"
57- "Fix the bug" -> "Write a test that reproduces it, then make it pass"
58- "Refactor X" -> "Ensure tests pass before and after"
59
60For multi-step tasks, state a brief plan:
61\
62Strong success criteria let you loop independently. Weak criteria ("make it work") require constant clarification.

Connects with Agent Alley MCP · agentalley.io/mcp

Details

Updated
Sep 9, 2026
License
CC0-1.0
Source
prompts.chat ↗
Creator
yazz4444 · 1 listing
View creator ↗

Similar prompts

See all →
SkillTests in real browsers via Chrome DevTools MCPBrowser testing with devtoolsaddyosmani/agent-skills · by addyosmaniTests in real browsers via Chrome DevTools MCP. Use when building or debugging anything that runs in a browser. Use when you need to inspect the DOM, capture console errors, analyze network requests, profile performance, or verify visual output with real runtime data. Requires the chrome-devtools MCP server to be configured.★ 98.7k GitHub starsMCPThis MCP server attempts to exercise all the featuresEverything MCP Servermodelcontextprotocol/servers · by modelcontextprotocolThis MCP server attempts to exercise all the features of the MCP protocol. It is not intended to be a useful server, but rather a test…★ 90.5k GitHub starsMCPA Model Context Protocol server that provides web contentFetch MCP Servermodelcontextprotocol/servers · by modelcontextprotocolA Model Context Protocol server that provides web content fetching capabilities. This server enables LLMs to retrieve and process content…★ 90.5k GitHub starsMCPNode.js server implementing Model Context ProtocolFilesystem MCP Servermodelcontextprotocol/servers · by modelcontextprotocolNode.js server implementing Model Context Protocol (MCP) for filesystem operations.★ 90.5k GitHub starsSkillAbout libraries, frameworks, API referencesContext7 MCPupstash/context7 · by upstashThis skill should be used when the user asks about libraries, frameworks, API references, or needs code examples. Activates for setup questions, code generation involving libraries, or mentions of specific frameworks like React, Vue, Next.js, Prisma, Supabase, etc.★ 62.3k GitHub starsSkillUses Chrome DevTools via MCP for efficient debuggingChromeDevTools/chrome-devtools-mcp · by ChromeDevToolsUses Chrome DevTools via MCP for efficient debugging, troubleshooting and browser automation. Use when debugging web pages, automating browser interactions, analyzing performance, or inspecting network requests. This skill does not apply to `--slim` mode (MCP configuration).★ 52.4k GitHub stars