Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
johnrogers avatar

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)
At a glance

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
From the docs

What swift-style says it does

Swift code style conventions for clean, readable code.
SKILL.md
npx skills add https://github.com/johnrogers/claude-swift-engineering --skill swift-style

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs1.5k
repo stars222
Security audit3 / 3 scanners passed
Last updatedJanuary 18, 2026
Repositoryjohnrogers/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

SKILL.mdMarkdownGitHub ↗

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.

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

  • private over fileprivate
  • 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 namesManager, 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.

Mobile Developmentfrontendintegrations

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.