Back to Skills

swiftlint

Configures and enforces SwiftLint in Swift projects using build tool plugins, run scripts, and CI. Covers .swiftlint.yml configuration, disabled_rules, opt_in_rules, only_rules, analyzer_rules, baselines, autocorrect, swiftlint:disable suppressions, reporter formats (sarif, json, checkstyle), strict and lenient modes, SwiftLintBuildToolPlugin via SimplyDanny/SwiftLintPlugins, swift package plugin swiftlint, Xcode run script phases, CI integration, multiple configuration files, and rollout strate

961stars48forksUpdated 8/4/2026

Security Assessment

Safe(96/100)
Security Score96/100

About swiftlint

This skill configures and enforces SwiftLint in Swift projects, covering setup, rule selection, suppression, CI integration, and rollout strategy for existing codebases. It solves the problem of getting consistent, automated Swift style and convention enforcement wired into a project the right way, whether via build tool plugin, Xcode run script, or CI, and helps teams choose between those approaches deliberately rather than by trial and error.

It documents the full .swiftlint.yml surface: disabled_rules, opt_in_rules, only_rules, analyzer_rules, baselines, autocorrect, swiftlint:disable suppressions, and reporter formats such as sarif, json, and checkstyle, plus strict and lenient modes. Its default recommendation is the build tool plugin via SimplyDanny/SwiftLintPlugins added to Package.swift, which runs SwiftLint automatically on every build with no run script. It explains layered configuration through child_config and parent_config, automatic nested per-directory configs (for example relaxed rules for Tests), and the merge semantics for rule state and included/excluded paths. Reference files cover adoption and configuration, custom rules and analyze, plugins and integrations, the rule reference, and suppressions and baselines, and an evals file validates the guidance.

It positions itself as a style-enforcement tool rather than a style guide, deferring naming conventions and architecture patterns to sibling skills. It is aimed at Swift/iOS developers and teams standardizing linting, adopting SwiftLint into an existing codebase via baselines, or integrating it into CI.

FAQ

What is the recommended way to set up SwiftLint?

The build tool plugin via SimplyDanny/SwiftLintPlugins added to Package.swift or Xcode package dependencies, which runs SwiftLint automatically on every build without a run script.

How do I adopt SwiftLint in a large existing codebase?

Use baselines to record existing violations so only new issues fail, alongside rollout strategies covered in the skill and its reference files.

What configuration options does it cover?

disabled_rules, opt_in_rules, only_rules, analyzer_rules, baselines, autocorrect, swiftlint:disable suppressions, reporter formats (sarif, json, checkstyle), and strict/lenient modes.

How do parent and child configs interact?

child_config refines the current config with higher priority and parent_config supplies lower-priority defaults; rule state merges, and a child overrides only when it explicitly states the opposite. Nested per-directory .swiftlint.yml files can relax or tighten rules for subtrees like Tests.

Is this a style guide?

No, it is a style-enforcement tool. It defers Swift naming and design conventions to swift-api-design-guidelines and architecture to swift-architecture.

All Files

7 files
evals/evals.json3.9 KB
View
references/adoption-and-configuration.md9.2 KB
View
references/custom-rules-and-analyze.md6.3 KB
View
references/plugins-run-scripts-and-integrations.md10.3 KB
View
references/rule-reference.md7.1 KB
View
references/rules-suppressions-and-baselines.md11.2 KB
View
SKILL.md14.9 KB
View

Install swiftlint

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill