SwiftUI Agent Skill: Install and use with AI coding tools Swift developer Antoine van der Lee released the open-source SwiftUI Agent Skill, a reusable AI coding skill that routes agents to 16 focused SwiftUI reference files instead of loading every guideline into the context window. The skill installs via the command `npx skills@latest add https://github.com/avdlee/swiftui-agent-skill --skill swiftui-expert-skill`, and the installer detects supported AI coding tools so users can select one or multiple tools and install the skill globally or within a project. Van der Lee built the skill with Omar Elsayed and moved it into the standardized `skills/` directory when adopting the Agent Plugins format, a relocation that caused older versions of the skills CLI to incorrectly treat the skill as deleted. A SwiftUI Agent Skill that helps you build better views or refactor existing ones. It’s the reality we’re in today, and I honestly can’t live without it anymore myself. Several skills helped me improve the code quality produced by agents, and I’m happy to introduce you to my open-source skill for SwiftUI. Before reading this article, I highly recommend reading Agent Skills explained: Replacing AGENTS.md with reusable AI knowledge https://www.avanderlee.com/ai-development/agent-skills-replacing-agents-md-with-reusable-ai-knowledge/ . It’s the foundation of what you need to know about this feature. Additionally, you can read a brief background on this new skill in How I Stopped Resisting AI and Started Teaching It https://www.swiftdifferently.com/blog/swiftui/How%20I%20stopped-resisting-ai-and-atarted-teaching-it , written by Omar Elsayed, with whom I built this skill. Fastlane alternative - Codemagic CLI tools https://github.com/codemagic-ci-cd/cli-tools/?utm source=swiftlee&utm medium=sponsorship&utm campaign=variant e Are you tired of Ruby and Fastlane installation issues? There's got to be a better way Discover Codemagic open source CLI tools. It is not a drop-in replacement for all of what Fastlane does screenshots for example , but we use it at Codemagic to build and publish iOS and Android apps, also versioning and device provisioning. View on GitHub https://github.com/codemagic-ci-cd/cli-tools/?utm source=swiftlee&utm medium=sponsorship&utm campaign=variant e . If you’ve been building with agents, I’m sure you’ve been updating your AGENTS.md file with all kinds of fixes for SwiftUI. One of the most common additions I’ve seen is this one: Never use the onChange modifier in its 1-parameter variant; either use the variant that accepts two parameters or accepts none. If you know, you know, but it’s annoying when agents make the same mistake over and over again. I’ve been updating my agents file too, but I’m now prompting this instead: The SwiftUI Agent Skill https://github.com/AvdLee/SwiftUI-Agent-Skill contains a compact SKILL.md file that routes your agent toward focused references: skills/swiftui-expert-skill/ SKILL.md references/ accessibility-patterns.md animation-basics.md charts.md document-apps.md environment-patterns.md image-optimization.md latest-apis.md layout-best-practices.md list-patterns.md modifier-patterns.md performance-patterns.md sheet-navigation-patterns.md state-management.md toolbar-patterns.md view-structure.md webkit-integration.md Each reference covers a specific SwiftUI topic and only loads when relevant to your task. I recommend checking the repository for the complete and most up-to-date overview. The easiest way to install the SwiftUI Agent Skill is by using the skills command-line tool: npx skills@latest add https://github.com/avdlee/swiftui-agent-skill --skill swiftui-expert-skill The @latest part is important since npx can otherwise use an older cached version of the command-line tool. Using the latest version ensures you benefit from recent compatibility fixes. The installer detects supported AI coding tools on your machine. You can select one or multiple tools and decide whether you want to install the skill globally or inside your current project. After installation, you can invoke the skill with a prompt like: Use the SwiftUI Expert Skill to review the current SwiftUI code for state management and performance improvements. Your agent will load the main SKILL.md file and open only the references relevant to your task. This gives your agent detailed SwiftUI knowledge without loading every guideline into the context window. The SwiftUI Agent Skill moved into the standardized skills/ directory when adopting the Agent Plugins format. Older versions of the skills CLI could incorrectly treat the skill as deleted after this relocation. You can migrate an existing installation by running: npx skills@latest update Version 1.5.24 or newer recognizes the relocated skill and updates its saved path. This behavior was added through a fix I contributed to the skills CLI https://github.com/vercel-labs/skills/pull/2124 . You can use the skill when building a new view, but I find it especially useful for reviewing existing SwiftUI code. For example, one of my reviews identified nested scrolling: - BuildInsightsPageView wraps BuildInsightsView in a ScrollView , while BuildInsightsView already contains its own ScrollView . This can cause awkward scrolling behavior, conflicting gestures, and unnecessary layout work. The same review also discovered duplicated state synchronization: - Selection and view-model synchronization happen in several onAppear and onChange handlers. Each handler updates currentSelectedApp , the view model, or both, making redundant updates more likely. These findings demonstrate why a SwiftUI-specific skill can improve an agent’s output. General models understand SwiftUI, but they might not recognize framework-specific performance and data-flow problems without additional guidance. The outcome depends on the quality of your existing views. However, if you have been developing with agents for a while, you probably have generated SwiftUI code that can benefit from a focused review. After several releases over the past few months, I’m happy to announce version 5.0.0. It adds verified guidance for SwiftUI development using the Xcode 27 and SDK 27 toolchain. The timing is especially relevant now that Apple has announced iPhone Duo. Apps increasingly need to adapt to different sizes and configurations without relying on fixed screen dimensions. The skill does not contain iPhone Duo-specific APIs. However, its adaptive-layout guidance helps agents avoid assumptions based on UIScreen.main or interface orientation. Instead, agents are instructed to work with proposed sizes, size classes, ViewThatFits , and AnyLayout . This gives your agent a stronger foundation for preparing apps for iPhone Duo. The release also adds or expands guidance for: - The SDK 27 @State macro and initialization diagnostics - @ContentBuilder ambiguities and migration - Reordering and swipe actions outside List - AsyncImage caching and custom URL sessions - Item-driven alerts and confirmation dialogs - Toolbar overflow and visibility APIs - The new Document protocol family - SwiftUI WebKit integration - Soft-deprecated SwiftUI APIs Several of these APIs did not exist when current AI models were trained. Without additional guidance, an agent might fall back to older SwiftUI patterns even when you are building with Xcode 27. The API signatures and availability claims were verified against the SDK 27 Swift interfaces. You can find the complete details in the SwiftUI Agent Skill 5.0.0 release https://github.com/AvdLee/SwiftUI-Agent-Skill/releases/tag/5.0.0 . At the same time, your future views built with agents can be better from the start. Agents are smart enough to reference the skill when needed, so chances are high that your initial versions of SwiftUI Views will already be improved using this Agent Skill. It’s important to note that agents aren’t always able to find skills https://vercel.com/blog/agents-md-outperforms-skills-in-our-agent-evals yet, but it’s only a matter of time before they do. If you have been developing intensively with agents already, you might have created your own set of agent instructions. We’ve already merged several pull requests from developers like yourself, and we would love to receive more. Feel free to open a PR, and make sure to read our detailed contribution guidelines https://github.com/AvdLee/SwiftUI-Agent-Skill/blob/main/CONTRIBUTING.md . Not because we’re strict, but because it will teach you how to build and test agent skills along the way Fastlane alternative - Codemagic CLI tools https://github.com/codemagic-ci-cd/cli-tools/?utm source=swiftlee&utm medium=sponsorship&utm campaign=variant e Are you tired of Ruby and Fastlane installation issues? There's got to be a better way Discover Codemagic open source CLI tools. It is not a drop-in replacement for all of what Fastlane does screenshots for example , but we use it at Codemagic to build and publish iOS and Android apps, also versioning and device provisioning. View on GitHub https://github.com/codemagic-ci-cd/cli-tools/?utm source=swiftlee&utm medium=sponsorship&utm campaign=variant e . The SwiftUI Agent Skill gives your coding agent focused guidance for writing and reviewing modern SwiftUI code. Version 5.0.0 expands that knowledge with verified Xcode 27 and SDK 27 guidance, while keeping the main skill compact through references that load on demand. You can use the skill to improve newly generated views or review existing code for state-management, performance, accessibility, and API improvements. It does not replace your judgment, but it gives your agent a much better SwiftUI foundation. If you want to improve your AI development knowledge, even more, check out the AI Development Category page https://www.avanderlee.com/ai-development/ . Feel free to contact me /cdn-cgi/l/email-protection 42212d2c36232136022334232c2627302e27276c212d2f or tweet me on Twitter https://www.twitter.com/twannl if you have any additional tips or feedback. Thanks