swift
- Repo stars 0
- Author repo skills-registry
- Domain
- Engineering
- Author-declared agents
- No explicit declaration found; this is not inferred or tested compatibility
- Static check
- 88 / 100 · heuristic scan, not runtime safety proof
- Runtime evidence
- Not run; no isolated runtime test evidence is currently recorded
- Author / version / license
- @tomevault-io · no license declared
- Token usage
- Lean
- Setup complexity
- Guided setup
- External API key
- Not required
- Operating systems
- Windows
- Runtime requirements
- No explicit requirements detected
- Detected file/system behavior
-
- Read-only
- Write / modify
- Shell exec
- Network behavior
- Local-only
- Install commands
- None (reference only)
Heads up: Tool permissions are not declared; actual access depends on the runtime.
# Swift/SwiftUI Best Practices
## SwiftUI View Composition
- Break views into small, single-responsibility components; extract reusable pieces into `View` structs
- Use `@ViewBuilder` for conditional and grouped content; prefer composition over deep nesting
- Apply modifiers consistently -- chain them in a logical order: layout -> appearance -> accessibility
- Use `ViewModifier` protocol for reusable modifier groups shared across views
- Keep view bodies free of business logic; move computation to ViewModels or use computed properties on the model
## Swift Concurrency
- Use `async/await` as the primary concurrency model; avoid completion handlers in new code
- Adopt `Actor` for shared mutable state isolation: `actor DataStore { ... }`
- Use `TaskGroup` for structured concurrency when spawning dynamic child tasks
- Apply `.task` modifier in SwiftUI for view-scoped async work that cancels on disappear
- Use `Sendable` conformance to guarantee thread-safe value types across concurrency boundaries
## SwiftData
- Define models with `@Model` macro; use `@Relationship` for references and `@Attribute` for constraints
- Use `ModelContainer` to configure storage: in-memory for previews, persistent for production
- Query with `@Query` in SwiftUI views; apply `#Predicate` for type-safe filtering and sorting
- Keep model types simple -- derive computed properties for presentation logic rather than storing derived data
- Use `ModelContext` directly in ViewModels for batch inserts, deletes, and background saves
## UIKit Interop
- Use `UIViewControllerRepresentable` and `UIViewRepresentable` to wrap UIKit components in SwiftUI
- Delegate pattern: implement the delegate protocol in a coordinator class nested inside the representable
- Use `UIHostingController` to embed SwiftUI views within UIKit navigation flows
- Prefer SwiftUI-native solutions before falling back to UIKit; only interop when no SwiftUI equivalent exists
## visionOS Spatial Computing
- Use `RealityView` for 3D content and `ImmersiveSpace` for full-room experiences
- Apply `Volume` for bounded 3D windows and `Window` for traditional 2D-style panels
- Use ARKit skeleton tracking and hand tracking via `HandTrackingProvider` for spatial input
- Design for comfort: keep content at comfortable distances, avoid rapid depth changes, provide rest states
- Test spatial UI in the visionOS simulator with varied room layouts before device testing
## Testing and Quality
- Use Swift Testing framework (`@Test`, `@Suite`) for new test targets alongside XCTest for compatibility
- Write `PreviewProvider` or `#Preview` macros for every SwiftUI view to enable live canvas development
- Apply SwiftLint or SwiftFormat consistently; enforce rules in CI with `swift-format`
- Use Instruments for profiling: Time Profiler, Allocations, and Leaks for performance validation
---
> Source: [calcosmic/Aether](https://github.com/calcosmic/Aether) — distributed by [TomeVault](https://tomevault.io).
<!-- tomevault:4.0:skill_md:2026-05-23 -->
Sections and files
Listed in source order.
sections -> SwiftUI View Composition → Swift Concurrency → SwiftData → UIKit Interop → visionOS Spatial Computing → Testing and Quality
terms -> --- > Source: [calcosmic/Aether](https://github.com/calcosmic/Aether) — distributed by [TomeVault](https://tomevault.io).
files/cmd -> View · @ViewBuilder · ViewModifier · async/await · Actor · actor DataStore { ... } · TaskGroup · .task
body sha256 -> a8bad948b29e
SwiftUI View Composition
Break views into small, single-responsibility components; extract reusable pieces into
Viewstructs Use@ViewBuilderfor conditional and grouped content; prefer composition over deep nesting Apply modifiers consistently -- chain them in a logical order: layout -> appearance -> accessibility UseViewModifierprotocol for reusable modifier groups shared across views Keep view bodies free of business logic; move computation to ViewModels or use computed properties on the modelSwift Concurrency
Use
async/awaitas the primary concurrency model; avoid completion handlers in new code AdoptActorfor shared mutable state isolation:actor DataStore { ... }UseTaskGroupfor structured concurrency when spawning dynamic child tasks Apply.taskmodifier in SwiftUI for view-scoped async work that cancels on disappear UseSendableconformance to guarantee thread-safe value types across concurrency boundariesSwiftData
Define models with
@Modelmacro; use@Relationshipfor references and@Attributefor constraints UseModelContainerto configure storage: in-memory for previews, persistent for production Query with@Queryin SwiftUI views; apply#Predicatefor type-safe filtering and sorting Keep model types simple -- derive computed properties for presentation logic rather than storing derived data UseModelContextdirectly in ViewModels for batch inserts, deletes, and background savesUIKit Interop
Use
UIViewControllerRepresentableandUIViewRepresentableto wrap UIKit components in SwiftUI Delegate pattern: implement the delegate protocol in a coordinator class nested inside the representable UseUIHostingControllerto embed SwiftUI views within UIKit navigation flows Prefer SwiftUI-native solutions before falling back to UIKit; only interop when no SwiftUI equivalent existsvisionOS Spatial Computing
Use
RealityViewfor 3D content andImmersiveSpacefor full-room experiences ApplyVolumefor bounded 3D windows andWindowfor traditional 2D-style panels Use ARKit skeleton tracking and hand tracking viaHandTrackingProviderfor spatial input Design for comfort: keep content at comfortable distances, avoid rapid depth changes, provide rest states Test spatial UI in the visionOS simulator with varied room layouts before device testing