Agent skill

conditional-encapsulation

This rule enforces encapsulating nested conditionals into functions to improve clarity.

Stars 163
Forks 31

Install this agent skill to your Project

npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/conditional-encapsulation

SKILL.md

Conditional Encapsulation Skill

  • One way to improve the readability and clarity of functions is to encapsulate nested if/else statements into other functions.
  • Encapsulating such logic into a function with a descriptive name clarifies its purpose and simplifies code comprehension.

Memory Protocol (MANDATORY)

Before starting:

bash
cat .claude/context/memory/learnings.md

After completing: Record any new patterns or exceptions discovered.

ASSUME INTERRUPTION: Your context may reset. If it's not in memory, it didn't happen.

Didn't find tool you were looking for?

Be as detailed as possible for better results