swift-quality-hooks

Installation
SKILL.md

Swift Quality Hooks

Install a fast (<1s on staged files), clean-code-suite git pre-commit hook for any Apple-platform Swift project. The hook runs SwiftLint --strict + SwiftFormat (or Apple's swift-format) --lint on staged .swift files only, with an opt-in xcodebuild typecheck stage gated by an environment variable.

This skill generalizes a battle-tested implementation that took a real ~50k LOC macOS app from 333 → 0 SwiftLint violations (verified across 288 Swift files; hook E2E-tested across 12 scenarios). The same architecture applies to iOS / tvOS / watchOS / visionOS by swapping one xcodebuild -destination flag.

When to use this skill

  • User says any of: "set up Swift pre-commit hook", "swift code quality automation", "install SwiftLint hook", "swiftformat hook", "swift git hook", "Apple platform pre-commit", "ios/macos/tvos/watchos/visionos pre-commit lint"
  • User has an Xcode project, Xcode workspace, or Package.swift and wants commit-time enforcement
  • User asks to migrate from no hook → hook, or from .git/hooks/core.hooksPath versioned hooks

When NOT to use

  • Generic "set up git hooks" requests with no Swift context → use a generic git-hooks skill
  • "Configure SwiftLint inside Xcode build phase only" with no commit-time enforcement requested → SwiftLint docs cover that directly
  • Non-Apple Swift (server-side Swift on Linux without Xcode) → adapt manually; the typecheck stage assumes xcodebuild

Operations

Related skills
Installs
16
GitHub Stars
6
First Seen
Apr 18, 2026