Agent skill
swiftdata-code-review
Reviews SwiftData code for model design, queries, concurrency, and migrations. Use when reviewing .swift files with import SwiftData, @Model, @Query, @ModelActor, or VersionedSchema.
Install this agent skill to your Project
npx add-skill https://github.com/existential-birds/beagle/tree/main/plugins/beagle-ios/skills/swiftdata-code-review
SKILL.md
SwiftData Code Review
Quick Reference
| Issue Type | Reference |
|---|---|
| @Model, @Attribute, @Relationship, delete rules | references/model-design.md |
| @Query, #Predicate, FetchDescriptor, #Index | references/queries.md |
| @ModelActor, ModelContext, background operations | references/concurrency.md |
| VersionedSchema, MigrationStage, lightweight/custom | 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
- Could this relationship assignment cause NULL foreign keys?
- Is @Relationship on both sides creating circular references?
- Could this @Query block the main thread with large datasets?
- Are model objects being passed between actors unsafely?
- Would schema changes require a migration plan?
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
review-python
Comprehensive Python/FastAPI backend code review with optional parallel agents
review-verification-protocol
Mandatory verification steps for all code reviews to reduce false positives. Load this skill before reporting ANY code review findings.
sqlalchemy-code-review
Reviews SQLAlchemy code for session management, relationships, N+1 queries, and migration patterns. Use when reviewing SQLAlchemy 2.0 code, checking session lifecycle, relationship() usage, or Alembic migrations.
fastapi-code-review
Reviews FastAPI code for routing patterns, dependency injection, validation, and async handlers. Use when reviewing FastAPI apps, checking APIRouter setup, Depends() usage, or response models.
pytest-code-review
Reviews pytest test code for async patterns, fixtures, parametrize, and mocking. Use when reviewing test_*.py files, checking async test functions, fixture usage, or mock patterns.
postgres-code-review
Reviews PostgreSQL code for indexing strategies, JSONB operations, connection pooling, and transaction safety. Use when reviewing SQL queries, database schemas, JSONB usage, or connection management.
Didn't find tool you were looking for?