Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

ios-swift-expert

БесплатноБез исполняемых скриптовНе проверен

This skill should be used when the user asks to "build an iOS app", "build a macOS app", "create a view controller", "create a SwiftUI view", "fix Xcode build…

sjunglingот sjungling★ 15 звёзд на GitHub106 установок в других каталогах

Об этом скилле

iOS and macOS Development Expert

Overview

Core principle: Follow Apple's Human Interface Guidelines, Swift API Design Guidelines, and modern iOS development best practices while writing clean, performant, memory-safe code.

When to Use

Automatically activates when:

  • Working with .swift source files
  • Opening or modifying Xcode projects (.xcodeproj, .xcworkspace)
  • Editing UIKit/AppKit view controllers or SwiftUI views
  • Implementing iOS/macOS frameworks (Core Data, Combine, UIKit, AppKit, SwiftUI, etc.)
  • Debugging Xcode build errors or runtime issues
  • Designing app architectures (MVVM, MVI, Clean Architecture)
  • Optimizing performance or fixing memory leaks
  • Implementing accessibility, localization, or privacy features
  • Configuring app targets, build settings, or project structure

Manual invocation when:

  • User explicitly asks about Swift language features
  • User needs guidance on Apple platform APIs
  • User requests iOS/macOS development best practices
  • User encounters Apple platform-specific problems

When NOT to Use This Skill

Do not use this skill for:

  • General programming questions unrelated to Apple platforms
  • Backend server development (unless using Vapor/Swift on server)
  • Cross-platform mobile development (React Native, Flutter, Kotlin Multiplatform)
  • Web development (unless WebKit/Safari specific or Swift for WebAssembly)
  • Android development
  • Desktop development on non-Apple platforms

Core Expertise

Decision Frameworks

UI Framework Selection:

  • iOS/iPadOS apps: prefer UIKit as the primary UI framework
  • macOS apps: prefer AppKit as the primary UI framework
  • Match the existing codebase: if a project is already SwiftUI-based, stay consistent rather than mixing paradigms
  • Use SwiftUI where the platform requires it (widgets, Live Activities, watchOS, App Intents UI) or for simple, self-contained views where it clearly reduces effort
  • Bridge SwiftUI into UIKit/AppKit via UIHostingController/NSHostingView — host SwiftUI inside the native app shell, not the reverse

State Management (when working in SwiftUI code):

  • @State: local value types
  • @StateObject: reference types created by the view
  • @EnvironmentObject: dependency injection across hierarchy
  • @Observable (iOS 17+): preferred for new code

Concurrency:

  • Use async/await, not completion handlers
  • Use actors for shared mutable state
  • Use MainActor for UI updates
  • Use TaskGroup for parallel work

Data Persistence:

  • SwiftData (iOS 17+): preferred for new projects
  • Core Data: existing projects or compatibility needs
  • Keychain: credentials and sensitive data only

Architecture:

  • MVVM + Coordinator: default for UIKit/AppKit apps
  • MVVM: default for SwiftUI code
  • Clean Architecture: multi-team projects with heavy testing

Development Workflow

1. Build Verification

Verify builds with the Xcode MCP BuildProject tool when available (see /build-and-run); otherwise fall back to xcodebuild -scheme <scheme> build -quiet and check the exit code.

2. Code Standards

Follow Swift API Design Guidelines. Key conventions:

  • UpperCamelCase for types, lowerCamelCase for functions/variables
  • Default to private; only expose what's needed
  • Use // MARK: - to organize: properties, init, lifecycle, public, private
  • Use [weak self] in escaping closures; break retain cycles between parent/child

3. Testing Requirements

Write testable code with appropriate coverage:

Unit Tests:

  • Test business logic, view models, data transformations
  • Mock network/database dependencies
  • Use dependency injection for testability
  • Aim for >80% coverage on critical paths

UI Tests:

  • Test critical user flows (login, purchase, main features)
  • Use accessibility identifiers for reliable element selection
  • Keep UI tests fast and focused

4. Performance Considerations

Optimize for user experience:

Rendering Performance:

  • Keep view hierarchies shallow
  • Avoid expensive operations in body (SwiftUI) or layoutSubviews (UIKit)
  • Profile with Instruments (Time Profiler, SwiftUI view body)
  • Lazy-load content, virtualize lists

Memory Management:

  • Release large objects when no longer needed
  • Monitor memory warnings and respond appropriately
  • Profile with Instruments (Allocations, Leaks)
  • Avoid strong reference cycles

Battery Life:

  • Minimize location services usage
  • Batch network requests
  • Use background modes judiciously
  • Profile with Instruments (Energy Log)

Performance Profiling:

Use xctrace to capture Instruments traces from CLI: xctrace record --template 'Time Profiler' --attach <pid> --output trace.trace --time-limit 10s. Key templates: Time Profiler (CPU), Allocations (memory), SwiftUI (view renders), Animation Hitches (frame drops).

See ./references/debugging-strategies.md for detailed profiling workflows and analysis patterns.

5. Apple Platform Best Practices

Follow Apple's official guidelines for:

  • Human Interface Guideli
Полный SKILL.md на GitHub

Установить ios-swift-expert в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

references/apple-guidelines.mdreferences/code-examples.mdreferences/debugging-strategies.mdreferences/patterns.md

FAQ

Что делает скилл ios-swift-expert?

This skill should be used when the user asks to "build an iOS app", "build a macOS app", "create a view controller", "create a SwiftUI view", "fix Xcode build errors", "implement Core Data", "design app architecture", or "optimize Swift performance". Automatically activates when working with .swift files, Xcode projects (.xcodeproj, .xcworkspace), UIKit or AppKit interfaces, SwiftUI views, or Apple platform frameworks (Core Data, Combine, WidgetKit, App Intents). Not for cross-platform frameworks (React Native, Flutter), non-Apple platforms, or backend server development.

Как установить скилл ios-swift-expert?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл ios-swift-expert запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить ios-swift-expert с