UIKit Expert Skill
An AI agent skill for writing correct, performant, modern UIKit code in Swift.
Table of Contents
Background
AI coding assistants tend to produce UIKit code with the same recurring mistakes: geometry work in viewDidLoad instead of viewIsAppearing, missing [weak self] in escaping closures, deprecated cell.textLabel instead of UIContentConfiguration, and navigation bar appearance set on the wrong object. This skill gives an agent the facts it needs to catch and fix those mistakes.
It ships in the Agent Skills format, so it works with any assistant that reads SKILL.md or AGENTS.md, including Claude Code, Cursor, Windsurf, and Codex. The entry point, SKILL.md, routes the agent through one of three workflows (review, improve, or implement) and points it at the matching reference file for the task at hand.
Philosophy
The skill teaches facts and best practices, not architecture. It draws a hard line:
- It uses "always" or "never" only for correctness, like setting
translatesAutoresizingMaskIntoConstraints = false on programmatic views.
- It uses "consider" or "suggest" for optimizations, like image downsampling or list prefetching.
- It enforces no architecture. No MVVM, VIPER, or Coordinator mandate.
- It dictates no formatting. No property ordering, file structure, or naming rules.
- It optimizes for correctness first, then performance, following Apple's documented APIs and Human Interface Guidelines.
Features
Fourteen reference files cover the surface area an agent hits when working with UIKit:
| Domain | Key topics |
|---|
| Lifecycle | viewIsAppearing (iOS 13+), child VC containment, deallocation verification |
| Auto Layout | Batch activation, zero-churn constraints, constraint animation, .flushUpdates (iOS 26) |
| Collection views | Diffable data sources, stable identity, compositional layout, list configuration |
| Cell configuration | UIContentConfiguration, UIBackgroundConfiguration, configurationUpdateHandler |
| List performance | Prefetching with Swift concurrency, cell reuse race condition, reconfigureItems |
| Navigation | Four-slot UINavigationBarAppearance, concurrent transition guards, Liquid Glass |
| Animation | API selection, UIViewPropertyAnimator state machine, spring animations |
| Memory | Retain cycle traps (Timer, NotificationCenter, CADisplayLink, nested closures), Task retention |
| Concurrency | @MainActor, Task lifecycle, Swift 6 migration, Task.detached pitfalls |
| Interop | UIHostingController containment, sizingOptions, UIViewRepresentable lifecycle |
| Images | ImageIO downsampling, decoded bitmap math, cancel/clear/verify pattern |
| Keyboard | UIKeyboardLayoutGuide, iPad floating keyboard, scroll view sync |
| Adaptive | registerForTraitChanges, Dynamic Type, CGColor dark mode trap, VoiceOver |
| Modern APIs | Observation framework, updateProperties(), .flushUpdates, mandatory UIScene |
Each reference is self-contained, with correct and incorrect Swift examples, a "why" for every recommendation, and a checklist at the bottom.
The guidance spans iOS 13 through 26:
- iOS 13+:
viewIsAppearing (back-deployed), UINavigationBarAppearance
- iOS 14+:
UIContentConfiguration, CellRegistration, compositional layout list configuration
- iOS 15+:
UIKeyboardLayoutGuide, reconfigureItems, scrollEdgeAppearance changes
- iOS 17+:
registerForTraitChanges, custom traits, spring animation API
- iOS 18+:
UIObservationTrackingEnabled (opt-in), automatic trait tracking
- iOS 26+:
updateProperties(), .flushUpdates, mandatory UIScene, Liquid Glass
Installation
Pick the path that matches your assistant.
skills.sh (recommended)
npx skills add https://github.com/ivan-magda/uikit-expert-skill --skill uikit-expert
See the skills.sh platform page for details.
Claude Code plugin
Add the marketplace, then install the skill:
/plugin marketplace add ivan-magda/uikit-expert-skill
/plugin install uikit-expert@uikit-expert-skill
To enable the skill for everyone on a repository, add this to the project's .claude/settings.json:
{
"enabledPlugins": {
"uikit-expert@uikit-expert-skill": true
},
"extraKnownMarketplaces": {
"uikit-expert-skill": {
"source": {
"source": "github",
"repo": "ivan-magda/uikit-expert-skill"
}
}
}
}
Claude Code prompts each team member to install the skill when they open the project.
Manual install