Skill Wiki v0.1.0
rule @ios-swift/rule-guard-let-early-return

Guard Let Early Return

When the rest of a function does not make sense without a particular optional being non-nil, write `guard let x = optionalX else { return ... }`.…

Skill
@ios-swift
Domain
ios-swift
Version
0.1.0
Quality
4.0
Edges
2 out · 2 in
Tokens
120/287/312
$ prime install @ios-swift/rule-guard-let-early-return

Projection

Always in _index.xml · the agent never has to ask for this.

GuardLetEarlyReturn [rule] v0.1.0

When the rest of a function does not make sense without a particular optional being non-nil, write guard let x = optionalX else { return ... }. The bound name is in scope for the entire remainder of the function, and the failure case sits at the top where it is easy to read. Use if let only when both branches do real work; do not use if let to bind a precondition and then put the entire function body inside the if.

Source

prime-system/examples/ios-swift/primes/compiled/@ios-swift/rule-guard-let-early-return/atom.yaml

Compiled at 2026-05-10