
Swift Style
- 1.5k installs
- 222 repo stars
- Updated January 18, 2026
- johnrogers/claude-swift-engineering
The swift-style skill enforces Swift code style conventions for formatting, naming, file organization, and idiomatic language patterns.
About
The swift-style skill enforces Swift code style conventions for formatting, naming, file organization, and idiomatic language patterns. Agents review diffs for consistent access control, protocol-oriented design clarity, guard versus nested if usage, and Swift API design guidelines alignment. It supports teams maintaining readable Swift across modules and PRs. Use when writing or reviewing Swift to keep style consistent with project conventions. Swift naming, formatting, and organization conventions. Idiomatic patterns and API design alignment. Review guidance for access control and guards. Keeps modules readable across PRs. Style consistency for Swift codebases. Apply Swift style conventions for naming, formatting, organization, and idiomatic patterns in clean readable code. Structured deliverables and steps from the swift-style skill workflow. User mentions swift-style or related skill triggers from the description. How do I apply swift-style for the workflow described in SKILL.md?.
- Swift naming, formatting, and organization conventions.
- Idiomatic patterns and API design alignment.
- Review guidance for access control and guards.
- Keeps modules readable across PRs.
- Style consistency for Swift codebases.
Swift Style by the numbers
- 1,520 all-time installs (skills.sh)
- +1 installs in the week ending Aug 5, 2026 (Skillselion tracking)
- Ranked #164 of 1,039 Mobile Development skills by installs in the Skillselion catalog
- Security screen: LOW risk (skills.sh audit)
- Data as of Aug 5, 2026 (Skillselion catalog sync)
swift-style capabilities & compatibility
- Capabilities
- swift naming, formatting, and organization conve · idiomatic patterns and api design alignment. · review guidance for access control and guards. · keeps modules readable across prs.
- Use cases
- code review
What swift-style says it does
Swift code style conventions for clean, readable code.
npx skills add https://github.com/johnrogers/claude-swift-engineering --skill swift-styleAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 1.5k |
|---|---|
| repo stars | ★ 222 |
| Security audit | 3 / 3 scanners passed |
| Last updated | January 18, 2026 |
| Repository | johnrogers/claude-swift-engineering ↗ |
How do I apply swift-style for the workflow described in SKILL.md?
Apply Swift style conventions for naming, formatting, organization, and idiomatic patterns in clean readable code.
Who is it for?
Teams using swift-style as documented in the skill repository.
Skip if: Tasks outside the swift-style scope defined in SKILL.md.
When should I use this skill?
User mentions swift-style or related skill triggers from the description.
What you get
Structured deliverables and steps from the swift-style skill workflow.
- Formatted Swift source
- Consistent type and function names
- Golden-path control-flow structure
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) -> UserGolden 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.
// Preferred
func configure() {
backgroundColor = .systemBackground
}Computed Properties
Omit get for read-only:
var diameter: Double {
radius * 2
}Closures
Trailing closure only for single closure parameter.
Type Inference
Let compiler infer when clear. For empty collections, use type annotation:
var names: [String] = []Syntactic Sugar
// Preferred
var items: [String]
var cache: [String: Int]
var name: String?Access Control
privateoverfileprivate- Don't add
internal(it's the default) - Access control as leading specifier
Memory Management
resource.request().onComplete { [weak self] response in
guard let self else { return }
self.updateModel(response)
}Comments
- Explain why, not what
- Use
//or///, avoid/* */ - Keep up-to-date or delete
Constants
Use case-less enum for namespacing:
enum Math {
static let pi = 3.14159
}Common Mistakes
1. Abbreviations beyond URL, ID, UUID — Abbreviations like cfg, mgr, ctx, desc hurt readability. Spell them out: configuration, manager, context, description. The three exceptions are URL, ID, UUID.
2. Nested guard/if statements — Deep nesting makes code hard to follow. Use early returns and guards to keep the happy path left-aligned.
3. Inconsistent self usage — Either always omit self (preferred) or always use it. Mixing makes code scanning harder and confuses capture semantics.
4. Overly generic type names — Manager, Handler, Helper, Coordinator are too vague. Names should explain responsibility: PaymentProcessor, EventDispatcher, ImageCache, NavigationCoordinator.
5. Implied access control — Don't skip access control. Explicit private, public helps future maintainers understand module boundaries. internal is default, so omit it.
Related skills
How it compares
Use swift-style for Apple idiomatic conventions during authoring; pair with SwiftLint for automated CI enforcement.
FAQ
What does swift-style do?
Apply Swift style conventions for naming, formatting, organization, and idiomatic patterns in clean readable code.
When should I invoke swift-style?
Use when you need Apply Swift style conventions for naming, formatting, organization, and idiomatic patterns in clean readable code.
What outcome does swift-style produce?
The swift-style skill enforces Swift code style conventions for formatting, naming, file organization, and idiomatic language patterns.
Is Swift Style safe to install?
skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.