Logo di Karpathy Guidelines

Karpathy Guidelines

Community
interfluve-wav
karpathy-guidelines

Behavioral guidelines to reduce common LLM coding mistakes. Derived from Andrej Karpathy's observations. Use ALWAYS when writing, reviewing, or refactoring code. Covers assumption surfacing, simplicity, surgical edits, and goal-driven execution with verification.

Panoramica

Pubblicato dainterfluve-wav
Repositoryandrej-karpathy-skills-hermes
Nome della skillkarpathy-guidelines
Stelle
29
Fork
4
File inclusi
1
LicenzaMIT
Link
  • Istruzioni in Markdown

    Un file SKILL.md che il modello carica quando serve, consumando token solo quando una richiesta è effettivamente pertinente.

  • Funziona con qualsiasi LLM

    Le skill IA sono in semplice Markdown, non in codice specifico di un fornitore, quindi funzionano con GPT, Claude, Gemini, Grok o un modello locale.

  • File inclusi: 1

    Script, template e riferimenti che il modello può leggere mentre lavora. I file sono di sola lettura e non vengono mai eseguiti.

  • Open source

    Pubblicata da interfluve-wav su GitHub. Leggi i sorgenti prima di installarla.

Installazione

Installa la skill IA Karpathy Guidelines in TypingMind per usarla con qualsiasi LLM, oppure copiala in un altro agente in grado di leggere SKILL.md.

1

Installa in TypingMind

TypingMind installa una skill direttamente dalla sua cartella GitHub: legge SKILL.md, raccoglie i file delle risorse e salva il risultato in locale.

  1. Apri l'app e vai su Plugin → Skill.
  2. Scegli "Installa da GitHub".
  3. Incolla l'URL della cartella della skill riportato qui sotto e conferma.
    https://github.com/interfluve-wav/andrej-karpathy-skills-hermes/tree/main/Karpathy-Hermes-Skill
  4. Attiva la skill in ogni chat in cui vuoi averla a disposizione.
Plugin → Skill → Aggiungi skill → Da URL GitHub, poi incolla l'URL della cartella e premi Continua.
2

Installa in un altro agente

Qualsiasi agente che legge il formato Agent Skills può usare questa skill: copia la cartella della skill nella directory delle skill di quell'agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/interfluve-wav/andrej-karpathy-skills-hermes.git /tmp/andrej-karpathy-skills-hermes
mkdir -p .claude/skills
cp -r /tmp/andrej-karpathy-skills-hermes/Karpathy-Hermes-Skill .claude/skills/karpathy-guidelines
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Karpathy Guidelines in qualsiasi chat di TypingMind e al resto pensa il modello. Il nome e la descrizione della skill sono nel prompt di sistema e, non appena arriva una richiesta pertinente, il modello carica da solo le istruzioni complete: non devi mai richiamarla manualmente e non consuma token finché non viene effettivamente usata.

Il modello carica automaticamente Karpathy Guidelines non appena riceve una richiesta pertinente.

Funziona con qualsiasi modello IA

Le skill IA sono semplici istruzioni in Markdown, non codice specifico di un fornitore, quindi Karpathy Guidelines non è vincolata al modello per cui è stata scritta. Installala una sola volta in TypingMind e usala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modello locale che esegui tu, sempre con le tue chiavi API.

  • Caricata solo quando serve

    Il prompt di sistema contiene solo il nome e la descrizione. Le istruzioni vengono recuperate alla prima richiesta pertinente, quindi una skill inutilizzata non costa nulla.

  • Cambia modello durante la chat

    Poiché la skill è composta da istruzioni e non da codice, continua a funzionare anche se cambi modello: il nuovo modello legge lo stesso file SKILL.md.

Istruzioni della skill

Questo è il contenuto di SKILL.md che il modello carica. Leggilo prima dell'installazione: una skill è un insieme di istruzioni che il tuo modello seguirà.

Karpathy Guidelines for Hermes

Behavioral guidelines to reduce common LLM coding mistakes, derived from Andrej Karpathy's observations on LLM coding pitfalls.

Tradeoff: These guidelines bias toward caution over speed. For trivial tasks (typo fixes, obvious one-liners), use judgment — not every change needs full rigor.


When to Load This Skill

Always active when:

  • Writing new code
  • Editing existing code
  • Reviewing code
  • Refactoring code
  • Planning code changes

Skip only when:

  • User explicitly says "just do it fast"
  • Pure configuration files (YAML, JSON, env)
  • Throwaway prototypes user confirmed are throwaway

The Four Principles

1. Think Before Coding

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

Before implementing ANYTHING:

  1. State assumptions explicitly. If uncertain, ask.
  2. Multiple interpretations? Present them — don't pick silently.
  3. Simpler approach exists? Say so. Push back when warranted.
  4. Something unclear? Stop. Name what's confusing. Ask.

Bad:

"I'll implement the export feature now." [proceeds with assumptions]

Good:

"Before implementing, I need to clarify:

  1. Export all users or filtered? (privacy implications)
  2. File download, API endpoint, or background job?
  3. Which fields? Some might be sensitive. What's your preference?"

The test: If you're about to write code and haven't stated your assumptions, you're doing it wrong.


2. Simplicity First

Minimum code that solves the problem. Nothing speculative.

Rules:

  • 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 write 200 lines and it could be 50, rewrite it

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

Bad:

python
# Strategy pattern, abstract base class, config system...
# for a single discount calculation
class DiscountStrategy(ABC):
    @abstractmethod
    def calculate(self, amount: float) -> float: pass
class PercentageDiscount(DiscountStrategy):
    # 50+ lines

Good:

python
def calculate_discount(amount: float, percent: float) -> float:
    return amount * (percent / 100)

When to add complexity: Only when you actually need it. Refactor later when requirements emerge.


3. 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.

Bad:

diff
- def upload_file(file_path, destination):
+ def upload_file(file_path: str, destination: str) -> bool:
+     """Upload file to destination with logging."""
+     logger.info(f"Uploading {file_path} to {destination}")
      try:
-         with open(file_path, 'rb') as f:
+         with open(file_path, "rb") as f:

[Added type hints, docstring, changed quote style — none requested]

Good:

diff
+ import logging
+ logger = logging.getLogger(__name__)
+
  def upload_file(file_path, destination):
+     logger.info(f'Starting upload: {file_path}')
      try:
          with open(file_path, 'rb') as f:

[Only added what was requested: logging. Matched existing style.]


4. Goal-Driven Execution

Define success criteria. Loop until verified.

Transform imperative tasks into verifiable goals:

Instead of...Transform to...
"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"
"Make it work""Define what 'works' means, write test, verify"

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.

Bad:

"I'll review the authentication code and make improvements." [Proceeds to change things without clear criteria]

Good:

"To fix authentication, I need success criteria. Issue: users stay logged in after password change. Plan:

  1. Write test: change password → old session invalidated
  2. Implement fix
  3. Verify test passes + no regressions Starting with step 1."

Integration with Hermes

This skill works alongside other Hermes skills:

  • [[test-driven-development]] — Pair with Principle 4 (Goal-Driven). TDD is the verification loop.
  • [[systematic-debugging]] — Pair with Principle 1 (Think Before Coding). Debug first, fix second.
  • [[writing-plans]] — Pair with Principle 4. Multi-step tasks need plans with verification.
  • [[requesting-code-review]] — All four principles apply during review.

Anti-Patterns Quick Reference

PrincipleAnti-PatternFix
Think Before CodingSilently assumes format, fields, scopeList assumptions, ask for clarification
Simplicity FirstStrategy pattern for single functionOne function until complexity needed
Surgical ChangesReformats quotes while fixing bugOnly change lines that fix the issue
Goal-Driven"I'll review and improve""Write test → fix → verify"

Key Insight

From Karpathy:

"LLMs are exceptionally good at looping until they meet specific goals... Don't tell it what to do, give it success criteria and watch it go."

Good code solves today's problem simply, not tomorrow's problem prematurely.


How to Know It's Working

These guidelines are working if you see:

  • Fewer unnecessary changes in diffs — Only requested changes appear
  • Fewer rewrites due to overcomplication — Code is simple the first time
  • Clarifying questions come before implementation — Not after mistakes
  • Clean, minimal PRs — No drive-by refactoring or "improvements"

Full Examples

See references/EXAMPLES.md for detailed before/after examples of each principle.

File inclusi

Il modello legge questi file quando servono, mentre la skill è caricata. Sono accessibili in sola lettura e non vengono mai eseguiti.

Domande frequenti

Cosa fa la skill IA Karpathy Guidelines?

Behavioral guidelines to reduce common LLM coding mistakes. Derived from Andrej Karpathy's observations. Use ALWAYS when writing, reviewing, or refactoring code. Covers assumption surfacing, simplicity, surgical edits, and goal-driven execution with verification.

Perché usare Karpathy Guidelines su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Karpathy Guidelines è scritta in semplice Markdown anziché in codice specifico di un fornitore, quindi la stessa skill funziona con GPT-5, Claude, Gemini, Grok o un modello locale, e puoi cambiare modello durante la chat senza che la skill smetta di funzionare. TypingMind usa le tue chiavi API, quindi paghi direttamente i fornitori anziché un abbonamento per posto utente, e le tue skill e chat restano nel tuo spazio di archiviazione.

Come installo Karpathy Guidelines in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/interfluve-wav/andrej-karpathy-skills-hermes/tree/main/Karpathy-Hermes-Skill. TypingMind legge il file SKILL.md, include i file associati e installa la skill, che puoi abilitare per ogni singola chat.

Quali modelli IA possono usare Karpathy Guidelines?

Qualsiasi modello che colleghi a TypingMind. Le skill IA sono semplici istruzioni in Markdown anziché codice specifico di un fornitore, quindi GPT, Claude, Gemini, Grok e i modelli locali possono tutti caricare questa skill quando una richiesta corrisponde al suo scopo.

Quanti modelli IA posso usare con Karpathy Guidelines?

Quanti ne vuoi. Se un modello supporta le skill, puoi usarlo con Karpathy Guidelines: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e molti altri, tutti su TypingMind con le tue chiavi API.

La skill IA Karpathy Guidelines è gratuita?

Sì. È pubblicata su GitHub da interfluve-wav con licenza MIT. Paghi solo il tuo fornitore IA per i token che usi.

Cosa sono le skill IA?

Una skill IA è un pacchetto di istruzioni riutilizzabili che insegna a un modello IA come svolgere un'attività specifica. Segue il formato aperto Agent Skills: un file SKILL.md con un nome e una descrizione, più eventuali script, template o file di riferimento di cui il modello potrebbe aver bisogno. Il modello legge le istruzioni solo quando la tua richiesta corrisponde alla skill, quindi una skill installata non comporta costi finché non viene usata.

In cosa si differenziano le skill IA dai plugin o dai server MCP?

Un plugin o un server MCP fornisce a un modello nuovi strumenti da richiamare: codice che viene eseguito da qualche parte e restituisce un risultato. Una skill IA, invece, fornisce al modello conoscenze e procedure: come affrontare un'attività, quali passaggi seguire e quali caratteristiche deve avere un buon output. Le skill sono semplici istruzioni in Markdown, quindi non richiedono server, chiavi API né ambienti di esecuzione e funzionano con qualsiasi modello.

Elenco completo

Crea subito il tuo spazio di lavoro AI

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇