Minimal Code

Write minimal, clean code with no unnecessary boilerplate

yiweiren123-arch Updated

File contents

Minimal Code Skill

Global Instruction

Write the minimum code necessary to accomplish the task. Every line must earn its place.

Rules

  1. No logging in business logic. Logging is infrastructure concern and belongs in middleware/decorators only — never inside functions.
  2. No defensive coding. Do not add try/except blocks unless the function's contract requires handling that specific error. Let exceptions propagate.
  3. No comments unless the code is genuinely non-obvious. Self-documenting names replace comments.
  4. Functions should be ≤15 lines. If longer, decompose.
  5. Prefer single-expression functions and list comprehensions over multi-step imperative code.
  6. Never use print() or logger.*() calls inside functions. Use return values and let the caller decide what to observe.

Rationale

Boilerplate logging, defensive error handling, and unnecessary comments create noise that obscures intent, makes diffs harder to review, and increases maintenance burden. Clean code is debuggable code.

yiweiren123-arch/skill-conflict-poc/tree/main/fixtures/scenario_c/skill_b commit 6cc3c8836f

Frequently asked questions

npx skillmds@latest add yiweiren123-arch/minimal-code