Skip to main content
skill CX Codex

swift · margelo — Claude Code skill: Swift API design and concurrency

A skill for Swift work: type-safe API design, concurrency choices, Apple-platform integration. Fires when edits touch .swift files, async/await, DispatchQueue, or Nitro Modules.

no license 1,300 installs ★ 181 updated 2026-08-21

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add margelo/react-native-skills --skill swift -a claude-code
Open on GitHub

What swift does

The skill sets a workflow for Swift code: read local files and generated protocols first, then pick a public type model, then commit to one concurrency model. Synchronous properties and methods stay cheap and nonblocking. Queue hops, I/O, and fallible work belong in the API, not behind it.

Type-safe design is the core. States should be expressed through types, not clusters of optionals. Closed sets get an enum with associated values; shared contracts get protocols with conforming structs. Related fields live on the same variant, so the compiler rejects meaningless combinations before they happen.

On concurrency the rule is blunt: either Swift concurrency or DispatchQueue, not both interleaved. DispatchQueue.sync is treated as a bug, especially inside getters and setters. Quick local work does not get wrapped in Task just because async exists. For Nitro Modules, the skill points to build-nitro-modules for generated specs and Promise mapping.

What it helps with

  • design a Swift state model without optional-field clusters
  • commit to one concurrency model before implementation
  • stop getters from running expensive or fallible work
  • cut redundant hops between main, background, and JS queues
  • review Nitro Module Swift code for thread boundaries

Example prompts for the agent

  • Design the type model for the scanner: text, barcode, and face as separate variants
  • Check this Swift class for unnecessary queue hops
  • Rework the getter that triggers a hardware scan into an async method

How to install swift

1Skills CLI (Vercel)

npx skills add margelo/react-native-skills --skill swift -a claude-code

2Manually: put the files in place

~/.claude/skills/swift/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/swift/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about swift

How do I install swift in Claude Code?

Run npx skills add margelo/react-native-skills --skill swift -a claude-code. The skill lands in ~/.claude/skills/swift/SKILL.md.

What does the swift skill do?

It gives rules for Swift API design and threading. It pushes type-safe state modeling, one concurrency model per feature, and no expensive work hidden behind properties.

How is it different from build-nitro-modules?

swift covers plain Swift: types, async/await, queues. build-nitro-modules handles generated specs, Promise mapping, and HybridObject constraints. Pair them for Nitro Module work.

Similar skills

All skills for Programming languages →

swift by other authors comes first.

swift Mindrally Guides your agent to write clean Swift and SwiftUI code for iOS, macOS, watchOS, and tvOS using the MVVM pattern. CX Codex +1 748installs swift wendylabsinc Topic notes on Swift configuration, logging, swift-otel, testing and strict memory safety that the agent pulls in when the work touches that code. CX Codex +1 ★ 64repo stars swift-concurrency Prisma-Labs-Dev A reference skill for Swift Concurrency: async/await, Task, TaskGroup, actors, AsyncSequence and continuation bridges. Useful when the agent writes async Swift code. CX Codex +1 752installs guide-swift-concurrency Prisma-Labs-Dev guide-swift-concurrency guides AI agents through reviewing and writing concurrent Swift 6.2 code under strict concurrency checks. It flags actor reentrancy bugs, unsafe tasks, and GCD patterns. CX Codex +1 539installs swift-concurrency-pro Paul Hudson swift-concurrency-pro reviews Swift code for concurrency correctness, modern API usage and common async/await pitfalls. Useful when reading or reviewing async code. CX Codex +1 13,100installs migrating-to-swift-concurrency kylehughes migrating-to-swift-concurrency supplies Apple's Swift Concurrency Migration Guide to your agent. Helps resolve data races, fix Sendable errors, and switch to Swift 6. CX Codex +1 ★ 58repo stars swift-expert https://github.com/Jeffallan swift-expert — a Swift skill that walks the agent through architecture, SwiftUI state, async/await and actors, with build checks in between. Built for iOS and macOS work. CX Codex +1 4,500installs swift-concurrency-expert Dimillian swift-concurrency-expert is a Claude Code skill for reviewing and fixing concurrency issues in Swift 6.2+, including Sendable, actor isolation, and migrating completion handlers to async/await. CX Codex +1 2,100installs

From the same set9

build-nitro-modules build-nitro-modules walks through building a React Native Nitro Module: HybridObject TypeScript specs, nitrogen codegen, native Swift, Kotlin and C++ implementations. CX Codex +1 1,700installs react-native-mmkv Works in Codex, Cursor, Copilot, Gemini CLI and OpenCode too. It keeps AI assistants on the real react-native-mmkv API — a synchronous key-value store built on the MMKV engine. CX Codex +1 1,700installs api-design The api-design skill shapes and reviews public APIs for TypeScript, JavaScript, React, and React Native libraries before implementation. CX Codex +1 1,400installs cpp Sets rules for C++ design: type modeling, ownership, file boundaries and async. Fits .cpp, .hpp, CMake and C++-backed Nitro modules. CX Codex +1 1,300installs kotlin A skill for Kotlin and Android API work: it pushes typed state modeling, explicit async boundaries, and keeps blocking calls out of properties. Useful when you touch .kt files or a Nitro Module wrapper. CX Codex +1 1,300installs react-native-vision-camera react-native-vision-camera — a routing skill for VisionCamera v5 in React Native: it tells the agent which reference to load for the task and which v5 rules to respect. CX Codex +1 776installs nitro-fetch Points AI assistants at the real react-native-nitro-fetch APIs instead of invented ones: fetch, WebSocket, TextDecoder, prefetching. CX Codex +1 668installs react-native-vision-camera-realtime react-native-vision-camera-realtime guides low-latency VisionCamera v5 architecture for real-time video processing. It helps implement zero-copy GPU paths, Nitro plugins, and Skia or WebGPU overlays. CX Codex +1 147installs

Project sponsors

Companies that keep this analytics open