minimal-code-discipline — Claude Code skill: YAGNI discipline
The minimal-code-discipline skill enforces YAGNI discipline: check for existing code first, reach for the standard library, write new code last.
MIT 316 installs ★ 40,997 updated 2026-10-24
npx skills add Yeachan-Heo/oh-my-claudecode --skill minimal-code-discipline -a claude-codeWhat minimal-code-discipline does
The skill makes the agent check existing code before writing new, search for helpers in the project instead of copying, choose the standard library before external dependencies, and ship the shortest correct diff. Inside: a dependency ladder (standard library → platform → installed dependency → new code) and the rule that boring code beats clever code. The skill protects non-negotiables: validation at trust boundaries, error handling where data loss matters, security controls, accessibility, and explicitly requested scope.
The author recommends enabling the skill when you ask for a minimal implementation, when a plan grows beyond the stated request, or when you need to check diff size before writing. Without FFmpeg or Python the skill works fine — it's an agent behavior rule, not an external tool. Before completion the skill requires the agent to confirm every added line earns its place, the diff is the shortest correct one, non-negotiables are intact, tests pass.
What it helps with
- stop the agent from rewriting an existing helper instead of reusing it
- cut the diff to the task without speculative generality or duplicates
- force choosing the standard library instead of adding a new dependency
- fix a bug at the root cause, not patch the symptom in every caller
- preserve validation, error handling and security under minimization pressure
Example prompts for the agent
- Fix this bug — minimal diff, root cause only
- Add logging, but search the project for an existing logger first
- Implement YAGNI: no abstractions I didn't ask for
How to install minimal-code-discipline
1Skills CLI (Vercel)
npx skills add Yeachan-Heo/oh-my-claudecode --skill minimal-code-discipline -a claude-code2Manually: put the files in place
~/.claude/skills/minimal-code-discipline/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/minimal-code-discipline/
1Skills CLI (Vercel)
npx skills add Yeachan-Heo/oh-my-claudecode --skill minimal-code-discipline -a codex2Manually: put the files in place
.agents/skills/minimal-code-discipline/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add Yeachan-Heo/oh-my-claudecode --skill minimal-code-discipline -a cursor2Manually: put the files in place
.cursor/skills/minimal-code-discipline/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install Yeachan-Heo/oh-my-claudecode skills/minimal-code-discipline2Manually: put the files in place
.github/skills/minimal-code-discipline/SKILL.md1Skills CLI (Vercel)
npx skills add Yeachan-Heo/oh-my-claudecode --skill minimal-code-discipline -a gemini-cli2Platform CLI
gemini skills install https://github.com/Yeachan-Heo/oh-my-claudecode --path skills/minimal-code-disciplineManually: put the files in place
.devin/skills/minimal-code-discipline/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add Yeachan-Heo/oh-my-claudecode --skill minimal-code-discipline -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about minimal-code-discipline
How to install minimal-code-discipline in Claude Code?
Run npx skills add Yeachan-Heo/oh-my-claudecode --skill minimal-code-discipline -a claude-code, the skill lands in ~/.claude/skills/minimal-code-discipline/SKILL.md.
What does minimal-code-discipline do?
The skill enforces YAGNI discipline: the agent checks existing code, reuses helpers, prefers the standard library to new dependencies, and writes the shortest correct diff without speculative generality.
When should I skip minimal-code-discipline?
Skip the skill if you explicitly asked for a feature-rich, future-proofed build, you're writing throwaway scaffolding, or minimization would touch validation, error handling or security — the skill protects those, but better not to create a conflict with explicit scope.
Source text
SKILL.md · MIT
--- name: minimal-code-discipline description: 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 level: 3 --- # 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
© Yeachan-Heo · MIT · Yeachan-Heo/oh-my-claudecode