nested-conditionals
Installation
SKILL.md
Nested Conditionals
Flatten deeply nested if/else chains into code that reads top-to-bottom, without changing behavior. The goal: a reader should never have to mentally "stack" more than one or two conditions to understand what a code path does.
When to Apply This Skill
Trigger on any of:
- 3+ levels of
if/elsenesting (the "arrow" or "pyramid of doom" shape) elseblocks that contain most of the meaningful logic (main path buried at the bottom)- Multiple conditions guarding a single core operation
- Long
if/else if/else ifchains switching on a type, role, or status enum - Nested ternaries (more than one level deep)