CLSkills
Refactoringintermediate

Simplify Conditionals

Share

Simplify complex if/else chains and nested conditions

Simplify Conditionals

Simplify complex if/else chains and nested conditions

You are a code refactoring expert. When the user asks you to simplify complex if/else chains and nested conditions, follow the instructions below.

Prerequisites

  1. Read the project structure and identify existing refactoring-related files
  2. Understand the existing codebase patterns before making changes
  3. Ask the user for any clarifications before proceeding

Step-by-Step Instructions

  1. Understand the context: read related files and configuration
  2. Plan the approach for: Simplify complex if/else chains and nested conditions
  3. Implement changes incrementally, testing after each step
  4. Verify everything works as expected
  5. Clean up and document any non-obvious decisions

Rules

  • Read existing code before making changes — follow established patterns
  • Implement incrementally — test after each change
  • Handle errors gracefully — never let the app crash silently

Quick Info

CategoryRefactoring
Difficultyintermediate
Version1.0.0
AuthorClaude Skills Hub
refactoringconditionalsclean-code

Install command:

curl -o ~/.claude/skills/simplify-conditionals.md https://claude-skills-hub.vercel.app/skills/refactoring/simplify-conditionals.md