Aller au contenu
Skillpedia
Programmation générale41k · #7010

minimal-code-discipline

Ce qu’il fait

Cette compétence guide un agent pour garder les modifications de code aussi petites que possible tout en restant correctes. Elle s'adresse aux personnes qui veulent des modifications ciblées, sans surcharge ni extras spéculatifs.

Quand l’utiliser

  • ✓Quand vous demandez une modification minimale, légère ou la plus petite possible.
  • ✓Quand un plan ou une modification dépasse ce qui a été demandé.
  • ✓Quand vous voulez qu'une modification proposée soit examinée pour détecter une taille inutile avant sa construction.

Lien du skill

https://github.com/Yeachan-Heo/oh-my-claudecode/blob/main/skills/minimal-code-discipline/SKILL.md

Copiez-le et collez-le dans votre IA (Claude, ChatGPT ou Cursor) en lui demandant de suivre les instructions.

Comment l’utiliser

Le plus simple : copiez le message et collez-le dans votre IA. Elle lit le skill et suit les instructions.

Message prêt à coller

Utilise ce skill pour m’aider : https://github.com/Yeachan-Heo/oh-my-claudecode/blob/main/skills/minimal-code-discipline/SKILL.md Lis le fichier SKILL.md de ce lien et suis ses instructions pour ma tâche.
Envie que votre IA trouve seule des skills comme celui-ci ?Installez le MCP gratuit de Skillpedia : une ligne, et elle cherche parmi 15 000+ skills avant chaque tâche.Installer en 1 minute →

Exemple de demande à votre IA

“Ajoute un simple bouton d'export à la page de rapport. Garde la modification aussi petite que possible et réutilise ce que nous avons déjà.”

5 nouveaux skills par semaine. 1 minute de lecture.

Comment ça marche

L'agent se demande d'abord si la modification est nécessaire, cherche dans la base de code les outils existants et privilégie l'outil le plus simple qui fait le travail. Il garde la modification courte tout en conservant les contrôles de sécurité.

Contenu technique (SKILL.md original)

Texte original de l’auteur, en anglais, directement depuis 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
Questions fréquentes

Supprime-t-il les contrôles de sécurité pour réduire le code ?

Non. Les comportements protégés et les contrôles de sécurité ne sont jamais retirés pour économiser des lignes.

Passe-t-il outre une demande de grosse fonctionnalité ?

Non. Si vous demandez explicitement une construction large ou pérenne, votre périmètre prime.

En quoi est-elle différente de la compétence de nettoyage ?

Celle-ci empêche d'écrire du code superflu, alors que la compétence de nettoyage allège le code après qu'il a été ajouté.

Détails

Description originale de l’auteur

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

repo: Yeachan-Heo/oh-my-claudecode

Popularité

Étoiles GitHub
41k
Position au classement
#7010
Licence
MIT
Mis à jour
02/11/2026

Ce skill vous est-il utile ?

0

Connectez-vous pour voter.

Commentaires

  • …

Autres skills de ce dépôt

Skills similaires