How to Stop Neural Networks from Generating Outdated SwiftUI Code
If you've tried generating iOS layouts with modern LLMs like Claude or models in Cursor, you've probably noticed some quirks. The model confidently outputs a screen that looks like it should work, the compiler doesn't complain, but underneath there's a zoo of outdated APIs. For example, NavigationView, which Apple archived a couple of years ago, or homemade workarounds for animations where built-in modifiers have existed for a long time.
Things are worst with VoiceOver. Assistants love to pile on layers of custom gestures, completely breaking accessibility for blind users.
Paul Hudson, the author of the Hacking with Swift project, solved this problem systematically. He created the repository twostraws/SwiftUI-Agent-Skill, which teaches assistants the right habits in declarative UI.
What SwiftUI Pro Is
Essentially, it's a specialized skill in the open Agent Skills standard. The format is supported by Claude Code, Codex, Gemini, Cursor, and Xcode extensions.
Instead of endlessly reminding in the system prompt "don't use deprecated syntax," you connect a ready-made rules database to the agent. The skill is based on Hudson's work from the AGENTS.md project and focuses specifically on the pitfalls that large language models stumble over most often.
What's inside this knowledge base:
- Coverage of current navigation and state binding;
- Rules for optimizing view redraws;
- Accessibility checks for VoiceOver controls;
- A catalog of soft-deprecated methods that the compiler still accepts, but shouldn't be written that way anymore.
The author has similar skills for other parts of the platform: SwiftData Pro, Swift Concurrency Pro, and Swift Testing Pro.
How to Install the Skill in Your Tools
Setup takes less than a minute via npx:
npx skills add https://github.com/twostraws/swiftui-agent-skill --skill swiftui-pro
The command will ask if you want to activate the skill globally for all projects or bind it only to the current repository.
If you're working in Claude Code, you can use the built-in plugin manager:
/plugin marketplace add twostraws/SwiftUI-Agent-Skill
/plugin install swiftui-pro@swiftui-agent-skill
For Xcode users, the author recorded a separate video covering integration into the development workflow. If you prefer, you can simply clone the repository and use the rules locally.
How to Run Checks
After installation, the skill is activated via commands or natural language. In Claude Code, just type:
/swiftui-pro
The Codex assistant responds to a similar construct:
$swiftui-pro
You can provide context to commands immediately so the agent doesn't waste time and tokens on a full file audit. For example:
/swiftui-pro Check for deprecated API
Or with a regular prompt: "Use the SwiftUI Pro skill and find performance issues in this module."
Token Savings and Focus on the Non-Obvious
An interesting detail in the project's philosophy: the author strictly controls the size of instructions. Basic things that models already know without prompting (like VStack syntax or the .padding() modifier) are intentionally not included. Every line of context consumes context window limits, so the rules contain only subtle points, edge cases, and non-obvious rendering pitfalls.
If you want to submit a pull request with your own rule, keep two conditions in mind: maximum brevity in wording and MIT license.
Who Will Find This Repository Useful
If you develop for iOS or macOS and actively use AI agents directly in the editor, it's definitely worth installing. It saves you from having to clean up legacy code generated by neural networks and immediately steers interface generation toward modern Swift standards.
Start by installing via npx in a small pet project and ask the agent to review a screen with animations. The difference in the suggested diffs will be visible immediately.
Related projects

