Reduce nesting

From Archive228/loopkit · View interactive version

Reduce nesting is an AI agent skill from the GitHub repository Archive228/loopkit. Flatten deeply nested conditionals into readable, early-return code. Use on any function with 3+ levels of indentation.

How to use this skill

Skill file

Reduce Nesting

Deep nesting hides bugs in the branches you didn't read.

Target: no function deeper than 2-3 levels. If you still need more, the function is doing too much — split it.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.