● Community
twostraws
⚡ Instant
SwiftUI Agent Skill
by twostraws · twostraws/SwiftUI-Agent-Skill
Paul Hudson's SwiftUI patterns packaged as a Claude skill.
By Paul Hudson (Hacking with Swift), this skill teaches Claude modern SwiftUI: @Observable, NavigationStack, async views, proper state ownership. The result: SwiftUI code that actually compiles and follows Apple's current guidance.
Why use it
Key features
- iOS 17+ Observation framework (no more ObservableObject in new code)
- NavigationStack patterns with type-safe destinations
- Common pitfalls list (TextField + State race conditions, sheet vs popover)
- Accessibility annotations baked into examples
- Test-friendly view structure
Live Demo
What it looks like in practice
swiftui-agent-skill.replay
▶ ready
Use Cases
Real-world ways to use SwiftUI Agent Skill
When to use: You want a Settings screen that's actually idiomatic for iOS 17+.
Prerequisites
- Server/skill installed and authenticated — See repo README
Flow
-
Plan
Using the SwiftUI skill, design a Settings view with sections: Account, Notifications, About. Use @Observable for the view model.✓ Copied
→ View hierarchy + ViewModel sketch
-
Code
Write the full file with toggles, NavigationLink to subpages, and a confirmation dialog for sign-out.✓ Copied
→ Compiles on Xcode 15+
Outcome: Idiomatic SwiftUI you don't have to rewrite next year.
Pitfalls
- Don't mix @StateObject with @Observable — Don't mix @StateObject with @Observable — the skill enforces one or the other; follow it.
Cost & Limits
What this costs to run
- API quota
- See provider docs for rate limits
- Tokens per call
- Varies by tool
- Monetary
- See repo README for pricing details
- Tip
- Cache tool results and avoid repeated identical calls.
Security
Permissions, secrets, blast radius
Credential storage: Use environment variables; never commit secrets
Data egress: Tool calls go to the provider's API as documented
Troubleshooting
Common errors and fixes
view doesn't update on state change
Ensure the property is on an @Observable class, not a struct. The skill's checklist covers this.
Verify: @Observable annotation present
preview crashes
@Observable views need a real instance in #Preview. The skill's examples show the pattern.
Verify: Preview compiles
Alternatives
SwiftUI Agent Skill vs others
| Alternative | When to use it instead | Tradeoff |
| wholiver/swiftui-design-skill | You want design direction, not code patterns | Design-focused; twostraws is code-focused |