Skip to main content
skill CX Codex

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

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add Yeachan-Heo/oh-my-claudecode --skill minimal-code-discipline -a claude-code
Open on GitHub

What 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-code

2Manually: put the files in place

~/.claude/skills/minimal-code-discipline/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/minimal-code-discipline/

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

Similar skills

All skills for Code review and refactoring →

From the same set48

The whole set →
remember remember is a Claude Code skill that sorts session knowledge into the right place. It activates when useful findings need to be preserved or organized. CX Codex +1 695installs wiki wiki is a Claude Code skill that maintains a Markdown knowledge base for project and session notes. It responds to requests to add, search, or lint wiki content. CX Codex +1 685installs autoresearch autoresearch runs one mission through repeated change-and-evaluate cycles, writing each result to JSON and a markdown decision log. Useful when the work needs a long recorded search rather than one attempt. CX Codex +1 654installs ultragoal Splits a brief into ordered goals and keeps an append-only ledger in .omc/ultragoal, so a long run survives a session restart. CX Codex +1 575installs omc-review omc-review is a Claude Code skill that checks finished code for defects, risks, and bloat before release. It ranks issues by severity without making fixes. CX Codex +1 309installs execute The execute skill takes a well-defined task through implementation and verification. Use it when you want working code and a clear account of what was checked. CX Codex +1 307installs graph Run multi-step pipelines as declarative directed acyclic graphs. If interrupted or restarted, execution resumes from the journal without re-running completed nodes. CX Codex +1 285installs drydock drydock — a skill for Claude Code, Codex, Cursor, Copilot, and Gemini CLI that sets up a shared repo harness on first run. It seeds CLAUDE.md and GLOSSARY.md immediately; every other surface appears on first use. CX Codex +1 273installs

Project sponsors

Companies that keep this analytics open