Skip to content
Back to skills

apple-engineer-superpowers

ASecurity

Use when writing Swift code for Apple platforms - iOS, macOS, visionOS. Covers Swift 6 concurrency, actors, Sendable, async/await, SwiftUI, MVVM architecture, Metal GPU programming, RealityKit ECS, visionOS scenes, interpolation/animation, advanced collection types, property wrappers, Combine bridging, error handling, testing, and API design patterns.

  • 28 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added May 26, 2026
developmentswiftreacttestingapi

Works with

  • api

Security analysis

A100/100

Pro scans all 10 files and shows the line behind each finding

Scanned May 27, 2026

npx -y skills add piemonte/apple-engineer-superpowers --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of apple-engineer-superpowers?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for apple-engineer-superpowers
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/piemonte-apple-engineer-superpowers/badge)](https://www.skillsdirectory.com/skills/piemonte-apple-engineer-superpowers)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: apple-engineer-superpowers
description: Use when writing Swift code for Apple platforms - iOS, macOS, visionOS. Covers Swift 6 concurrency, actors, Sendable, async/await, SwiftUI, MVVM architecture, Metal GPU programming, RealityKit ECS, visionOS scenes, interpolation/animation, advanced collection types, property wrappers, Combine bridging, error handling, testing, and API design patterns.
---

# Apple Platform Engineering

Comprehensive Swift engineering standards for building production-quality Apple platform applications.

## Core Principles

1. **No Force Unwrapping (`!`)** - Use `guard let`, `if let`, nil coalescing (`??`), or optional chaining. Never crash on nil.
2. **Actor-First Concurrency** - Use actors as the default for stateful components. Prefer actor isolation over manual locking.
3. **Async/Await Always** - Never use completion handlers in new code. Use `async throws` functions.
4. **Sendable Everything** - All shared types must conform to `Sendable`. All closures crossing concurrency boundaries must be `@Sendable`.
5. **Swift 6 Strict Concurrency** - Enable `StrictConcurrency` from the start. No data races.
6. **Protocol-Oriented Design** - Define contracts through protocols. Use dependency injection for testability.
7. **LocalizedError for Errors** - Domain-specific error enums conforming to `LocalizedError, Sendable`.

## Quick Reference

### Safe Optional Handling

| Instead of | Use |
|------------|-----|
| `value!` | `guard let value else { return }` |
| `string.data(using: .utf8)!` | `string.data(using: .utf8) ?? Data()` |
| `url!` | `guard let url = URL(string: s) else { return }` |
| `object.property!` | `object.property?.method()` or `if let prop = object.property { }` |

### Concurrency Primitives

| Need | Use |
|------|-----|
| Stateful shared component | `actor` |
| Simple value protection | `Mutex<State>` |
| Low-level sync | `OSAllocatedUnfairLock` |
| UI state management | `@MainActor` on ViewModels |
| Progress/events stream | `AsyncStream` / `AsyncThrowingStream` |
| Multi-subscriber broadcast | `AsyncBroadcastChannel` or `AsyncNotifier` |

### Actor vs @MainActor Decision

| Scenario | Use |
|----------|-----|
| API service, data operations | `actor` |
| ViewModel with `@Published` | `@MainActor final class: ObservableObject` |
| Service with `@Published` properties Views observe | `@MainActor ObservableObject` (rare) |
| Pure data model | `struct: Sendable` |

### Error Handling Pattern

```swift
enum ServiceError: LocalizedError, Sendable {
    case operationFailed(String)

    var errorDescription: String? {
        switch self {
        case .operationFailed(let msg): return "Operation failed: \(msg)"
        }
    }
}
```

### API Design

| Pattern | Use |
|---------|-----|
| `func work() async throws -> T` | Standard async operation |
| `func work() -> AsyncThrowingStream<Event, Error>` | Progress/event reporting |
| `func work(progress: @Sendable (Float) -> Void) async throws -> T` | Simple progress callback |

### Metal GPU Quick Reference

| Need | Use |
|------|-----|
| Compute pipeline | `MTLComputePipelineDescriptor` + `device.makeComputePipelineState` |
| Render pipeline | `MTLRenderPipelineDescriptor` + vertex/fragment functions |
| Buffer management | `MetalBuffer<Element>` generic wrapper |
| Multi-frame pipelining | Ring buffer (pool of 3) with `tick()` |
| Texture from IOSurface | `device.makeTexture(descriptor:iosurface:plane:)` |
| Threadgroup sizing | `min(elementCount, pipelineState.maxTotalThreadsPerThreadgroup)` |

### RealityKit/visionOS Quick Reference

| Need | Use |
|------|-----|
| Custom entity data | `struct: Component` |
| Per-frame logic | `class: System` with scene subscriptions |
| Show entities in SwiftUI | `RealityView { content in content.add(entity) }` |
| Observe component changes | `entity.componentChangePublisher(T.self)` |
| Full immersion | `ImmersiveSpace(id:) { }.immersionStyle(.full)` |
| Multi-window | `WindowGroup(id:)` with `WindowPlacement` |

### Advanced Patterns Quick Reference

| Need | Use |
|------|-----|
| Smooth value tracking | `ExponentialDamper<T: Lerpable>` |
| Generic interpolation | `Lerpable` protocol with `lerp(from:to:blend:)` |
| Non-empty guarantee | `NonEmpty<C: Collection>` |
| Enum-keyed storage | `Table<E: CaseIterable, V>` |
| Multi-consumer async | `AsyncBroadcastChannel` with back-pressure |
| Combine to async | `publisher.sinkSingleValue() async throws` |
| Custom defaults | `@DefaultValue<T>` property wrapper |

## Detailed References

- **swift-concurrency.md** — Swift 6 concurrency patterns: actors, Sendable, AsyncSequence, task cancellation, synchronization, state machines, reactive patterns, generics, persistence, networking, testing, diagnostics
- **swiftui-architecture.md** — SwiftUI app architecture: MVVM, ViewModel/View guidelines, service layer patterns, data flow, App Intents, file organization
- **metal-graphics.md** — Metal GPU programming: pipelines, buffers, textures, compute dispatch, ring buffers, shaders, frame pacing
- **realitykit-visionos.md** — RealityKit ECS and visionOS: entities, components, systems, scene subscriptions, immersive spaces, windows, hand tracking
- **advanced-swift-patterns.md** — Property wrappers, interpolation/animation, collection types, Combine bridging, advanced async abstractions, @dynamicMemberLookup

Files in this skill

  • .claude-plugin/marketplace.json1023 B
  • .claude-plugin/plugin.json574 B
  • .codex/INSTALL.md1.5 KB
  • .cursor-plugin/plugin.json631 B
  • SKILL.md5.3 KB
  • advanced-swift-patterns.md27.4 KB
  • metal-graphics.md17.3 KB
  • realitykit-visionos.md14.8 KB
  • swift-concurrency.md17.9 KB
  • swiftui-architecture.md11 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.