zig-control-flow
Installation
SKILL.md
Zig Control Flow
Use this skill when writing conditional logic, loops, switch expressions, or using Zig's block/defer mechanisms.
When to Use This Skill
- Writing if/else expressions (including with optionals)
- Using switch as an expression
- Writing for and while loops
- Using labeled blocks for early returns
- Understanding defer execution order
- Using unreachable for optimization hints
if
Zig's if is an expression:
const val = if (condition) x else y;