control-flow

Installation
SKILL.md

Human-Readable Control Flow

When refactoring complex control flow, mirror natural human reasoning patterns:

Related Skills: See refactoring for systematic code audit methodology including branch collapsing and caller counting.

Core Pattern

  1. Ask the human question first: "Can I use what I already have?" -> early return for happy path
  2. Assess the situation: "What's my current state and what do I need to do?" -> clear, mutually exclusive conditions
  3. Take action: "Get what I need" -> consolidated logic at the end
  4. Use natural language variables: isUsingNavigator, isUsingLocalTranscription, needsOldFileCleanup: names that read like thoughts
  5. Avoid artificial constructs: No nested conditions that don't match how humans actually think through problems

Transform this: nested conditionals with duplicated logic Into this: linear flow that mirrors human decision-making

Example: Early Returns with Natural Language Variables

Installs
72
GitHub Stars
4.7K
First Seen
Jan 20, 2026
control-flow — epicenterhq/epicenter