mcpField
S
swift-core

swift-core

github.com/fusengineDevelopment3441 installsUpdated 2w ago
Repository

About swift-core

A fundamentals skill for Swift 6 developers working across Apple platforms. It covers concurrency, architecture, testing, localization, and profiling, with references for each topic.

Key features

  1. 01Swift 6 concurrency and safe types
  2. 02MVVM and Clean Architecture
  3. 03Async XCTest testing
  4. 04String Catalog localization
  5. 05Performance profiling with Instruments

Use cases

  1. 01Implement async/await and actors
  2. 02Plan Swift app architecture
  3. 03Write asynchronous XCTest tests
  4. 04Localize interfaces and profile performance

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/fusengine/agents --skill swift-core

After installing, type/swift-corein Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
architecture.md
concurrency.md
i18n.md
performance.md
testing.md

Details

From the project README
Covers Swift 6 language and platform fundamentals shared across iOS, macOS, iPadOS, watchOS, and visionOS: async/await and actors with strict concurrency checking, Sendable typing, app architecture (MVVM with @Observable as the recommended default, Clean Architecture for complex apps), async testing with XCTest, String Catalog-based localization, and performance profiling with Instruments.

References cover each area in depth: concurrency, architecture/DI, testing, i18n, and performance.

Best practices: prefer actors over classes with locks for shared state, @Observable over ObservableObject, structured concurrency over completion handlers, String Catalogs for all user-facing text, profiling in Release (-O) builds, and value types (structs) over classes where possible.

Swift Core

Swift 6 fundamentals shared across all Apple platforms.

Agent Workflow (MANDATORY)

Before ANY implementation, spawn 3 agents in parallel, one Agent call each with a name:

  1. fuse-ai-pilot:explore-codebase - Analyze existing Swift patterns
  2. fuse-ai-pilot:research-expert - Verify latest Swift 6 docs via Context7/Exa
  3. mcp__apple-docs__search_apple_docs - Check Swift concurrency patterns

After implementation, run fuse-ai-pilot:sniper for validation.


Overview

When to Use
  • Implementing async/await, actors, Sendable
  • Designing app architecture (MVVM, Clean Architecture)
  • Writing async tests with XCTest
  • Localizing with String Catalogs
  • Profiling with Instruments
Why Swift Core
FeatureBenefit
ActorsThread-safe shared state without locks
@ObservableSimple reactive state (replaces ObservableObject)
String CatalogsAutomatic localization with Xcode 15+
InstrumentsBuilt-in performance profiling

Key Concepts

Concurrency (Swift 6)

Modern async/await with strict concurrency checking. Actors provide thread-safe state, Sendable marks safe types.

Architecture

MVVM with @Observable is the recommended pattern. Clean Architecture for complex apps with domain separation.

Testing

XCTest with native async/await support. No need for expectations with async tests.

Internationalization

String Catalogs are mandatory. All user-facing text must be localized.

Performance

Profile with Instruments. Use lazy loading, avoid heavy work in view body.


Reference Guide

NeedReference
Async/await, actors, Sendableconcurrency.md
MVVM, Clean Architecture, DIarchitecture.md
XCTest, async tests, mockingtesting.md
String Catalogs, localizationi18n.md
Instruments, optimizationperformance.md

Best Practices

  1. Actors for shared state - Prefer actors over classes with locks
  2. @Observable over ObservableObject - Simpler, better performance
  3. Structured concurrency - async/await, no completion handlers
  4. String Catalogs - ALL user-facing text must be localized
  5. Profile in Release - Always profile with -O optimization
  6. Value types - Prefer structs over classes

Comments

Markdown supported