项目简介
面向 Claude Code、Codex、Gemini 等 AI 编程助手的技能包,用于提升生成的 SwiftUI 代码质量。覆盖导航、布局、动画、状态管理、无障碍与弃用 API 等方面,针对 LLM 常见错误给出指导,凝聚多年实践经验,可快速安装使用。
README 预览
\n \n\n\nSwiftUI Agent Skill for AI Coding Assistants\n\n\n \n \n \n \n \n\n\nAn 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.\n\nAlso available:\n\n- [SwiftData Pro](https://github.com/twostraws/SwiftData-Agent-Skill)\n- [Swift Concurrency Pro](https://github.com/twostraws/Swift-Concurrency-Agent-Skill)\n- [Swift Testing Pro](https://github.com/twostraws/Swift-Testing-Agent-Skill)\n\nFind more agent skills for Swift and Apple platform development at [Swift Agent Skills](https://github.com/twostraws/Swift-Agent-Skills).\n\nThe skill builds upon my existing [AGENTS.md](https://github.com/twostraws/SwiftAgents) 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](https://agentskills.io/home) format, so it works smoothly with Claude Code, Codex, Gemini, Cursor, and more.\n\n\n## Installing SwiftUI Pro\n\nYou can install this skill into Claude Code, Codex, Gemini, Cursor, and more by using npx:\n\n```bash\nnpx skills add https://github.com/twostraws/swiftui-agent-skill --skill swiftui-pro\n```\n\nIf 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:\n\n```bash\nbrew install node\n```\n\nAnd if *that* fails it usually means you need to [install Homebrew](https://brew.sh) first.\n\nWhen 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.\n\nClaude Code users can add the SwiftUI Agent Skill marketplace then instal
常见问题 (2)
操作指南如何在 Xcode 的编程助手中安装和使用 AI 智能体技能(Claude Code / Codex)?
对于 Xcode 中的 Codex,将 skill 文件夹(例如 swiftui-pro)复制到 ~/Library/Developer/Xcode/CodingAssistant/codex/skills/swiftui-pro/,它会自动生效。Claude Code 则需要额外的设置步骤(注意:即使未安装 Claude Agent 也能正常工作)。分步指南:https://www.hackingwithswift.com/articles/283/how-to-install-and-use-ai-agent-skills-in-xcode,以及 Stewart Lynch 的视频教程:https://www.youtube.com/watch?v=QdpaI_j0FRU
故障排除为什么 Claude Code 没有加载我安装到 ~/.agents/skills 的技能?
Claude Code 只会从 ~/.claude/skills 加载技能,而不会从 ~/.agents/skills 加载。如果安装程序跳过了 "Installation Method" 提示(Symlink 或 Copy to all agents),并将技能放置在了 ~/.agents/skills 目录下,可以通过创建符号链接手动修复:
mkdir -p ~/.claude/skills
ln -s ~/.agents/skills/<skill-name> ~/.claude/skills/<skill-name>
将 <skill-name> 替换为你的技能文件夹名称(例如 swift-concurrency-pro 或 swiftui-pro)。或者,也可以使用 npx skills add 重新安装,它会提示你选择安装目标,并将技能正确安装到 Claude Code 对应的位置。