一键导入
karpathy-principles
Behavioral guidelines to reduce common LLM coding mistakes — Think Before Coding, Simplicity First, Surgical Changes, Goal-Driven Execution.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Behavioral guidelines to reduce common LLM coding mistakes — Think Before Coding, Simplicity First, Surgical Changes, Goal-Driven Execution.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use 4-phase root cause analysis (Observe, Hypothesize, Verify, Fix); avoid unverified patches.
Use Git worktrees to create parallel working directories safely; avoid branch-switch contamination.
Enforce "no evidence = no completion"; run Gate Function verification before declaring done.
Pre-ship observability readiness checklist — ensures errors reach production monitoring, not just debug consoles.
Adversarial security and resilience analysis — auto-triggered during /review and /test based on task classification. Provides attack surface analysis, boundary testing, auth bypass attempts, dependency chain attacks, and Beast Mode stress testing.
Evaluate when to dispatch parallel agents; use a 4-step pattern to split, coordinate, and integrate results.
| name | karpathy-principles |
| description | Behavioral guidelines to reduce common LLM coding mistakes — Think Before Coding, Simplicity First, Surgical Changes, Goal-Driven Execution. |
Derived from Andrej Karpathy's observations on LLM coding pitfalls.
Tradeoff: These guidelines bias toward caution over speed. For trivial tasks, use judgment.
Don't assume. Don't hide confusion. Surface tradeoffs.
Before implementing:
Minimum code that solves the problem. Nothing speculative.
Self-check: "Would a senior engineer say this is overcomplicated?" If yes, simplify.
Touch only what you must. Clean up only your own mess.
When editing existing code:
When your changes create orphans:
The test: Every changed line should trace directly to the user's request.
Define success criteria. Loop until verified.
Transform tasks into verifiable goals:
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.
During /plan:
During /implement:
During /review:
When reviewing or refactoring, apply Chesterton's Fence — understand WHY before removing:
Simplification rules:
For phase-entry loading, read only:
When to ApplyChecklistCode Simplification ChecklistLoad numbered principle sections (## 1–## 4), Common Rationalizations, Anti-Patterns, and References on full read or cache miss only.
| Rationalization | Reality |
|---|---|
| "It works, that's good enough" | Working code that's unreadable or architecturally wrong creates debt that compounds. |
| "We'll clean it up later" | Later never comes. The current phase is the quality gate — use it. |
| "I'm confident about this approach" | Confidence is not evidence. State your assumptions explicitly or verify against docs. |
| "This abstraction might be useful later" | Don't preserve speculative abstractions. If there's only one caller, inline it. |
| "I'll just quickly improve this unrelated code too" | Unscoped changes create noisy diffs and obscure the actual intent. Touch only what you must. |
| "The tests pass, so it's good" | Tests are necessary but not sufficient. They don't catch architecture problems, security issues, or readability. |
writing-plans (Think Before Coding), verification-before-completion (Goal-Driven Execution).agent/rules/engineering_guardrails.md §7 Scope Discipline