Use safe optional handling instead of force unwrapping: ```swift func title(for item: Item?) -> String { guard let item else { return "Untitled" } return item.title } let displayTitle = item?.title ?? "Untitled" if let item { print(item.title) } ``` Use `guard let` when the value is needed for the remainder of the scope, `if let` for a local branch, and `??` for a default. Avoid `Type!`, `!`, and `as!`; use proper optionals and conditional casts (`as?`).
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Swift Language?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/hoangnguyen0403-swift-language-agent-skills-standard)
Use safe optional handling instead of force unwrapping:
```swift
func title(for item: Item?) -> String {
guard let item else { return "Untitled" }
return item.title
}
let displayTitle = item?.title ?? "Untitled"
if let item { print(item.title) }
```
Use `guard let` when the value is needed for the remainder of the scope, `if let` for a local branch, and `??` for a default. Avoid `Type!`, `!`, and `as!`; use proper optionals and conditional casts (`as?`).