Agent SkillsYeachan-Heo/oh-my-claudecode › minimal-code-discipline

minimal-code-discipline

GitHub

提供最小代码纪律,通过YAGNI原则、复用优先和依赖层级约束,确保代码变更简洁正确,防止范围蔓延。

skills/minimal-code-discipline/SKILL.md Yeachan-Heo/oh-my-claudecode

触发场景

用户要求最小化或精简实现 计划或变更超出原始需求 编写新代码时预防范围蔓延 在实施前审查Diff大小

安装

npx skills add Yeachan-Heo/oh-my-claudecode --skill minimal-code-discipline -g -y
更多选项

不安装直接使用

npx skills use Yeachan-Heo/oh-my-claudecode@minimal-code-discipline

指定 Agent (Claude Code)

npx skills add Yeachan-Heo/oh-my-claudecode --skill minimal-code-discipline -a claude-code -g -y

安装 repo 全部 skill

npx skills add Yeachan-Heo/oh-my-claudecode --all -g -y

预览 repo 内 skill

npx skills add Yeachan-Heo/oh-my-claudecode --list

SKILL.md

Frontmatter
{
    "name": "minimal-code-discipline",
    "level": 3,
    "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"
}

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

版本历史

  • e9e8fa3 当前 2026-09-03 09:14

同 Skill 集合

skills/ai-slop-cleaner/SKILL.md
skills/ask/SKILL.md
skills/autopilot/SKILL.md
skills/autoresearch/SKILL.md
skills/cancel/SKILL.md
skills/ccg/SKILL.md
skills/configure-notifications/SKILL.md
skills/debug/SKILL.md
skills/deep-dive/SKILL.md
skills/deep-interview/SKILL.md
skills/deepinit/SKILL.md
skills/drydock/SKILL.md
skills/execute/SKILL.md
skills/external-context/SKILL.md
skills/graph/SKILL.md
skills/hud/SKILL.md
skills/learner/SKILL.md
skills/local-build-reminder/SKILL.md
skills/mcp-setup/SKILL.md
skills/merge-readiness/SKILL.md
skills/omc-doctor/SKILL.md
skills/omc-reference/SKILL.md
skills/omc-setup/SKILL.md
skills/omc-teams/SKILL.md
skills/plan/SKILL.md
skills/project-session-manager/SKILL.md
skills/ralph/SKILL.md
skills/ralplan/SKILL.md
skills/release/SKILL.md
skills/remember/SKILL.md
skills/research/SKILL.md
skills/review/SKILL.md
skills/sciomc/SKILL.md
skills/self-improve/SKILL.md
skills/setup/SKILL.md
skills/skill/SKILL.md
skills/skillify/SKILL.md
skills/team/SKILL.md
skills/trace/SKILL.md
skills/ultragoal/SKILL.md
skills/ultraqa/SKILL.md
skills/ultrawork/SKILL.md
skills/verify/SKILL.md
skills/visual-verdict/SKILL.md
skills/wiki/SKILL.md
skills/writer-memory/SKILL.md
skills/launch/SKILL.md

元信息

文件数
0
版本
4820f56
Hash
4e013df3
收录时间
2026-09-03 09:14

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-09-09 19:34
浙ICP备14020137号-1 $访客地图$