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-code

Installs 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, protocols
  • lowerCamelCase — 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

Details

Repository
github.com/johnrogers/claude-swift-engineering
Categories
Documentation, Code Review & Quality, Mobile Development

More from johnrogers/claude-swift-engineering

All 10
1davila7 avatarremotiondavila7/claude-code-templatesBest practices and comprehensive guide for Remotion - programmatic video creation in React with animations, compositions, and media handling1.5Kskills.sh installs
2dotnet avatarmsbuild-serverdotnet/skillsGuide for using MSBuild Server to improve CLI build performance. Activate when developers report slow incremental builds from the command line, or when CLI buil1.5Kskills.sh installs
3galaxy-dawn avatarcitation-verificationgalaxy-dawn/claude-scholarThis skill provides reference guidance for citation verification in academic writing. Use when the user asks about "citation verification best practices", "how 1.5Kskills.sh installs
4charleswiltgen avataraxiom-shippingcharleswiltgen/axiomUse when preparing ANY app for submission, handling App Store rejections, writing appeals, or managing App Store Connect. Covers submission checklists, rejectio1.5Kskills.sh installs
5loops-so avatarloops-email-sending-best-practicesloops-so/skillsUse this skill when the user wants to review, audit, improve, or plan email sending best practices. This includes deliverability, inbox placement, sender reputa1.5Kskills.sh installs
6mapbox avatarmapbox-ios-patternsmapbox/mapbox-agent-skillsOfficial integration patterns for Mapbox Maps SDK on iOS. Covers installation, adding markers, user location, custom data, styles, camera control, and featurese1.5Kskills.sh installs