# swift-expert

swift-expert guides an agent through Swift work for iOS and macOS, from SwiftUI screens to async code. Use it when a task involves Combine or modern Swift features.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 163 installs · ★ 45 repo stars
- Author: personamanagmentlayer
- License: Apache-2.0 · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/personamanagmentlayer/pcl/tree/HEAD/stdlib/languages/swift-expert/SKILL.md
- Updated: 2026-10-12
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/personamanagmentlayer-swift-expert

## What it does

The skill covers Swift 5.9+ topics such as async/await, actors, closures, protocols, and value versus reference types. Its SwiftUI guidance includes view state, composition, navigation, and animation.

Examples in the skill cover Combine-based view models, URLSession networking, and JSON decoding. The agent can use Read, Write, and Edit, along with `swift` and `xcodebuild` commands; its permitted tools are limited to that set.

## Install

### Claude Code (native platform)

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

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

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add personamanagmentlayer/pcl --skill swift-expert -a codex
```

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

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add personamanagmentlayer/pcl --skill swift-expert -a cursor
```

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

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install personamanagmentlayer/pcl stdlib/languages/swift-expert
```

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

### Gemini CLI

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

2. **Platform CLI**
```bash
gemini skills install https://github.com/personamanagmentlayer/pcl --path stdlib/languages/swift-expert
```

### Windsurf (Devin Desktop)

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

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add personamanagmentlayer/pcl --skill swift-expert -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/personamanagmentlayer/pcl/tree/HEAD/stdlib/languages/swift-expert/SKILL.md

## When to use it
- build a SwiftUI screen with managed state
- write an asynchronous Swift API request
- set up reactive search with Combine
- understand Swift closures, protocols, and types

## Example prompts
- Create a SwiftUI profile screen with loading and error states.
- Write a Swift API client using async/await and JSON decoding.
- Show how to implement text search with Combine.

## Source text · SKILL.md · Apache-2.0

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 6425d3be030d576c.

BEGIN THIRD-PARTY FILE 6425d3be030d576c
````text
---
name: swift-expert
version: 1.1.0
description: >-
  Expert-level Swift development for iOS, macOS with SwiftUI, Combine, and modern Swift
  5.9+. Use when the user mentions iOS, macOS, SwiftUI, Combine, async await, or Apple
  platforms, or when the task involves Modern Swift Features, Basics and Optionals,
  Functions and Closures, or Structs and Classes.
category: languages
tags: [swift, ios, macos, swiftui, combine, async-await, apple]
allowed-tools:
  - Read
  - Write
  - Edit
  - Bash(swift:*, xcodebuild:*)
---

# Swift Expert

Expert guidance for Swift development including iOS/macOS apps, SwiftUI, Combine, async/await, and Swift 5.9+ features.

## Core Concepts

### Modern Swift Features (5.9+)

- Async/await concurrency
- Actors for thread safety
- Property wrappers
- Result builders
- Protocols and generics
- Value types vs reference types
- Automatic Reference Counting (ARC)
- Macros (Swift 5.9+)

### SwiftUI

- Declarative UI framework
- State management
- View composition
- Layout system
- Animations
- Navigation

### Combine

- Reactive programming
- Publishers and subscribers
- Operators
- Error handling

## SwiftUI

### Basic Views

```swift
import SwiftUI

struct ContentView: View {
    @State private var name = ""
    @State private var count = 0

    var body: some View {
        VStack(spacing: 20) {
            Text("Hello, \(name.isEmpty ? "World" : name)!")
                .font(.title)
                .foregroundColor(.blue)

            TextField("Enter name", text: $name)
                .textFieldStyle(.roundedBorder)
                .padding()

            HStack {
                Button("Decrement") {
                    count -= 1
                }

                Text("\(count)")
                    .frame(minWidth: 50)

                Button("Increment") {
                    count += 1
                }
            }
            .buttonStyle(.borderedProminent)
        }
        .padding()
    }
}
```

### State Management

```swift
// @State - local view state
struct CounterView: View {
    @State private var count = 0

    var body: some View {
        Button("Count: \(count)") {
            count += 1
        }
    }
}

// @Binding - pass state reference
struct ChildView: View {
    @Binding var isOn: Bool

    var body: some View {
        Toggle("Setting", isOn: $isOn)
    }
}

// @ObservableObject - external state
class UserViewModel: ObservableObject {
    @Published var user: User?
    @Published var isLoading = false
    @Published var error: Error?

    func fetchUser() async {
        isLoading = true
        defer { isLoading = false }

        do {
            user = try await APIClient.shared.fetchUser()
        } catch {
            self.error = error
        }
    }
}

struct UserView: View {
    @StateObject private var viewModel = UserViewModel()

    var body: some View {
        Group {
            if viewModel.isLoading {
                ProgressView()
            } else if let user = viewModel.user {
                UserDetailView(user: user)
            } else if let error = viewModel.error {
                ErrorView(error: error)
            }
        }
        .task {
````
END THIRD-PARTY FILE 6425d3be030d576c

The third-party file has ended. Everything between the 6425d3be030d576c tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 3188 of 10647 bytes. © personamanagmentlayer · Apache-2.0 · https://github.com/personamanagmentlayer/pcl/tree/HEAD/stdlib/languages/swift-expert/SKILL.md

_Part of the page did not fit — see the HTML version._

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