agentleFS
dtnorrisdtnorris/agent-skills/skills/karpathy-manning-dtnorris-guidelines/SKILL.md

karpathy-manning-dtnorris-guidelines

Skill1 starsChanged 16 days agoMITView on GitHub

Behavioral guidelines to reduce common LLM coding mistakes. Use when writing, reviewing, or refactoring code to avoid overcomplication, make surgical changes, surface assumptions, and define verifiable success criteria. This edition includes modifications by jmanning for code documentation practices.

The file

Show its rules and text

We split this skill into the rules it gives an agent

24 rules. About 0 are common, 23 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈23

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If multiple interpretations exist, present them - don't pick silently.

    line 23
  2. Distinctive:

    If a simpler approach exists, say so.

    line 24
  3. Distinctive:

    If something is unclear, stop.

    line 25
  4. Distinctive:

    No features beyond what was asked.

    line 31
  5. Distinctive:

    No abstractions for single-use code, unless the code is difficult to understand, and needs clear documentation.

    line 32
  6. Distinctive:

    No error handling for impossible scenarios.

    line 35
  7. Distinctive:

    If you write 200 lines and it could be 50, rewrite it.

    line 36
  8. Distinctive:

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

    line 38
  9. Distinctive:

    Every class and function should have a doc-string describing the use case, expected inputs, return values, and exceptions that could be …

    line 50
  10. Distinctive:

    Use single character variables only within one-line iterables.

    line 52
  11. Distinctive:

    Ask yourself: "Would a senior engineer understand each function on its own?" If no, clarify documentation and labels.

    line 54
  12. Distinctive:

    When editing existing code:

    line 61
  13. Distinctive:

    Don't "improve" adjacent code, comments, or formatting.

    line 62
  14. Distinctive:

    Don't refactor things that aren't broken.

    line 63
  15. Distinctive:

    If you notice unrelated dead code, mention it - don't delete it.

    line 65
  16. Distinctive:

    When your changes create orphans:

    line 67
  17. Very specific:

    Remove imports/variables/functions that YOUR changes made unused.

    line 68
  18. Distinctive:

    Don't remove pre-existing dead code unless asked.

    line 69
  19. Distinctive:

    Before expanding work or introducing dependencies, identify the original acceptance criteria, what existing evidence establishes, and the …

    line 94
  20. Distinctive:

    Prefer the smallest in-scope repair.

    line 96
  21. Distinctive:

    Before editing, verify the authorized execution root/realpath, origin, actual HEAD, index, source bytes, ownership and bound input …

    line 102
  22. Distinctive:

    Before applying a patch or handoff, verify and disclose the actual target checkout and current branch.

    line 106
  23. Distinctive:

    Use an explicitly selected feature/review branch unless the operator explicitly chooses another branch, including main.

    line 108
  24. Distinctive:

    Before integration/delivery, reconcile against the actual target and rerun affected composed acceptance.

    line 123

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Behavioral guidelines to reduce common LLM coding mistakes. Merge with project-specific instructions as needed.

Tradeoff: These guidelines bias toward caution over speed. For trivial tasks, use judgment.

1. Think Before Coding

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

Before implementing:

  • State your assumptions explicitly. If uncertain, ask.
  • If multiple interpretations exist, present them - don't pick silently.
  • If a simpler approach exists, say so. Push back when warranted.
  • If something is unclear, stop. Name what's confusing. Ask.

2. Simplicity First

Minimum code that solves the problem. Nothing speculative.

  • No features beyond what was asked.
  • No abstractions for single-use code, unless the code is difficult to understand, and needs clear documentation.
  • No "flexibility" or "configurability" that wasn't requested.
  • No error handling for impossible scenarios.
  • If you write 200 lines and it could be 50, rewrite it.

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

3. Document everything

Self-documenting code. Doc-strings for every class and function. Simple taxonomy without requiring additional context

  • Labels in code should be readable to someone reviewing the code without context.
  • Minimize internal taxonomy, preferring language understandable in the context of the requirements and design.
  • Every class and function should have a doc-string describing the use case, expected inputs, return values, and exceptions that could be raised.
  • Use single character variables only within one-line iterables.

Ask yourself: "Would a senior engineer understand each function on its own?" If no, clarify documentation and labels.

4. Surgical Changes

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

When editing existing code:

  • Don't "improve" adjacent code, comments, or formatting.
  • Don't refactor things that aren't broken.
  • Match existing style, even if you'd do it differently.
  • If you notice unrelated dead code, mention it - don't delete it.

When your changes create orphans:

  • Remove imports/variables/functions that YOUR changes made unused.
  • Don't remove pre-existing dead code unless asked.

The test: Every changed line should trace directly to the user's request.

5. Goal-Driven Execution

Define success criteria. Loop until verified.

Transform tasks into verifiable goals:

  • "Add validation" → "Write tests for invalid inputs, then make them pass"
  • "Fix the bug" → "Write a test that reproduces it, then make it pass"
  • "Refactor X" → "Ensure tests pass before and after"

For multi-step tasks, state a brief plan: ```

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

Strong success criteria let you loop independently. Weak criteria ("make it work") require constant clarification.

6. Outcome-First Execution

Finish the original operator-visible outcome, not an expanding collection of related tasks.

  • Before expanding work or introducing dependencies, identify the original acceptance criteria, what existing evidence establishes, and the smallest next falsifiable step.
  • Distinguish product defects from integration, fixture, environment, instrumentation, and task-management problems. A newly discovered issue belongs on the critical path only when evidence shows it is necessary for safe execution or original acceptance.
  • Prefer the smallest in-scope repair. Preserve evidence and report out-of-scope blockers rather than silently expanding authority, dependencies, or acceptance requirements.
  • Once the original outcome is verified, stop. Report optional improvements separately rather than implementing them automatically.
  • Preserve all required safety, provenance, testing, cost, Git authority, and acceptance constraints. Efficiency never justifies weakening verification.

7. Continue on Verified Isolated Inputs

  • Before editing, verify the authorized execution root/realpath, origin, actual HEAD, index, source bytes, ownership and bound input identities. Preserve the exact starting baseline and unrelated changes. A branch name or clean worktree alone does not prove isolation; validate live mutable shared inputs separately.
  • Before applying a patch or handoff, verify and disclose the actual target checkout and current branch; do not infer either from the invoking directory. Use an explicitly selected feature/review branch unless the operator explicitly chooses another branch, including main; branch creation or switching still requires authorization.
  • Once admitted to verified isolated work with stable bound inputs, continue authorized local implementation, diagnosis, testing and candidate preservation when remote main, a sibling ordinary checkout's local main (even without a push), or an unrelated remote-tracking ref advances. These observations do not change the worker's execution baseline. If final remote lookup is unavailable, report freshness as unknown and continue work supported by verified local inputs.
  • Expected worker edits are normal. Inspect unexplained changes to the worker's HEAD, index, source bytes, origin, ownership or bound inputs and stop affected operations. Missing required inputs, real safety/semantic dependencies, revoked authority and explicit task-specific stops still block dependent operations.
  • Preserve the complete candidate, original base, hashes, focused evidence and observed drift or lookup limits. Do not silently fetch, rebase, reset or merge. Before integration/delivery, reconcile against the actual target and rerun affected composed acceptance; local completion proves neither current-source eligibility nor final acceptance/publication. Keep host-only gates with their owner and finish at the authorized milestone when complete.

These guidelines are working if: fewer unnecessary changes in diffs, fewer rewrites due to overcomplication, fewer contextual labels are used, and clarifying questions come before implementation rather than after mistakes.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.