smithery/CANTAGESTUDIO

refactor-simplify-branching

[Code Quality] Simplifies complex conditionals: deep nesting, long if-else chains, switch sprawl. Use when control flow is hard to follow or has high cyclomatic complexity.

Installation

$ npx skills add smithery/CANTAGESTUDIO --skill refactor-simplify-branching

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery/CANTAGESTUDIO.

npx skills add smithery/CANTAGESTUDIO

Browse all from smithery/CANTAGESTUDIO

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 913 B
  • docs SUMMARY.md 207 B

History

  1. First recorded snapshot · 0 installs

SKILL.md

Refactor: Simplify Branching

Reduce conditional complexity for better readability.

Techniques

1. Guard Clauses (Early Return)

Replace deep nesting with flat guards.

2. Replace Conditionals with Polymorphism

Use protocol dispatch instead of type checking.

3. Replace Nested Conditionals with Table

Use lookup tables for multi-dimensional conditions.

4. Decompose Compound Conditionals

Extract complex conditions to named variables or methods.

5. Replace Flag Arguments

Create separate methods instead of boolean flags.

Warning Signs

  • Nesting > 3 levels deep
  • More than 3 else-if branches
  • Switch with > 5 cases
  • Condition spans multiple lines