mattmakes/multi-herdr/swiftdata-pro

Claude Code and agent skill by mattmakes/multi-herdr

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Writes, reviews, and improves SwiftData code using modern APIs and best practices. Use when reading, writing, or reviewing projects that use SwiftData.

Install

npx vskill@latest install mattmakes/multi-herdr/swiftdata-pro

SKILL.md

The same SKILL.md was published earlier as mattmakes/multi-herdr/swiftdata-pro.

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.

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.
  6. If the schema changes between releases, or the code reads persistent history, check versioning, migration plans, and history handling using references/migrations-and-history.md.
  7. If the project already uses Core Data, or shares a store between Core Data and SwiftData, follow references/core-data-adoption.md.
  8. If the code does background persistence, uses @ModelActor, or passes models between actors, check references/concurrency-and-actors.md.

If doing partial work, load only the relevant reference files.

Core Instructions

  • Target Swift 6.2 or later, using modern Swift concurrency.
  • The user strongly prefers to use SwiftData across the board. Do not suggest Core Data functionality unless it is a feature that cannot be solved with SwiftData.
  • Do not introduce third-party frameworks unless the task allows them. If one seems necessary, send the orchestrator a message that names it and says why, and wait for the answer.
  • Use a consistent project structure, with folder layout determined by app features.

Output Format

If the user asks for a review, organize findings by file. For each issue:

  1. State the file and relevant line(s).
  2. Name the rule being violated.
  3. Show a brief before/after code fix.

Skip files with no issues. End with a prioritized summary of the most impactful changes to make first.

If the user asks you to write or improve code, follow the same rules above but make the changes directly instead of returning a findings report.

Example output:

Destination.swift

Line 8: Add an explicit delete rule for relationships.

swift
// Before
var sights: [Sight]
// After
@Relationship(deleteRule: .cascade, inverse: \Sight.destination) var sights: [Sight]

Line 22: Do not use `isEmpty == false` in predicates – it crashes at runtime. Use `!` instead.

swift
// Before
#Predicate<Destination> { $0.sights.isEmpty == false }
// After
#Predicate<Destination> { !$0.sights.isEmpty }
DestinationListView.swift

Line 5: `@Query` must only be used inside SwiftUI views.

swift
// Before
class DestinationStore {
@Query var destinations: [Destination]
}
// After
class DestinationStore {
var modelContext: ModelContext
func fetchDestinations() throws -> [Destination] {
try modelContext.fetch(FetchDescriptor<Destination>())
}
}
Summary
  1. Data loss (high): Missing delete rule on line 8 of Destination.swift means sights will be orphaned when a destination is deleted.
  2. Crash (high): isEmpty == false on line 22 will crash at runtime – use !isEmpty instead.
  3. Incorrect behavior (high): @Query on line 5 of DestinationListView.swift only works inside SwiftUI views.

End of example.

References

  • references/core-rules.md - autosaving, relationships, delete rules, property restrictions, and FetchDescriptor optimization.
  • references/predicates.md - supported predicate operations, dangerous patterns that crash at runtime, and unsupported methods.
  • references/cloudkit.md - CloudKit-specific constraints including uniqueness, optionality, and eventual consistency.
  • references/indexing.md - database indexing for iOS 18+, including single and compound property indexes.
  • references/class-inheritance.md - model subclassing for iOS 26+, including @available requirements, schema setup, and predicate filtering.
  • references/migrations-and-history.md - VersionedSchema, SchemaMigrationPlan, lightweight and custom stages, persistent history, and deletion tombstones.
  • references/core-data-adoption.md - full, incremental, and coexisting Core Data to SwiftData adoption, with a migration checklist.
  • references/concurrency-and-actors.md - @ModelActor, context isolation, passing identifiers across actors, undo limits, and history with concurrent writers.

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/mattmakes/multi-herdr/swiftdata-pro/badge)](https://verified-skill.com/skills/mattmakes/multi-herdr/swiftdata-pro)

Something wrong with this skill or its page? Tell us.