Skip to content
Skills Library
Programming · Learning & explanation

guide-swiftdata

/guide-swiftdata

SwiftData patterns — autosave, relationships, dangerous predicates, CloudKit constraints, indexing, class inheritance. Use when writing, reviewing, or debugging SwiftData code.

Licence
MIT
Last repository change
26.09.2026

Assessment and security

90/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content25 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
6
Scripts
0
HTML comments
0
URLs in SKILL.md
2
Deprecation

No signals detected. Repository changed on 26.09.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

SwiftData patterns — autosave, relationships, dangerous predicates, CloudKit constraints, indexing, class inheritance. Use when writing, reviewing, or debugging SwiftData code.

Original author description

SwiftData patterns — autosave, relationships, dangerous predicates, CloudKit constraints, indexing, class inheritance. Use when writing, reviewing, or debugging SwiftData code.

How it works

  1. Core Instructions
  2. Review Process
  3. References
Original SKILL.md headings · 34 lines, 234 words
SKILL.md preview
---
name: guide-swiftdata
description: SwiftData patterns — autosave, relationships, dangerous predicates, CloudKit constraints, indexing, class inheritance. Use when writing, reviewing, or debugging SwiftData code.
type: guide
origin: https://github.com/twostraws/SwiftData-Agent-Skill
license: MIT
---

> **Guide Skill** — This is an expert workflow/pattern guide, not API reference documentation.
> Originally from [twostraws/SwiftData-Agent-Skill](https://github.com/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

1. Check for core SwiftData issues using `references/core-rules.md`.
2. Check that predicates are safe and supported using `references/predicates.md`.
3. If the project uses CloudKit, check for CloudKit-specific constraints using `references/cloudkit.md`.
4. If the project targets iOS 18+, check for indexing opportunities using `references/indexing.md`.
5. 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` |
Files in this package (6)
  • SKILL.md 2 KB
  • references/class-inheritance.md 4 KB
  • references/cloudkit.md 1 KB
  • references/core-rules.md 4 KB
  • references/indexing.md 1 KB
  • references/predicates.md 2 KB

Versions

The database has no other skills named guide-swiftdata.

Database snapshot: 13.11.2026 · package version bb6758533bdf (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100ios-core-data-swiftdata-persistence
    Use this skill when managing local relational persistence, migrations, and CloudKit sync on iOS using SwiftData and Core Data.
  • 100swiftdata-pro
    Use when modeling data with SwiftData (@Model), writing @Query, configuring ModelContainer, performing migrations, or enabling CloudKit sync on iOS 17+.
  • 95swiftdata-inheritance
    SwiftData class inheritance patterns for hierarchical models with type-based querying, polymorphic relationships, and when to choose inheritance vs enums. Use when designing SwiftData model hierarchies.
  • 100swiftdata-persistence-expert
    SwiftData and Core Data persistence architecture, schema design, model relationships, CloudKit sync, and safe multi-version database migrations (VersionedSchema & SchemaMigrationPlan). Use when designing data persistence, fixing store corruption, or upgrading app schema between releases.
  • 100axiom-audit-swiftdata
    Use when the user mentions SwiftData review, @Model issues, SwiftData migration safety, or SwiftData performance checking.
  • 100swiftdata-pro
    Writes, reviews, and improves SwiftData code using modern APIs and best practices. Use when reading, writing, or reviewing projects that use SwiftData.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.