swiftlint — Claude Code skill: setup and install
Sets up SwiftLint for Swift projects, covering rules, suppressions, baselines and CI checks. Use it when adding linting to a build or bringing existing code under review.
npx skills add dpearson2699/swift-ios-skills --skill swiftlint -a claude-codeWhat swiftlint does
This skill guides SwiftLint setup through .swiftlint.yml, including rule selection, disabled_rules, opt_in_rules, only_rules, severity modes and report formats. It covers autocorrect, focused swiftlint:disable comments, and path exclusions for generated code.
For SwiftPM targets, it describes SwiftLintBuildToolPlugin from SimplyDanny/SwiftLintPlugins, which runs linting on every build. Xcode projects without Package.swift can add the package dependency and enable the plugin through Build Phases or the trust dialog. That is the preferred route here because it avoids a separate run script.
For an established codebase, the skill explains how to write a baseline for current violations and keep new ones out through CI. It also covers the difference between strict and lenient, plus analyzer_rules for checks that need compiler logs via swiftlint analyze.
What it helps with
- configure
.swiftlint.ymlfor a Swift project - attach SwiftLint to a SwiftPM build target
- create a baseline for existing violations
- suppress a rule on a line or code region
- produce lint output in
sarifformat
Example prompts for the agent
- "Configure SwiftLint with
.swiftlint.ymland add the rules we need." - "Add
SwiftLintBuildToolPluginto the target inPackage.swift." - "Create a baseline for current violations and set up the CI check."
How to install swiftlint
1Skills CLI (Vercel)
npx skills add dpearson2699/swift-ios-skills --skill swiftlint -a claude-code2Manually: put the files in place
~/.claude/skills/swiftlint/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/swiftlint/
1Skills CLI (Vercel)
npx skills add dpearson2699/swift-ios-skills --skill swiftlint -a codex2Manually: put the files in place
.agents/skills/swiftlint/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add dpearson2699/swift-ios-skills --skill swiftlint -a cursor2Manually: put the files in place
.cursor/skills/swiftlint/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install dpearson2699/swift-ios-skills swiftlint2Manually: put the files in place
.github/skills/swiftlint/SKILL.md1Skills CLI (Vercel)
npx skills add dpearson2699/swift-ios-skills --skill swiftlint -a gemini-cli2Platform CLI
gemini skills install https://github.com/dpearson2699/swift-ios-skills --path skills/swiftlintManually: put the files in place
.devin/skills/swiftlint/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add dpearson2699/swift-ios-skills --skill swiftlint -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about swiftlint
How do I install swiftlint in Claude Code?
Run the listed commands in order: npx skills add dpearson2699/swift-ios-skills --skill swiftlint -a claude-code, then npx skills add dpearson2699/swift-ios-skills --skill swiftlint -a claude-code. The skill file is located at ~/.claude/skills/swiftlint/SKILL.md.
What does the swiftlint skill do?
It helps configure SwiftLint rules, autocorrection, suppressions, baselines and CI checks. It also covers build tool plugin and Xcode run script integration.
How do multiple .swiftlint.yml files work?
SwiftLint can merge the main configuration with the nearest nested .swiftlint.yml for each file. Passing --config turns off automatic nested configuration discovery.