minimal-modular-code
Installation
SKILL.md
Minimal Modular Code
Keep agent-written code minimal and modular. Minimal is not fewest lines: it is behavior behind a small interface, reused before rebuilt, legible to a finite-context reader. Steer by named heuristics:
- Reuse before write — grep the repo and deps for an existing helper before adding one.
- Subtract first — ask "what can be removed?"; the subtractive option never surfaces on its own.
- Rule of three — duplication is cheaper than the wrong abstraction; back a bad abstraction out rather than parameterize it.
- Deep modules — small interface over substantial behavior; single-caller indirection and pass-through layers are negative-value structure.
- Information hiding — put the seam where it hides the likely-to-change decision; dependencies point toward stable code.
- Concise, not terse — fewer semantic elements, never code golf.
- Gates, not prose — a load-bearing invariant needs a failing check, not a sentence.
Deletion needs proof. Never delete guards, tests, validation, error paths, or boundaries to make a diff smaller unless the prompt supplies proof they are obsolete — from blame, tests, the contract, or an upstream invariant. "Not in scope", downstream behavior, or a promised later PR is not proof. When proof is missing, keep the code and say why.