con un clic
control-flow
Flatten nested conditionals and make the happy path readable
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Menú
Flatten nested conditionals and make the happy path readable
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Add user-facing entries to CHANGELOG.md's Unreleased section for recent changes
Remove AI-generated code slop from a diff, path, branch, or repository
Review a diff for AI-shaped code before a PR, commit, or final summary
Remove useless comments and keep only human-useful context
Audit a diff for the five dangerous AI patterns
Propose a conventional commit message for the current diff
Basado en la clasificación ocupacional SOC
| name | control-flow |
| description | Flatten nested conditionals and make the happy path readable |
Use this skill when a change touches branching logic, validation, installation flow, filesystem routing, renderer event handlers, or any function with nested conditionals.
This skill targets dangerous pattern #4 from AI_DANGER_PATTERNS.md: deep if/else nesting.
The happy path should not be buried.
Invalid, unsupported, or exceptional cases should exit early.
Look for:
if/else blockselse after return, throw, continue, or breakTry these in order:
else after terminal statementsswitch for many exclusive domain casesBad:
if (game.isInstalled) {
if (game.supportsMods) {
if (!game.isRunning) {
installMod(mod)
}
}
}
Good:
if (!game.isInstalled) return
if (!game.supportsMods) return
if (game.isRunning) return
installMod(mod)
Bad:
if (!gamePath) {
return null
} else {
return scanGame(gamePath)
}
Good:
if (!gamePath) return null
return scanGame(gamePath)
Do not change behavior while flattening code.
Before editing, identify which branches return early, throw, mutate state, write files, call APIs, or show UI feedback. After editing, ensure those effects still happen under the same conditions.
Do not fix nesting by creating a fake abstraction.
Bad:
function validateGameState(game: Game) {
return game.isInstalled && game.supportsMods && !game.isRunning
}
Only good if validateGameState is a real reused domain rule. Otherwise use a named boolean inline.
After editing, report: