Engineering
swiftui-expert-skill avatar

swiftui-expert-skill

Expert SwiftUI development assistant: refactor code, improve performance, and diagnose app hitches or CPU issues using Xcode Instruments trace analysis.

Introduction

The SwiftUI Expert skill acts as a senior engineer within your AI agent, specializing in modern Apple framework development. It is designed for developers, teams, and technical writers who need to build, review, or optimize high-performance SwiftUI applications. By integrating directly with the repository's internal reference documentation and CLI tools, it provides precise guidance on state management, view lifecycle, and layout performance. The skill excels at migrating deprecated APIs to modern standards, implementing iOS 26+ Liquid Glass effects when requested, and enforcing Apple's Human Interface Guidelines.

  • Perform comprehensive code reviews targeting state management anti-patterns, inefficient view composition, and improper data flow.

  • Analyze Xcode Instruments .trace files to identify hangs, CPU hotspots, and animation hitches with root-cause visibility into SwiftUI dependency graphs.

  • Automate the recording of profiling sessions using built-in scripts to attach to running apps or capture fresh launches across simulators and physical devices.

  • Provide actionable recommendations for optimizing hot-path view updates and reducing structural invalidation bugs using swiftui-causes data analysis.

  • Suggest modern concurrency patterns, ensuring thread-safe state handling and proper #available gating for version-specific features.

  • Always consult the provided references/latest-apis.md to ensure code is future-proof and avoid using deprecated APIs or bridging layers like UIKit/AppKit unless strictly necessary.

  • When diagnosing performance, follow a structured workflow: scope the analysis to a specific window, identify expensive views, and use the fan-in analysis to trace invalidations back to their source.

  • Use the record_trace.py script to standardize profiling output, choosing the correct template (SwiftUI or Time Profiler) based on the target device type to ensure accurate metric capture.

  • Prioritize native SwiftUI API usage to take advantage of framework-level optimizations before resorting to custom architectural patterns like MVVM or VIPER, which are not explicitly mandated.

  • Maintain focus on scalability by refactoring complex view bodies into smaller subviews, which improves both code readability and the efficiency of SwiftUI's diffing engine.

Repository Stats

Stars
2,718
Forks
122
Open Issues
5
Language
Python
Default Branch
main
Sync Status
Idle
Last Synced
Apr 30, 2026, 08:17 AM
View on GitHub