移动开发

swiftui-expert-skill

avdlee/swiftui-…nt-skill

Use when writing, reviewing, or refactoring SwiftUI code for iOS or macOS, including state and `@Observable` data flow, view composition, resizable layouts, safe areas, display scale, performance, lists, environment, localization, animation, Liquid Glass, and API migration. Also use for iPhone Duo, foldable, or large-display layouts (`NavigationSplitView` on large displays, iPhone tab sidebar, two-column reflow, foldable grids, `ArrangementView`, `ReservedRegion`), hinge effects, vertical bars, `@State` initialization or synthesized-property diagnostics, `@ContentBuilder` ambiguity, `reorderable` drag/drop, custom `AsyncImage` `URLSession`, swipe actions outside List, item-bound `alert`/`confirmationDialog`, `ToolbarOverflowMenu`, `AnimatableValues`, Document APIs (`Document`/`DocumentReader`), and Instruments `.trace` capture or analysis.

  • 3.5万 次安装
  • 3800 星标
  • 收录于

安装命令

npx skills add https://github.com/avdlee/swiftui-agent-skill --skill swiftui-expert-skill

要点

Expert SwiftUI code review, refactoring, and implementation guidance with iOS 26+ and macOS support.

  • Covers state management, view composition, performance optimization, and modern SwiftUI patterns across iOS 15+ through iOS 26+
  • Flags deprecated APIs and suggests modern replacements; gates version-specific features with #available and fallbacks
  • Addresses lists, layouts, animations, accessibility, Swift Charts, and platform-specific patterns (macOS scenes, Liquid Glass)
  • Enforces correctness rules for property wrappers, ForEach identity, and view diffing; presents performance improvements as optional suggestions

SKILL.md

SwiftUI Expert Skill

Operating Rules

  • Treat each View type as an invalidation boundary: give it only the data it reads and keep frequently changing dependencies close to the smallest affected subtree
  • Search references/latest-apis.md when writing, reviewing, or migrating API usage; look up only the APIs relevant to the task
  • Replace hard-deprecated APIs with modern equivalents. During feature work, flag soft-deprecated APIs and leave them in place (see references/soft-deprecation.md)
  • Prefer native SwiftUI APIs over UIKit/AppKit bridging unless bridging is necessary
  • Focus on correctness and performance; do not enforce specific architectures (MVVM, VIPER, etc.)
  • Encourage separating business logic from views for testability without mandating how
  • Follow Apple's Human Interface Guidelines and API design patterns
  • Only adopt Liquid Glass when explicitly requested by the user (see references/liquid-glass.md)
  • Present performance optimizations as suggestions, not requirements
  • Use #available gating with sensible fallbacks for version-specific APIs
  • For layout and rendering inputs, read the value nearest the SwiftUI view that consumes it; do not substitute process-global screen state

Task Workflow