Awesome-omni-skills swiftui-expert-skill
SwiftUI Expert Skill workflow skill. Use this skill when the user needs Write, review, or improve SwiftUI code following best practices for state management, view composition, performance, and iOS 26+ Liquid Glass adoption. Use when building new SwiftUI features, refactoring existing views, reviewing code quality, or adopting modern SwiftUI patterns and the operator should preserve the upstream workflow, copied support files, and provenance before merging or handing off.
git clone https://github.com/diegosouzapw/awesome-omni-skills
T=$(mktemp -d) && git clone --depth=1 https://github.com/diegosouzapw/awesome-omni-skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/swiftui-expert-skill" ~/.claude/skills/diegosouzapw-awesome-omni-skills-swiftui-expert-skill && rm -rf "$T"
skills/swiftui-expert-skill/SKILL.mdSwiftUI Expert Skill
Overview
This public intake copy packages
plugins/antigravity-awesome-skills-claude/skills/swiftui-expert-skill from https://github.com/sickn33/antigravity-awesome-skills into the native Omni Skills editorial shape without hiding its origin.
Use it when the operator needs the upstream workflow, support files, and repository context to stay intact while the public validator and private enhancer continue their normal downstream flow.
This intake keeps the copied upstream files intact and uses
metadata.json plus ORIGIN.md as the provenance anchor for review.
SwiftUI Expert Skill
Imported source sections that did not map cleanly to the public headings are still preserved below or in the support files. Notable imported sections: Review Checklist, Philosophy, Limitations.
When to Use This Skill
Use this section as the trigger filter. It should make the activation boundary explicit before the operator loads files, runs commands, or opens a pull request.
- You are building, reviewing, or refactoring SwiftUI code and need current best practices.
- The task involves state management, view composition, performance, accessibility, or iOS 26+ Liquid Glass adoption.
- You need a fact-based SwiftUI guidance layer without locking into a specific application architecture.
- Use when the request clearly matches the imported source intent: Write, review, or improve SwiftUI code following best practices for state management, view composition, performance, and iOS 26+ Liquid Glass adoption. Use when building new SwiftUI features, refactoring existing....
- Use when the operator should preserve upstream workflow detail instead of rewriting the process from scratch.
- Use when provenance needs to stay visible in the answer, PR, or review packet.
Operating Table
| Situation | Start here | Why it matters |
|---|---|---|
| First-time use | | Confirms repository, branch, commit, and imported path before touching the copied workflow |
| Provenance review | | Gives reviewers a plain-language audit trail for the imported source |
| Workflow execution | | Starts with the smallest copied file that materially changes execution |
| Supporting context | | Adds the next most relevant copied source file without loading the entire package |
| Handoff decision | | Helps the operator switch to a stronger native skill when the task drifts |
Workflow
This workflow is intentionally editorial and operational at the same time. It keeps the imported source useful to the operator while still satisfying the public intake standards that feed the downstream enhancer flow.
- First, consult references/latest-apis.md to ensure only current, non-deprecated APIs are used
- Check property wrapper usage against the selection guide (see references/state-management.md)
- Verify view composition follows extraction rules (see references/view-structure.md)
- Check performance patterns are applied (see references/performance-patterns.md)
- Verify list patterns use stable identity (see references/list-patterns.md)
- Check animation patterns for correctness (see references/animation-basics.md, references/animation-transitions.md)
- Review accessibility: proper grouping, traits, Dynamic Type support (see references/accessibility-patterns.md)
Imported Workflow Notes
Imported: Workflow Decision Tree
1) Review existing SwiftUI code
- First, consult
to ensure only current, non-deprecated APIs are usedreferences/latest-apis.md - Check property wrapper usage against the selection guide (see
)references/state-management.md - Verify view composition follows extraction rules (see
)references/view-structure.md - Check performance patterns are applied (see
)references/performance-patterns.md - Verify list patterns use stable identity (see
)references/list-patterns.md - Check animation patterns for correctness (see
,references/animation-basics.md
)references/animation-transitions.md - Review accessibility: proper grouping, traits, Dynamic Type support (see
)references/accessibility-patterns.md - Inspect Liquid Glass usage for correctness and consistency (see
)references/liquid-glass.md - Validate iOS 26+ availability handling with sensible fallbacks
2) Improve existing SwiftUI code
- First, consult
to replace any deprecated APIs with their modern equivalentsreferences/latest-apis.md - Audit state management for correct wrapper selection (see
)references/state-management.md - Extract complex views into separate subviews (see
)references/view-structure.md - Refactor hot paths to minimize redundant state updates (see
)references/performance-patterns.md - Ensure ForEach uses stable identity (see
)references/list-patterns.md - Improve animation patterns (use value parameter, proper transitions, see
,references/animation-basics.md
)references/animation-transitions.md - Improve accessibility: use
over tap gestures, addButton
for Dynamic Type (see@ScaledMetric
)references/accessibility-patterns.md - Suggest image downsampling when
is used (as optional optimization, seeUIImage(data:)
)references/image-optimization.md - Adopt Liquid Glass only when explicitly requested by the user
3) Implement new SwiftUI feature
- First, consult
to use only current, non-deprecated APIs for the target deployment versionreferences/latest-apis.md - Design data flow first: identify owned vs injected state (see
)references/state-management.md - Structure views for optimal diffing (extract subviews early, see
)references/view-structure.md - Keep business logic in services and models for testability (see
)references/layout-best-practices.md - Use correct animation patterns (implicit vs explicit, transitions, see
,references/animation-basics.md
,references/animation-transitions.md
)references/animation-advanced.md - Use
for tappable elements, add accessibility grouping and labels (seeButton
)references/accessibility-patterns.md - Apply glass effects after layout/appearance modifiers (see
)references/liquid-glass.md - Gate iOS 26+ features with
and provide fallbacks#available
Imported: Overview
Use this skill to build, review, or improve SwiftUI features with correct state management, optimal view composition, and iOS 26+ Liquid Glass styling. Prioritize native APIs, Apple design guidance, and performance-conscious patterns. This skill focuses on facts and best practices without enforcing specific architectural patterns.
Imported: Review Checklist
Latest APIs (see references/latest-apis.md
)
references/latest-apis.md- No deprecated modifiers used (check against the quick lookup table)
- API choices match the project's minimum deployment target
State Management
-
properties are@Stateprivate -
only where child modifies parent state@Binding -
for owned,@StateObject
for injected@ObservedObject - iOS 17+:
with@State
,@Observable
for injected@Bindable - Passed values NOT declared as
or@State@StateObject - Nested
avoided (or passed directly to child views)ObservableObject
Sheets & Navigation (see references/sheet-navigation-patterns.md
)
references/sheet-navigation-patterns.md- Using
for model-based sheets.sheet(item:) - Sheets own their actions and dismiss internally
ScrollView (see references/scroll-patterns.md
)
references/scroll-patterns.md- Using
with stable IDs for programmatic scrollingScrollViewReader
View Structure (see references/view-structure.md
)
references/view-structure.md- Using modifiers instead of conditionals for state changes
- Complex views extracted to separate subviews
- Container views use
@ViewBuilder let content: Content
Performance (see references/performance-patterns.md
)
references/performance-patterns.md- View
kept simple and pure (no side effects)body - Passing only needed values (not large config objects)
- Eliminating unnecessary dependencies
- State updates check for value changes before assigning
- Hot paths minimize state updates
- No object creation in
body - Heavy computation moved out of
body
List Patterns (see references/list-patterns.md
)
references/list-patterns.md- ForEach uses stable identity (not
).indices - Constant number of views per ForEach element
- No inline filtering in ForEach
- No
in list rowsAnyView
Layout (see references/layout-best-practices.md
)
references/layout-best-practices.md- Avoiding layout thrash (deep hierarchies, excessive GeometryReader)
- Gating frequent geometry updates by thresholds
- Business logic kept in services and models (not in views)
- Action handlers reference methods (not inline logic)
- Using relative layout (not hard-coded constants)
- Views work in any context (context-agnostic)
Animations (see references/animation-basics.md
, references/animation-transitions.md
, references/animation-advanced.md
)
references/animation-basics.mdreferences/animation-transitions.mdreferences/animation-advanced.md- Using
with value parameter.animation(_:value:) - Using
for event-driven animationswithAnimation - Transitions paired with animations outside conditional structure
- Custom
has explicitAnimatable
implementationanimatableData - Preferring transforms over layout changes for animation performance
- Phase animations for multi-step sequences (iOS 17+)
- Keyframe animations for precise timing (iOS 17+)
- Completion handlers use
for reexecution.transaction(value:)
Accessibility (see references/accessibility-patterns.md
)
references/accessibility-patterns.md-
used instead ofButton
for tappable elementsonTapGesture -
used for custom values that should scale with Dynamic Type@ScaledMetric - Related elements grouped with
accessibilityElement(children:) - Custom controls use
when appropriateaccessibilityRepresentation
Liquid Glass (iOS 26+)
-
with fallback for Liquid Glass#available(iOS 26, *) - Multiple glass views wrapped in
GlassEffectContainer -
applied after layout/appearance modifiers.glassEffect() -
only on user-interactable elements.interactive() - Shapes and tints consistent across related elements
Examples
Example 1: Ask for the upstream workflow directly
Use @swiftui-expert-skill to handle <task>. Start from the copied upstream workflow, load only the files that change the outcome, and keep provenance visible in the answer.
Explanation: This is the safest starting point when the operator needs the imported workflow, but not the entire repository.
Example 2: Ask for a provenance-grounded review
Review @swiftui-expert-skill against metadata.json and ORIGIN.md, then explain which copied upstream files you would load first and why.
Explanation: Use this before review or troubleshooting when you need a precise, auditable explanation of origin and file selection.
Example 3: Narrow the copied support files before execution
Use @swiftui-expert-skill for <task>. Load only the copied references, examples, or scripts that change the outcome, and name the files explicitly before proceeding.
Explanation: This keeps the skill aligned with progressive disclosure instead of loading the whole copied package by default.
Example 4: Build a reviewer packet
Review @swiftui-expert-skill using the copied upstream files plus provenance, then summarize any gaps before merge.
Explanation: This is useful when the PR is waiting for human review and you want a repeatable audit packet.
Best Practices
Treat the generated public skill as a reviewable packaging layer around the upstream repository. The goal is to keep provenance explicit and load only the copied source material that materially improves execution.
- @State must be private; use for internal view state
- @Binding only when a child needs to modify parent state
- @StateObject when view creates the object; @ObservedObject when injected
- iOS 17+: Use @State with @Observable classes; use @Bindable for injected observables needing bindings
- Use let for read-only values; var + .onChange() for reactive reads
- Never pass values into @State or @StateObject — they only accept initial values
- Nested ObservableObject doesn't propagate changes — pass nested objects directly; @Observable handles nesting fine
Imported Operating Notes
Imported: Core Guidelines
State Management
must be@State
; use for internal view stateprivate
only when a child needs to modify parent state@Binding
when view creates the object;@StateObject
when injected@ObservedObject- iOS 17+: Use
with@State
classes; use@Observable
for injected observables needing bindings@Bindable - Use
for read-only values;let
+var
for reactive reads.onChange() - Never pass values into
or@State
— they only accept initial values@StateObject - Nested
doesn't propagate changes — pass nested objects directly;ObservableObject
handles nesting fine@Observable
View Composition
- Extract complex views into separate subviews for better readability and performance
- Prefer modifiers over conditional views for state changes (maintains view identity)
- Keep view
simple and pure (no side effects or complex logic)body - Use
functions only for small, simple sections@ViewBuilder - Prefer
over closure-based content properties@ViewBuilder let content: Content - Keep business logic in services and models; views should orchestrate UI flow
- Action handlers should reference methods, not contain inline logic
- Views should work in any context (don't assume screen size or presentation style)
Performance
- Pass only needed values to views (avoid large "config" or "context" objects)
- Eliminate unnecessary dependencies to reduce update fan-out
- Check for value changes before assigning state in hot paths
- Avoid redundant state updates in
,onReceive
, scroll handlersonChange - Minimize work in frequently executed code paths
- Use
/LazyVStack
for large listsLazyHStack - Use stable identity for
(neverForEach
for dynamic content).indices - Ensure constant number of views per
elementForEach - Avoid inline filtering in
(prefilter and cache)ForEach - Avoid
in list rowsAnyView - Consider POD views for fast diffing (or wrap expensive views in POD parents)
- Suggest image downsampling when
is encountered (as optional optimization)UIImage(data:) - Avoid layout thrash (deep hierarchies, excessive
)GeometryReader - Gate frequent geometry updates by thresholds
- Use
orSelf._logChanges()
to debug unexpected view updatesSelf._printChanges()
Animations
- Use
with value parameter (deprecated version without value is too broad).animation(_:value:) - Use
for event-driven animations (button taps, gestures)withAnimation - Prefer transforms (
,offset
,scale
) over layout changes (rotation
) for performanceframe - Transitions require animations outside the conditional structure
- Custom
implementations must have explicitAnimatableanimatableData - Use
for multi-step sequences (iOS 17+).phaseAnimator - Use
for precise timing control (iOS 17+).keyframeAnimator - Animation completion handlers need
for reexecution.transaction(value:) - Implicit animations override explicit animations (later in view tree wins)
Accessibility
- Prefer
overButton
for tappable elements (free VoiceOver support)onTapGesture - Use
for custom numeric values that should scale with Dynamic Type@ScaledMetric - Group related elements with
for joined labelsaccessibilityElement(children: .combine) - Provide
when default labels are unclear or missingaccessibilityLabel - Use
for custom controls that should behave like native onesaccessibilityRepresentation
Liquid Glass (iOS 26+)
Only adopt when explicitly requested by the user.
- Use native
,glassEffect
, and glass button stylesGlassEffectContainer - Wrap multiple glass elements in
GlassEffectContainer - Apply
after layout and visual modifiers.glassEffect() - Use
only for tappable/focusable elements.interactive() - Use
withglassEffectID
for morphing transitions@Namespace
Troubleshooting
Problem: The operator skipped the imported context and answered too generically
Symptoms: The result ignores the upstream workflow in
plugins/antigravity-awesome-skills-claude/skills/swiftui-expert-skill, fails to mention provenance, or does not use any copied source files at all.
Solution: Re-open metadata.json, ORIGIN.md, and the most relevant copied upstream files. Load only the files that materially change the answer, then restate the provenance before continuing.
Problem: The imported workflow feels incomplete during review
Symptoms: Reviewers can see the generated
SKILL.md, but they cannot quickly tell which references, examples, or scripts matter for the current task.
Solution: Point at the exact copied references, examples, scripts, or assets that justify the path you took. If the gap is still real, record it in the PR instead of hiding it.
Problem: The task drifted into a different specialization
Symptoms: The imported skill starts in the right place, but the work turns into debugging, architecture, design, security, or release orchestration that a native skill handles better. Solution: Use the related skills section to hand off deliberately. Keep the imported provenance visible so the next skill inherits the right context instead of starting blind.
Related Skills
- Use when the work is better handled by that native specialization after this imported skill establishes context.@supply-chain-risk-auditor
- Use when the work is better handled by that native specialization after this imported skill establishes context.@sveltekit
- Use when the work is better handled by that native specialization after this imported skill establishes context.@swift-concurrency-expert
- Use when the work is better handled by that native specialization after this imported skill establishes context.@swiftui-liquid-glass
Additional Resources
Use this support matrix and the linked files below as the operator packet for this imported skill. They should reflect real copied source material, not generic scaffolding.
| Resource family | What it gives the reviewer | Example path |
|---|---|---|
| copied reference notes, guides, or background material from upstream | |
| worked examples or reusable prompts copied from upstream | |
| upstream helper scripts that change execution or validation | |
| routing or delegation notes that are genuinely part of the imported package | |
| supporting assets or schemas copied from the source package | |
Imported Reference Notes
Imported: Quick Reference
Property Wrapper Selection
| Wrapper | Use When |
|---|---|
| Internal view state (must be ) |
| Child modifies parent's state |
| View owns an |
| View receives an |
| iOS 17+: Injected needing bindings |
| Read-only value from parent |
| Read-only value watched via |
Liquid Glass Patterns
// Basic glass effect with fallback if #available(iOS 26, *) { content .padding() .glassEffect(.regular.interactive(), in: .rect(cornerRadius: 16)) } else { content .padding() .background(.ultraThinMaterial, in: RoundedRectangle(cornerRadius: 16)) } // Grouped glass elements GlassEffectContainer(spacing: 24) { HStack(spacing: 24) { GlassButton1() GlassButton2() } } // Glass buttons Button("Confirm") { } .buttonStyle(.glassProminent)
Imported: References
- Required reading for all workflows. Version-segmented guide of deprecated-to-modern API transitions (iOS 15+ through iOS 26+)references/latest-apis.md
- Property wrappers and data flowreferences/state-management.md
- View composition, extraction, and container patternsreferences/view-structure.md
- Performance optimization techniques and anti-patternsreferences/performance-patterns.md
- ForEach identity, stability, and list best practicesreferences/list-patterns.md
- Layout patterns, context-agnostic views, and testabilityreferences/layout-best-practices.md
- Accessibility traits, grouping, Dynamic Type, and VoiceOverreferences/accessibility-patterns.md
- Core animation concepts, implicit/explicit animations, timing, performancereferences/animation-basics.md
- Transitions, custom transitions, Animatable protocolreferences/animation-transitions.md
- Transactions, phase/keyframe animations (iOS 17+), completion handlers (iOS 17+)references/animation-advanced.md
- Sheet presentation and navigation patternsreferences/sheet-navigation-patterns.md
- ScrollView patterns and programmatic scrollingreferences/scroll-patterns.md
- AsyncImage, image downsampling, and optimizationreferences/image-optimization.md
- iOS 26+ Liquid Glass APIreferences/liquid-glass.md
Imported: Philosophy
This skill focuses on facts and best practices, not architectural opinions:
- We don't enforce specific architectures (e.g., MVVM, VIPER)
- We do encourage separating business logic for testability
- We optimize for performance and maintainability
- We follow Apple's Human Interface Guidelines and API design patterns
Imported: Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.