guide-swiftdata
Skill336 starsChanged 7 months agoMITView on GitHub
SwiftData patterns — autosave, relationships, dangerous predicates, CloudKit constraints, indexing, class inheritance. Use when writing, reviewing, or debugging SwiftData code.
In this repository29 other files it gives its agents.
- AGENTS.mdAGENTS.md
- apple-asoSkill
- apple-docs-indexSkill
- backgroundtasksSkill
- combineSkill
- core-animationSkill
- corehapticsSkill
- eventkitSkill
- guide-macos-spm-packagingSkill
- guide-swift-concurrencySkill
- guide-swift-testingSkill
- guide-swiftui-chartsSkill
- guide-swiftui-performance-auditSkill
- healthkitSkill
- higSkill
- ios-devSkill
- ios-liquid-glassSkill
- mapkitSkill
- photosuiSkill
- storekitSkill
- swift-concurrencySkill
- swiftdataSkill
- swift-testingSkill
- swiftuiSkill
- tipkitSkill
- uikitSkill
- usernotificationsSkill
- widgetkitSkill
- xcuitestSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 4 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Write and review SwiftData code for correctness, modern API usage, and adherence to project conventions.
- Distinctive: line 19
Prefer SwiftData across the board.
- Distinctive: line 20
Do not introduce third-party frameworks without asking first.
- Very specific: line 24
Check for core SwiftData issues using references/core-rules.md.
- Very specific: line 25
Check that predicates are safe and supported using references/predicates.md.
- Very specific: line 26
If the project uses CloudKit, check for CloudKit-specific constraints using references/cloudkit.md.
- Very specific: line 27
If the project targets iOS 18+, check for indexing opportunities using references/indexing.md.
- Very specific: line 28
If the project targets iOS 26+, check for class inheritance patterns using references/class-inheritance.md.
- Distinctive: line 30
If doing partial work, load only the relevant reference files.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Guide Skill — This is an expert workflow/pattern guide, not API reference documentation. Originally from twostraws/SwiftData-Agent-Skill by Paul Hudson. MIT License.
SwiftData Patterns
Write and review SwiftData code for correctness, modern API usage, and adherence to project conventions. Report only genuine problems — do not nitpick or invent issues.
Core Instructions
- Target Swift 6.2 or later, using modern Swift concurrency.
- Prefer SwiftData across the board. Do not suggest Core Data unless the feature cannot be solved with SwiftData.
- Do not introduce third-party frameworks without asking first.
Review Process
- Check for core SwiftData issues using
references/core-rules.md. - Check that predicates are safe and supported using
references/predicates.md. - If the project uses CloudKit, check for CloudKit-specific constraints using
references/cloudkit.md. - If the project targets iOS 18+, check for indexing opportunities using
references/indexing.md. - If the project targets iOS 26+, check for class inheritance patterns using
references/class-inheritance.md.
If doing partial work, load only the relevant reference files.
References
| Topic | Reference |
Autosave, relationships, delete rules, @Query restrictions, #Unique, @Transient | references/core-rules.md |
| Supported predicates, dangerous patterns that crash at runtime, unsupported methods | references/predicates.md |
CloudKit constraints: no #Unique, optional requirements, eventual consistency | references/cloudkit.md |
| Database indexing (iOS 18+), single and compound property indexes | references/indexing.md |
Model subclassing (iOS 26+), @available requirements, predicate filtering | references/class-inheritance.md |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

