本文へスキップ
Skillpedia
一般的なプログラミング220k · #628

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がスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/multica-ai/andrej-karpathy-skills/blob/main/skills/karpathy-guidelines/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

📦 このスキルを含むパック

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.

repo: multica-ai/andrej-karpathy-skills

人気

GitHubのスター
220k
ランキング
#628
ライセンス
—
更新日
2026/4/20

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

似ているスキル