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

minimal-code-discipline

できること

このスキルは、コードの変更を正しさを保ちながら、できる限り小さくするようエージェントを導きます。余分な肥大化や推測による追加がない、焦点の定まった変更がほしい人向けです。

使う場面

  • ✓最小限、簡潔、できるだけ小さい変更を頼んだとき。
  • ✓計画や変更が、頼まれた範囲を超えて大きくなってきたとき。
  • ✓構築する前に、提案された変更が不要に大きくないかレビューしてほしいとき。

スキルのリンク

https://github.com/Yeachan-Heo/oh-my-claudecode/blob/main/skills/minimal-code-discipline/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

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

AIへの頼み方の例

“レポートページに簡単なエクスポートボタンを追加してください。変更はできるだけ小さくし、既存のものを再利用してください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

エージェントは、まずそもそも変更が必要かを尋ね、既存のヘルパーをコードベースで探します。最も単純で仕事をこなせるツールを優先します。安全性のチェックは残したまま、変更を短く保ちます。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Minimal Code Discipline

Use this skill to apply a minimal-code (YAGNI-ladder) discipline while planning and writing code changes. It keeps diffs small and obviously correct without sacrificing the checks that keep users safe.

This skill complements ai-slop-cleaner: that skill cleans slop after it lands; this one keeps it from being written.

When to Use

Use this skill when:

  • the user asks for a minimal, lean, YAGNI, or smallest-possible-diff implementation
  • a plan or in-flight change is growing beyond the stated request
  • writing new code where scope creep, reinvented helpers, or speculative generality are likely
  • reviewing a proposed diff for size before implementation

When Not to Use

Do not use this skill when:

  • the user explicitly asks for a broad, feature-rich, or future-proofed build (their explicit scope wins)
  • the task is exploratory scaffolding the user has marked as throwaway
  • minimization pressure would touch protected behavior (see Non-Negotiables)

The Discipline

Existence first. Ask whether the change needs to exist at all; skip work that serves only a speculative future need.

Reuse before writing. Search the codebase for an existing helper, type, or pattern before writing anything new. Never copy a helper that already lives a few files away — reuse it or extract it to one shared location.

Dependency ladder. Reach for the standard library first, then platform-native capability, then an already-installed dependency. Hand-written code is the last resort. Do not introduce a new dependency when a few lines of code suffice, unless the user explicitly requested or approved it.

Understand before minimizing. Read the affected code and follow its execution path first. Ship the shortest correct diff once the problem is understood — code you never write never breaks.

Boring over clever. Prefer boring, obviously-correct code over clever code.

Mark the ceiling. Record deliberate simplifications with a short comment naming the accepted limit and what would justify replacing it.

Root cause, not symptoms. Fix bugs at the root cause shared by every caller, not with a separate patch for each reported symptom.

Non-Negotiables

Never minimize away:

  • validation wherever a trust boundary is crossed
  • error handling that guards against data loss
  • security controls
  • accessibility fundamentals
  • scope the user explicitly requested

Verification

Before reporting completion, confirm:

  • every added line earns its place (no speculative generality, no duplicate helpers)
  • the diff is the shortest one that correctly solves the stated problem
  • non-negotiables are intact
  • tests still pass and behavior is unchanged except as requested
よくある質問

コードを小さくするために、安全性のチェックを削りますか?

いいえ。保護されている動作や安全性のチェックは、行数を減らすためには削りません。

大きな機能の依頼を覆しますか?

いいえ。広い範囲や将来を見越した構築を明示的に頼んだ場合は、あなたの範囲が優先されます。

整理のスキルとはどう違いますか?

このスキルは余分なコードが書かれるのを防ぎ、整理のスキルは追加された後にコードを片付けます。

詳細

作者による元の説明

YAGNI-ladder coding discipline for writing changes — existence-first, reuse before writing, dependency ladder, shortest correct diff, with non-negotiables that must never be minimized away

repo: Yeachan-Heo/oh-my-claudecode

人気

GitHubのスター
41k
ランキング
#7010
ライセンス
MIT
更新日
2026/11/2

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

0

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

コメント

  • …

このリポジトリの他のスキル

似ているスキル