format-swift-sources

format-swift-sources is a skill for Claude Code, Codex from gaelic-ghost/socket. It costs 74 tokens per session (2,310 once invoked), scanned A, original, Apache-2.0.

A Swift source-formatting workflow covering SwiftFormat and SwiftLint across editors, builds, Git hooks, packages, and CI. SwiftFormat controls code layout, while SwiftLint checks additional style and safety rules.

In plain words
What is it for?
Use it to set up formatting and linting in Xcode projects, Swift packages, pre-commit hooks, and GitHub Actions.
Why use it?
It helps teams keep Swift code consistent and catch style problems before changes are committed or merged.

Skill for Claude CodeCodex

Part of the apple-dev-skills plugin — 65 skills, 2 MCP servers shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/gaelic-ghost/socket/format-swift-sources
Any agent
npx skills add gaelic-ghost/socket --skill format-swift-sources
Clone the repo
git clone --depth 1 https://github.com/gaelic-ghost/socket

Made for: Claude Code, Codex.

Or install apple-dev-skills, the plugin that ships this one along with the rest of its 65 skills, 2 MCP servers.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for format-swift-sources

README.md
[![agentmods](https://agentmods.dev/badge/skills/gaelic-ghost/socket/format-swift-sources.svg)](https://agentmods.dev/skills/gaelic-ghost/socket/format-swift-sources)
Your own site
<a href="https://agentmods.dev/skills/gaelic-ghost/socket/format-swift-sources"><img src="https://agentmods.dev/badge/skills/gaelic-ghost/socket/format-swift-sources.svg" alt="Measured on agentmods" height="20"></a>
Per session 74 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,310 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00074 $0.02310
Opus 5 $0.00037 $0.01155
Sonnet 5 $0.00015 $0.00462
Haiku 4.5 $0.00007 $0.00231

Measured yesterday against content hash 54ff66603f10, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

format-swift-sources scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/apple-dev-skills/skills/format-swift-sources/SKILL.md · 145 lines

How it starts

The opening of the file, as written. The whole thing — 145 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Format Swift Sources

Purpose

Use this skill as the top-level workflow for integrating and maintaining SwiftLint and SwiftFormat in Apple or Swift repositories. The skill keeps the support matrix explicit, teaches the shortest correct path for each surface, and includes a deterministic helper script for turning SwiftFormat for Xcode shared settings into a project-root .swiftformat file when the host app export path is unavailable or inconvenient. For shared Swift repositories, the preferred baseline is a checked-in repo-root .swiftformat plus a Git pre-commit hook that formats staged Swift sources and then reruns SwiftFormat in lint mode before the commit is allowed through. When both tools are in play, treat SwiftFormat as the primary owner of formatting shape and use SwiftLint as a complementary signal layer for clarity, safety, maintenance, and selectively chosen documentation expectations rather than as a second formatter. When the script path is needed, prefer feeding it the real shared plist from the SwiftFormat group container over assuming the defaults-domain export is complete, and treat the generated file as a curated starting point rather than as a guaranteed final repo config. It is also the canonical first pass before and after structure-swift-sources when a request will split, move, or reorganize Swift source files.

When To Use

  • Use this skill when the user wants to add or maintain swiftformat, swiftlint, or both in a Swift repository.
  • Use this skill when the user wants guidance on how to divide responsibility between SwiftFormat and SwiftLint in the same repository.
  • Use this skill when the user wants guidance for one of these integration surfaces:
    • CLI
    • Xcode Run Script Build Phase
    • Xcode source editor extension
    • Swift Package Manager plugin
    • AppleScript or Automator-style local triggers
    • Git pre-commit hook
    • GitHub Actions
  • Use this skill when the user wants to promote personal SwiftFormat for Xcode settings into a checked-in .swiftformat file.
  • Use this skill when the user wants the recommended shared-repo formatting baseline for a Swift repository.
  • Use this skill when the user needs the supported-path caveats for SwiftLint or SwiftFormat, such as plugin config-path limitations, Xcode script sandboxing, or per-project config gaps in the SwiftFormat extension.
  • Use this skill first when a later structure-swift-sources pass will split files, move files, or normalize section layout and the repo needs a clean formatting baseline before structural edits begin.
  • Recommend bootstrap-xcode-workspace --operation create --component-kind library when the user is creating a brand new Swift package and style tooling is only one part of that scaffold.
  • Recommend bootstrap-xcode-workspace when the user is creating a native Apple product and style tooling is only one part of that scaffold.
  • Recommend swift-package-build-run-workflow or swift-package-testing-workflow when the task shifts from style-tooling integration to ordinary SwiftPM package execution.
  • Recommend swift-package-extension-workflow when the task shifts from formatter-specific setup to general plugin capability, permissions, generated outputs, dual-toolchain behavior, or Xcode handoff policy.
  • Recommend xcode-build-run-workflow when the task shifts from style-tooling integration to active Xcode execution, diagnostics, or mutation work in an existing project.
  • Recommend xcode-testing-workflow when the task shifts from style-tooling integration to active Xcode test work.
  • Recommend structure-swift-sources when the task shifts from formatter or linter setup into file splitting, file moves, declaration grouping, or TODO/FIXME ledger cleanup.
  • Recommend author-swift-docc-docs when the task shifts from style-tooling setup into symbol documentation, DocC article work, landing-page structure, topic groups, or DocC-oriented review.
  • Recommend bootstrap-xcode-workspace --operation align for product guidance alignment.

Read the full file on GitHub · 145 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 145 lines · 74 tokens per session scan A 54ff66603f10

Subscribe to this mod's changes

format-swift-sources is a skill published in the GitHub repository gaelic-ghost/socket (7 stars, last pushed 9d ago), licensed Apache-2.0. It adds 74 tokens to every session and 2,310 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

pipeline

Use when the user wants a feature idea taken end-to-end in one autonomous run — phrases like "run the whole pipeline", "take this feature from idea to finished branch", "brainstorm then build it autonomously", "do everything from idea to merged", "implement all phases without stopping". Triggers when they want…

kardebadas/claude-plugin · 80 tokens

craft

Use when a product idea is still vague and needs to become a clear definition of what to build — "let's craft an app like X", "help me define what I actually want", "clarify this idea before we plan it". Also use before planning or implementation when requirements, UX, domain behaviour, or technical preferences have…

kardebadas/claude-plugin · 83 tokens

apple-engineer-superpowers

Use when writing Swift code for Apple platforms - iOS, macOS, visionOS. Covers Swift 6 concurrency, actors, Sendable, async/await, SwiftUI, MVVM architecture, Metal GPU programming, RealityKit ECS, visionOS scenes, interpolation/animation, advanced collection types, property wrappers, Combine bridging, error handling…

piemonte/apple-engineer-superpowers · 82 tokens

setup-vscode-swift

Inspect and configure VS Code for Swift and Xcode development on macOS. Use when installing SweetPad and the official Swift extension, configuring Cmd+R/Cmd+B shortcuts, installing xcode-build-server, creating buildServer.json, or diagnosing SourceKit-LSP completion. Trigger for requests such as "set up VS Code for…

enebin/setup-vscode-swift · 92 tokens

scenario-planning

Plans under genuine uncertainty — building scenarios, identifying which assumptions are load-bearing, setting early-warning indicators, and stress-testing a plan against futures rather than forecasting one. Use this when a decision depends on something unknowable, when a plan assumes conditions that may not hold…

cbrock84/headcount · 78 tokens

ai-ml-governance

Governs models and AI systems in production — intended use, evaluation, monitoring, human oversight, documentation, and the decision to deploy or retire. Use this before deploying a model or AI feature, when defining evaluation criteria, when a model's behavior has drifted, when assessing AI risk or regulatory…

cbrock84/headcount · 83 tokens