mcpField
S
swift-optimise

swift-optimise

github.com/pproencaDevelopment218282 installsUpdated 11w ago
Repository

About swift-optimise

A performance guide for developers building Swift and SwiftUI applications, with 19 rules covering concurrency, rendering, scrolling, and animation. It targets iOS 26 and Swift 6.2 and assumes a specified modular MVVM-C architecture.

Key features

  1. 0119 rules in three categories
  2. 02Swift 6 concurrency guidance
  3. 03SwiftUI rendering and scrolling
  4. 04Animation performance practices
  5. 05Assumes modular MVVM-C architecture

Use cases

  1. 01Migrate code to Swift 6 concurrency
  2. 02Replace Combine publishers with async/await
  3. 03Improve scrolling and rendering performance
  4. 04Review SwiftUI animation implementations

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/pproenca/dot-skills --skill swift-optimise

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

Bundled files

References and scripts installed along with SKILL.md.

metadata.json
assets/templates/
_template.md
references/
_sections.md
anim-gesture-driven.md
anim-matchedgeometry.md
anim-spring.md
anim-transition-effects.md
anim-with-animation.md
conc-actor-for-shared-state.md
conc-asyncsequence-streams.md
conc-combine-to-async.md
conc-mainactor-isolation.md
conc-swift6-sendable.md
conc-task-id-pattern.md
perf-async-image.md
perf-canvas-timeline.md
perf-drawinggroup.md
perf-equatable-views.md
perf-instruments-profiling.md
perf-lazy-containers.md
perf-task-modifier.md
perf-view-decomposition.md

Details

From the project README

Apple Swift/SwiftUI Performance Optimization Best Practices

Comprehensive guide for Swift and SwiftUI performance optimization. Contains 19 rules across 3 categories covering modern concurrency, render performance, and animation performance. Targets iOS 26 / Swift 6.2 with @Observable and Swift 6 strict concurrency.

Clinic Architecture Contract (iOS 26 / Swift 6.2)

All guidance in this skill assumes the clinic modular MVVM-C architecture:

  • Feature modules import Domain + DesignSystem only (never Data, never sibling features)
  • App target is the convergence point and owns DependencyContainer, concrete coordinators, and Route Shell wiring
  • Domain stays pure Swift and defines models plus repository, *Coordinating, ErrorRouting, and AppError contracts
  • Data owns SwiftData/network/sync/retry/background I/O and implements Domain protocols
  • Read/write flow defaults to stale-while-revalidate reads and optimistic queued writes
  • ViewModels call repository protocols directly (no default use-case/interactor layer)

When to Apply

Reference these guidelines when:

  • Migrating to Swift 6 strict concurrency (Sendable, actor isolation)
  • Replacing Combine publishers with async/await
  • Implementing @MainActor isolation and actor-based concurrency
  • Decomposing views to reduce state invalidation blast radius
  • Optimizing scroll and render performance with lazy containers
  • Using Canvas/TimelineView for high-performance rendering
  • Profiling with SwiftUI Instruments before optimizing
  • Building performant spring animations and transitions

Rule Categories by Priority

PriorityCategoryImpactPrefix
1Concurrency & AsyncCRITICALconc-
2Render & Scroll PerformanceHIGHperf-
3Animation PerformanceMEDIUManim-

Quick Reference

1. Concurrency & Async (CRITICAL)
2. Render & Scroll Performance (HIGH)
3. Animation Performance (MEDIUM)

How to Use

Read individual reference files for detailed explanations and code examples:

Reference Files

FileDescription
references/_sections.mdCategory definitions and ordering
assets/templates/_template.mdTemplate for new rules

Comments

Markdown supported