# swiftlint

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.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 2700 installs · ★ 1237
- Author: dpearson2699
- License: LicenseRef-Unknown · policy=link-only · description only; the file stays with the author
- Source: https://github.com/dpearson2699/swift-ios-skills/tree/HEAD/skills/swiftlint/SKILL.md
- Updated: 2026-07-31
- HTML: https://affpapa.org/en/nevibecode/skills/swiftlint

## What it 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`.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill swiftlint -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/swiftlint/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/swiftlint/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill swiftlint -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/swiftlint/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill swiftlint -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/swiftlint/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install dpearson2699/swift-ios-skills swiftlint
```

2. **Manually: put the files in place**
- File: `.github/skills/swiftlint/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill swiftlint -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/dpearson2699/swift-ios-skills --path skills/swiftlint
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/swiftlint/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill swiftlint -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/dpearson2699/swift-ios-skills/tree/HEAD/skills/swiftlint/SKILL.md

## When to use it
- configure `.swiftlint.yml` for 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 `sarif` format

## Example prompts
- "Configure SwiftLint with `.swiftlint.yml` and add the rules we need."
- "Add `SwiftLintBuildToolPlugin` to the target in `Package.swift`."
- "Create a baseline for current violations and set up the CI check."

## Similar
- [spm-build-analysis](https://affpapa.org/en/nevibecode/skills/spm-build-analysis.md) — skill · 3400 installs
- [build-run-debug](https://affpapa.org/en/nevibecode/skills/build-run-debug.md) — skill · 60 installs
- [test-triage](https://affpapa.org/en/nevibecode/skills/test-triage.md) — skill · 51 installs
- [cmux-testing](https://affpapa.org/en/nevibecode/skills/cmux-testing.md) — skill · 4900 installs
- [swift-development](https://affpapa.org/en/nevibecode/skills/swift-development.md) — skill · 488 installs
- [developing-ios-apps](https://affpapa.org/en/nevibecode/skills/developing-ios-apps.md) — skill · 1500 installs

From the same set: [dpearson2699/swift-ios-skills](https://affpapa.org/en/nevibecode/by/dpearson2699/swift-ios-skills.md) — 86 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
