loom-swift

loom-swift is a skill for Claude Code, Codex from cosmix/loom. It costs 15 tokens per session (6,775 once invoked), scanned A, original, MIT.

Swift language guidance for production code, including Swift 6, Swift Package Manager, concurrency, and testing. Swift Package Manager is Swift's tool for building projects and managing dependencies.

In plain words
What is it for?
Use it to create and maintain Swift packages and app libraries, manage dependencies, build with Xcode or SwiftPM, and run targeted tests in local development or CI.
Why use it?
It helps prevent errors involving value types, actors, data-race checking, protocol extensions, continuations, and Codable defaults.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: positional $N argument.

Good fit Use it to create and maintain Swift packages and app libraries, manage dependencies, build with Xcode or SwiftPM, and run targeted tests in local development or CI.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/cosmix/loom/loom-swift
View source ↗ cosmix/loom
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.

Any agent
npx skills add cosmix/loom --skill loom-swift
Clone the repo
git clone --depth 1 https://github.com/cosmix/loom

Made for: Claude Code, Codex.

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 loom-swift

README.md
[![agentmods](https://agentmods.dev/badge/skills/cosmix/loom/loom-swift/github.svg)](https://agentmods.dev/skills/cosmix/loom/loom-swift)
Your own site
<a href="https://agentmods.dev/skills/cosmix/loom/loom-swift"><img src="https://agentmods.dev/badge/skills/cosmix/loom/loom-swift/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for loom-swift

Your own site · 80×15
<a href="https://agentmods.dev/skills/cosmix/loom/loom-swift"><img src="https://agentmods.dev/badge/skills/cosmix/loom/loom-swift.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 15 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 6,775 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00015 $0.06775
Opus 5.5 $0.00006 $0.02710
Sonnet 5.5 $0.00003 $0.01355
Haiku 4.5 $0.00002 $0.00677

Measured 29d ago against content hash f150c9a88c48, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

loom-swift scanned grade A with 1 finding 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 29d ago.

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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

func fetch(_ url: URL) async throws -> Data {
skills/loom-swift/SKILL.md · 514 lines

How it starts

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

Swift Language Expertise

Overview

Idiomatic, production-grade Swift 6: SwiftPM packages, value semantics, optionals, protocol-oriented generics, and structured concurrency under strict data-race checking. Assumes the reader knows the syntax. The value is in what is easy to get wrong: protocol-extension dispatch, actor reentrancy, Sendable escape hatches, continuation misuse, Codable defaults, and two test frameworks that share one swift test command.

Tooling

SwiftPM is the build tool and package manager. Xcode projects (.xcodeproj) build with xcodebuild; keep libraries in a SwiftPM package even when an app wraps them, so they build and test on Linux and in CI without a simulator.

Task Command
New package swift package init --type library (or --type executable)
Add a dependency swift package add-dependency https://github.com/apple/swift-argument-parser --from 1.5.0 (6.0+)
Wire it to a target swift package add-target-dependency ArgumentParser spool-cli --package swift-argument-parser
Resolve / update swift package resolve / swift package update (rewrites Package.resolved)
Build with tests swift build --build-tests
Test swift test (--parallel for XCTest; Swift Testing runs tests in parallel by default)
List test ids swift test list
Release build swift build -c release (whole-module optimization)
Format swift format --in-place --recursive Sources Tests (swift-format ships with the 6.0 toolchain)
Lint swift format lint --strict --recursive Sources Tests; swiftlint lint --strict where .swiftlint.yml exists
// swift-tools-version: 6.0
// The tools version line selects the manifest API AND the Swift 6 language mode for every target.
import PackageDescription

let package = Package(
    name: "Spool",
    platforms: [.macOS(.v14), .iOS(.v17)],
    products: [.library(name: "Spool", targets: ["Spool"])],
    dependencies: [
        .package(url: "https://github.com/apple/swift-argument-parser", from: "1.5.0"),
    ],
    targets: [
        .target(name: "Spool"),
        .executableTarget(name: "spool-cli", dependencies: [
            "Spool",
            .product(name: "ArgumentParser", package: "swift-argument-parser"),
        ]),
        .testTarget(name: "SpoolTests", dependencies: ["Spool"]),
    ]
)

Read the full file on GitHub · 514 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. 29d ago First seen · 514 lines · 15 tokens per session scan A f150c9a88c48

Subscribe to this mod's changes

loom-swift is a skill published in the GitHub repository cosmix/loom (63 stars, last pushed yesterday), licensed MIT. It adds 15 tokens to every session and 6,775 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-26.