用专家指导构建 SwiftUI 应用
生成现代、性能优良且无障碍友好的 SwiftUI 建议。
使用前,准备这些
输入素材:代码库、技术环境与任务验收条件
- 在下方原始文档中确认支持的 AI 工具、模型和运行依赖。
- 打开原仓库,按作者的安装说明完成配置;模型 API 或外部服务可能需要单独开通。
- 用自己的素材试运行,再检查事实、版式与输出文件。
许可证:MIT
来源快照:2026-09-15。README ↗
原项目许可证与版权声明
MIT License Copyright (c) 2026 Paul Hudson. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
可以这样开始
SwiftUI Agent Skill for AI Coding Assistants
An agent skill that helps AI coding assistants write smarter, simpler, and more modern SwiftUI, including guidance on API usage, design, performance, and accessibility. Covers navigation, layout, animations, state management, VoiceOver, deprecated API, and more, targeting the mistakes LLMs actually make.
Also available:
Find more agent skills for Swift and Apple platform development at Swift Agent Skills.
The skill builds upon my existing AGENTS.md file, meaning that you can bring years of knowledge and practical experience into your coding agent of choice in just a few minutes. It uses the Agent Skills format, so it works smoothly with Claude Code, Codex, Gemini, Cursor, and more.
Installing SwiftUI Pro
You can install this skill into Claude Code, Codex, Gemini, Cursor, and more by using npx:
npx skills add https://github.com/twostraws/swiftui-agent-skill --skill swiftui-pro
If you get the error npx: command not found, it means you don’t currently have Node installed. You need to run this command to install Node through Homebrew:
brew install node
And if that fails it usually means you need to install Homebrew first.
When using npx, you can select exactly which agents you want to use during the installation. You can also select whether the skill should be installed just for one project, or whether it should be made available for all your projects.
Claude Code users can add the SwiftUI Agent Skill marketplace then install the plugin directly through Claude, like this:
/plugin marketplace add twostraws/SwiftUI-Agent-Skill
/plugin install swiftui-pro@swiftui-agent-skill
Alternatively, you can clone this whole repository and install it however you want.
If you’re using Xcode, watch the YouTube video on How to Install and Use Agent Skills in Xcode for a walkthrough.
Using SwiftUI Pro
The skill is called SwiftUI Pro, and can be triggered in various ways. For example, in Claude Code you would use this:
/swiftui-pro
And in Codex you would use this:
$swiftui-pro
In both cases you can provide specific instructions if you want only a partial review. For example, /swiftui-pro Check for deprecated API on Claude, or $swiftui-pro Focus on accessibility in Codex.
You can also trigger the skill using natural language:
Use the SwiftUI Pro skill to look for performance problems in this project.
Why Use an Agent Skill for SwiftUI?
This skill is built on thousands of hours of learning, experimenting, and building real-world SwiftUI projects. The rules contained here directly target common SwiftUI mistakes made by LLMs. They sometimes make buttons invisible to VoiceOver, they frequently use deprecated API, and they would often write code that causes surprise performance problems.
You can read more about why I created this skill in my article: SwiftUI Agent Skill - Write better code with Claude, Codex, and other AI tools.
Contributing
I welcome all contributions, whether that's adding new checks, improving existing checks, or editing this README – everyone is welcome!
- Keep your Markdown concise. There is a token cost to using skills, particularly with SKILL.md, so please respect the token budgets of users.
- Do not repeat things that LLMs already know, because it burns tokens for no benefit. Focus on edge cases, surprises, soft deprecations, and similar.
- All work must be licensed under the MIT license so it can benefit the most people.
Please ensure you abide by the Code of Conduct.
License
SwiftUI Pro was originally created by Paul Hudson, who writes free Swift tutorials over at Hacking with Swift. It’s available under the MIT License, which permits commercial use, modification, distribution, and private use.