# swift

Topic notes on Swift configuration, logging, swift-otel, testing and strict memory safety that the agent pulls in when the work touches that code.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · ★ 64 repo stars
- Author: wendylabsinc
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/wendylabsinc/claude-skills/tree/HEAD/swift/SKILL.md
- Updated: 2026-10-22
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/swift

## What it does

\`SKILL.md` points at a `references/` folder with five topic files: configuration, `swift-log`, `swift-otel`, Swift Testing and debugging. The agent opens the one matching the conversation instead of loading the whole set.

Conventions cover how code is laid out. Types and functions stay `internal` until something outside needs them. Public members come first, sorted into `// MARK: -` sections named with gerund phrases; internal and private helpers sit under their own visibility headings. An is-a conformance goes on the type declaration, while an ability protocol such as `Codable` gets an extension at the bottom of the file. Platform code splits into `+macos`, `+linux` and `+default` files, so adding a protocol method means editing each of them. For Swift 6.2 there is material on `.strictMemorySafety()` and on `Span`, which borrows its backing storage and cannot outlive it or cross an async boundary.

Dropping Foundation from a public API is not cosmetic on an embedded target or in a library that must behave the same on Linux and Apple platforms: `FoundationEssentials` costs 15-40MB. Imports stay internal, with `canImport(FoundationEssentials)` falling back to `Foundation`. Linux builds need `Glibc` or `Musl`.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add wendylabsinc/claude-skills --skill swift -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/swift/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/swift/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add wendylabsinc/claude-skills --skill swift -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/swift/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add wendylabsinc/claude-skills --skill swift -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/swift/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install wendylabsinc/claude-skills swift
```

2. **Manually: put the files in place**
- File: `.github/skills/swift/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add wendylabsinc/claude-skills --skill swift -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/wendylabsinc/claude-skills --path swift
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/swift/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add wendylabsinc/claude-skills --skill swift -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/wendylabsinc/claude-skills/tree/HEAD/swift/SKILL.md

## When to use it
- group public members into `// MARK:` sections
- move XCTest cases onto Swift Testing
- keep Foundation out of a library's public API
- split platform code into `+platform` files
- pick an OTLP backend for a server app

## Example prompts
- Rewrite the interface selection so it sorts once instead of repeating the same loop.
- Give every `@Test` a backtick sentence-style name and switch the assertions to `#expect`.
- Check that `Span` never escapes the closure or crosses an async boundary.

## Similar
- [swift-testing-expert](https://affpapa.org/en/nevibecode/skills/swift-testing-expert.md) — skill · 5700 installs
- [swift-testing](https://affpapa.org/en/nevibecode/skills/prisma-labs-dev-swift-testing.md) — skill · 746 installs
- [swift-testing-pro](https://affpapa.org/en/nevibecode/skills/swift-testing-pro.md) — skill · 10900 installs
- [guide-swift-testing](https://affpapa.org/en/nevibecode/skills/guide-swift-testing.md) — skill · 534 installs
- [swift-test-creator](https://affpapa.org/en/nevibecode/agents/swift-test-creator.md) — subagent · ★ 233 repo stars
- [swift-lsp](https://affpapa.org/en/nevibecode/plugins/swift-lsp.md) — plugin · ★ 47914 repo stars

## Other versions with the same name
- [swift · margelo](https://affpapa.org/en/nevibecode/skills/margelo-swift.md) — 1300 installs
- [swift · mindrally](https://affpapa.org/en/nevibecode/skills/mindrally-swift.md) — 748 installs

From the same set: [wendylabsinc/claude-skills](https://affpapa.org/en/nevibecode/by/wendylabsinc/claude-skills.md) — 26 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
