Agent skill

Swift Development

by sammcj in sammcj/agentic-coding

You MUST activate this skill when working on Swift projects. An agent skill from sammcj/agentic-coding.

Apache-2.0Auto-check passedMobile

Install Swift Development

skills CLI
$ npx skills add sammcj/agentic-coding --skill swift-development -a claude-code

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

GitHub CLI
$ gh skill install sammcj/agentic-coding swift-development --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/sammcj/agentic-coding.git skills-src && mkdir -p .claude/skills && cp -r skills-src/Skills/swift-development .claude/skills/swift-development && 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-development
GitHub stars
162
Token cost
~2.4k tokens
SKILL.md length
846 words
Files
5 (incl. references)
Skills in repo
62
Repo updated
First seen
Licence
Apache-2.0

At a glance

You MUST activate this skill when working on Swift projects. An agent skill from sammcj/agentic-coding.

  • Works in 5 steps: Clarity at point of use is paramount -… → Clarity over brevity - compact code… → Write documentation for every public… → …
  • Tasks that involve iOS development
  • SKILL.md covers Overview, When to Use This Skill, Core Guidelines and How to Use This Skill, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Swift Development is an agent skill from sammcj/agentic-coding. You MUST activate this skill when working on Swift projects

Its SKILL.md is about 2.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 5 other files, including reference files (for example `references/api-design.md`, `references/availability-patterns.md` and `references/concurrency.md`).

It sits in Mobile, covering iOS development. It works with Swift and macOS. The repository describes itself as: Agentic Coding Rules, Templates etc... The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve iOS development

Example prompts

  • “/swift-development”

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Clarity at point of use is paramount - evaluate designs by examining use cases, not just declarations
  2. Clarity over brevity - compact code comes from the type system, not minimal characters
  3. Write documentation for every public declaration - if you can't describe functionality simply, the API may be poorly designed
  4. Name by role, not type - var greeting = "Hello" not var string = "Hello"
  5. Favour elegance through simplicity - avoid over-engineering unless complexity genuinely warrants it

What it can do on your machine

Read from SKILL.md and the folder at commit 62ba5a2. 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 Development loads about 2.4k tokens when it runs, and up to ~12k if it reads all its reference files. Until then it costs about 19 tokens; SKILL.md has 846 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~19
When it runs · the whole SKILL.md, loaded when a task matches
~2.4k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~12k

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 sammcj/agentic-coding at commit 62ba5a2, republished under its Apache-2.0 licence (© sammcj). 846 words, ~2,387 tokens.

Download SKILL.mdSave it as .claude/skills/swift-development/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.
name
swift-development
description
You MUST activate this skill when working on Swift projects

Swift Best Practices Skill

Overview

Apply modern Swift development best practices focusing on Swift 6+ features, concurrency safety, API design principles, and code quality guidelines for iOS and macOS projects targeting macOS 15.7+.

When to Use This Skill

Use this skill when:

  • Writing new Swift code for iOS or macOS applications
  • Reviewing Swift code for correctness, safety, and style
  • Implementing Swift concurrency features (async/await, actors, MainActor)
  • Designing Swift APIs and public interfaces
  • Migrating code from Swift 5 to Swift 6
  • Addressing concurrency warnings, data race issues, or compiler errors related to Sendable/isolation
  • Working with modern Swift language features introduced in Swift 6 and 6.2

Core Guidelines

Fundamental Principles
  1. Clarity at point of use is paramount - evaluate designs by examining use cases, not just declarations
  2. Clarity over brevity - compact code comes from the type system, not minimal characters
  3. Write documentation for every public declaration - if you can't describe functionality simply, the API may be poorly designed
  4. Name by role, not type - var greeting = "Hello" not var string = "Hello"
  5. Favour elegance through simplicity - avoid over-engineering unless complexity genuinely warrants it
Swift 6 Concurrency Model

Swift 6 enables complete concurrency checking by default with region-based isolation (SE-0414). The compiler now proves code safety, eliminating many false positives whilst catching real concurrency issues at compile time.

Critical understanding:

  • Async ≠ background - async functions can suspend but don't automatically run on background threads
  • Actors protect mutable shared state through automatic synchronisation
  • @MainActor ensures UI-related code executes on the main thread
  • Global actor-isolated types are automatically Sendable
Essential Patterns
Async/Await
swift
// Parallel execution with async let
func fetchData() async -> (String, Int) {
    async let stringData = fetchString()
    async let intData = fetchInt()
    return await (stringData, intData)
}

// Always check cancellation in long-running operations
func process(_ items: [Item]) async throws -> [Result] {
    var results: [Result] = []
    for item in items {
        try Task.checkCancellation()
        results.append(await process(item))
    }
    return results
}
MainActor for UI Code
swift
// Apply at type level for consistent isolation
@MainActor
class ContentViewModel: ObservableObject {
    @Published var images: [UIImage] = []

    func fetchData() async throws {
        self.images = try await fetchImages()
    }
}

// Avoid MainActor.run when direct await works
await doMainActorStuff()  // Good
await MainActor.run { doMainActorStuff() }  // Unnecessary
Actor Isolation
swift
actor DataCache {
    private var cache: [String: Data] = [:]

    func store(_ data: Data, forKey key: String) {
        cache[key] = data  // No await needed inside actor
    }

    nonisolated func cacheType() -> String {
        return "DataCache"  // No await needed - doesn't access isolated state
    }
}
Common Pitfalls to Avoid
  1. Don't mark functions as async unnecessarily - async calling convention has overhead
  2. Never use DispatchSemaphore with async/await - risk of deadlock
  3. Don't create stateless actors - use non-isolated async functions instead
  4. Avoid split isolation - don't mix isolation domains within one type
  5. Check task cancellation - long operations must check Task.checkCancellation()
  6. Don't assume async means background - explicitly move work to background if needed
  7. Avoid excessive context switching - group operations within same isolation domain
AppKit Gotchas

Menu-bar app windows open behind everything / hide on click-away. Two separate causes, usually hit together:

  • .accessory activation policy means the app is never brought forward when a window opens.
  • SwiftUI's Settings scene is an NSPanel, which in an accessory app defaults to hidesOnDeactivate = true.

Fix both: switch to .regular while the window is open, clear hidesOnDeactivate, then revert on NSWindow.willCloseNotification.

swift
NSApp.setActivationPolicy(.regular)
NSApp.activate()
openSettings()
DispatchQueue.main.async {          // window does not exist until SwiftUI opens it
    guard let w = NSApp.windows.first(where: {
        $0.identifier?.rawValue.hasPrefix("com_apple_SwiftUI_Settings") == true }) else { return }
    w.hidesOnDeactivate = false
    w.makeKeyAndOrderFront(nil)
    w.orderFrontRegardless()
}
// On willCloseNotification: NSApp.setActivationPolicy(.accessory)

Cost: a Dock icon while the window is open. SettingsLink cannot do this - it has no action hook, so use @Environment(\.openSettings).

JSONEncoder.dateEncodingStrategy = .iso8601 truncates to whole seconds. Silently breaks any sub-second timing logic. Use .custom with ISO8601DateFormatter + .withFractionalSeconds.

API Design Quick Reference
Naming Conventions
  • Types/protocols: UpperCamelCase
  • Everything else: lowerCamelCase
  • Protocols describing capabilities: -able, -ible, -ing suffixes (Equatable, ProgressReporting)
  • Factory methods: Begin with make (x.makeIterator())
  • Mutating pairs: imperative vs past participle (x.sort() / x.sorted())
Method Naming by Side Effects
  • No side effects: Noun phrases (x.distance(to: y))
  • With side effects: Imperative verbs (x.append(y), x.sort())
Show full SKILL.md (350 more words)Show less
Argument Labels
  • Omit when arguments can't be distinguished: min(number1, number2)
  • Value-preserving conversions omit first label: Int64(someUInt32)
  • Prepositional phrases label at preposition: x.removeBoxes(havingLength: 12)
  • Label all other arguments
Swift 6 Breaking Changes
Must Explicitly Mark Types with @MainActor (SE-0401)

Property wrappers no longer infer actor isolation automatically.

swift
@MainActor
struct LogInView: View {
    @StateObject private var model = ViewModel()
}
Global Variables Must Be Concurrency-Safe (SE-0412)
swift
static let config = Config()  // Constant - OK
@MainActor static var state = State()  // Actor-isolated - OK
nonisolated(unsafe) var cache = [String: Data]()  // Unsafe - use with caution
Other Changes
  • @UIApplicationMain/@NSApplicationMain deprecated (use @main)
  • any required for existential types
  • Import visibility requires explicit access control
API Availability Patterns
swift
// Basic availability
@available(macOS 15, iOS 18, *)
func modernAPI() { }

// Deprecation with message
@available(*, deprecated, message: "Use newMethod() instead")
func oldMethod() { }

// Renaming with auto-fix
@available(*, unavailable, renamed: "newMethod")
func oldMethod() { }

// Runtime checking
if #available(iOS 18, *) {
    // iOS 18+ code
}

// Inverted checking (Swift 5.6+)
if #unavailable(iOS 18, *) {
    // iOS 17 and lower
}

Key differences:

  • deprecated - Warning, allows usage
  • obsoleted - Error from specific version
  • unavailable - Error, completely prevents usage

How to Use This Skill

When Writing Code
  1. Apply naming conventions following role-based, clarity-first principles
  2. Use appropriate isolation (@MainActor for UI, actors for mutable state)
  3. Implement async/await patterns correctly with proper cancellation handling
  4. Follow Swift 6 concurrency model - trust compiler's flow analysis
  5. Document public APIs with clear, concise summaries
When Reviewing Code
  1. Check for concurrency safety violations
  2. Verify proper actor isolation and Sendable conformance
  3. Ensure async functions handle cancellation appropriately
  4. Validate API naming follows Swift guidelines
  5. Confirm availability annotations are correct for target platforms
Code Quality Standards
  • Minimise comments - code should be self-documenting where possible
  • Avoid over-engineering and unnecessary abstractions
  • Use meaningful variable names based on role, not type
  • Follow established project architecture and patterns
  • Prefer count(where:) over filter().count
  • Use InlineArray for fixed-size, performance-critical data
  • Trust compiler's concurrency flow analysis - avoid unnecessary Sendable conformances

Resources

references/

Detailed reference material to load when in-depth information is needed:

  • api-design.md - Complete API design conventions, documentation standards, parameter guidelines, and naming patterns
  • concurrency.md - Detailed async/await patterns, actor best practices, common pitfalls, performance considerations, and thread safety patterns
  • swift6-features.md - New language features in Swift 6/6.2, breaking changes, migration strategies, and modern patterns
  • availability-patterns.md - Comprehensive @available attribute usage, deprecation strategies, and platform version management

Load these references when detailed information is needed beyond the core guidelines provided above.

Platform Requirements

  • Swift 6.0+ compiler for Swift 6 features
  • Swift 6.2+ for InlineArray and enhanced concurrency features
  • macOS 15.7+ with appropriate SDK
  • iOS 18+ for latest platform features
  • Use #available for runtime platform detection
  • Use @available for API availability marking

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

Files

SKILL.md and 4 other files (references) in Skills/swift-development of sammcj/agentic-coding.

  • SKILL.md
  • references/api-design.md
  • references/availability-patterns.md
  • references/concurrency.md
  • references/swift6-features.md

Open the folder on GitHubat commit 62ba5a2

Compare with similar skills

Swift Development 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 Development compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Swift Development this skillsammcj/agentic-coding162—~2.4kAutomated safety check: PassApache-2.0
macOS Spm App PackagingDimillian/Skills4k5 repos~1.2kAutomated safety check: PassMIT
macOS DevelopmentKartikLabhshetwar/better-shot2.4k2 repos~735Automated safety check: PassCustom licence
Snapshot Testsmicrosoft/SwiftStreamingMarkdown378—~2.2kAutomated safety check: PassMIT
Write SwiftKartikLabhshetwar/better-shot2.4k4 repos~10kAutomated safety check: PassCustom licence
Build Run Debugrobinebers/openusage4.3k—~1.8kAutomated safety check: PassMIT

Similar skills

  • macOS Spm App Packaging

    Dimillian/Skills

    Scaffold, build, and package SwiftPM-based macOS apps without an Xcode project.

    4k GitHub starsUsed in 5 repos~1.2k tokens
    MobileAuto-check passed
  • macOS Development

    KartikLabhshetwar/better-shot

    Comprehensive macOS development guidance including Swift 6+, SwiftUI, SwiftData, architecture patterns, AppKit bridging, and macOS 26 Tahoe APIs.

    2.4k GitHub starsUsed in 2 repos~735 tokens
    MobileAuto-check passed
  • Snapshot Tests

    microsoft/SwiftStreamingMarkdown

    Official

    Record and validate swift-snapshot-testing snapshots in the SwiftStreamingMarkdown package: regenerate reference PNGs, run snapshot tests, and diff failed snapshots.

    378 GitHub stars~2.2k tokensUpdated 13 days ago
    MobileAuto-check passed
  • Write Swift

    KartikLabhshetwar/better-shot

    How to write modern Swift well — modeling with value types, Swift 6 data-race safety and approachable concurrency (@concurrent, main-actor-by-default, actors, task groups), protocols and generics…

    2.4k GitHub starsUsed in 4 repos~10k tokens
    MobileAuto-check passed
  • Build Run Debug

    robinebers/openusage

    Build, run, and debug local macOS apps and desktop executables using shell-first Xcode and Swift workflows.

    4.3k GitHub stars~1.8k tokensUpdated 2 days ago
    MobileAuto-check passed
  • Bootstrap iOS

    RayFernando1337/rayfernando-skills

    Bootstrap agents for iOS, iPadOS, macOS, Swift, SwiftUI, SwiftData/Core Data, Swift Testing, Xcode build/test/debug, Simulator, App Intents, or XcodeBuildMCP work.

    130 GitHub stars~1.1k tokensUpdated 2 mo ago
    MobileAuto-check passed

More from sammcj/agentic-coding

All 62 skills in this repo
  • Yue2 Music

    sammcj/agentic-coding

    A skill your agent uses when generating songs with YuE2, covering a recording via SheetSage2 audio-to-ABC, editing a score or lyrics with melody preservation, or building a reproducible listening…

    162 GitHub stars~2.3k tokensUpdated today
    Auto-check passed
  • Bento Slides

    sammcj/agentic-coding

    A skill your agent uses when creating or editing Bento (.bento.html) slide decks, including any request for a single-file HTML slide deck.

    162 GitHub stars~2.9k tokensUpdated today
    Auto-check passed
  • Idrive Backup

    sammcj/agentic-coding

    A skill your agent uses whenever the user wants you to manage, discuss or diagnose iDrive Backup configuration on macOS

    162 GitHub stars~1.7k tokensUpdated today
    Auto-check: notes
  • Piper Tts Training

    sammcj/agentic-coding

    Train custom TTS voices for Piper (ONNX format) using fine-tuning or from-scratch approaches.

    162 GitHub stars~1.4k tokensUpdated today
    Auto-check passed
  • PPTX To Md

    sammcj/agentic-coding

    Convert a PPTX slide deck into per-slide markdown that preserves both the verbatim text and the meaning of embedded screenshots, diagrams and charts in their original layout positions.

    162 GitHub stars~1.8k tokensUpdated today
    Auto-check passed
  • Skill Creator Primer

    sammcj/agentic-coding

    You MUST load this skill before the skill-creator skill AND before making ANY change to, or conducting a review of ANY Agent Skill.

    162 GitHub stars~9.8k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Swift Development

What does Swift Development do?

You MUST activate this skill when working on Swift projects. An agent skill from sammcj/agentic-coding. Swift Development is an agent skill from sammcj/agentic-coding.

When should I use Swift Development?

Swift Development fits situations like: tasks that involve iOS development.

How do I install Swift Development in Claude Code?

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

How do I install Swift Development in Codex?

Run `npx skills add sammcj/agentic-coding --skill swift-development -a codex`. Or copy the skill folder (Skills/swift-development in sammcj/agentic-coding) into .agents/skills/swift-development in your project. Codex loads it when a task matches its description.

Can I use Swift Development 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 sammcj/agentic-coding --skill swift-development -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-development, .gemini/skills/swift-development, .github/skills/swift-development and .opencode/skills/swift-development in your project.

What does Swift Development need to run?

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

Does Swift Development 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 Development 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 Development use?

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

How many tokens does Swift Development use?

About 2.4k tokens (SKILL.md is roughly 9.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 10k tokens, read only when the agent opens those files.

What are the alternatives to Swift Development?

Skills that share tags, products or a category with Swift Development: macOS Spm App Packaging (Dimillian/Skills, 4k stars), macOS Development (KartikLabhshetwar/better-shot, 2.4k stars), Snapshot Tests (microsoft/SwiftStreamingMarkdown, 378 stars) and Write Swift (KartikLabhshetwar/better-shot, 2.4k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Swift Development?

sammcj (a GitHub user) maintains it in sammcj/agentic-coding, which has 162 GitHub stars. The repository holds 62 skills in this directory. The repository was last updated on October 7, 2026.

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