format-swift-sources

Integrate SwiftLint and SwiftFormat across Apple workflows with deterministic export scripts.

6|Updated Apr 9, 2026
One-click install
npx skills add https://github.com/gaelic-ghost/socket --skill format-swift-sources
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: format-swift-sources
Source: https://github.com/gaelic-ghost/socket/tree/main/plugins/apple-dev-skills/skills/format-swift-sources
Command: npx skills add https://github.com/gaelic-ghost/socket --skill format-swift-sources

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires PyYAML, and includes scripts (resource) and references (resource) components.

What problem does it solve?

SwiftLint and SwiftFormat provide complementary quality gates for Swift code, but teams often struggle to coordinate their rules, surfaces, and configurations across CLI tooling, Xcode phases, packaging, and automation. This skill clarifies a single, coherent workflow to install, configure, and apply both tools consistently in Apple-centric repositories.

Core Features & Use Cases

  • Unified guidance for integrating SwiftLint and SwiftFormat across CLI, Xcode build phases, SwiftPM plugins, AppleScript automation, Git hooks, and GitHub Actions.
  • Deterministic export pathway via scripts/export_swiftformat_xcode_config.py to produce a portable .swiftformat configuration from the SwiftFormat shared defaults when needed.
  • Clear guidance on preferred paths (host-app export flow first) and safe fallbacks, plus verification steps to ensure the integration actually runs.

Quick Start

Use the host-app export flow to generate a portable SwiftFormat config at the project root, or fall back to the scriptable export in scripts/export_swiftformat_xcode_config.py when a deterministic export is required.

Frequently Asked Questions about format-swift-sources

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I integrate SwiftLint and SwiftFormat across Xcode and CI workflows?

Integrating SwiftLint and SwiftFormat across Xcode and CI requires coordinating rules, surfaces, and configurations across CLI tooling, build phases, SwiftPM plugins, Git hooks, and GitHub Actions. This Skill provides a single coherent workflow path from setup to verification.

What is the best way to configure SwiftLint and SwiftFormat rules consistently in an Apple-centric repository?

Configuring SwiftLint and SwiftFormat consistently involves applying shared default configurations across all surfaces. The Skill recommends a preferred host-app export flow first, with safe fallbacks and verification steps to ensure the integration actually runs.

Can I generate a portable SwiftFormat configuration for Xcode build phases?

Yes, you can generate a portable SwiftFormat configuration for Xcode build phases. The Skill includes a deterministic export pathway using a Python script to produce a portable .swiftformat file from SwiftFormat shared defaults when needed.

Does this SwiftLint and SwiftFormat integration work with SwiftPM plugins and pre-commit hooks?

Yes, the SwiftLint and SwiftFormat integration works with SwiftPM plugins and pre-commit hooks. It offers unified guidance covering CLI, Xcode build phases, package plugins, AppleScript automation, Git hooks, and GitHub Actions.

Why do I need a deterministic export script for SwiftFormat in GitHub Actions?

A deterministic export script for SwiftFormat in GitHub Actions ensures a portable .swiftformat configuration is generated identically every run. The export script extracts from shared defaults, satisfying requirements for a full integration path and verification.

What are the limitations of relying on SwiftLint and SwiftFormat shared defaults?

Relying on SwiftLint and SwiftFormat shared defaults may not cover every project-specific rule. The Skill addresses this by offering a scriptable export fallback to generate a portable config, plus verification steps to ensure the integration actually runs.