swiftlint_skill

This skill enforces Swift style and conventions by running SwiftLint from the project root, linting files, and applying safe autocorrections.
  • Python

2.6k

GitHub Stars

2

Bundled Files

2 months ago

Catalog Refreshed

3 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill openclaw/skills --skill swiftlint

  • _meta.json273 B
  • SKILL.md16.9 KB

Overview

This skill wraps SwiftLint to enforce Swift style, conventions, and static analysis from the CLI. It lints entire projects, supports autocorrect for fixable violations, and produces machine-readable reports for CI and tooling. Use it to keep code consistent, catch common mistakes, and integrate checks into Xcode or pipelines.

How this skill works

Run swiftlint from the project root to recursively analyze .swift files, or target specific files and directories with --path. It reports violations as warnings or errors, can autocorrect fixable issues with --fix, and outputs results in many formats (json, checkstyle, github-actions-logging, markdown, etc.). Configuration is read from .swiftlint.yml and supports opt-in rules, custom regex rules, and child/parent configs.

When to use it

  • When you want automated style and lint checks locally or in CI.
  • Before code review to autocorrect trivial issues and reduce noise.
  • When integrating static checks into Xcode build phases or SPM plugins.
  • When producing machine-readable reports for CI tools or PR annotations.
  • When adding or testing custom project rules via .swiftlint.yml.

Best practices

  • Always lint before running --fix so you can review what will change.
  • Read the project’s existing .swiftlint.yml and modify it instead of replacing it.
  • Prefer targeted inline disables (disable:this or disable:next) over broad disables.
  • Use the SPM plugin for Xcode 15+ to pin SwiftLint to the project rather than relying on local install.
  • Use --reporter json for programmatic processing and github-actions-logging for GitHub Actions annotations.

Example use cases

  • Run swiftlint in a pre-commit or CI job to fail builds on style violations (--strict).
  • Autocorrect trivial issues across the codebase with swiftlint --fix, then review remaining violations.
  • Generate a checkstyle XML for Jenkins or a JSON/markdown report for PR comments.
  • Add custom regex-based rules to disallow prints, require localized strings, or enforce accessibility IDs.
  • Integrate SwiftLint as an SPM plugin so every developer and CI uses the same tool version.

FAQ

Use git diff to list changed .swift files and pass each path to swiftlint lint --path <file> combined with the github-actions reporter for annotations.

Can SwiftLint autocorrect all issues?

No. --fix only changes autocorrectable violations. Always lint first and treat remaining violations for manual review or configuration updates.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational
swiftlint skill by openclaw/skills | VeilStrat