karpathy-guidelines

Apply rule-based prompts to reduce LLM coding mistakes in review workflows.

2|Updated Apr 24, 2026
One-click install
npx skills add https://github.com/river-walras/virtus --skill karpathy-guidelines-river-walras
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: karpathy-guidelines
Source: https://github.com/river-walras/virtus/tree/main/skills/karpathy-guidelines
Command: npx skills add https://github.com/river-walras/virtus --skill karpathy-guidelines-river-walras

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Behavioral guidelines to reduce common LLM coding mistakes, derived from Andrej Karpathy's observations on LLM coding pitfalls.

Core Features & Use Cases

  • Think Before Coding: Surface assumptions, ask clarifying questions when uncertain, and present multiple interpretations when needed.
  • Simplicity First: Use minimal, purpose-built changes with no unnecessary abstractions.
  • Surgical Changes: Edit only what is necessary, preserve existing style, and avoid unintended side effects.
  • Goal-Driven Execution: Define verifiable success criteria, and loop with checks until verified.

Quick Start

Begin each coding task by explicitly stating assumptions, surfacing ambiguities, and choosing the simplest verifiable approach.

Frequently Asked Questions about karpathy-guidelines

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent common LLM coding mistakes during code generation?

To prevent common LLM coding mistakes, apply behavioral guidelines that enforce explicit assumptions, surface ambiguities, and prompt the model to present multiple interpretations before writing code. This reduces unintended side effects and ensures safer code generation.

What is the best way to ensure surgical changes when refactoring code with an LLM?

The best way to ensure surgical changes is to instruct the LLM to edit only what is necessary, preserve existing code style, and use minimal, purpose-built modifications without introducing unnecessary abstractions or unrelated edits.

How do I get an LLM to think before coding and ask clarifying questions?

To get an LLM to think before coding, use rule-based prompts that require it to explicitly state assumptions, surface ambiguities, and choose the simplest verifiable approach before generating any code blocks or refactoring solutions.

Why does my LLM introduce unnecessary abstractions when writing or reviewing code?

Your LLM introduces unnecessary abstractions because it lacks strict simplicity constraints. Enforce guidelines that demand minimal, purpose-built changes and surgical edits to prevent the model from over-engineering solutions beyond the requested scope.

Can I use these coding guidelines for both writing new code and reviewing existing code?

Yes, you can use these coding guidelines for writing new code and reviewing existing code. The heuristics apply across refactoring and generation workflows to surface tradeoffs, define verifiable success criteria, and encourage safe changes.

How do I define verifiable success criteria for LLM-generated code?

To define verifiable success criteria for LLM-generated code, establish goal-driven execution rules that require the model to loop with checks until the output is verified. This ensures the generated code meets explicit functional requirements.