Claude Skills
CollectionsCompareWorkflowsNominate
Sign inSign up
© 2026 Curated Agent Skills·Learn more about Agent Skills
Back to repository

swiftdata-code-review

verified

Reviews SwiftData code for model design, queries, concurrency, and migrations. Use when reviewing .swift files with import SwiftData, @Model, @Query, @ModelActor, or VersionedSchema.

View on GitHub

Marketplace

existential-birds

existential-birds/beagle

Plugin

beagle

Repository

existential-birds/beagle
16stars

skills/swiftdata-code-review/SKILL.md

Last Verified

February 1, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/existential-birds/beagle/blob/main/skills/swiftdata-code-review/SKILL.md -a claude-code --skill swiftdata-code-review

Installation paths:

Claude
.claude/skills/swiftdata-code-review/
Powered by add-skill CLI

Instructions

# SwiftData Code Review

## Quick Reference

| Issue Type | Reference |
|------------|-----------|
| @Model, @Attribute, @Relationship, delete rules | [references/model-design.md](references/model-design.md) |
| @Query, #Predicate, FetchDescriptor, #Index | [references/queries.md](references/queries.md) |
| @ModelActor, ModelContext, background operations | [references/concurrency.md](references/concurrency.md) |
| VersionedSchema, MigrationStage, lightweight/custom | [references/migrations.md](references/migrations.md) |

## Review Checklist

- [ ] Models marked `final` (subclassing crashes)
- [ ] @Relationship decorator on ONE side only (not both)
- [ ] Delete rules explicitly set (not relying on default .nullify)
- [ ] Relationships initialized to empty arrays, not default objects
- [ ] Batch operations used for bulk inserts (`append(contentsOf:)`)
- [ ] @Query not loading thousands of items on main thread
- [ ] External values in predicates captured in local variables
- [ ] Scalar comparisons in predicates (not object references)
- [ ] @ModelActor used for background operations
- [ ] PersistentIdentifier/DTOs used to pass data between actors
- [ ] VersionedSchema defined for each shipped version
- [ ] MigrationPlan passed to ModelContainer

## When to Load References

- Reviewing @Model or relationships -> model-design.md
- Reviewing @Query or #Predicate -> queries.md
- Reviewing @ModelActor or background work -> concurrency.md
- Reviewing schema changes or migrations -> migrations.md

## Review Questions

1. Could this relationship assignment cause NULL foreign keys?
2. Is @Relationship on both sides creating circular references?
3. Could this @Query block the main thread with large datasets?
4. Are model objects being passed between actors unsafely?
5. Would schema changes require a migration plan?

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
1827 chars