SwiftUI-Agent-Skill README

The project's README from github.com/twostraws/SwiftUI-Agent-Skill. As one markdown file: README.md.

SwiftUI Pro - Agent Skill for Claude Code, Codex, and Gemini

SwiftUI Agent Skill for AI Coding Assistants

Designed for iOS 26 and later. Designed for Swift 6.2 and later. Twitter: @twostraws

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!

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.

Hacking with Swift+ logo

 

Hacking with Swift logo
A Hacking with Swift Project

SwiftUI-Agent-Skill (twostraws/SwiftUI-Agent-Skill)

Searching Database…

这是什么?这是一个“代理技能”(agent skill)——一组指令,教 Claude Code、Codex、Gemini、Cursor 等 AI 编程助手写出更聪明、更简洁、更现代的 SwiftUI 代码,涵盖导航、布局、动画、状态管理、无障碍访问以及已废弃 API 的使用。
这是需要我运行的插件,还是只是给 AI 读的文本文件?它是一个基于 Markdown 的 Agent Skill 文件(不是要导入的代码),采用 Agent Skills 格式编写,可以直接加载到 Claude Code、Codex、Gemini、Cursor 等工具的上下文中。
需要安装 Node 吗?支持哪些代理?需要——npx 依赖 Node.js,没有的话可以通过 Homebrew 安装;支持的代理包括 Claude Code、Codex、Gemini 和 Cursor,Xcode 用户则可以跟着链接里的 YouTube 演示教程做。
它会自动修复我的代码吗?不会,它是被动的指导——只有在你显式触发时才会运行,比如在 Claude Code 中输入“/swiftui-pro”或在 Codex 中输入“$swiftui-pro”;而且这个技能刻意保持精简,以控制加载它的 token 开销。
安装之后怎么触发这个技能?在 Claude Code 中输入“/swiftui-pro”,或在 Codex 中输入“$swiftui-pro”,后面可以跟上诸如“Check for deprecated API”这样的指令;也可以直接用自然语言提问,比如“Use the SwiftUI Pro skill to look for performance problems”。
它针对哪些 SwiftUI 错误?它针对 LLM 常犯的错误,比如让按钮对 VoiceOver 不可见、使用已废弃的 SwiftUI API,以及写出引发意外性能问题的代码。
有其他 Apple 主题的相关技能吗?有——同一作者还提供 SwiftData Pro、Swift Concurrency Pro 和 Swift Testing Pro,更多 Swift 和 Apple 平台技能列在 Swift Agent Skills 上。
Creator
twostraws
Size
0.1 MB
Stars
6.1K
Age
7mo
Commits · 90 Days