control-flow
Installation
SKILL.md
Human-Readable Control Flow
When refactoring complex control flow, mirror natural human reasoning patterns:
Related Skills: See
refactoringfor systematic code audit methodology including branch collapsing and caller counting.
Core Pattern
- Ask the human question first: "Can I use what I already have?" -> early return for happy path
- Assess the situation: "What's my current state and what do I need to do?" -> clear, mutually exclusive conditions
- Take action: "Get what I need" -> consolidated logic at the end
- Use natural language variables:
isUsingNavigator,isUsingLocalTranscription,needsOldFileCleanup: names that read like thoughts - 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