By vanhe2003
Behavioral guidelines to reduce common LLM coding mistakes, derived from Andrej Karpathy's observations on LLM coding pitfalls
Behavioral guidelines combining project-specific rules for AI-Teaching-Assistant-1 with universal LLM coding principles derived from Andrej Karpathy's observations on common LLM coding pitfalls.
English | 简体中文
"The models make wrong assumptions on your behalf and just run along with them without checking. They don't manage their confusion, don't seek clarifications, don't surface inconsistencies, don't present tradeoffs, don't push back when they should."
"They really like to overcomplicate code and APIs, bloat abstractions, don't clean up dead code... implement a bloated construction over 1000 lines when 100 would do."
"They still sometimes change/remove comments and code they don't sufficiently understand as side effects, even if orthogonal to the task."
Four universal principles + project-specific rules, merged into one coherent set:
| Layer | What it provides |
|---|---|
| Project context | 5 bases, working scope, no-touch zones |
| Core rules | Base flow, reuse-first, surgical changes, simplicity, clean code |
| Workflow | ANALYZE → WEB SEARCH → PLAN → IMPLEMENT → VERIFY |
| Base-specific | FastAPI patterns / Vue 3 patterns |
| Bug-fix | Test-first verification loop |
Don't assume. Don't hide confusion. Surface tradeoffs.
Minimum code that solves the problem. Nothing speculative.
The test: Would a senior engineer say this is overcomplicated? If yes, simplify.
Touch only what you must. Clean up only your own mess.
The test: Every changed line should trace directly to the user's request.
Define success criteria. Loop until verified.
Transform every task into verifiable goals:
For multi-step tasks, state a plan with verification for each step:
1. [Step] → verify: [check]
2. [Step] → verify: [check]
Option A: Claude Code Plugin (recommended)
From within Claude Code:
/plugin marketplace add forrestchang/andrej-karpathy-skills
/plugin install andrej-karpathy-skills@karpathy-skills
Option B: CLAUDE.md (per-project)
curl -o CLAUDE.md https://raw.githubusercontent.com/forrestchang/andrej-karpathy-skills/main/CLAUDE.md
See CURSOR.md for Cursor setup, using the rule in other projects, and Claude Code vs Cursor differences.
From Andrej:
"LLMs are exceptionally good at looping until they meet specific goals... Don't tell it what to do, give it success criteria and watch it go."
The "Goal-Driven Execution" principle captures this: transform imperative instructions into declarative goals with verification loops.
These guidelines bias toward caution over speed. For trivial tasks (simple typo fixes, obvious one-liners), use judgment — not every change needs full rigor.
The goal is reducing costly mistakes on non-trivial work, not slowing down simple tasks.
MIT
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
npx claudepluginhub vanhe2003/rule --plugin andrej-karpathy-skillsBehavioral guidelines to reduce common LLM coding mistakes, derived from Andrej Karpathy's observations on LLM coding pitfalls
Design fluency for frontend development. 1 skill with 23 commands (/impeccable polish, /impeccable audit, /impeccable critique, etc.) and curated anti-pattern detection.
Comprehensive skill pack with 66 specialized skills for full-stack developers: 12 language experts (Python, TypeScript, Go, Rust, C++, Swift, Kotlin, C#, PHP, Java, SQL, JavaScript), 10 backend frameworks, 6 frontend/mobile, plus infrastructure, DevOps, security, and testing. Features progressive disclosure architecture for 50% faster loading.
Access thousands of AI prompts and skills directly in your AI coding assistant. Search prompts, discover skills, save your own, and improve prompts with AI.
Develop, test, build, and deploy Godot 4.x games with Claude Code. Includes GdUnit4 testing, web/desktop exports, CI/CD pipelines, and deployment to Vercel/GitHub Pages/itch.io.
Complete developer toolkit for Claude Code