minimal-code-discipline
What it does
This skill guides an agent to keep code changes as small as possible while staying correct. It is for people who want focused changes without bloat or speculative extras.
When to use it
- ✓When you ask for a minimal, lean or smallest-possible change.
- ✓When a plan or change is growing beyond what was asked.
- ✓When you want a proposed change reviewed for unnecessary size before it is built.
Skill link
https://github.com/Yeachan-Heo/oh-my-claudecode/blob/main/skills/minimal-code-discipline/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Add a simple export button to the report page. Keep the change as small as possible and reuse what we already have.”
5 new skills a week. 1 minute to read.
How it works
The agent first asks whether the change is needed at all, checks the codebase for existing helpers, and prefers the simplest tool that does the job. It keeps the change short while keeping safety checks in place.
Technical content (original SKILL.md)
Original text by the author, straight from 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
FAQ
Will it remove safety checks to keep the code small?
No. Protected behavior and safety checks are never cut just to save lines.
Does it override a request for a big feature?
No. If you explicitly ask for a broad or future-proof build, your scope wins.
How is it different from the cleanup skill?
This one stops extra code from being written, while the cleanup skill tidies code after it has been added.
Details
Original description by the author
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
Popularity
- GitHub stars
- 41k
- Ranking position
- #7010
- License
- MIT
- Updated
- 11/2/2026
Comments
- …
More skills from this repository
agent-doc-discipline
41kTeaches your agent to write instructions that other AI agents can follow on their own, with rules that can be checked and a clear reason behind each.
ai-slop-cleaner
41kHelps your agent tidy up AI-written code that works but is bloated or repetitive, removing extra code without changing what it does.
architecture-survey
41kHelps your agent review a codebase's structure and list the parts that are getting hard to change, with evidence, without changing anything itself.
ask-navigator
41kHelps your agent turn a fuzzy project into a map of clear decision questions, then work through them one at a time until the path is clear.
Similar skills
diffs
394kLets your agent produce a real, shareable diff of edits as a viewer link or image file, instead of a hand-written summary.
coding-agent
394kHelps your agent hand a larger coding job to Codex, Claude Code, or OpenCode as a background worker, then check on its progress.
gh-issues
394kHelps your agent find GitHub issues, pick the ones to work on, and open pull requests with fixes, including follow-up on review comments.