ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified developer tools Safety 5/5

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.

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/anderskev/swiftdata-code-review
Or

What This Skill Does

The swiftdata-code-review skill is a specialized diagnostic tool designed for developers working with Apple's SwiftData framework. It acts as an automated architectural auditor, analyzing Swift source code for common pitfalls, anti-patterns, and performance bottlenecks associated with persistent data storage. By parsing @Model definitions, @Query implementations, @ModelActor usage, and migration logic, the skill provides actionable feedback based on industry-standard best practices.

Installation

To add this skill to your OpenClaw environment, execute the following command in your terminal: clawhub install openclaw/skills/skills/anderskev/swiftdata-code-review

Ensure your local environment is configured to access the OpenClaw repository and that you have the necessary permissions to install community-provided skill modules.

Use Cases

  • Model Architecture Audit: Use this skill to verify that your data models are configured correctly, specifically checking that relationships are defined on one side only to prevent graph circularity and that delete rules are explicitly defined to prevent unexpected data loss.
  • Performance Tuning: Leverage the tool to analyze @Query objects. It helps determine if a fetch request might block the main thread by checking for high-volume data retrieval without proper predicates or batching.
  • Concurrency Management: Verify that background operations are wrapped in a @ModelActor and that data transfer between actors uses PersistentIdentifier or DTOs to avoid cross-thread crashes.
  • Schema Evolution: Ensure that your migration strategy is robust before shipping updates, verifying that your VersionedSchema and MigrationPlan are correctly configured to handle evolving data schemas without database corruption.

Example Prompts

  1. "Review this file: [attached SwiftData model file]. Check for circular relationships and ensure that I have explicitly set the delete rules for all properties."
  2. "I am running into a performance issue with my persistent store. Can you audit my usage of @Query and predicates to see if they are causing main thread contention?"
  3. "Here is my MigrationPlan implementation. Does this align with the requirements for moving from schema v1 to v2 without losing user data?"

Tips & Limitations

  • Scope: The skill is strictly limited to SwiftData. It will not provide general debugging for UI or networking code unless those components interact directly with the data layer.
  • Context is Key: To get the best results, provide the entire file or context regarding the relationship between different models in your schema. Isolated snippets may hide relationship-based bugs.
  • Not a Compiler: While this tool identifies logic errors and architectural anti-patterns, it is not a replacement for the Swift compiler. Always verify suggestions in Xcode.
  • Safety Note: This tool performs static analysis on your local files. It does not alter your code automatically but provides specific modification suggestions for you to review and implement manually.

Metadata

Author@anderskev
Stars4473
Views0
Updated2026-05-01
View Author Profile
AI Skill Finder

Not sure this is the right skill?

Describe what you want to build — we'll match you to the best skill from 16,000+ options.

Find the right skill
Add to Configuration

Paste this into your clawhub.json to enable this plugin.

{
  "plugins": {
    "official-anderskev-swiftdata-code-review": {
      "enabled": true,
      "auto_update": true
    }
  }
}

Tags(AI)

#swift#swiftdata#ios#persistence#code-review
Safety Score: 5/5

Flags: file-read