Prefer the simplest code that preserves behavior and defaults.
This skill is for refactors where the main goal is not “more architecture”, but “less to read, less to remember, less to mentally simulate”.
Apply this skill by default before finalizing any code change, even when the user did not explicitly ask for simplification.
Delete indirection before adding structure. Inline helper methods if they are only forwarding state or hiding a one-line operation.
Convert at the boundary when different implementations need different concrete values. Keep shared state generic, then map it to tool-specific values only where the concrete API is called.
Preserve native defaults. Do not eagerly overwrite built-in defaults just because shared state exists. Only apply shared state after it is meaningfully set.
Extract constants only when they are real constants and referenced in multiple places. Do not introduce constants for single-use values, temporary mappings, or values that exist only to make code look more abstract.
Optimize for scanability. A reader should understand the control flow without jumping between multiple tiny helpers.
Prefer expression-bodied arrows for return-only callbacks.
When an arrow callback only returns one expression, remove braces and return; for multi-line expressions, break immediately after => and indent the returned expression one level so the expression remains the visual focus.
Prefer short-circuit expressions for truthy-or-null choices.
When an expression only chooses between a value and null, prefer condition && value over condition ? value : null.
Prefer a single expression for small return-only branches.
When a function only selects one value from a short ordered set of conditions, prefer a ternary expression over multiple if returns, as long as the result is still easy to scan top-to-bottom.
Before finishing any code change, explicitly check:
Choose the version that makes more of these true:
Bad:
Better:
if