skills/by-role/engineer/karpathy-guidelines/SKILL.md
Behavioral guardrails against the six most common LLM coding failure modes. Apply on every coding task: writing, editing, reviewing, or refactoring.
npx skillsauth add qa-aman/claude-skills karpathy-guidelinesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Six failure modes. Six rules. Apply all six on every coding task.
Inspired by Andrej Karpathy's observations (Jan 2026).
Run this before each phase:
Before writing code: rules 1, 2, 4 While editing: rule 3 Before claiming done: rules 5, 6
Trigger: At the start of any task where the request requires an implicit choice - a library, a data structure, an architecture decision, an interpretation of ambiguous scope.
Rule: State every assumption before writing a line. If a requirement has multiple valid interpretations, list them and declare which one you will implement. Do not silently pick.
Do:
users.ts."Do not:
Self-audit: List every decision you made that wasn't explicitly specified in the request. If any decision is unnamed, name it before proceeding.
Trigger: Before writing any code, adding a dependency, creating an abstraction, or adding an error handler.
Rule: Write only what was asked for. Every line of code you write must be traceable to an explicit requirement in the request. If it isn't, do not write it.
Do:
Do not:
options parameter "in case someone needs flexibility later."Self-audit: If you removed every line that wasn't directly traceable to the request, would the task still be complete? If yes, those lines should not exist.
Trigger: Every time you open an existing file to edit it.
Rule: Modify only the code necessary to fulfill the request. Do not refactor, rename, reformat, or clean up code adjacent to your changes - even if you would write it differently.
Do:
parseDate() on line 47 - not in scope here, flagging for a separate fix."Do not:
Self-audit: Can every changed line be explained by a direct requirement from the request? If a line changed for any other reason, revert it.
Trigger: At the start of any task with more than one step, any bug fix, or any refactor.
Rule: Before writing code, state what "done" means as something you can verify with a command. Subjective criteria ("it works", "looks correct") are not success conditions. A passing test, a specific API response, or a zero-error build output are.
Do:
GET /items?page=2 returns the correct slice with total_pages in the response body."1. Write failing test for the broken case → verified by: test output shows 1 failure
2. Implement the fix → verified by: that test passes
3. Confirm no regressions → verified by: full suite passes
Do not:
Self-audit: Is your success condition something you can verify by running a command and reading the output? If not, restate it until it is.
Trigger: Any time you are about to write the words "done", "fixed", "complete", "it works", or "tests pass."
Rule: Run the verification command. Paste the relevant output. Do not claim completion without evidence. If verification is impossible (UI-only change, no test harness), state that explicitly - do not imply success.
Do:
pytest tests/auth_test.py -v - 14 passed, 0 failed." [paste output]npm run build exited with code 0." [paste last 5 lines]/auth/login."Do not:
Self-audit: Does your response contain actual command output proving the task is complete? If not, run the command before responding.
Trigger: Any time you notice a second issue while working on the first, or when your diff touches more than one logical concern.
Rule: One diff, one purpose. If you discover a second bug while fixing the first, stop - report it and leave it unfixed. Do not bundle unrelated changes into the same commit.
Do:
validateToken() has an off-by-one error on line 83 - not touching it here, flagging for a separate fix."Do not:
Self-audit: If the user ran git revert on this commit, would they lose only the thing they asked for - and nothing else? If they would also lose something unrelated, split the commit before proceeding.
development
Plan a webinar end-to-end using April Dunford's Obviously Awesome positioning framework to find the topic angle that makes the webinar obviously valuable to the right audience. Produces topic positioning, abstract, speaker brief, registration page, promotion sequence, day-of run-of-show, and post-webinar follow-up. Use when the user asks to plan a webinar, virtual event, online workshop, "we need a webinar on X", host a webinar, online masterclass, or any live virtual event with promotion and follow-up. Reads ICP, services, and brand voice from knowledge/.
development
Write long-form thought leadership articles, opinion pieces, industry POV essays, and CEO/founder bylines using the Made to Stick SUCCESs framework (Chip and Dan Heath). Use when the user asks for a long-form article, executive byline, opinion piece, industry POV, manifesto, "explain our point of view on X", or wants to publish an authority-building piece (1200-2500 words). Reads brand voice and positioning from knowledge/.
development
Plan a monthly content calendar across channels using the Content Marketing Matrix (Dave Chaffey, Smart Insights) - Entertain/Inspire/Educate/Convince. Every post gets a quadrant label. The monthly calendar must hit 40% Educate, 40% Inspire+Convince, 20% Entertain. Produces a week-by-week posting schedule with topics, formats, channels, and asset links. Use when the user says "content calendar", "social calendar", "plan next month's content", "what should we post", "content plan", "editorial calendar", "schedule posts for the month", or wants a structured posting plan for LinkedIn, Twitter, email, or blog. Reads brand voice, ICP, and past learnings from knowledge/.
development
Write SEO-optimized long-form articles targeting specific keywords using the They Ask You Answer Big 5 framework (Marcus Sheridan). Articles are categorized by Big 5 type (Cost, Problems, Versus, Best/Reviews, How-To) and structured accordingly. The "answer first" rule applies to every article. Use when the user asks for an SEO article, blog post for ranking, "rank for keyword X", organic content, search-optimized post, pillar page, or content for organic traffic. Includes keyword targeting, search intent matching, internal linking suggestions, and meta tags.