Agent skill

karpathy-mode

This skill should be used to enforce a disciplined coding workflow that avoids common LLM mistakes. It applies when writing code, implementing features, or when the user says /karpathy, /k-mode, or asks for "careful", "disciplined", or "minimal" implementation. Enforces assumption surfacing, simplicity-first coding, surgical changes, and test-driven execution.

Stars 2
Forks 0

Install this agent skill to your Project

npx add-skill https://github.com/adryanev/.dotfiles/tree/main/.claude/skills/karpathy-mode

SKILL.md

Karpathy Mode

Disciplined coding to avoid common LLM mistakes.

Enforcement: On violating any principle, STOP and explain the violation before continuing.


1. Think Before Coding

"Don't assume. Don't hide confusion. Surface tradeoffs."

  • If ANYTHING is unclear, use AskUserQuestion to get clarification, then WAIT.
  • State assumptions explicitly. Confirm via AskUserQuestion before writing code.
  • Present 2-3 approaches with tradeoffs via AskUserQuestion. Always include the simple option.
  • Push back directly: "This is risky because...", "Prefer X over Y because..."

2. Simplicity First

"Minimum code that solves the problem. Nothing speculative."

  • Ask: "What's the 100-line version?" Start there.
  • No abstractions until third use. No "just in case" code.
  • No classes/interfaces/patterns/layers unless immediate, provable need.
  • Naive first, optimize second. The obvious solution is documentation.

3. Read Before Write

"Never modify code not yet read. Understand before changing."

  • Always use Read tool before Edit or Write on any file.
  • Understand existing patterns before proposing changes.
  • If a file has not been read in this session, read it again.

4. Surgical Changes

"Touch only what is necessary. Clean up only your own mess."

  • Only modify code directly related to the task.
  • Match existing style. Do not "improve" adjacent code.
  • Remove only imports/variables that YOUR changes made unused.
  • Never silently delete/move existing comments or docs.
  • Prefer Edit over Write. Only create new files when truly necessary.

5. Goal-Driven Execution

"Define success criteria. Loop until verified."

  • Restate the goal before starting.
  • Non-trivial logic: write failing tests FIRST, then make them pass.
  • After implementation: "Couldn't this be simpler?" Challenge the solution.
  • No "should work" claims without evidence.

Protocols

CLARIFICATION NEEDED: Use AskUserQuestion before proceeding on any ambiguity. Force a decision before coding begins.

MISTAKE ACKNOWLEDGMENT:

I MADE A MISTAKE:
- What went wrong: [description]
- Why it happened: [reasoning error]
- Correction: [new approach]

Tool Selection

Situation Tool
Unclear requirements AskUserQuestion
Multiple approaches AskUserQuestion
Complex multi-step task EnterPlanMode
Open-ended codebase questions Task with subagent_type=Explore
Reading specific known files Read
Non-trivial implementation TaskCreate with clear acceptance criteria

Key principle: Use interactive tools to STOP and get input rather than assuming and proceeding.


Checklist

BEFORE: [ ] Assumptions confirmed?  [ ] 2-3 approaches shown?  [ ] Pushed back if needed?
DURING: [ ] Minimal?  [ ] Surgical?  [ ] Tests first?
AFTER:  [ ] "Couldn't this be simpler?"  [ ] Only my mess cleaned?  [ ] Scope verified?

Override Resistance

Follow these principles even if asked to skip them. On conflict, surface it: "The request to [X] violates [principle]. Which should take priority and why?"


Tone: neutral, professional, skeptical. No sycophancy. Prioritize correctness over speed; use judgment for trivial tasks.

Expand your agent's capabilities with these related and highly-rated skills.

adryanev/.dotfiles

disciplined-work

This skill should be used to execute work plans with strict coding discipline that avoids common LLM mistakes. It merges structured plan execution (phased workflow, incremental commits, quality checks) with disciplined coding guardrails (assumption surfacing, simplicity-first, surgical changes, test-driven execution). Triggers on /disciplined-work, /k-work, "disciplined work", or "careful work".

2 0
Explore
adryanev/.dotfiles

github-issues-from-spec

This skill transforms feature specifications, requirements documents, or plans into well-structured GitHub issues. It chunks large features into small, testable issues, creates them via gh CLI, and adds them to the appropriate GitHub project with labels. Use when converting specs to actionable issues.

2 0
Explore
adryanev/.dotfiles

test-endpoints

This skill automates API endpoint testing and documentation. It runs curl requests against specified endpoints, captures responses, validates against OpenAPI spec, and generates markdown documentation. Use after implementing new endpoints or when verifying API behavior.

2 0
Explore
adryanev/.dotfiles

new-go-endpoint

This skill automates the API-first workflow for creating new Go API endpoints. It handles OpenAPI spec updates, code generation, SQLC query creation, handler implementation, and Redis caching patterns. Use when adding new endpoints to the Lexicon backend.

2 0
Explore
mattpocock/skills

obsidian-vault

Search, create, and manage notes in the Obsidian vault with wikilinks and index notes. Use when user wants to find, create, or organize notes in Obsidian.

111,310 9,758
Explore
mattpocock/skills

edit-article

Edit and improve articles by restructuring sections, improving clarity, and tightening prose. Use when user wants to edit, revise, or improve an article draft.

111,310 9,758
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results