karpathy-guidelines
できること
このガイドは、よくあるミスを避けて、AIがより良いコードを書けるようにするものです。AIに、コードを書く前によく考えること、コードをシンプルに保つこと、必要な変更だけを加えること、そして良い結果とは何かを明確に定義することを教えます。
使う場面
- ✓AIが新しいコードを書くとき。
- ✓AIに既存のコードを修正・改善してもらうとき。
- ✓AIに余計な複雑さを避けてほしいとき。
スキルのリンク
https://github.com/multica-ai/andrej-karpathy-skills/blob/main/skills/karpathy-guidelines/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
📦 このスキルを含むパック
AIへの頼み方の例
“AI、リストに含まれる数値の平均を計算する関数を書いてください。始める前によく考えて、本当に必要なものだけを追加してください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
AIは次の手順に従います。書き始める前によく考える、最低限必要なものに集中する、必要な部分だけを変更する、そして作業が完了したと判断できる条件を定義する、という流れです。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Karpathy Guidelines
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, 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.
- 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. 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.
4. 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.
よくある質問
なぜAIはコードを書く前によく考えるべきなのですか?
ミスを避け、問題を十分に理解し、必要以上に複雑な解決策を作らないためです。
「シンプルなコード」とはどういう意味ですか?
余計な機能や不必要な複雑さを加えず、問題を解決するために必要最小限のコードを書くことです。
AIはどのようにしてコードが良いかを判断するのですか?
明確で検証可能なゴールを設定することで判断します。たとえば「バグを直す」ではなく、「バグを示すテストを書き、そのテストが通るようにする」というゴールにします。
詳細
作者による元の説明
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.
人気
- GitHubのスター
- 220k
- ランキング
- #628
- ライセンス
- —
- 更新日
- 2026/4/20
コメント
- …
似ているスキル
diffs
394k編集内容の実際の共有可能な差分を、手書きの要約ではなく、ビューアーのリンクや画像ファイルとして作成するようエージェントを支援します。
coding-agent
394kCodex、Claude Code、OpenCodeに大きめのコーディング作業をバックグラウンドのワーカーとして渡し、その進捗を確認するようエージェントを支援します。
gh-issues
394kGitHubのイシューを探し、取り組むものを選び、修正を含むプルリクエストを開くようエージェントを支援します。レビューコメントへの対応も含みます。