一键导入
swiftdata
Writes, reviews, and improves SwiftData code using modern APIs and best practices. Use when reading, writing, or reviewing projects that use SwiftData.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Writes, reviews, and improves SwiftData code using modern APIs and best practices. Use when reading, writing, or reviewing projects that use SwiftData.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Root-cause fix workflow for the TablePro macOS app. Use whenever the user wants to fix a GitHub issue (by number or URL) or a described bug, behaviour gap, or UX problem, and cares about doing it the right way: native AppKit/SwiftUI, Apple HIG, clean architecture, full scope, no quick patches. It runs a parallel investigation team (codebase tracing + Apple platform research + competitor/UX research), synthesizes a refactor-aware implementation blueprint, gets the user's approval, then implements to TablePro's standards. Trigger on things like "fix issue #1234", "fix this bug", "this should behave like a native app", "do this properly / natively", or any non-trivial defect or behaviour gap in the app. Prefer this over an ad-hoc fix when the change touches UI behaviour, architecture, or anything the user expects to match Apple conventions.
Comprehensively reviews SwiftUI code for best practices on modern APIs, maintainability, and performance. Use when reading, writing, or reviewing SwiftUI projects.
Prepares and ships a new TablePro release — bumps version numbers in project.pbxproj, finalizes CHANGELOG.md, commits, tags, and pushes. Also handles separate plugin releases (Redis, Oracle, ClickHouse, DuckDB). Use this skill whenever the user says "release", "bump version", "ship version", "tag a release", "cut a release", or provides a version number they want to release (e.g., "/release 0.5.0", "/release plugin-oracle 1.0.0").
| name | swiftdata |
| description | Writes, reviews, and improves SwiftData code using modern APIs and best practices. Use when reading, writing, or reviewing projects that use SwiftData. |
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:
references/core-rules.md.references/predicates.md.references/cloudkit.md.references/indexing.md.references/class-inheritance.md.If doing partial work, load only the relevant reference files.
If the user asks for a review, organize findings by file. For each issue:
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:
Line 8: Add an explicit delete rule for relationships.
// 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.
// Before
#Predicate<Destination> { $0.sights.isEmpty == false }
// After
#Predicate<Destination> { !$0.sights.isEmpty }
Line 5: @Query must only be used inside SwiftUI views.
// Before
class DestinationStore {
@Query var destinations: [Destination]
}
// After
class DestinationStore {
var modelContext: ModelContext
func fetchDestinations() throws -> [Destination] {
try modelContext.fetch(FetchDescriptor<Destination>())
}
}
isEmpty == false on line 22 will crash at runtime – use !isEmpty instead.@Query on line 5 of DestinationListView.swift only works inside SwiftUI views.End of example.
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.