Karpathy Guidelines

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

The Karpathy Guidelines skill, hosted in the popular mxyhi/ok-skills repository which has earned over 400 stars, provides a structured behavioral framework for AI agents to minimize common programming errors. This coding-focused skill is designed for compatibility with agents like Claude, Cursor, and Codex. It instructs the AI to prioritize surgical code modifications over broad rewrites, helping to prevent unnecessary complexity in software projects. By surfacing underlying technical assumptions and establishing verifiable success criteria, the guidelines ensure that refactoring and writing tasks remain focused and accurate. This resource serves as a practical implementation of best practices for developers using LLM-based tools to maintain high code quality and logic consistency.

Use Cases

Refactoring legacy codebases using surgical changes to minimize regression risks.
Conducting automated code reviews to identify and eliminate overcomplicated logic.
Defining clear success criteria and surfacing hidden assumptions before generating new functions.

Install Notes

# Review source first
open https://github.com/mxyhi/ok-skills/blob/main/karpathy-guidelines/SKILL.md

Copy or clone the skill folder into your agent skills directory after reviewing its instructions and scripts.

Security Notes

This skill consists of behavioral instructions and does not require specific system permissions or external dependencies. Users should review the guidelines within the mxyhi/ok-skills repository to ensure the logic aligns with their organization's internal coding standards and security policies before deployment.

Related Skills

MCP Builder

anthropics/skills

Coding

Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).

CodexClaude
typescriptpython
165,880 StarsApache-2.0

Claude API

anthropics/skills

Coding

Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER — read BEFORE opening the target file; don't skip because it "looks like a one-liner" — whenever: the prompt names Claude/Anthropic in any form (Claude, Anthr...

Claude CodeClaude
typescriptpython
165,880 StarsApache-2.0

Skill Creator

anthropics/skills

Coding

Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.

Claude CodeClaude
pythondesign
165,880 StarsApache-2.0

Git Workflow And Versioning

addyosmani/agent-skills

Coding

Structures git workflow practices. Use when making any code change. Use when committing, branching, resolving conflicts, or when you need to organize work across multiple parallel streams. Use when cutting a release, choosing a semantic version bump, tagging, or writing a changelog.

securityreview
81,373 StarsMIT

Spec Driven Development

addyosmani/agent-skills

Coding

Creates specs before coding. Use when starting a new project, feature, or significant change and no specification exists yet. Use when requirements are unclear, ambiguous, or only exist as a vague idea.

reacttesting
81,373 StarsMIT

Code Simplification

addyosmani/agent-skills

Coding

Simplifies code for clarity. Use when refactoring code for clarity without changing behavior. Use when code works but is harder to read, maintain, or extend than it should be. Use when reviewing code that has accumulated unnecessary complexity.

Claude CodeClaude
typescriptjavascript
81,373 StarsMIT