karpathy-guidelines

Behavioral checklist for disciplined LLM coding. Use when starting non-trivial tasks to enforce assumption surfacing, minimal changes, and verifiable goals. Derived from Andrej Karpathy's observations on LLM coding pitfalls.

14 stars

Best use case

karpathy-guidelines is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Behavioral checklist for disciplined LLM coding. Use when starting non-trivial tasks to enforce assumption surfacing, minimal changes, and verifiable goals. Derived from Andrej Karpathy's observations on LLM coding pitfalls.

Teams using karpathy-guidelines should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/karpathy-guidelines/SKILL.md --create-dirs "https://raw.githubusercontent.com/blacktop/dotfiles/main/ai/skills/karpathy-guidelines/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/karpathy-guidelines/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How karpathy-guidelines Compares

Feature / Agentkarpathy-guidelinesStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Behavioral checklist for disciplined LLM coding. Use when starting non-trivial tasks to enforce assumption surfacing, minimal changes, and verifiable goals. Derived from Andrej Karpathy's observations on LLM coding pitfalls.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Karpathy Guidelines

Four behavioral rules for non-trivial coding tasks. Trivial one-liners don't need the full rigor.

## 1. Surface Assumptions

Before implementing, state assumptions explicitly. When multiple interpretations exist, present them — don't pick silently. If confused, name what's unclear and ask.

**Test:** Can you trace every design choice to something the user said? If not, you assumed.

## 2. Minimum Viable Change

Write the least code that solves the problem. No speculative abstractions, no configurable hooks for single-use logic, no error handling for impossible scenarios. If 200 lines could be 50, rewrite.

**Test:** Would a senior engineer say "this is overcomplicated"? If yes, simplify.

## 3. Surgical Edits

Every changed line traces to the user's request. Don't improve adjacent code, comments, or formatting. Match existing style. If your changes orphan imports or variables, clean those up — but don't touch pre-existing dead code unless asked.

**Test:** Can every diff hunk be justified by the request? If not, revert the extras.

## 4. Verifiable Goals

Transform tasks into goals with success criteria:

| Vague | Verifiable |
|-------|-----------|
| "Add validation" | Write tests for invalid inputs, make them pass |
| "Fix the bug" | Write a reproducing test, make it pass |
| "Refactor X" | Tests pass before and after |

For multi-step work, state a plan with verification at each step:

```
1. [Step] → verify: [check]
2. [Step] → verify: [check]
```

## Working Indicators

These rules are working when: diffs contain only requested changes, code is simple on the first attempt, questions come before implementation, and PRs have no drive-by refactoring.

Related Skills

second-opinion

14
from blacktop/dotfiles

Run an external LLM code review with Codex CLI, Gemini CLI, or both. Use when the user asks for a second opinion, external review, Codex review, Gemini review, or wants a model-vs-model review of current changes, a branch diff, a specific commit, or a GitHub pull request.

seatbelt-sandboxer

14
from blacktop/dotfiles

Generates minimal macOS Seatbelt sandbox configurations. Use when sandboxing, isolating, or restricting macOS applications with allowlist-based profiles.

screenshot-analyzer

14
from blacktop/dotfiles

Find and analyze screenshots from ~/Downloads/Screenshots/ for UI/UX review. Use when asked to look at screenshots, review UI designs, inspect interface errors, analyze layout issues, or examine visual problems. Triggers on "check my latest screenshot", "review my UI", "analyze this screen capture".

save-session

14
from blacktop/dotfiles

Save AI agent session information for later resumption. Use when: (1) Finishing a work session and want to save progress (2) User says "save session", "remember this session", or "save your session ID" (3) Before ending a long coding/debugging session (4) When user wants to be able to resume this conversation later Supports Claude, Codex, Gemini, Copilot, Cursor, and other AI agents.

rust-profiling

14
from blacktop/dotfiles

Profile Rust code using samply to identify CPU bottlenecks. Use when performance is slow, before optimizing, or when the user asks to profile.

ratatui-tui

14
from blacktop/dotfiles

Build terminal UIs with ratatui following 2026 Rust best practices. Use when: (1) Creating new TUI apps, (2) Adding widgets/layouts, (3) Keyboard navigation/state management, (4) Image integration via ratatui-image, (5) Async event handling, (6) Release optimization. Covers v0.30.0+ API, Elm Architecture, StatefulWidget, color-eyre.

orchestrate

14
from blacktop/dotfiles

Orchestrate multi-step work with Claude Code CLI as a bounded worker while Codex stays lead developer. Use when Codex should split a task into scoped sub-tasks, delegate planning or implementation to Claude with `claude -p`, run parallel Claude sessions, isolate risky edits in worktrees, define custom Claude subagents, or move repeated enforcement into Claude hooks/settings.

instruments-profiling

14
from blacktop/dotfiles

Use when profiling native macOS or iOS apps with Instruments/xctrace. Covers correct binary selection, CLI arguments, exports, and common gotchas.

humanizer

14
from blacktop/dotfiles

Remove signs of AI-generated writing from text. Use when editing or reviewing text to make it sound more natural and human-written. Based on Wikipedia's comprehensive "Signs of AI writing" guide. Detects and fixes patterns including: inflated symbolism, promotional language, superficial -ing analyses, vague attributions, em dash overuse, rule of three, AI vocabulary words, negative parallelisms, and excessive conjunctive phrases. 30c5c8d (Update humanizer plugin to upstream v2.2.0)

html-artifacts

14
from blacktop/dotfiles

Produce a single self-contained .html artifact (no build, no external assets) when the task is spatial, interactive, visual, multi-axis, or long-running. Triggers on "build me an HTML for X", "make a dashboard / status snapshot / comparison / decision tree / timeline / architecture map", "render this plan as a clickable site", or when content can't fit markdown structurally. Skips short replies, code-only outputs, simple plans.

handoff

14
from blacktop/dotfiles

Generate optimized handoff prompts for delegating work to another LLM agent. Use when handing work to GPT-5.x/Codex, Claude 4.x, Gemini 3.x, or Grok 4.x, either as a shared-workspace sub-task handoff or a fresh-context handoff for a new session or model. Triggers on requests like "create a handoff prompt", "delegate this task to another agent", "hand this off", or "prepare context for another agent".

go-performance

14
from blacktop/dotfiles

Measure and improve Go program performance on modern Go (1.24+). Use when profiling Go code, diagnosing CPU or memory bottlenecks, investigating latency or contention, writing or fixing benchmarks, comparing benchmark results, using pprof or trace data, applying PGO, or tuning hot-path Go code.