swiftdata-inheritance

Installation
SKILL.md

SwiftData Class Inheritance

Guide for implementing class inheritance in SwiftData models. Covers when to use inheritance versus enums or protocols, how to annotate subclasses, query across hierarchies, and avoid common pitfalls with schema migrations and relationship modeling.

When This Skill Activates

  • User is designing a SwiftData model hierarchy with shared base properties
  • User asks about @Model on subclasses or how inheritance works in SwiftData
  • User needs to query across a type hierarchy (all trips vs only business trips)
  • User is deciding between inheritance, enums, or protocols for model variants
  • User has issues with polymorphic relationships or type casting in SwiftData
  • User is migrating a Core Data inheritance hierarchy to SwiftData

Decision Tree

Installs
76
GitHub Stars
482
First Seen
May 28, 2026
swiftdata-inheritance — rshankras/claude-code-apple-skills