Swiftui ui patterns
Skill 7vibex/swiftui-developer-kit/.agents/skills/swiftui-ui-patterns
Build or refactor SwiftUI screens with modern state ownership, navigation, sheets, async loading, previews, accessibility, and performance-aware view composition.From its SKILL.md
npx -y skills add 7vibex/swiftui-developer-kit --skill swiftui-ui-patternsAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
3.7 KB, 707 tokens by cl100k_base, as published. Nobody here has run it
SwiftUI UI Patterns
Use this skill when shaping a SwiftUI screen, refactoring view structure, choosing state wrappers, wiring navigation or sheets, or reviewing UI composition before implementation.
References
- Read
references/state-ownership.mdwhen deciding where state lives or which property wrapper to use. - Read
references/navigation-sheets.mdwhen routing, presenting sheets, alerts, popovers, or split navigation. - Read
references/ipad-mac-adaptation.mdwhen screens need iPad, macOS, menu bar, window, keyboard, pointer, or resizing behavior. - Read
references/async-ui-state.mdwhen screens load, refresh, search, debounce, or cancel async work. - Read
references/view-refactor-patterns.mdwhen splitting large views or cleaning computedsome Viewhelpers. - Read
references/previews-performance.mdwhen adding previews, fixtures, list identity, or render-cost checks. - Use
references/output-contract.mdfor final reports.
Prefer existing project conventions. When the app already has a clear architecture, improve inside that architecture instead of introducing a new pattern.
Workflow
- Identify the target screen, primary interaction, deployment target, and existing local patterns.
- Choose the source of truth for state before choosing property wrappers.
- Map navigation and modal presentation as data, using enum or item state for mutually exclusive destinations.
- Pick an adaptive navigation model: tab, stack, sidebar/detail, inspector, or multiwindow.
- Keep resizing, rotation, and multiwindow behavior non-destructive.
- Keep async work cancellable and tied to view lifecycle or explicit user actions.
- Split complex screens into dedicated subview types with small explicit inputs.
- Add previews for important states when the project supports previews.
- Check accessibility, Dynamic Type, and stable identity for lists, grids, and frequently updating views.
- Verify with build, tests, or static checks when safe and relevant.
Guardrails
- Do not add a ViewModel just to mirror local view state.
- Do not bury business logic in
body,.task,.onAppear,.onChange, or button closures. - Do not replace a working project-wide pattern for stylistic reasons.
- Do not use multiple booleans for mutually exclusive sheets, alerts, or navigation destinations.
- Do not create a screen from many large computed
some Viewproperties when dedicated subviews would be clearer. - Do not hide menu, command, or toolbar actions by destroying them for ordinary state changes; disable unavailable actions instead.
- Do not leave document or multiwindow scenes unnamed when the app supports multiple windows.
- Do not silently remove iOS 17 or earlier support when adopting newer Observation or SwiftUI APIs.
Do Not Use When
- The main task is broad architecture audit, persistence correctness, build debugging, release review, or PR drafting.
- The user wants visual taste review without changing SwiftUI structure or interaction patterns.
Done When
- State ownership, navigation, sheets, async UI state, adaptation, previews, and accessibility are addressed.
- Recommendations fit existing project conventions and avoid unnecessary architecture changes.
- Output includes concrete SwiftUI changes and safe verification steps.
Output
Use references/output-contract.md.
Follow ../../../docs/skill-quality-standard.md and compare ../../../examples/skill-outputs/swiftui-ui-patterns-bad-output.md with ../../../examples/skill-outputs/swiftui-ui-patterns-good-output.md.
What ships with it: 7 files
9.9 KB alongside SKILL.md
references/
- async-ui-state.md1.2 KB
- ipad-mac-adaptation.md1.7 KB
- navigation-sheets.md1.7 KB
- output-contract.md957 B
- previews-performance.md1.2 KB
- state-ownership.md1.4 KB
- view-refactor-patterns.md1.6 KB