convez.ai
SkillDesenvolvimento WebIntermediário
costrict-plugins-repo

Karpathy Coder

costrict-plugins-repo/alirezarezvani-claude-code-skills-karpathy-coder

Enforcer de qualidade de código baseado nos 4 princípios de Karpathy

Ver no GitHub
InicialPluginScore · de 0 a 100

Skill que enforça disciplina de codificação baseado nos princípios de Andrej Karpathy sobre armadilhas de LLMs ao programar. Fornece ferramentas Python para detectar violações de 4 princípios-chave, um agente revisor, comando slash e hook de pré-commit.

Instalação

$npx convez-ai costrict-plugins-repo/alirezarezvani-claude-code-skills-karpathy-coder

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
0
Forks
0
Acompanhando
0
Saúde
37%
Último commit
há 1 semana
Versão
—
Issues abertas
0
Contribuidores
1

Casos de uso

  • Revisar código antes de commits para detectar over-engineering
  • Validar planos de implementação contra suposições ocultas
  • Analisar diffs para remover ruído e mudanças desnecessárias
  • Verificar se implementações atingem objetivos declarados com testes concretos

Veredito

Ferramental sólido e pragmático para elevar padrão de revisão de código em equipes. As 4 ferramentas Python (sem dependências) são diretas e aplicáveis, embora o maior valor esteja na disciplina comportamental que impõem — não substitui code review humano, mas augmenta o processo com checks automáticos concretos.

README

A tradução para o português deste README ainda está na fila.

karpathy-coder

Active coding discipline enforcer based on Andrej Karpathy's observations on LLM coding pitfalls.

Not just guidelines — ships Python tools that detect violations, a review agent, a slash command, and a pre-commit hook.

The 4 principles

#PrincipleWhat it preventsTool that checks it
1Think Before CodingHidden assumptions, silent choicesassumption_linter.py
2Simplicity FirstOver-engineering, premature abstractionscomplexity_checker.py
3Surgical ChangesDiff noise, drive-by refactorsdiff_surgeon.py
4Goal-Driven ExecutionVague plans, missing verificationgoal_verifier.py

Quick start

# Install as Claude Code plugin
/plugin marketplace add alirezarezvani/claude-skills
/plugin install karpathy-coder@claude-code-skills

# Run before committing
/karpathy-check

# Or use individual tools from the shell
python scripts/complexity_checker.py src/ --threshold strict
python scripts/diff_surgeon.py --diff HEAD~1..HEAD
echo "I'll just export all user data" | python scripts/assumption_linter.py -
python scripts/goal_verifier.py plan.md

What's in the box

PieceCountDetail
SKILL.md1The 4 principles with context: fork for skill chaining
Python tools4complexity_checker, diff_surgeon, assumption_linter, goal_verifier — all stdlib-only
Sub-agent1karpathy-reviewer — runs all 4 principles against a diff
Slash command1/karpathy-check — one-command pre-commit review
Pre-commit hook1karpathy-gate.sh — non-blocking awareness gate
Reference docs3Full Karpathy context, 10+ anti-pattern examples, 4-level enforcement guide

The tools

complexity_checker.py (Principle #2)

Detects over-engineering: cyclomatic complexity, class density, nesting depth, function length, premature ABC/Protocol usage, import coupling.

python scripts/complexity_checker.py src/auth/ --threshold strict --json
# → score 72/100, 3 findings: nesting depth 6, function 'validate' 62 lines, 2 classes in 80 lines

Three threshold levels: strict (new code), medium (default), relaxed (legacy).

diff_surgeon.py (Principle #3)

Analyzes a git diff and flags lines that don't trace to the stated goal: comment-only changes, whitespace noise, style drift (quote swaps), drive-by refactors, docstring additions to unchanged functions.

python scripts/diff_surgeon.py                    # staged changes
python scripts/diff_surgeon.py --diff HEAD~3..HEAD # last 3 commits
# → Noise ratio: 23% (NOISY), 7 comment-only changes, 2 quote-style swaps

assumption_linter.py (Principle #1)

Reads a plan or proposal and flags hidden assumptions: "just" (hides complexity), "obviously" (unstated assumption), "should work" (hopeful, not verified), vague action verbs, unscoped user references, missing format specifications.

echo "I'll just add a function to export all user data" | python scripts/assumption_linter.py -
# → 3 findings: assumption-just, missing-format, scope-absolute

goal_verifier.py (Principle #4)

Scores each step of a plan for verification quality (0-3 per step). Flags vague criteria ("should work"), checks for final end-to-end verification, and recommends concrete checks.

python scripts/goal_verifier.py implementation-plan.md --json
# → 6 steps, 8/18 (44%), WEAK — 3 steps have no verification

Enforcement levels

  1. Passive — install plugin, principles load as context (~60% compliance)
  2. Active review — run /karpathy-check before commits (~85%)
  3. Pre-commit hook — wire karpathy-gate.sh via Husky (~95%)
  4. CI gate — add tools to GitHub Actions PR checks (~99%)

See references/enforcement-patterns.md for setup instructions at each level.

Cross-tool compatibility

The tools are pure Python stdlib. The principles work in any AGENTS.md-aware CLI (Codex, Cursor, Antigravity, OpenCode, Gemini CLI).

Attribution

Derived from Andrej Karpathy's X post on LLM coding pitfalls. The principles are Karpathy's observations; the tooling, enforcement patterns, and anti-pattern gallery are original.

License

MIT.

Ver o original no GitHub

Bom para

Relacionados