Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
athola avatar

Karpathy Principles

  • 77 installs
  • 325 repo stars
  • Updated August 2, 2026
  • athola/claude-night-market

Stop LLM coding drift by naming eight anti-pattern rails and applying think-before-coding checks before agents ship silent assumptions.

About

Karpathy Principles (packaged as anti-pattern drift rails) is a journey-wide agent skill for solo builders who delegate implementation to LLMs and need discipline before code lands. It encodes eight named ways agentic coding goes wrong—starting with hidden assumptions and multiple interpretations chosen silently—each with triggers, contrasting bad and good shapes, and a quick test you can run on your own diff. The skill maps rails to think-before-coding style principles adapted from community distillations of Andrej Karpathy’s notes, with attribution separated from the teaching prose. Use it whenever a feature request has unstated dimensions (scope, format, volume, privacy) or when you notice an agent shipping a default path without asking. It is meta-process, not a code generator: the deliverable is fewer silent assumptions and explicit user confirmation before implementation proceeds.

  • Eight named drift rails (e.g. hidden assumptions, silent interpretation picks) mapped to Karpathy-style principles
  • Each rail includes trigger pattern, bad vs good example shape, and a one-sentence test for your diff
  • AP-1 rule: three or more silent assumptions in a diff is a rail violation
  • Forces explicit confirmation on scope, format, privacy, and volume before coding
  • Source chain documented via references/source-attribution.md in upstream repo

Karpathy Principles by the numbers

  • 77 all-time installs (skills.sh)
  • Ranked #5,386 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
  • Security screen: LOW risk (skills.sh audit)
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/athola/claude-night-market --skill karpathy-principles

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs77
repo stars325
Security audit3 / 3 scanners passed
Last updatedAugust 2, 2026
Repositoryathola/claude-night-market

What it does

Stop LLM coding drift by naming eight anti-pattern rails and applying think-before-coding checks before agents ship silent assumptions.

Files

SKILL.mdMarkdownGitHub ↗
The models make wrong assumptions on your behalf and
just run along with them without checking. They don't
manage their confusion, don't seek clarifications,
don't surface inconsistencies, don't present
tradeoffs, don't push back when they should.

>

(Andrej Karpathy, on agentic coding failure modes)

What This Is

A four-principle contract for reducing the most common LLM coding pitfalls. Compact entry-point. Each principle has a deeper-dive skill in night-market; this skill is the index, not the encyclopedia.

Derivation: distilled by Forrest Chang (forrestchang/andrej-karpathy-skills, MIT) from Karpathy's observations. Full attribution in references/source-attribution.md.

When to Use

  • Before starting any coding task larger than a typo
  • During code review, to name the failure mode you see
  • After writing a diff, to self-audit before claiming

done

  • When training a junior engineer to read agent diffs

When NOT to Use

These principles bias toward caution over speed. For cases listed in modules/tradeoff-acknowledgment.md, use judgment: trivial fixes, exploratory spikes, documentation-only edits, and time-boxed prototypes.

The Four Principles

1. Think Before Coding

State assumptions. Surface confusion. Match tone to evidence.

  • If multiple interpretations of the request exist,

list them. Do not silently pick.

  • If a simpler approach exists, name it. Push back

when the simpler path is correct.

  • If something is unclear, stop and ask. Hidden

assumptions are the cheapest bug to prevent and the most expensive to find later.

  • Make claims no stronger than the evidence supports.

Calibrated tone beats confident hand-waving.

Deep dives: Skill(imbue:rigorous-reasoning) for the sycophancy guard, Skill(superpowers:brainstorming) for option generation, /spec-kit:speckit-clarify command for ambiguity drilldown.

2. Simplicity First

Minimum code that solves the problem. Nothing speculative.

They really like to overcomplicate code and APIs,
bloat abstractions.

>

(Andrej Karpathy, on the same agentic-coding thread)
  • No features beyond what was asked
  • No abstractions for single-use code
  • No flexibility or configurability that wasn't

requested

  • No error handling for impossible scenarios
  • If you wrote 200 lines and it could be 50, rewrite

it

Self-check: would a senior engineer say this is overcomplicated? See modules/senior-engineer-test.md.

Deep dives: Skill(imbue:scope-guard) for the worthiness formula and branch budgets, Skill(leyline:additive-bias-defense) for burden of proof on every addition, Skill(conserve:code-quality-principles) for the KISS / YAGNI / SOLID foundation.

Record the Tradeoff (decision journal)

When this step settles a decision with real alternatives, record it to docs/tradeoffs.md while the reasoning is live (draft and confirm):

  • If leyline is installed, invoke Skill(leyline:decision-journal) and append

a tradeoff entry (the decision, the options weighed, and what was sacrificed; set phase to plan). Show the draft; append on confirmation.

  • Fallback (leyline absent): append to docs/tradeoffs.md using the in-file

ENTRY TEMPLATE; assign the next TR-NNN id.

3. Surgical Changes

Touch only what you must. Clean up only your own mess.

  • Do not improve adjacent code, comments, or

formatting

  • Do not refactor things that aren't broken
  • Match existing style even when you would do it

differently

  • If you notice unrelated dead code, mention it; do

not delete it

  • When your changes orphan imports or variables,

remove the orphans you created. Pre-existing dead code stays unless asked.

The trace-back test: every changed line should trace directly to the user's request.

Deep dives: Skill(imbue:justify) for additive-bias audits on diffs, Skill(leyline:additive-bias-defense) for the burden-of-proof contract, the bounded-discovery.md rule for read-budget caps.

4. Goal-Driven Execution

Define verifiable success criteria. Loop until verified.

Transform vague tasks into checkable goals:

  • "Add validation" becomes "tests for invalid inputs

pass"

  • "Fix the bug" becomes "test reproducing the bug,

then make it pass"

  • "Refactor X" becomes "tests pass before and after"
  • "Make it faster" becomes "benchmark Y under N ms"

For multi-step tasks, state a brief plan with verification per step. Strong success criteria let you loop independently. Weak criteria require constant clarification.

See modules/verifiable-goals.md for the full reformulation template.

Deep dives: Skill(imbue:proof-of-work) for the Iron Law (no implementation without a failing test first), Skill(superpowers:test-driven-development) for the RED-GREEN-REFACTOR loop.

The Karpathy Self-Check

Before you ship, four questions:

PrincipleQuestion
Think Before CodingDid I list assumptions, or did I guess silently?
Simplicity FirstWould a senior engineer call this overcomplicated?
Surgical ChangesDoes every changed line trace to the request?
Goal-Driven ExecutionCan I prove this is done with a check, not a feeling?

Four "yes" answers means ship. Anything else means iterate.

Modules

  • modules/anti-patterns.md - eight named drift rails

with before/after diffs

  • modules/senior-engineer-test.md - the

three-question self-check battery

  • modules/verifiable-goals.md - vague-to-verifiable

reformulation template with worked examples

  • modules/tradeoff-acknowledgment.md - when the four

principles do not apply

References

  • references/source-attribution.md - Karpathy

primary citation, Forrest Chang derivation, license, adjacent prior art

Related Skills

  • Skill(imbue:scope-guard) - worthiness formula and

branch budgets

  • Skill(imbue:proof-of-work) - Iron Law TDD gate
  • Skill(imbue:rigorous-reasoning) - sycophancy and

hidden-assumption guard

  • Skill(imbue:justify) - additive-bias diff audit
  • Skill(leyline:additive-bias-defense) - burden of

proof on every addition

  • Skill(conserve:code-quality-principles) - KISS,

YAGNI, SOLID

  • Skill(superpowers:test-driven-development) -

RED-GREEN-REFACTOR

  • Skill(superpowers:brainstorming) - generate

options before committing

  • See docs/quality-gates.md#skill-level-quality-gate-composition

for the full gate-skill federation graph (this skill is the synthesis hub)

Required TodoWrite Items

When invoked as a pre-flight gate, create:

  • karpathy:assumptions-listed - principle 1 satisfied
  • karpathy:simplicity-checked - principle 2 satisfied
  • karpathy:trace-back-verified - principle 3 satisfied
  • karpathy:success-criteria-defined - principle 4

satisfied

Exit Criteria

  • Each of the four principles has been answered with a

concrete artifact (assumption list, scope rationale, diff trace, verification plan).

  • The senior-engineer test was applied at least once.
  • Verifiable success criteria are written down before

the implementation begins.

  • The chosen approach and its simplicity tradeoff are

recorded to docs/tradeoffs.md (or the in-file template) when real alternatives were weighed.

Related skills

FAQ

Is Karpathy Principles safe to install?

skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.

AI & Agent Buildingintegrationstesting

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.