Swift Data
Helps with Swift, data as part of building frontend UIs and user experiences workflows.
Install on your platform
We auto-selected Claude Code based on this skill’s supported platforms.
Run in terminal (recommended)
claude mcp add swift-data npx -- -y @trustedskills/swift-data
Or manually add to ~/.claude/settings.json
{
"mcpServers": {
"swift-data": {
"command": "npx",
"args": [
"-y",
"@trustedskills/swift-data"
]
}
}
}Requires Claude Code (claude CLI). Run claude --version to verify your install.
About This Skill
What it does
This skill provides a comprehensive guide to using SwiftData for building frontend user interfaces and experiences within a modular MVVM-C architecture. It focuses on best practices for data modeling, persistence, synchronization, and error handling specifically when working with the "clinic" modular approach. The skill ensures that SwiftData types are isolated to Data layer implementations, promoting clean separation of concerns between feature modules, domain logic, and data access.
When to use it
- When defining
@Modelentity classes and mapping them to corresponding domain structs. - When setting up the
ModelContainerandModelContextwithin your application's Data layer. - When implementing repository protocols using SwiftData as the underlying persistence mechanism.
- When designing stale-while-revalidate data fetching strategies.
Key capabilities
- Provides guidance on defining
@Modelentities and mapping them to domain structs. - Covers setup of
ModelContainerandModelContext. - Explains how to implement repository protocols using SwiftData.
- Details best practices for stale-while-revalidate data fetching.
- Enforces a strict architectural separation: Feature modules import only Domain and DesignSystem, while Data owns SwiftData implementation.
Example prompts
- "How should I structure my
@Modelentities to align with the clinic architecture?" - "Can you explain how to implement repository protocols using SwiftData in this skill's recommended approach?"
- "What are the best practices for setting up
ModelContextwithin a Data layer following these guidelines?"
Tips & gotchas
- This skill assumes familiarity with the clinic modular MVVM-C architecture. Ensure your project is structured accordingly before applying its guidance.
SwiftDatatypes (@Model,ModelContext,@Query) are strictly confined to Data layer implementations; avoid importing them into Feature or Domain modules.- The skill emphasizes a direct ViewModel call to repository protocols, bypassing default use-case/interactor layers.
Tags
TrustedSkills Verification
Unlike other registries that point to live repositories, TrustedSkills pins every skill to a verified commit hash. This protects you from malicious updates — what you install today is exactly what was reviewed and verified.
Security Audits
| Gen Agent Trust Hub | Pass |
| Socket | Pass |
| Snyk | Pass |
🌐 Community
Passed automated security scans.