{"slug": "swiftui-agent-skill-install-and-use-with-ai-coding-tools", "title": "SwiftUI Agent Skill: Install and use with AI coding tools", "summary": "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.", "body_md": "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.\n\nBefore 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. \n\n[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.\n\n[View on GitHub](https://github.com/codemagic-ci-cd/cli-tools/?utm_source=swiftlee&utm_medium=sponsorship&utm_campaign=variant_e).\n\n## \n\nIf 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:\n\n```\nNever use the `onChange()` modifier in its 1-parameter variant; either use the variant that accepts two parameters or accepts none.\n```\n\nIf 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:\n\nThe [SwiftUI Agent Skill](https://github.com/AvdLee/SwiftUI-Agent-Skill) contains a compact `SKILL.md` file that routes your agent toward focused references:\n\n```\nskills/swiftui-expert-skill/\n  SKILL.md\n  references/\n    accessibility-patterns.md\n    animation-basics.md\n    charts.md\n    document-apps.md\n    environment-patterns.md\n    image-optimization.md\n    latest-apis.md\n    layout-best-practices.md\n    list-patterns.md\n    modifier-patterns.md\n    performance-patterns.md\n    sheet-navigation-patterns.md\n    state-management.md\n    toolbar-patterns.md\n    view-structure.md\n    webkit-integration.md\n```\n\nEach 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.\n\n## \n\nThe easiest way to install the SwiftUI Agent Skill is by using the skills command-line tool:\n\n```\nnpx skills@latest add https://github.com/avdlee/swiftui-agent-skill --skill swiftui-expert-skill\n```\n\nThe `@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.\n\nThe 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.\n\nAfter installation, you can invoke the skill with a prompt like:\n\nUse the SwiftUI Expert Skill to review the current SwiftUI code for state management and performance improvements.\n\nYour 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.\n\n### \n\nThe 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.\n\nYou can migrate an existing installation by running:\n\n```\nnpx skills@latest update\n```\n\nVersion 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).\n\n## \n\nYou 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:\n\n- `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.\n\nThe same review also discovered duplicated state synchronization:\n\n- 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.\n\nThese 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.\n\nThe 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.\n\n## \n\nAfter 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.\n\nThe 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.\n\nThe 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.\n\nThe release also adds or expands guidance for:\n\n- The SDK 27 `@State` macro and initialization diagnostics\n- `@ContentBuilder` ambiguities and migration\n- Reordering and swipe actions outside `List`\n- `AsyncImage` caching and custom URL sessions\n- Item-driven alerts and confirmation dialogs\n- Toolbar overflow and visibility APIs\n- The new Document protocol family\n- SwiftUI WebKit integration\n- Soft-deprecated SwiftUI APIs\n\nSeveral 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.\n\nThe 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).\n\n## \n\nAt 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.\n\n## \n\nIf 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!\n\n[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.\n\n[View on GitHub](https://github.com/codemagic-ci-cd/cli-tools/?utm_source=swiftlee&utm_medium=sponsorship&utm_campaign=variant_e).\n\n### \n\nThe 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.\n\nYou 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.\n\nIf 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.\n\nThanks!", "url": "https://wpnews.pro/news/swiftui-agent-skill-install-and-use-with-ai-coding-tools", "canonical_source": "https://www.avanderlee.com/ai-development/swiftui-agent-skill-build-better-views-with-ai/", "published_at": "2026-09-14 11:49:33+00:00", "updated_at": "2026-09-14 12:10:21.278766+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "developer-tools", "ai-products"], "entities": ["SwiftUI Agent Skill", "Antoine van der Lee", "Omar Elsayed", "Agent Skills", "Agent Plugins", "GitHub", "Codemagic"], "alternates": {"html": "https://wpnews.pro/news/swiftui-agent-skill-install-and-use-with-ai-coding-tools", "markdown": "https://wpnews.pro/news/swiftui-agent-skill-install-and-use-with-ai-coding-tools.md", "text": "https://wpnews.pro/news/swiftui-agent-skill-install-and-use-with-ai-coding-tools.txt", "jsonld": "https://wpnews.pro/news/swiftui-agent-skill-install-and-use-with-ai-coding-tools.jsonld"}}