Skip to content
Back to skills

Minimal Code Discipline

ASecurity

Use when writing code changes — YAGNI ladder: existence-first, reuse over rewrite, dependency ladder, shortest correct diff; bottom-line items are never minimized away.

  • 16 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added October 13, 2026
ai-agentsrustgosecurity

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned November 23, 2026

npx -y skills add 1225Sakura/oh-my-deepseekharness --skill minimal-code-discipline --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Minimal Code Discipline?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Minimal Code Discipline
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/1225sakura-minimal-code-discipline/badge)](https://www.skillsdirectory.com/skills/1225sakura-minimal-code-discipline)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: minimal-code-discipline
description: Use when writing code changes — YAGNI ladder: existence-first, reuse over rewrite, dependency ladder, shortest correct diff; bottom-line items are never minimized away.
when-to-use: 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; sizing a proposed diff before implementation.
---

# 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 (`grep`/`glob`) 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

## State Contract (状态契约)

Minimal-code-discipline **holds no mode state**. It is a writing-time discipline, not an execution mode: no `omd_state_write`/`omd_state_clear`, no files under `.omd/`. When applied inside an enclosing mode (autopilot, ralph, team), persistence belongs to that mode's state contract.

Files in this skill

  • SKILL.md3.5 KB
  • SKILL.zh.md3.1 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.