Agent skill

avoid-deep-nesting

Keep nesting to a maximum of 2-3 levels Use when enforcing code quality standards. Quality category skill.

Stars 163
Forks 31

Install this agent skill to your Project

npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/avoid-deep-nesting

Metadata

Additional technical details for this skill

category
Quality
priority
high
is built in
YES
session guardian id
builtin_avoid_deep_nesting

SKILL.md

Avoid Deep Nesting

Keep nesting to a maximum of 2-3 levels. Use early returns (guard clauses) to handle edge cases and errors first, leaving the main logic un-nested. Extract nested blocks into well-named functions. Consider using techniques like map/filter/reduce instead of nested loops. If you can't flatten the nesting, the function is likely doing too much.

Expand your agent's capabilities with these related and highly-rated skills.

Didn't find tool you were looking for?

Be as detailed as possible for better results