Configures and enforces SwiftLint for Swift projects via build-tool plugins, Xcode scripts, Swift Package plugins, or CI. Covers rule configuration, suppressions, baselines, autocorrection, reporters, strictness, multi-config setups, and staged rollout.
Ships in all-ios-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Enforce Swift style, formatting, and conventions using SwiftLint. Covers build-tool plugins, .swiftlint.yml configuration, staged rollouts, baselines, and CI integration.
Scope Boundary: SwiftLint is a linting and style enforcement tool. For underlying API naming, conventions, and architectural rules, see
swift-api-design-guidelinesandswift-code-review.
Prefer the build tool plugin from SimplyDanny/SwiftLintPlugins for Xcode projects and Swift Packages. It avoids global machine installs and runs automatically during target compilation:
// Package.swift
dependencies: [
.package(url: "https://github.com/SimplyDanny/SwiftLintPlugins", from: "0.58.0")
],
targets: [
.target(
name: "MyFeature",
plugins: [
.plugin(name: "SwiftLintBuildToolPlugin", package: "SwiftLintPlugins")
]
)
]
Place .swiftlint.yml in the project root:
included:
- Sources
- Tests
excluded:
- Pods
- .build
- DerivedData
opt_in_rules:
- empty_count
- missing_docs
- fatal_error_message
disabled_rules:
- line_length
- todo
line_length:
warning: 120
error: 160
Adopt rules incrementally in existing codebases:
swiftlint --fix.Suppress legitimate exceptions in code:
// swiftlint:disable:next force_cast
let cell = tableView.dequeueReusableCell(withIdentifier: "Cell") as! CustomCell
// Entire block suppression
// swiftlint:disable cyclomatic_complexity
func complexAlgorithm() { ... }
// swiftlint:enable cyclomatic_complexity
For legacy codebases, capture existing violations into a baseline to prevent regressions without blocking existing files: swiftlint analyze --compiler-log-path xcodebuild.log.
Run in CI before running unit tests:
# Lint with strict error exit codes
swiftlint --strict --reporter github-actions-logging
# Automatically fix whitespace and mechanical violations locally
swiftlint --fix
Pods/ or .build/ dramatically slows down compilation.// swiftlint:disable:next rule_id over disabling rules for entire files.--strict..swiftlint.yml excludes derived data and third-party dependencies--strictevals/evals.json (opens in a new tab)references/adoption-and-configuration.md (opens in a new tab)references/custom-rules-and-analyze.md (opens in a new tab)references/plugins-run-scripts-and-integrations.md (opens in a new tab)references/rule-reference.md (opens in a new tab)references/rules-suppressions-and-baselines.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
/all-ios-skills:swiftlintfrom all-ios-skills
npx claudepluginhub thienqo/ios-skills --plugin all-ios-skills95 skills in this plugin
/accessorysetupkitDiscover and configure Bluetooth and Wi-Fi accessories using AccessorySetupKit. Use when presenting a privacy-preserving accessory picker, defining discovery descriptors for BLE or Wi-Fi devices, handling accessory session events, migrating from CoreBluetooth permission-based scanning, or setting up accessories without requiring broad Bluetooth permissions./activitykitBuild or review Live Activities and Dynamic Island experiences with ActivityKit, including lifecycle, layouts, push updates, and scheduled delivery. Use for time-sensitive Lock Screen or Dynamic Island state; route ordinary widgets to widgetkit./adattributionkitMeasure ad effectiveness with privacy-preserving attribution using AdAttributionKit. Use when registering ad impressions, handling attribution postbacks, updating conversion values, implementing re-engagement attribution, configuring publisher or advertiser apps, or replacing SKAdNetwork with AdAttributionKit for ad measurement.Other plugins' skills for the same job