karpathy-skills

Guide code edits with assumptions, minimal diffs, and result verification.

1|Updated Apr 11, 2026
One-click install
npx skills add https://github.com/drgon1/santian --skill karpathy-skills
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: karpathy-skills
Source: https://github.com/drgon1/santian/tree/main/ai-skills/skills/karpathy-skills
Command: npx skills add https://github.com/drgon1/santian --skill karpathy-skills

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps AI assistants make code changes with greater precision, fewer unnecessary edits, and clearer reasoning before implementation.

Core Features & Use Cases

  • Think Before Coding: State assumptions, surface uncertainties, and compare options before changing code.
  • Simplicity First: Prefer the smallest effective solution and avoid speculative abstractions or extra features.
  • Surgical Changes: Modify only what the request requires, keeping surrounding code, comments, and style intact.
  • Goal-Driven Execution: Define success criteria up front, then validate the change until the expected result is confirmed.
  • Use Case: Ideal for bug fixes, targeted refactors, feature additions, and test-driven verification where minimizing risk and preserving existing behavior matter.

Quick Start

Use the karpathy-skills guidelines to review the requested code change, state your assumptions, propose the smallest safe edit, and verify the result.

Frequently Asked Questions about karpathy-skills

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

FAQPage Schema
How do I enforce minimal diff code editing when fixing bugs or refactoring?

Minimal diff code editing requires stating assumptions upfront, proposing the smallest safe modification, and modifying only what the request requires to keep surrounding code intact. This surgical approach prevents unnecessary changes and preserves existing behavior during bug fixes or refactors.

What is surgical code editing and when should I use it for software engineering tasks?

Surgical code editing is a technique that modifies only the necessary code for a specific request while keeping surrounding code, comments, and style intact. Use it for targeted refactors, bug fixes, and feature additions where minimizing risk and preserving existing behavior matter.

How do I verify code changes and validate test results after a targeted refactor?

To verify code changes, define explicit success criteria up front, implement the modification, and validate the result until the expected outcome is confirmed. This goal-driven execution ensures test verification passes and surrounding code remains stable after refactoring.

Can I use surgical code editing for feature additions without breaking existing behavior?

Yes, surgical code editing applies to feature additions by preferring the smallest effective solution and avoiding speculative abstractions. By defining clear success criteria and tracing modifications directly to the request, it maintains surrounding code stability and prevents unnecessary changes.

What is the best way to prevent unnecessary code changes during AI-assisted bug fixing?

The best way to prevent unnecessary changes during AI-assisted bug fixing is to enforce precise editing behavior through assumption handling, minimal-diff implementation, and explicit result verification. This requires clear success criteria and simple solutions that avoid extra features.

Why does my code refactor introduce unexpected changes to surrounding code?

Code refactors introduce unexpected changes when edits are not surgically isolated to the request. Without enforcing minimal-diff implementation and upfront assumption handling, modifications can unintentionally alter surrounding code, comments, or style instead of preserving existing behavior.