opencode-skills-antigravity 1.0.12 → 1.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/bundled-skills/app-store-changelog/SKILL.md +75 -0
  2. package/bundled-skills/app-store-changelog/agents/openai.yaml +4 -0
  3. package/bundled-skills/app-store-changelog/references/release-notes-guidelines.md +34 -0
  4. package/bundled-skills/app-store-changelog/scripts/collect_release_changes.sh +33 -0
  5. package/bundled-skills/docs/integrations/jetski-cortex.md +3 -3
  6. package/bundled-skills/docs/integrations/jetski-gemini-loader/README.md +1 -1
  7. package/bundled-skills/docs/maintainers/repo-growth-seo.md +3 -3
  8. package/bundled-skills/docs/maintainers/skills-update-guide.md +1 -1
  9. package/bundled-skills/docs/sources/sources.md +10 -0
  10. package/bundled-skills/docs/users/bundles.md +9 -1
  11. package/bundled-skills/docs/users/claude-code-skills.md +1 -1
  12. package/bundled-skills/docs/users/faq.md +36 -0
  13. package/bundled-skills/docs/users/gemini-cli-skills.md +1 -1
  14. package/bundled-skills/docs/users/getting-started.md +1 -1
  15. package/bundled-skills/docs/users/kiro-integration.md +1 -1
  16. package/bundled-skills/docs/users/usage.md +14 -4
  17. package/bundled-skills/docs/users/visual-guide.md +4 -4
  18. package/bundled-skills/github/SKILL.md +76 -0
  19. package/bundled-skills/github/agents/openai.yaml +4 -0
  20. package/bundled-skills/ios-debugger-agent/SKILL.md +59 -0
  21. package/bundled-skills/ios-debugger-agent/agents/openai.yaml +4 -0
  22. package/bundled-skills/macos-menubar-tuist-app/SKILL.md +109 -0
  23. package/bundled-skills/macos-menubar-tuist-app/agents/openai.yaml +4 -0
  24. package/bundled-skills/macos-spm-app-packaging/SKILL.md +105 -0
  25. package/bundled-skills/macos-spm-app-packaging/agents/openai.yaml +4 -0
  26. package/bundled-skills/macos-spm-app-packaging/assets/templates/bootstrap/Package.swift +17 -0
  27. package/bundled-skills/macos-spm-app-packaging/assets/templates/bootstrap/Sources/MyApp/Resources/.keep +0 -0
  28. package/bundled-skills/macos-spm-app-packaging/assets/templates/bootstrap/Sources/MyApp/main.swift +11 -0
  29. package/bundled-skills/macos-spm-app-packaging/assets/templates/bootstrap/version.env +2 -0
  30. package/bundled-skills/macos-spm-app-packaging/assets/templates/build_icon.sh +49 -0
  31. package/bundled-skills/macos-spm-app-packaging/assets/templates/compile_and_run.sh +63 -0
  32. package/bundled-skills/macos-spm-app-packaging/assets/templates/launch.sh +28 -0
  33. package/bundled-skills/macos-spm-app-packaging/assets/templates/make_appcast.sh +82 -0
  34. package/bundled-skills/macos-spm-app-packaging/assets/templates/package_app.sh +206 -0
  35. package/bundled-skills/macos-spm-app-packaging/assets/templates/setup_dev_signing.sh +52 -0
  36. package/bundled-skills/macos-spm-app-packaging/assets/templates/sign-and-notarize.sh +52 -0
  37. package/bundled-skills/macos-spm-app-packaging/assets/templates/version.env +2 -0
  38. package/bundled-skills/macos-spm-app-packaging/references/packaging.md +17 -0
  39. package/bundled-skills/macos-spm-app-packaging/references/release.md +32 -0
  40. package/bundled-skills/macos-spm-app-packaging/references/scaffold.md +79 -0
  41. package/bundled-skills/orchestrate-batch-refactor/SKILL.md +97 -0
  42. package/bundled-skills/orchestrate-batch-refactor/agents/openai.yaml +4 -0
  43. package/bundled-skills/orchestrate-batch-refactor/references/agent-prompt-templates.md +53 -0
  44. package/bundled-skills/orchestrate-batch-refactor/references/work-packet-template.md +31 -0
  45. package/bundled-skills/project-skill-audit/SKILL.md +190 -0
  46. package/bundled-skills/project-skill-audit/agents/openai.yaml +4 -0
  47. package/bundled-skills/react-component-performance/SKILL.md +135 -0
  48. package/bundled-skills/react-component-performance/agents/openai.yaml +4 -0
  49. package/bundled-skills/react-component-performance/references/examples.md +88 -0
  50. package/bundled-skills/simplify-code/SKILL.md +179 -0
  51. package/bundled-skills/snowflake-development/SKILL.md +233 -0
  52. package/bundled-skills/swift-concurrency-expert/SKILL.md +113 -0
  53. package/bundled-skills/swift-concurrency-expert/agents/openai.yaml +4 -0
  54. package/bundled-skills/swift-concurrency-expert/references/approachable-concurrency.md +63 -0
  55. package/bundled-skills/swift-concurrency-expert/references/swift-6-2-concurrency.md +272 -0
  56. package/bundled-skills/swift-concurrency-expert/references/swiftui-concurrency-tour-wwdc.md +33 -0
  57. package/bundled-skills/swiftui-liquid-glass/SKILL.md +98 -0
  58. package/bundled-skills/swiftui-liquid-glass/agents/openai.yaml +4 -0
  59. package/bundled-skills/swiftui-liquid-glass/references/liquid-glass.md +280 -0
  60. package/bundled-skills/swiftui-performance-audit/SKILL.md +114 -0
  61. package/bundled-skills/swiftui-performance-audit/agents/openai.yaml +4 -0
  62. package/bundled-skills/swiftui-performance-audit/references/code-smells.md +150 -0
  63. package/bundled-skills/swiftui-performance-audit/references/demystify-swiftui-performance-wwdc23.md +46 -0
  64. package/bundled-skills/swiftui-performance-audit/references/optimizing-swiftui-performance-instruments.md +29 -0
  65. package/bundled-skills/swiftui-performance-audit/references/profiling-intake.md +44 -0
  66. package/bundled-skills/swiftui-performance-audit/references/report-template.md +47 -0
  67. package/bundled-skills/swiftui-performance-audit/references/understanding-hangs-in-your-app.md +33 -0
  68. package/bundled-skills/swiftui-performance-audit/references/understanding-improving-swiftui-performance.md +52 -0
  69. package/bundled-skills/swiftui-ui-patterns/SKILL.md +103 -0
  70. package/bundled-skills/swiftui-ui-patterns/agents/openai.yaml +4 -0
  71. package/bundled-skills/swiftui-ui-patterns/references/app-wiring.md +201 -0
  72. package/bundled-skills/swiftui-ui-patterns/references/async-state.md +96 -0
  73. package/bundled-skills/swiftui-ui-patterns/references/components-index.md +50 -0
  74. package/bundled-skills/swiftui-ui-patterns/references/controls.md +57 -0
  75. package/bundled-skills/swiftui-ui-patterns/references/deeplinks.md +66 -0
  76. package/bundled-skills/swiftui-ui-patterns/references/focus.md +90 -0
  77. package/bundled-skills/swiftui-ui-patterns/references/form.md +97 -0
  78. package/bundled-skills/swiftui-ui-patterns/references/grids.md +71 -0
  79. package/bundled-skills/swiftui-ui-patterns/references/haptics.md +71 -0
  80. package/bundled-skills/swiftui-ui-patterns/references/input-toolbar.md +51 -0
  81. package/bundled-skills/swiftui-ui-patterns/references/lightweight-clients.md +93 -0
  82. package/bundled-skills/swiftui-ui-patterns/references/list.md +86 -0
  83. package/bundled-skills/swiftui-ui-patterns/references/loading-placeholders.md +38 -0
  84. package/bundled-skills/swiftui-ui-patterns/references/macos-settings.md +71 -0
  85. package/bundled-skills/swiftui-ui-patterns/references/matched-transitions.md +59 -0
  86. package/bundled-skills/swiftui-ui-patterns/references/media.md +73 -0
  87. package/bundled-skills/swiftui-ui-patterns/references/menu-bar.md +101 -0
  88. package/bundled-skills/swiftui-ui-patterns/references/navigationstack.md +159 -0
  89. package/bundled-skills/swiftui-ui-patterns/references/overlay.md +45 -0
  90. package/bundled-skills/swiftui-ui-patterns/references/performance.md +62 -0
  91. package/bundled-skills/swiftui-ui-patterns/references/previews.md +48 -0
  92. package/bundled-skills/swiftui-ui-patterns/references/scroll-reveal.md +133 -0
  93. package/bundled-skills/swiftui-ui-patterns/references/scrollview.md +87 -0
  94. package/bundled-skills/swiftui-ui-patterns/references/searchable.md +71 -0
  95. package/bundled-skills/swiftui-ui-patterns/references/sheets.md +155 -0
  96. package/bundled-skills/swiftui-ui-patterns/references/split-views.md +72 -0
  97. package/bundled-skills/swiftui-ui-patterns/references/tabview.md +114 -0
  98. package/bundled-skills/swiftui-ui-patterns/references/theming.md +71 -0
  99. package/bundled-skills/swiftui-ui-patterns/references/title-menus.md +93 -0
  100. package/bundled-skills/swiftui-ui-patterns/references/top-bar.md +49 -0
  101. package/bundled-skills/swiftui-view-refactor/SKILL.md +210 -0
  102. package/bundled-skills/swiftui-view-refactor/agents/openai.yaml +4 -0
  103. package/bundled-skills/swiftui-view-refactor/references/mv-patterns.md +161 -0
  104. package/bundled-skills/wordpress/SKILL.md +281 -4
  105. package/bundled-skills/wordpress-penetration-testing/SKILL.md +106 -1
  106. package/bundled-skills/wordpress-plugin-development/SKILL.md +296 -3
  107. package/bundled-skills/wordpress-theme-development/SKILL.md +316 -3
  108. package/bundled-skills/wordpress-woocommerce-development/SKILL.md +442 -2
  109. package/package.json +1 -1
@@ -0,0 +1,33 @@
1
+ # SwiftUI Concurrency Tour (Summary)
2
+
3
+ Context: SwiftUI-focused concurrency overview covering actor isolation, Sendable closures, and how SwiftUI runs work off the main thread.
4
+
5
+ ## Main-actor default in SwiftUI
6
+
7
+ - `View` is `@MainActor` isolated by default; members and `body` inherit isolation.
8
+ - Swift 6.2 can infer `@MainActor` for all types in a module (new language mode).
9
+ - This default simplifies UI code and aligns with UIKit/AppKit `@MainActor` APIs.
10
+
11
+ ## Where SwiftUI runs code off the main thread
12
+
13
+ - SwiftUI may evaluate some view logic on background threads for performance.
14
+ - Examples: `Shape` path generation, `Layout` methods, `visualEffect` closures, and `onGeometryChange` closures.
15
+ - These APIs often require `Sendable` closures to reflect their runtime semantics.
16
+
17
+ ## Sendable closures and data-race safety
18
+
19
+ - Accessing `@MainActor` state from a `Sendable` closure is unsafe and flagged by the compiler.
20
+ - Prefer capturing value copies in the closure capture list (e.g., copy a `Bool`).
21
+ - Avoid sending `self` into a sendable closure just to read a single property.
22
+
23
+ ## Structuring async work with SwiftUI
24
+
25
+ - SwiftUI action callbacks are synchronous so UI updates (like loading states) can be immediate.
26
+ - Use `Task` to bridge into async contexts; keep async bodies minimal.
27
+ - Use state as the boundary: async work updates model/state; UI reacts synchronously.
28
+
29
+ ## Performance-driven concurrency
30
+
31
+ - Offload expensive work from the main actor to avoid hitches.
32
+ - Keep time-sensitive UI logic (animations, gesture responses) synchronous.
33
+ - Separate UI code from long-running async work to improve responsiveness and testability.
@@ -0,0 +1,98 @@
1
+ ---
2
+ name: swiftui-liquid-glass
3
+ description: Implement or review SwiftUI Liquid Glass APIs with correct fallbacks and modifier order.
4
+ risk: safe
5
+ source: "Dimillian/Skills (MIT)"
6
+ date_added: "2026-03-25"
7
+ ---
8
+
9
+ # SwiftUI Liquid Glass
10
+
11
+ ## Overview
12
+ Use this skill to build or review SwiftUI features that fully align with the iOS 26+ Liquid Glass API. Prioritize native APIs (`glassEffect`, `GlassEffectContainer`, glass button styles) and Apple design guidance. Keep usage consistent, interactive where needed, and performance aware.
13
+
14
+ ## When to Use
15
+
16
+ - When the user wants to adopt or review Liquid Glass in SwiftUI UI.
17
+ - When you need correct API usage, fallback handling, or modifier ordering for Liquid Glass.
18
+
19
+ ## Workflow Decision Tree
20
+ Choose the path that matches the request:
21
+
22
+ ### 1) Review an existing feature
23
+ - Inspect where Liquid Glass should be used and where it should not.
24
+ - Verify correct modifier order, shape usage, and container placement.
25
+ - Check for iOS 26+ availability handling and sensible fallbacks.
26
+
27
+ ### 2) Improve a feature using Liquid Glass
28
+ - Identify target components for glass treatment (surfaces, chips, buttons, cards).
29
+ - Refactor to use `GlassEffectContainer` where multiple glass elements appear.
30
+ - Introduce interactive glass only for tappable or focusable elements.
31
+
32
+ ### 3) Implement a new feature using Liquid Glass
33
+ - Design the glass surfaces and interactions first (shape, prominence, grouping).
34
+ - Add glass modifiers after layout/appearance modifiers.
35
+ - Add morphing transitions only when the view hierarchy changes with animation.
36
+
37
+ ## Core Guidelines
38
+ - Prefer native Liquid Glass APIs over custom blurs.
39
+ - Use `GlassEffectContainer` when multiple glass elements coexist.
40
+ - Apply `.glassEffect(...)` after layout and visual modifiers.
41
+ - Use `.interactive()` for elements that respond to touch/pointer.
42
+ - Keep shapes consistent across related elements for a cohesive look.
43
+ - Gate with `#available(iOS 26, *)` and provide a non-glass fallback.
44
+
45
+ ## Review Checklist
46
+ - **Availability**: `#available(iOS 26, *)` present with fallback UI.
47
+ - **Composition**: Multiple glass views wrapped in `GlassEffectContainer`.
48
+ - **Modifier order**: `glassEffect` applied after layout/appearance modifiers.
49
+ - **Interactivity**: `interactive()` only where user interaction exists.
50
+ - **Transitions**: `glassEffectID` used with `@Namespace` for morphing.
51
+ - **Consistency**: Shapes, tinting, and spacing align across the feature.
52
+
53
+ ## Implementation Checklist
54
+ - Define target elements and desired glass prominence.
55
+ - Wrap grouped glass elements in `GlassEffectContainer` and tune spacing.
56
+ - Use `.glassEffect(.regular.tint(...).interactive(), in: .rect(cornerRadius: ...))` as needed.
57
+ - Use `.buttonStyle(.glass)` / `.buttonStyle(.glassProminent)` for actions.
58
+ - Add morphing transitions with `glassEffectID` when hierarchy changes.
59
+ - Provide fallback materials and visuals for earlier iOS versions.
60
+
61
+ ## Quick Snippets
62
+ Use these patterns directly and tailor shapes/tints/spacing.
63
+
64
+ ```swift
65
+ if #available(iOS 26, *) {
66
+ Text("Hello")
67
+ .padding()
68
+ .glassEffect(.regular.interactive(), in: .rect(cornerRadius: 16))
69
+ } else {
70
+ Text("Hello")
71
+ .padding()
72
+ .background(.ultraThinMaterial, in: RoundedRectangle(cornerRadius: 16))
73
+ }
74
+ ```
75
+
76
+ ```swift
77
+ GlassEffectContainer(spacing: 24) {
78
+ HStack(spacing: 24) {
79
+ Image(systemName: "scribble.variable")
80
+ .frame(width: 72, height: 72)
81
+ .font(.system(size: 32))
82
+ .glassEffect()
83
+ Image(systemName: "eraser.fill")
84
+ .frame(width: 72, height: 72)
85
+ .font(.system(size: 32))
86
+ .glassEffect()
87
+ }
88
+ }
89
+ ```
90
+
91
+ ```swift
92
+ Button("Confirm") { }
93
+ .buttonStyle(.glassProminent)
94
+ ```
95
+
96
+ ## Resources
97
+ - Reference guide: `references/liquid-glass.md`
98
+ - Prefer Apple docs for up-to-date API details.
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "SwiftUI Liquid Glass"
3
+ short_description: "Build SwiftUI Liquid Glass features"
4
+ default_prompt: "Use $swiftui-liquid-glass to implement or review a SwiftUI feature using Liquid Glass APIs."
@@ -0,0 +1,280 @@
1
+ # Implementing Liquid Glass Design in SwiftUI
2
+
3
+ ## Overview
4
+
5
+ Liquid Glass is a dynamic material introduced in iOS that combines the optical properties of glass with a sense of fluidity. It blurs content behind it, reflects color and light from surrounding content, and reacts to touch and pointer interactions in real time. This guide covers how to implement and customize Liquid Glass effects in SwiftUI applications. You should always seek guides on Liquid Glass when asked for help adopting new Apple design.
6
+
7
+ Key features of Liquid Glass:
8
+ - Blurs content behind the material
9
+ - Reflects color and light from surrounding content
10
+ - Reacts to touch and pointer interactions
11
+ - Can morph between shapes during transitions
12
+ - Available for standard and custom components
13
+
14
+ ## Basic Implementation
15
+
16
+ ### Adding Liquid Glass to a View
17
+
18
+ The simplest way to add Liquid Glass to a view is using the `glassEffect()` modifier:
19
+
20
+ ```swift
21
+ Text("Hello, World!")
22
+ .font(.title)
23
+ .padding()
24
+ .glassEffect()
25
+ ```
26
+
27
+ By default, this applies the regular variant of Glass within a Capsule shape behind the view's content.
28
+
29
+ ### Customizing the Shape
30
+
31
+ You can specify a different shape for the Liquid Glass effect:
32
+
33
+ ```swift
34
+ Text("Hello, World!")
35
+ .font(.title)
36
+ .padding()
37
+ .glassEffect(in: .rect(cornerRadius: 16.0))
38
+ ```
39
+
40
+ Common shape options:
41
+ - `.capsule` (default)
42
+ - `.rect(cornerRadius: CGFloat)`
43
+ - `.circle`
44
+
45
+ ## Customizing Liquid Glass Effects
46
+
47
+ ### Glass Variants and Properties
48
+
49
+ You can customize the Liquid Glass effect by configuring the `Glass` structure:
50
+
51
+ ```swift
52
+ Text("Hello, World!")
53
+ .font(.title)
54
+ .padding()
55
+ .glassEffect(.regular.tint(.orange).interactive())
56
+ ```
57
+
58
+ Key customization options:
59
+ - `.regular` - Standard glass effect
60
+ - `.tint(Color)` - Add a color tint to suggest prominence
61
+ - `.interactive(Bool)` - Make the glass react to touch and pointer interactions
62
+
63
+ ### Making Interactive Glass
64
+
65
+ To make Liquid Glass react to touch and pointer interactions:
66
+
67
+ ```swift
68
+ Text("Hello, World!")
69
+ .font(.title)
70
+ .padding()
71
+ .glassEffect(.regular.interactive(true))
72
+ ```
73
+
74
+ Or more concisely:
75
+
76
+ ```swift
77
+ Text("Hello, World!")
78
+ .font(.title)
79
+ .padding()
80
+ .glassEffect(.regular.interactive())
81
+ ```
82
+
83
+ ## Working with Multiple Glass Effects
84
+
85
+ ### Using GlassEffectContainer
86
+
87
+ When applying Liquid Glass effects to multiple views, use `GlassEffectContainer` for better rendering performance and to enable blending and morphing effects:
88
+
89
+ ```swift
90
+ GlassEffectContainer(spacing: 40.0) {
91
+ HStack(spacing: 40.0) {
92
+ Image(systemName: "scribble.variable")
93
+ .frame(width: 80.0, height: 80.0)
94
+ .font(.system(size: 36))
95
+ .glassEffect()
96
+
97
+ Image(systemName: "eraser.fill")
98
+ .frame(width: 80.0, height: 80.0)
99
+ .font(.system(size: 36))
100
+ .glassEffect()
101
+ }
102
+ }
103
+ ```
104
+
105
+ The `spacing` parameter controls how the Liquid Glass effects interact with each other:
106
+ - Smaller spacing: Views need to be closer to merge effects
107
+ - Larger spacing: Effects merge at greater distances
108
+
109
+ ### Uniting Multiple Glass Effects
110
+
111
+ To combine multiple views into a single Liquid Glass effect, use the `glassEffectUnion` modifier:
112
+
113
+ ```swift
114
+ @Namespace private var namespace
115
+
116
+ // Later in your view:
117
+ GlassEffectContainer(spacing: 20.0) {
118
+ HStack(spacing: 20.0) {
119
+ ForEach(symbolSet.indices, id: \.self) { item in
120
+ Image(systemName: symbolSet[item])
121
+ .frame(width: 80.0, height: 80.0)
122
+ .font(.system(size: 36))
123
+ .glassEffect()
124
+ .glassEffectUnion(id: item < 2 ? "1" : "2", namespace: namespace)
125
+ }
126
+ }
127
+ }
128
+ ```
129
+
130
+ This is useful when creating views dynamically or with views that live outside of an HStack or VStack.
131
+
132
+ ## Morphing Effects and Transitions
133
+
134
+ ### Creating Morphing Transitions
135
+
136
+ To create morphing effects during transitions between views with Liquid Glass:
137
+
138
+ 1. Create a namespace using the `@Namespace` property wrapper
139
+ 2. Associate each Liquid Glass effect with a unique identifier using `glassEffectID`
140
+ 3. Use animations when changing the view hierarchy
141
+
142
+ ```swift
143
+ @State private var isExpanded: Bool = false
144
+ @Namespace private var namespace
145
+
146
+ var body: some View {
147
+ GlassEffectContainer(spacing: 40.0) {
148
+ HStack(spacing: 40.0) {
149
+ Image(systemName: "scribble.variable")
150
+ .frame(width: 80.0, height: 80.0)
151
+ .font(.system(size: 36))
152
+ .glassEffect()
153
+ .glassEffectID("pencil", in: namespace)
154
+
155
+ if isExpanded {
156
+ Image(systemName: "eraser.fill")
157
+ .frame(width: 80.0, height: 80.0)
158
+ .font(.system(size: 36))
159
+ .glassEffect()
160
+ .glassEffectID("eraser", in: namespace)
161
+ }
162
+ }
163
+ }
164
+
165
+ Button("Toggle") {
166
+ withAnimation {
167
+ isExpanded.toggle()
168
+ }
169
+ }
170
+ .buttonStyle(.glass)
171
+ }
172
+ ```
173
+
174
+ The morphing effect occurs when views with Liquid Glass appear or disappear due to view hierarchy changes.
175
+
176
+ ## Button Styling with Liquid Glass
177
+
178
+ ### Glass Button Style
179
+
180
+ SwiftUI provides built-in button styles for Liquid Glass:
181
+
182
+ ```swift
183
+ Button("Click Me") {
184
+ // Action
185
+ }
186
+ .buttonStyle(.glass)
187
+ ```
188
+
189
+ ### Glass Prominent Button Style
190
+
191
+ For a more prominent glass button:
192
+
193
+ ```swift
194
+ Button("Important Action") {
195
+ // Action
196
+ }
197
+ .buttonStyle(.glassProminent)
198
+ ```
199
+
200
+ ## Advanced Techniques
201
+
202
+ ### Background Extension Effect
203
+
204
+ To stretch content behind a sidebar or inspector with the background extension effect:
205
+
206
+ ```swift
207
+ NavigationSplitView {
208
+ // Sidebar content
209
+ } detail: {
210
+ // Detail content
211
+ .background {
212
+ // Background content that extends under the sidebar
213
+ }
214
+ }
215
+ ```
216
+
217
+ ### Extending Horizontal Scrolling Under Sidebar
218
+
219
+ To extend horizontal scroll views under a sidebar or inspector:
220
+
221
+ ```swift
222
+ ScrollView(.horizontal) {
223
+ // Scrollable content
224
+ }
225
+ .scrollExtensionMode(.underSidebar)
226
+ ```
227
+
228
+ ## Best Practices
229
+
230
+ 1. **Container Usage**: Always use `GlassEffectContainer` when applying Liquid Glass to multiple views for better performance and morphing effects.
231
+
232
+ 2. **Effect Order**: Apply the `.glassEffect()` modifier after other modifiers that affect the appearance of the view.
233
+
234
+ 3. **Spacing Consideration**: Carefully choose spacing values in containers to control how and when glass effects merge.
235
+
236
+ 4. **Animation**: Use animations when changing view hierarchies to enable smooth morphing transitions.
237
+
238
+ 5. **Interactivity**: Add `.interactive()` to glass effects that should respond to user interaction.
239
+
240
+ 6. **Consistent Design**: Maintain consistent shapes and styles across your app for a cohesive look and feel.
241
+
242
+ ## Example: Custom Badge with Liquid Glass
243
+
244
+ ```swift
245
+ struct BadgeView: View {
246
+ let symbol: String
247
+ let color: Color
248
+
249
+ var body: some View {
250
+ ZStack {
251
+ Image(systemName: "hexagon.fill")
252
+ .foregroundColor(color)
253
+ .font(.system(size: 50))
254
+
255
+ Image(systemName: symbol)
256
+ .foregroundColor(.white)
257
+ .font(.system(size: 30))
258
+ }
259
+ .glassEffect(.regular, in: .rect(cornerRadius: 16))
260
+ }
261
+ }
262
+
263
+ // Usage:
264
+ GlassEffectContainer(spacing: 20) {
265
+ HStack(spacing: 20) {
266
+ BadgeView(symbol: "star.fill", color: .blue)
267
+ BadgeView(symbol: "heart.fill", color: .red)
268
+ BadgeView(symbol: "leaf.fill", color: .green)
269
+ }
270
+ }
271
+ ```
272
+
273
+ ## References
274
+
275
+ - [Applying Liquid Glass to custom views](https://developer.apple.com/documentation/SwiftUI/Applying-Liquid-Glass-to-custom-views)
276
+ - [Landmarks: Building an app with Liquid Glass](https://developer.apple.com/documentation/SwiftUI/Landmarks-Building-an-app-with-Liquid-Glass)
277
+ - [SwiftUI View.glassEffect(_:in:isEnabled:)](https://developer.apple.com/documentation/SwiftUI/View/glassEffect(_:in:isEnabled:))
278
+ - [SwiftUI GlassEffectContainer](https://developer.apple.com/documentation/SwiftUI/GlassEffectContainer)
279
+ - [SwiftUI GlassEffectTransition](https://developer.apple.com/documentation/SwiftUI/GlassEffectTransition)
280
+ - [SwiftUI GlassButtonStyle](https://developer.apple.com/documentation/SwiftUI/GlassButtonStyle)
@@ -0,0 +1,114 @@
1
+ ---
2
+ name: swiftui-performance-audit
3
+ description: Audit SwiftUI performance issues from code review and profiling evidence.
4
+ risk: safe
5
+ source: "Dimillian/Skills (MIT)"
6
+ date_added: "2026-03-25"
7
+ ---
8
+
9
+ # SwiftUI Performance Audit
10
+
11
+ ## Quick start
12
+
13
+ Use this skill to diagnose SwiftUI performance issues from code first, then request profiling evidence when code review alone cannot explain the symptoms.
14
+
15
+ ## When to Use
16
+
17
+ - When the user reports slow rendering, janky scrolling, layout thrash, or high CPU in SwiftUI.
18
+ - When you need a code-first audit plus Instruments guidance if profiling evidence is required.
19
+
20
+ ## Workflow
21
+
22
+ 1. Classify the symptom: slow rendering, janky scrolling, high CPU, memory growth, hangs, or excessive view updates.
23
+ 2. If code is available, start with a code-first review using `references/code-smells.md`.
24
+ 3. If code is not available, ask for the smallest useful slice: target view, data flow, reproduction steps, and deployment target.
25
+ 4. If code review is inconclusive or runtime evidence is required, guide the user through profiling with `references/profiling-intake.md`.
26
+ 5. Summarize likely causes, evidence, remediation, and validation steps using `references/report-template.md`.
27
+
28
+ ## 1. Intake
29
+
30
+ Collect:
31
+ - Target view or feature code.
32
+ - Symptoms and exact reproduction steps.
33
+ - Data flow: `@State`, `@Binding`, environment dependencies, and observable models.
34
+ - Whether the issue shows up on device or simulator, and whether it was observed in Debug or Release.
35
+
36
+ Ask the user to classify the issue if possible:
37
+ - CPU spike or battery drain
38
+ - Janky scrolling or dropped frames
39
+ - High memory or image pressure
40
+ - Hangs or unresponsive interactions
41
+ - Excessive or unexpectedly broad view updates
42
+
43
+ For the full profiling intake checklist, read `references/profiling-intake.md`.
44
+
45
+ ## 2. Code-First Review
46
+
47
+ Focus on:
48
+ - Invalidation storms from broad observation or environment reads.
49
+ - Unstable identity in lists and `ForEach`.
50
+ - Heavy derived work in `body` or view builders.
51
+ - Layout thrash from complex hierarchies, `GeometryReader`, or preference chains.
52
+ - Large image decode or resize work on the main thread.
53
+ - Animation or transition work applied too broadly.
54
+
55
+ Use `references/code-smells.md` for the detailed smell catalog and fix guidance.
56
+
57
+ Provide:
58
+ - Likely root causes with code references.
59
+ - Suggested fixes and refactors.
60
+ - If needed, a minimal repro or instrumentation suggestion.
61
+
62
+ ## 3. Guide the User to Profile
63
+
64
+ If code review does not explain the issue, ask for runtime evidence:
65
+ - A trace export or screenshots of the SwiftUI timeline and Time Profiler call tree.
66
+ - Device/OS/build configuration.
67
+ - The exact interaction being profiled.
68
+ - Before/after metrics if the user is comparing a change.
69
+
70
+ Use `references/profiling-intake.md` for the exact checklist and collection steps.
71
+
72
+ ## 4. Analyze and Diagnose
73
+
74
+ - Map the evidence to the most likely category: invalidation, identity churn, layout thrash, main-thread work, image cost, or animation cost.
75
+ - Prioritize problems by impact, not by how easy they are to explain.
76
+ - Distinguish code-level suspicion from trace-backed evidence.
77
+ - Call out when profiling is still insufficient and what additional evidence would reduce uncertainty.
78
+
79
+ ## 5. Remediate
80
+
81
+ Apply targeted fixes:
82
+ - Narrow state scope and reduce broad observation fan-out.
83
+ - Stabilize identities for `ForEach` and lists.
84
+ - Move heavy work out of `body` into derived state updated from inputs, model-layer precomputation, memoized helpers, or background preprocessing. Use `@State` only for view-owned state, not as an ad hoc cache for arbitrary computation.
85
+ - Use `equatable()` only when equality is cheaper than recomputing the subtree and the inputs are truly value-semantic.
86
+ - Downsample images before rendering.
87
+ - Reduce layout complexity or use fixed sizing where possible.
88
+
89
+ Use `references/code-smells.md` for examples, Observation-specific fan-out guidance, and remediation patterns.
90
+
91
+ ## 6. Verify
92
+
93
+ Ask the user to re-run the same capture and compare with baseline metrics.
94
+ Summarize the delta (CPU, frame drops, memory peak) if provided.
95
+
96
+ ## Outputs
97
+
98
+ Provide:
99
+ - A short metrics table (before/after if available).
100
+ - Top issues (ordered by impact).
101
+ - Proposed fixes with estimated effort.
102
+
103
+ Use `references/report-template.md` when formatting the final audit.
104
+
105
+ ## References
106
+
107
+ - Profiling intake and collection checklist: `references/profiling-intake.md`
108
+ - Common code smells and remediation patterns: `references/code-smells.md`
109
+ - Audit output template: `references/report-template.md`
110
+ - Add Apple documentation and WWDC resources under `references/` as they are supplied by the user.
111
+ - Optimizing SwiftUI performance with Instruments: `references/optimizing-swiftui-performance-instruments.md`
112
+ - Understanding and improving SwiftUI performance: `references/understanding-improving-swiftui-performance.md`
113
+ - Understanding hangs in your app: `references/understanding-hangs-in-your-app.md`
114
+ - Demystify SwiftUI performance (WWDC23): `references/demystify-swiftui-performance-wwdc23.md`
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "SwiftUI Performance Audit"
3
+ short_description: "Audit SwiftUI runtime performance"
4
+ default_prompt: "Use $swiftui-performance-audit to review this SwiftUI code for performance issues and suggest concrete fixes."
@@ -0,0 +1,150 @@
1
+ # Common code smells and remediation patterns
2
+
3
+ ## Intent
4
+
5
+ Use this reference during code-first review to map visible SwiftUI patterns to likely runtime costs and safer remediation guidance.
6
+
7
+ ## High-priority smells
8
+
9
+ ### Expensive formatters in `body`
10
+
11
+ ```swift
12
+ var body: some View {
13
+ let number = NumberFormatter()
14
+ let measure = MeasurementFormatter()
15
+ Text(measure.string(from: .init(value: meters, unit: .meters)))
16
+ }
17
+ ```
18
+
19
+ Prefer cached formatters in a model or dedicated helper:
20
+
21
+ ```swift
22
+ final class DistanceFormatter {
23
+ static let shared = DistanceFormatter()
24
+ let number = NumberFormatter()
25
+ let measure = MeasurementFormatter()
26
+ }
27
+ ```
28
+
29
+ ### Heavy computed properties
30
+
31
+ ```swift
32
+ var filtered: [Item] {
33
+ items.filter { $0.isEnabled }
34
+ }
35
+ ```
36
+
37
+ Prefer deriving this once per meaningful input change in a model/helper, or store derived view-owned state only when the view truly owns the transformation lifecycle.
38
+
39
+ ### Sorting or filtering inside `body`
40
+
41
+ ```swift
42
+ List {
43
+ ForEach(items.sorted(by: sortRule)) { item in
44
+ Row(item)
45
+ }
46
+ }
47
+ ```
48
+
49
+ Prefer sorting before render work begins:
50
+
51
+ ```swift
52
+ let sortedItems = items.sorted(by: sortRule)
53
+ ```
54
+
55
+ ### Inline filtering inside `ForEach`
56
+
57
+ ```swift
58
+ ForEach(items.filter { $0.isEnabled }) { item in
59
+ Row(item)
60
+ }
61
+ ```
62
+
63
+ Prefer a prefiltered collection with stable identity.
64
+
65
+ ### Unstable identity
66
+
67
+ ```swift
68
+ ForEach(items, id: \.self) { item in
69
+ Row(item)
70
+ }
71
+ ```
72
+
73
+ Avoid `id: \.self` for non-stable values or collections that reorder. Use a stable domain identifier.
74
+
75
+ ### Top-level conditional view swapping
76
+
77
+ ```swift
78
+ var content: some View {
79
+ if isEditing {
80
+ editingView
81
+ } else {
82
+ readOnlyView
83
+ }
84
+ }
85
+ ```
86
+
87
+ Prefer one stable base view and localize conditions to sections or modifiers. This reduces root identity churn and makes diffing cheaper.
88
+
89
+ ### Image decoding on the main thread
90
+
91
+ ```swift
92
+ Image(uiImage: UIImage(data: data)!)
93
+ ```
94
+
95
+ Prefer decode and downsample work off the main thread, then store the processed image.
96
+
97
+ ## Observation fan-out
98
+
99
+ ### Broad `@Observable` reads on iOS 17+
100
+
101
+ ```swift
102
+ @Observable final class Model {
103
+ var items: [Item] = []
104
+ }
105
+
106
+ var body: some View {
107
+ Row(isFavorite: model.items.contains(item))
108
+ }
109
+ ```
110
+
111
+ If many views read the same broad collection or root model, small changes can fan out into wide invalidation. Prefer narrower derived inputs, smaller observable surfaces, or per-item state closer to the leaf views.
112
+
113
+ ### Broad `ObservableObject` reads on iOS 16 and earlier
114
+
115
+ ```swift
116
+ final class Model: ObservableObject {
117
+ @Published var items: [Item] = []
118
+ }
119
+ ```
120
+
121
+ The same warning applies to legacy observation. Avoid having many descendants observe a large shared object when they only need one derived field.
122
+
123
+ ## Remediation notes
124
+
125
+ ### `@State` is not a generic cache
126
+
127
+ Use `@State` for view-owned state and derived values that intentionally belong to the view lifecycle. Do not move arbitrary expensive computation into `@State` unless you also define when and why it updates.
128
+
129
+ Better alternatives:
130
+ - precompute in the model or store
131
+ - update derived state in response to a specific input change
132
+ - memoize in a dedicated helper
133
+ - preprocess on a background task before rendering
134
+
135
+ ### `equatable()` is conditional guidance
136
+
137
+ Use `equatable()` only when:
138
+ - equality is cheaper than recomputing the subtree, and
139
+ - the view inputs are value-semantic and stable enough for meaningful equality checks
140
+
141
+ Do not apply `equatable()` as a blanket fix for all redraws.
142
+
143
+ ## Triage order
144
+
145
+ When multiple smells appear together, prioritize in this order:
146
+ 1. Broad invalidation and observation fan-out
147
+ 2. Unstable identity and list churn
148
+ 3. Main-thread work during render
149
+ 4. Image decode or resize cost
150
+ 5. Layout and animation complexity