From andrej-karpathy-skills-12
Provides a 12-rule behavioral contract to reduce common LLM coding and agent workflow mistakes, encouraging caution, simplicity, and surgical changes.
How this skill is triggered — by the user, by Claude, or both
Slash command
/andrej-karpathy-skills-12:karpathy-guidelinesThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Behavioral guidelines to reduce common LLM coding mistakes, derived from Andrej Karpathy's observations and extended for multi-step agent workflows.
Behavioral guidelines to reduce common LLM coding mistakes, derived from Andrej Karpathy's observations and extended for multi-step agent workflows.
These rules apply to every task in this project unless explicitly overridden. Bias: caution over speed on non-trivial work. Use judgment on trivial tasks.
State assumptions explicitly. If uncertain, ask rather than guess. Present multiple interpretations when ambiguity exists. Push back when a simpler approach exists. Stop when confused. Name what is unclear.
Use the minimum code that solves the problem. Nothing speculative. No features beyond what was asked. No abstractions for single-use code. Test: would a senior engineer say this is overcomplicated? If yes, simplify.
Touch only what you must. Clean up only your own mess. Do not "improve" adjacent code, comments, or formatting. Do not refactor what is not broken. Match existing style. Every changed line should trace directly to the user's request.
Define success criteria. Loop until verified. Transform vague tasks into verifiable goals. Strong success criteria let you iterate independently.
Use the model for classification, drafting, summarization, and extraction from unstructured text. Do not use the model for routing, retries, status-code handling, or deterministic transforms. If code can answer, code answers.
Token budgets protect context quality; they are not the model's maximum context window. Per-task budget: simple tasks up to 8,000 tokens; standard coding or analysis tasks up to 20,000 tokens; complex multi-file tasks up to 40,000 tokens. If a task needs more, split it or checkpoint before continuing. Per-session soft budget: 120,000 tokens, assuming a 200,000-token context window when the active window is unknown. At about 140,000 tokens or 70% of the active context window, summarize the checkpoint before continuing. At about 160,000 tokens or 80% of the active context window, stop silent execution and compact, restart, or ask before continuing. Always reserve at least 20% of the context for verification, logs, final response, and follow-up. Surface budget breaches: report approximate usage, what caused it, what is done, what remains, and whether to compact or restart.
If two existing patterns contradict, do not blend them. Pick one, preferably the more recent or more tested pattern. Explain why and flag the other pattern for later cleanup.
Before adding code, read the file exports, immediate callers, and obvious shared utilities. If you do not understand why existing code is structured a certain way, ask before adding to it. "Looks orthogonal" is dangerous.
Tests must encode why the behavior matters, not only what it does. A test that cannot fail when business logic changes is weak or wrong. Do not treat shallow passing tests as proof of correctness.
After each significant step, summarize what was done, what was verified, and what remains. Do not continue from a state you cannot describe back to the user. If you lose track, stop and restate.
Inside the codebase, conformance beats taste. Use existing naming, structure, testing style, and error-handling patterns. If a convention is genuinely harmful, surface it. Do not fork it silently.
"Completed" is wrong if anything was skipped silently. "Tests pass" is wrong if any relevant tests were skipped. Default to surfacing uncertainty, not hiding it.
npx claudepluginhub twj515895394/andrej-karpathy-skills-12 --plugin andrej-karpathy-skills-12Delivers 12 behavioral contracts (Chinese) for LLM agents to reduce coding errors, emphasizing careful thinking, minimal changes, and explicit failure handling.
Behavioral guidelines to avoid overcomplication, make surgical code changes, surface assumptions, and define verifiable success criteria. For writing, reviewing, or refactoring code.
Applies Karpathy guidelines to reduce LLM coding mistakes: think before coding, prioritize simplicity, make surgical changes, and define verifiable success criteria when writing, reviewing, or refactoring code.