Agent skill

Swift Patterns

by vibeeval in vibeeval/vibecosystem

SwiftUI view composition, @Observable patterns, async/await concurrency, TCA architecture, and Combine reactive streams.

MITAuto-check passedMobile

Install Swift Patterns

skills CLI
$ npx skills add vibeeval/vibecosystem --skill swift-patterns -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install vibeeval/vibecosystem swift-patterns --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/vibeeval/vibecosystem.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/swift-patterns .claude/skills/swift-patterns && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
swift-patterns
GitHub stars
531
Token cost
~1.8k tokens
SKILL.md length
128 words
Files
1
Skills in repo
144
Repo updated
First seen
Licence
MIT

At a glance

SwiftUI view composition, @Observable patterns, async/await concurrency, TCA architecture, and Combine reactive streams.

  • Tasks that involve iOS development
  • SKILL.md covers SwiftUI View Composition, @Observable Pattern (iOS 17+), Structured Concurrency and TCA (The Composable…, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Tasks that involve Async programming

What it does

Swift Patterns is an agent skill from vibeeval/vibecosystem. SwiftUI view composition, @Observable patterns, async/await concurrency, TCA architecture, and Combine reactive streams.

Its SKILL.md is about 1.8k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Mobile, covering iOS development and Async programming. It works with SwiftUI and iOS. The repository describes itself as: AI software team for Claude Code - 138 agents, 295 skills, 73 hooks. Self-learning, multi-agent swarm, autonomous skill evolution. The licence is MIT.

When your agent uses it

  • Tasks that involve iOS development
  • Tasks that involve Async programming

Example prompts

  • “/swift-patterns”

What it can do on your machine

Read from SKILL.md and the folder at commit 3b763b1. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are swift).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Swift Patterns loads about 1.8k tokens when it runs. Until then it costs about 34 tokens; SKILL.md has 128 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~34
When it runs · the whole SKILL.md, loaded when a task matches
~1.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from vibeeval/vibecosystem at commit 3b763b1, republished under its MIT licence (© vibeeval). 128 words, ~1,842 tokens.

Download SKILL.mdSave it as .claude/skills/swift-patterns/SKILL.md (or your agent's skills folder).
name
swift-patterns
description
SwiftUI view composition, @Observable patterns, async/await concurrency, TCA architecture, and Combine reactive streams.

Swift Patterns

Modern Swift patterns for iOS/macOS application development.

SwiftUI View Composition

swift
// Small, focused views composed together
struct ProductCard: View {
    let product: Product

    var body: some View {
        VStack(alignment: .leading, spacing: 8) {
            ProductImage(url: product.imageURL)
            ProductInfo(name: product.name, price: product.price)
            RatingStars(rating: product.rating, count: product.reviewCount)
        }
        .padding()
        .background(.regularMaterial)
        .clipShape(RoundedRectangle(cornerRadius: 12))
    }
}

// Extract subviews for readability and reusability
struct ProductImage: View {
    let url: URL

    var body: some View {
        AsyncImage(url: url) { phase in
            switch phase {
            case .success(let image):
                image.resizable().aspectRatio(contentMode: .fill)
            case .failure:
                Image(systemName: "photo").foregroundStyle(.secondary)
            case .empty:
                ProgressView()
            @unknown default:
                EmptyView()
            }
        }
        .frame(height: 200)
        .clipped()
    }
}

// ViewModifier for reusable styling
struct CardModifier: ViewModifier {
    func body(content: Content) -> some View {
        content
            .padding()
            .background(.regularMaterial)
            .clipShape(RoundedRectangle(cornerRadius: 12))
            .shadow(radius: 2)
    }
}

extension View {
    func cardStyle() -> some View {
        modifier(CardModifier())
    }
}

@Observable Pattern (iOS 17+)

swift
import Observation

@Observable
final class ProductStore {
    var products: [Product] = []
    var isLoading = false
    var errorMessage: String?

    private let apiClient: APIClient

    init(apiClient: APIClient = .shared) {
        self.apiClient = apiClient
    }

    func loadProducts() async {
        isLoading = true
        errorMessage = nil

        do {
            products = try await apiClient.fetchProducts()
        } catch {
            errorMessage = error.localizedDescription
        }

        isLoading = false
    }

    func deleteProduct(_ product: Product) async throws {
        try await apiClient.deleteProduct(id: product.id)
        products.removeAll { $0.id == product.id }
    }
}

// Usage in SwiftUI (automatic tracking, no @Published needed)
struct ProductListView: View {
    @State private var store = ProductStore()

    var body: some View {
        List(store.products) { product in
            ProductCard(product: product)
        }
        .overlay {
            if store.isLoading { ProgressView() }
            if let error = store.errorMessage {
                ContentUnavailableView("Error", systemImage: "exclamationmark.triangle",
                                       description: Text(error))
            }
        }
        .task { await store.loadProducts() }
    }
}

Structured Concurrency

swift
// TaskGroup for parallel async work
func loadDashboard() async throws -> Dashboard {
    async let profile = apiClient.fetchProfile()
    async let orders = apiClient.fetchRecentOrders()
    async let recommendations = apiClient.fetchRecommendations()

    // All three run concurrently, await all results
    return try await Dashboard(
        profile: profile,
        orders: orders,
        recommendations: recommendations
    )
}

// TaskGroup with dynamic number of tasks
func loadImages(urls: [URL]) async -> [URL: UIImage] {
    await withTaskGroup(of: (URL, UIImage?).self) { group in
        for url in urls {
            group.addTask {
                let image = try? await ImageLoader.load(url)
                return (url, image)
            }
        }

        var results: [URL: UIImage] = [:]
        for await (url, image) in group {
            if let image { results[url] = image }
        }
        return results
    }
}

// Actor for thread-safe shared state
actor ImageCache {
    private var cache: [URL: UIImage] = [:]
    private var inFlight: [URL: Task<UIImage, Error>] = [:]

    func image(for url: URL) async throws -> UIImage {
        if let cached = cache[url] { return cached }

        // Coalesce duplicate requests
        if let existing = inFlight[url] {
            return try await existing.value
        }

        let task = Task {
            let (data, _) = try await URLSession.shared.data(from: url)
            guard let image = UIImage(data: data) else {
                throw ImageError.invalidData
            }
            return image
        }

        inFlight[url] = task
        let image = try await task.value
        cache[url] = image
        inFlight[url] = nil
        return image
    }
}

TCA (The Composable Architecture) Pattern

swift
import ComposableArchitecture

@Reducer
struct ProductFeature {
    @ObservableState
    struct State: Equatable {
        var products: [Product] = []
        var isLoading = false
        var alert: AlertState<Action>?
    }

    enum Action {
        case onAppear
        case productsLoaded(Result<[Product], Error>)
        case deleteProduct(Product)
        case alertDismissed
    }

    @Dependency(\.apiClient) var apiClient

    var body: some ReducerOf<Self> {
        Reduce { state, action in
            switch action {
            case .onAppear:
                state.isLoading = true
                return .run { send in
                    let result = await Result { try await apiClient.fetchProducts() }
                    await send(.productsLoaded(result))
                }

            case .productsLoaded(.success(let products)):
                state.isLoading = false
                state.products = products
                return .none

            case .productsLoaded(.failure(let error)):
                state.isLoading = false
                state.alert = AlertState { TextState(error.localizedDescription) }
                return .none

            case .deleteProduct(let product):
                state.products.removeAll { $0.id == product.id }
                return .run { _ in try await apiClient.deleteProduct(id: product.id) }

            case .alertDismissed:
                state.alert = nil
                return .none
            }
        }
    }
}

Checklist

  • Views under 50 lines; extract subviews for composition
  • Use @Observable (iOS 17+) over ObservableObject/@Published
  • Structured concurrency with async let for parallel work
  • Actors for shared mutable state (not locks/queues)
  • ViewModifiers for reusable styling patterns
  • Environment for dependency injection in SwiftUI
  • Task cancellation handled (check Task.isCancelled)
  • Preview providers for every view with mock data

Anti-Patterns

  • Massive views: 200+ line body property (extract subviews)
  • @StateObject in child views: use @State or pass as parameter
  • Blocking main thread with synchronous work in views
  • Force unwrapping optionals: use guard let or nil coalescing
  • Ignoring task cancellation: leaked work after view disappears
  • Using singletons instead of dependency injection (untestable)

© vibeeval, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/swift-patterns of vibeeval/vibecosystem.

Open the folder on GitHubat commit 3b763b1

Compare with similar skills

Swift Patterns next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Swift Patterns compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Swift Patterns this skillvibeeval/vibecosystem531—~1.8kAutomated safety check: PassMIT
Swift ExpertJeffallan/claude-skills12k—~1.5kAutomated safety check: PassMIT
Swift ExpertFNOSP/FlyNarwhal495—~813Automated safety check: PassAGPL-3.0
Swift Optimisepproenca/dot-skills214—~1.3kAutomated safety check: PassMIT
iOS Reviewplayer-ui/player101—~1.6kAutomated safety check: PassMIT
Anishelf Releasesamuelhe52/AniShelf140—~2kAutomated safety check: PassApache-2.0

Similar skills

  • Swift Expert

    Jeffallan/claude-skills

    Builds Swift apps for Apple platforms with SwiftUI, protocol-oriented design, async/await, actors and Sendable checks, verified with swift build and swift test.

    12k GitHub stars~1.5k tokensUpdated 4 days ago
    MobileAuto-check passed
  • Swift Expert

    FNOSP/FlyNarwhal

    A skill your agent uses when building iOS/macOS applications with Swift 5.9+, SwiftUI, or async/await concurrency.

    495 GitHub stars~813 tokensUpdated yesterday
    MobileAuto-check passed
  • Swift Optimise

    pproenca/dot-skills

    Swift 6.2 and SwiftUI performance optimization for iOS 26 clinic architecture codebases.

    214 GitHub stars~1.3k tokensUpdated 1 mo ago
    MobileAuto-check passed
  • iOS Review

    player-ui/player

    Review Swift/iOS code against team conventions. An agent skill from player-ui/player.

    101 GitHub stars~1.6k tokensUpdated yesterday
    MobileAuto-check passed
  • Anishelf Release

    samuelhe52/AniShelf

    Prepare and publish AniShelf source-control releases through validation, release commits, annotated tags, and the main-to-release pull request.

    140 GitHub stars~2k tokensUpdated today
    MobileAuto-check passed
  • View Refactor

    robinebers/openusage

    Refactor macOS SwiftUI views and scenes with strong defaults for small dedicated subviews, stable sidebar and selection structure, explicit command and toolbar ownership, scene-aware state, and…

    4.3k GitHub stars~1.4k tokensUpdated yesterday
    MobileAuto-check passed

More from vibeeval/vibecosystem

All 144 skills in this repo
  • Agent Benchmark

    vibeeval/vibecosystem

    Framework for measuring and tracking agent response quality over time.

    531 GitHub stars~2.9k tokensUpdated 2 mo ago
    Auto-check passed
  • Differential Review

    vibeeval/vibecosystem

    Security-focused differential code review with blast radius analysis, risk-adaptive depth (DEEP/FOCUSED/SURGICAL), git history correlation, and structured finding format.

    531 GitHub stars~1.6k tokensUpdated 2 mo ago
    Auto-check passed
  • Factcheck Guard

    vibeeval/vibecosystem

    A skill your agent uses when making any factual claim about the codebase — existence, absence, or behavior.

    531 GitHub stars~2.2k tokensUpdated 2 mo ago
    Auto-check passed
  • Fp Check

    vibeeval/vibecosystem

    Systematic false positive verification for security findings.

    531 GitHub stars~1.6k tokensUpdated 2 mo ago
    Auto-check passed
  • N8n Workflows

    vibeeval/vibecosystem

    n8n otomasyon workflow'lari. An agent skill from vibeeval/vibecosystem.

    531 GitHub stars~3.3k tokensUpdated 2 mo ago
    Auto-check passed
  • Notepad System

    vibeeval/vibecosystem

    A skill your agent uses when context compression is imminent, when resuming a session, or when preserving critical decisions across long tasks.

    531 GitHub stars~1.7k tokensUpdated 2 mo ago
    Auto-check passed

Works with

Questions about Swift Patterns

What does Swift Patterns do?

SwiftUI view composition, @Observable patterns, async/await concurrency, TCA architecture, and Combine reactive streams. Swift Patterns is an agent skill from vibeeval/vibecosystem. SwiftUI view composition, @Observable patterns, async/await concurrency, TCA architecture, and Combine reactive streams.

When should I use Swift Patterns?

Swift Patterns fits situations like: tasks that involve iOS development; tasks that involve Async programming.

How do I install Swift Patterns in Claude Code?

Run `npx skills add vibeeval/vibecosystem --skill swift-patterns -a claude-code`. Or copy the skill folder (skills/swift-patterns in vibeeval/vibecosystem) into .claude/skills/swift-patterns in your project. Claude Code loads it when a task matches its description.

How do I install Swift Patterns in Codex?

Run `npx skills add vibeeval/vibecosystem --skill swift-patterns -a codex`. Or copy the skill folder (skills/swift-patterns in vibeeval/vibecosystem) into .agents/skills/swift-patterns in your project. Codex loads it when a task matches its description.

Can I use Swift Patterns in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add vibeeval/vibecosystem --skill swift-patterns -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/swift-patterns, .gemini/skills/swift-patterns, .github/skills/swift-patterns and .opencode/skills/swift-patterns in your project.

What does Swift Patterns need to run?

SKILL.md names no scripts, command-line tools or credentials: Swift Patterns is instructions for the agent only.

Does Swift Patterns access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Swift Patterns safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Swift Patterns use?

Swift Patterns is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Swift Patterns use?

About 1.8k tokens (SKILL.md is roughly 7.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Swift Patterns?

Skills that share tags, products or a category with Swift Patterns: Swift Expert (Jeffallan/claude-skills, 12k stars), Swift Expert (FNOSP/FlyNarwhal, 495 stars), Swift Optimise (pproenca/dot-skills, 214 stars) and iOS Review (player-ui/player, 101 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Swift Patterns?

vibeeval (a GitHub user) maintains it in vibeeval/vibecosystem, which has 531 GitHub stars. The repository holds 144 skills in this directory. The repository was last updated on August 8, 2026.

Source: vibeeval/vibecosystem on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.