Swift code style conventions for clean, readable code. Use when writing Swift code to ensure consistent formatting, naming, organization, and idiomatic patterns.
swift-style is a concise Swift code-style guide that encodes conventions for clean, readable, idiomatic Swift. It solves the problem of inconsistent formatting, naming, and organization across a Swift codebase by giving Claude a compact reference to apply whenever it writes or edits Swift. Its guiding principle is "Clarity > Brevity > Consistency," and it expects code to compile without warnings.
The guide covers naming (UpperCamelCase for types and protocols, lowerCamelCase for everything else, no abbreviations except URL/ID/UUID), the "golden path" of early returns and guards to keep the happy path left-aligned, code organization with extensions and MARK comments, spacing and brace conventions, when to omit `self`, computed-property shorthand, trailing-closure rules, type inference, access control (prefer `private`, omit the default `internal`), and memory management with `[weak self]` capture. It closes with a list of common mistakes to avoid, such as vague type names like `Manager` or `Helper`, unnecessary abbreviations, and inconsistent `self` usage. The entire skill is a single SKILL.md with no scripts or executable content.
Target users are Swift and iOS/macOS developers who want Claude to produce consistent, idiomatic code, and teams that want a shared house style applied automatically during code generation. Typical use cases include writing new Swift files, refactoring existing code to a consistent style, and reviewing code against these conventions.
Whenever Swift code is being written or edited, to keep formatting, naming, organization, and idiomatic patterns consistent.
"Clarity > Brevity > Consistency," and code should compile without warnings. Guidance flows from readability at the call site.
UpperCamelCase for types and protocols, lowerCamelCase for everything else, and no abbreviations except the universal URL, ID, and UUID. It also warns against overly generic type names like Manager, Handler, or Helper.
Yes, briefly — it shows the `[weak self]` capture pattern with a `guard let self else { return }` unwrap inside closures.
No. It is a single Markdown style guide with no scripts, commands, or executable content.
Quick Setup:
.claude/skills/Repository
johnrogers/claude-swift-engineering