
Swift Style
A solid reference for writing Swift that doesn't look like translated Objective-C. Covers the fundamentals: naming conventions (UpperCamelCase for types, lowerCamelCase for everything else), the golden path pattern with guard statements instead of nested ifs, and when to omit self. The common mistakes section is the most useful part, calling out real issues like overusing abbreviations beyond URL/ID/UUID and slapping Manager or Handler on everything. It's opinionated in the right ways, like preferring private over fileprivate and always using trailing closures for single closure parameters. Keep this handy when reviewing code or onboarding developers who need to write idiomatic Swift instead of whatever they learned from random tutorials.
- skills.sh installs
- 1.5K
- GitHub stars
- 233
- last updated
- Aug 21, 2026
Install
$ npx -y skills add johnrogers/claude-swift-engineering --skill swift-style --agent claude-codeInstalls into .claude/skills of the current project.
Files
Swift Style Guide
Code style conventions for clean, readable Swift code.
Core Principles
Clarity > Brevity > Consistency
Code should compile without warnings.
Naming
UpperCamelCase— Types, protocolslowerCamelCase— Everything else- Clarity at call site
- No abbreviations except universal (URL, ID)
// Preferred
let maximumWidgetCount = 100
func fetchUser(byID id: String) -> User
Golden Path
Left-hand margin is the happy path. Don't nest if statements.
// Preferred
func process(value: Int?) throws -> Result {
guard let value = value else {
throw ProcessError.nilValue
}
guard value > 0 else {
throw ProcessError.invalidValue
}
return compute(value)
}
Code Organization
Use extensions and MARK comments:
class MyViewController: UIViewController {
// Core implementation
}
// MARK: - UITableViewDataSource
extension MyViewController: UITableViewDataSource { }
Spacing
- Braces open on same line, close on new line
- One blank line between methods
- Colon: no space before, one space after
Self
Avoid self unless required by compiler.
Sponsors