
Swift Style
Swift style conventions covering naming, golden-path control flow, spacing, and access control for readable code.
- skills.sh installs
- 1.5K
- GitHub stars
- 233
- last updated
- Aug 21, 2026
What it does
- Covers naming, golden-path control flow, code organization, spacing,
selfusage, closures, and memory management - Includes preferred and avoided examples for
guardearly returns, MARK-grouped extensions, and[weak self]captures - Enforces full spelling of abbreviations except URL, ID, and UUID, and explicit
privateoverfileprivate - Designed for writing Swift code that compiles without warnings and reads consistently across a codebase
Install
$ npx -y skills add johnrogers/claude-swift-engineering --skill swift-style -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
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.
Details
- Repository
- github.com/johnrogers/claude-swift-engineering
- Categories
- Code Review & Quality, Mobile Apps
More from johnrogers/claude-swift-engineering
All 10Similar to Swift Style
More Code Review & Quality
swift-api-design-guidelines-skillSkillerikote04/swift-api-design-guidelines-agent-skill1.2K installsSwift API naming, argument-label, and documentation guidance for designing, refactoring, and reviewing clear, fluent public interfaces.
swift-languageSkilldpearson2699/swift-ios-skills4.2K installsModern Swift language idioms for core code: expressions, typed throws, builders, and generics.
swift-core-skillsPlugindpearson2699/swift-ios-skills1.3K starsCore Swift language features, concurrency, API design guidelines, testing, SwiftData, Core Data, Charts, Codable, FormatStyle, and architecture patterns
swift-developmentSkillrshankras/claude-code-apple-skills518 installsSwift language guidance covering concurrency, performance, and modern idioms for code review and architecture.
clean-codeSkillratacat/claude-skills359 installsCoding guide that applies Robert C. Martin's Clean Code rules to naming, functions, classes, errors, and tests.
golang-code-styleSkillsamber/cc-skills-golang46.6K installsGo code style conventions for clarity: line breaking, variable declarations, control flow, and when comments help.