swiftui-patterns · dpearson2699 — Claude Code skill: install guide
Guides SwiftUI view work around state, composition, environment wiring, and isolated previews. Use it when refactoring a screen or sorting out @Observable ownership.
npx skills add dpearson2699/swift-ios-skills --skill swiftui-patterns -a claude-codeWhat swiftui-patterns does
This skill guides SwiftUI implementation and review with an MV approach: views express state, while models and services keep business logic. It covers @Observable ownership, choosing @State, @Bindable, or @Environment, splitting views, ViewModifier, and .task-based loading.
Its workflow starts by recording existing behaviour, then makes the smallest structural change and builds after each step. Previews should cover loaded, loading, empty, and error states where they apply.
The guidance targets Swift 6.3 and iOS 26+, while the patterns are backward-compatible with iOS 17 except where noted. UI-bound @Observable stores need @MainActor isolation because observation does not make mutable shared state thread-safe.
What it helps with
- review state ownership in a SwiftUI view
- choose between
@State,@Bindable, and@Environment - split a large screen into smaller views
- create isolated previews for UI states
- fix
@Observableisolation for UI state
Example prompts for the agent
- "Review this SwiftUI screen and check whether
@Stateand@Bindableare used correctly." - "Split
FeedViewinto smaller views while preserving its current behaviour." - "Create previews for loading, error, and empty list states."
How to install swiftui-patterns
1Skills CLI (Vercel)
npx skills add dpearson2699/swift-ios-skills --skill swiftui-patterns -a claude-code2Manually: put the files in place
~/.claude/skills/swiftui-patterns/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/swiftui-patterns/
1Skills CLI (Vercel)
npx skills add dpearson2699/swift-ios-skills --skill swiftui-patterns -a codex2Manually: put the files in place
.agents/skills/swiftui-patterns/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add dpearson2699/swift-ios-skills --skill swiftui-patterns -a cursor2Manually: put the files in place
.cursor/skills/swiftui-patterns/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install dpearson2699/swift-ios-skills swiftui-patterns2Manually: put the files in place
.github/skills/swiftui-patterns/SKILL.md1Skills CLI (Vercel)
npx skills add dpearson2699/swift-ios-skills --skill swiftui-patterns -a gemini-cli2Platform CLI
gemini skills install https://github.com/dpearson2699/swift-ios-skills --path skills/swiftui-patternsManually: put the files in place
.devin/skills/swiftui-patterns/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add dpearson2699/swift-ios-skills --skill swiftui-patterns -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about swiftui-patterns
How do I install swiftui-patterns in Claude Code?
Run npx skills add dpearson2699/swift-ios-skills --skill swiftui-patterns -a claude-code, then run npx skills add dpearson2699/swift-ios-skills --skill swiftui-patterns -a claude-code again. The skill file is placed at ~/.claude/skills/swiftui-patterns/SKILL.md.
What does swiftui-patterns do?
It guides SwiftUI view implementation and review around MV structure, state management, environment dependencies, and isolated previews. It also covers asynchronous loading and selected iOS 26+ APIs.
Does swiftui-patterns support iOS 17?
The documented patterns are backward-compatible with iOS 17 except where a case is separately noted. Its main target is Swift 6.3 with iOS 26+.
Similar skills
Everything for Mobile →swiftui-patterns by other authors comes first.