Fold the strongest guidance from Apple's bundled swiftui-specialist skill into
the SwiftUI Expert Skill, deduplicating overlaps and fixing stale advice.
Fixes / corrections:
- list-patterns: `.enumerated()` no longer needs Array() on Swift 6.1+, and the
id must be the element's identity, not `\.offset` (same trap as `.indices`)
- list-patterns: make the unified-row example unary (wrap branching in a
container) so List can template row ids
- view-structure: soften the property-ordering mandate to an optional
readability suggestion (per AGENTS.md, no formatting rules)
Sharpened:
- view-structure: invalidation-boundary framing for extracting subviews, plus
the multi-section detail-view anti-pattern and a "don't auto-refactor .if"
review note
- performance-patterns: full rapidly-updating-environment pattern (coarsened
@Observable thresholds, per-item models, scrollTransition/visualEffect)
- animation-advanced: when to implement animatableData manually, AnimatableValues
(iOS 26+) vs AnimatablePair
Added:
- state-management: make @Observable property types Equatable (setter
short-circuit), per-property observation granularity traps + fixes, KeyPath
bindings over closure bindings, no closures in custom environment keys,
stable @Entry defaults, removing unused @Environment reads
- view-structure: keep view init cheap; single-child Group anti-pattern
- list-patterns: unary vs multi rows, -LogForEachSlowPath, stable/cheap ids
- new references/localization.md and references/soft-deprecation.md
- SKILL.md Topic Router, References list, Correctness Checklist, and trigger
description updated for the new coverage
The `.cursor-plugin/plugin.json` is now in place, so Option C no longer
needs the "coming soon" disclaimer. Point readers at the Cursor plugins
docs for installation instructions.
Co-authored-by: jack-old-archive <aven@users.noreply.github.com>
Per AGENTS.md, testing frameworks and patterns are excluded from this
skill. Drop the XCTest, XCUITest, snapshot testing, and @Observable
model testing sections, and rename the reference to previews.md so the
file name matches its remaining scope.
Also addresses the Copilot review:
- Remove the UIKit/AppKit preview section (off-mission per the
SwiftUI-first operating rule).
- Replace the invented URLSession.decode(_:from:) call with a real
URLSession.data(from:) + JSONDecoder pair.
- Switch the @Previewable @FocusState example from .onAppear writes to
.defaultFocus, matching focus-patterns.md.
- Soften the "use #Preview for all new previews" checklist item to a
preference, since PreviewProvider is not deprecated.
- Cross-link state-management.md and focus-patterns.md from the
preview docs.
- Restore the blank line between the correctness checklist and the
References section in SKILL.md.
GlassEffectStyle does not exist; the actual type is Glass. Also renames
the parameter label from style to glass to match the SDK signature, and
adds the missing isEnabled: Bool = true parameter to the modifier
signature and the glassEffectWithFallback helper example.
Glass.prominent does not exist in the shipping iOS 26 or macOS 26 SDKs.
The real static values are .regular, .clear, and .identity. Replace all
.prominent references with .regular (with tint for emphasis where needed)
and document the full set of available Glass statics.
Fixes#64
The skill currently has no coverage for testing or previews. Add a new
reference covering #Preview macro usage and traits, @Previewable for
inline bindings, mock data patterns for previews, XCTest strategies
for @Observable models and UI tests, ViewInspector for view-layer
unit testing, and snapshot testing with swift-snapshot-testing.