1. Habit
  2. Skills
  3. SwiftData Pro skill
twostraws · 9K installs

SwiftData Pro skill
Runs by itself, Swift pull request opened.

SwiftData bugs caught before merge.

Install the SwiftData Pro skill and make it a habit: follow https://gethabit.dev/skills/twostraws/swiftdata-pro.md

  1. 1Copy
  2. 2Paste into Claude Code, Codex or Cursor
  3. 3It runs by itself

9K installs451 starsMIT licenceSource on GitHub ↗

SwiftData Pro

by twostraws · 9K installs

The skill

The swiftdata pro skill writes and reviews SwiftData code with modern APIs: relationships, delete rules, safe predicates, CloudKit limits and indexing.

Only when you ask.

The habit

SwiftData bugs caught before merge.

↻ Runs by itselfSwift pull request opened

How the habit works.
You don't have to.

Three questionsWhen does it start? How does it check its work? What does it remember?

One run, step by step.
Then it stops.

Stop ruleStops after one pull request per run.

  1. 01

    Core rules

    The agent checks the changed code against references/core-rules.md.

  2. 02

    Predicates

    It checks predicates for unsafe or unsupported patterns with references/predicates.md.

  3. 03

    Platform checks

    It loads references/cloudkit.md, references/indexing.md or references/class-inheritance.md only when the project needs them.

  4. 04

    Report by file

    It lists each real issue with file, line, rule and a short before and after fix.

  5. 05

    Prioritise

    It ends with the most important changes first.

  6. 06

    Log

    It adds the broken rules to the log for the next review.

What it may do.
Nothing more.

Safe by defaultIt writes only in its own folder and asks you before anything goes out.

Is it for you?
Use it when it fits.

Quick checkRead both lists. If the left one sounds like you, the SwiftData Pro skill helps.

Use it when

  • ✓ You review SwiftData models
  • ✓ Predicates crash at runtime
  • ✓ You sync data with CloudKit

Skip it when

  • – The app uses Core Data only
  • – There is no Swift code

Questions

SwiftData Pro skill, answered.

Will it suggest Core Data?

Only for a feature SwiftData cannot solve.

Does it add new frameworks?

No. The skill asks first before any third-party framework.

How do I install the SwiftData Pro skill?

Copy the prompt at the top into your agent. It installs the skill from twostraws/swiftdata-agent-skill and sets up the habit. Or run npx skills add twostraws/swiftdata-agent-skill --skill swiftdata-pro.

Is the SwiftData Pro skill free?

Yes. It is published under MIT. Habit is free too.

SwiftData Pro. Now as a habit.

Install the SwiftData Pro skill and make it a habit: follow https://gethabit.dev/skills/twostraws/swiftdata-pro.md

  • Free
  • No account
  • Undo in one line

All twostraws skills →More code skills →

Works in

  • Claude Code
  • Codex
  • Cursor
  • ChatGPT
  • Claude app

Made by twostraws, published under MIT. Habit links to the original and never changes it. Is this your skill?

Copying didn't work here. Select the line and copy it by hand.