● Community
twostraws
⚡ Sofort
SwiftUI Agent Skill
von 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.
Warum nutzen
Hauptfunktionen
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
In der Praxis
swiftui-agent-skill.replay
▶ bereit
▶ Abspielen
Schritt ›
0/0
Anwendungsfälle
Praxisnahe Nutzung: SwiftUI Agent Skill
Wann einsetzen: You want a Settings screen that's actually idiomatic for iOS 17+.
Voraussetzungen
Server/skill installed and authenticated — See repo README
Ablauf
Plan
Using the SwiftUI skill, design a Settings view with sections: Account, Notifications, About. Use @Observable for the view model.✓ Kopiert
→ View hierarchy + ViewModel sketch
Code
Write the full file with toggles, NavigationLink to subpages, and a confirmation dialog for sign-out.✓ Kopiert
→ Compiles on Xcode 15+
Ergebnis: Idiomatic SwiftUI you don't have to rewrite next year.
Fallstricke
Don't mix @StateObject with @Observable — Don't mix @StateObject with @Observable — the skill enforces one or the other; follow it.
Kosten & Limits
Was der Betrieb kostet
API-Kontingent See provider docs for rate limits
Tokens pro Aufruf Varies by tool
Kosten in € See repo README for pricing details
Tipp Cache tool results and avoid repeated identical calls.
Sicherheit
Rechte, Secrets, Reichweite
Credential-Speicherung: Use environment variables; never commit secrets
Datenabfluss: Tool calls go to the provider's API as documented
Fehlerbehebung
Häufige Fehler und Lösungen
view doesn't update on state change
Ensure the property is on an @Observable class, not a struct. The skill's checklist covers this.
Prüfen: @Observable annotation present
preview crashes
@Observable views need a real instance in #Preview. The skill's examples show the pattern.
Prüfen: Preview compiles
Alternativen
SwiftUI Agent Skill vs. andere
Alternative Wann stattdessen Kompromiss
wholiver/swiftui-design-skill You want design direction, not code patterns Design-focused; twostraws is code-focused