← 返回 Skills 市场
anderskev

Swiftdata Code Review

作者 Kevin Anderson · GitHub ↗ · v1.2.1 · MIT-0
cross-platform ✓ 安全检测通过
161
总下载
0
收藏
1
当前安装
2
版本数
在 OpenClaw 中安装
/install swiftdata-code-review
功能描述
Reviews SwiftData code for model design, queries, concurrency, and migrations. Use when reviewing .swift files with import SwiftData, @Model, @Query, @ModelA...
使用说明 (SKILL.md)

SwiftData Code Review

Quick Reference

Issue Type Reference
@Model, @Attribute, @Relationship, delete rules references/model-design.md
@Query, #Predicate, FetchDescriptor, #Index references/queries.md
@ModelActor, ModelContext, background operations references/concurrency.md
VersionedSchema, MigrationStage, lightweight/custom references/migrations.md

Hard gates (before reporting findings)

Run in order; do not assert an issue until the gate for that issue passes.

  1. Scope — pass when: You have the target .swift path(s) and confirmed SwiftData surface in scope (e.g. import SwiftData, @Model, @Query, @ModelActor, VersionedSchema, or migration types). If none apply, stop or narrow scope with one sentence.
  2. Reference — pass when: For each checklist area you evaluate (models, queries, concurrency, migrations), you opened the matching references/*.md from the Quick Reference table or wrote N/A: no \x3Carea> in this review with a one-line reason.
  3. Evidence — pass when: Every finding uses the [FILE:LINE] ISSUE_TITLE header (line range allowed) from the file you read; no finding without a cite.
  4. Report — pass when: Findings list cites first (or inline) using [FILE:LINE] ISSUE_TITLE, then severity or checklist grouping—no uncited assertions.

Review Checklist

  • Models marked final (subclassing crashes)
  • @Relationship decorator on ONE side only (not both)
  • Delete rules explicitly set (not relying on default .nullify)
  • Relationships initialized to empty arrays, not default objects
  • Batch operations used for bulk inserts (append(contentsOf:))
  • @Query not loading thousands of items on main thread
  • External values in predicates captured in local variables
  • Scalar comparisons in predicates (not object references)
  • @ModelActor used for background operations
  • PersistentIdentifier/DTOs used to pass data between actors
  • VersionedSchema defined for each shipped version
  • MigrationPlan passed to ModelContainer

When to Load References

  • Reviewing @Model or relationships -> model-design.md
  • Reviewing @Query or #Predicate -> queries.md
  • Reviewing @ModelActor or background work -> concurrency.md
  • Reviewing schema changes or migrations -> migrations.md

Review Questions

  1. Could this relationship assignment cause NULL foreign keys?
  2. Is @Relationship on both sides creating circular references?
  3. Could this @Query block the main thread with large datasets?
  4. Are model objects being passed between actors unsafely?
  5. Would schema changes require a migration plan?
安全使用建议
This skill appears coherent: it bundles detailed SwiftData review guidance and instructs the agent to analyze only .swift files and cite findings. Because it is instruction-only and requests no credentials or installs, the technical risk is low. Two practical cautions: (1) provenance is unknown (no homepage / unknown owner), so if you care about source-trust, prefer skills from known publishers; (2) when using the skill, avoid pasting secrets or production credentials into the code snippets you ask it to review — the skill will produce findings based on whatever you provide. If you need higher assurance, request the publisher's identity or test the skill on non-sensitive sample code first.
能力评估
Purpose & Capability
Name/description match the included references and the SKILL.md review checklist. No binaries, env vars, or unrelated config paths are requested — everything requested is appropriate for a static code-review helper for SwiftData code.
Instruction Scope
SKILL.md confines work to .swift files that use SwiftData surface markers and requires citing findings with [FILE:LINE]. References are local files bundled with the skill. There are no instructions to read system files, fetch remote endpoints, or access secrets.
Install Mechanism
No install spec and no code files to execute — instruction-only skill. This minimizes on-disk/remote install risk.
Credentials
Skill declares no required environment variables, credentials, or config paths. The review logic uses only the bundled reference docs and the input code, which is proportionate to its purpose.
Persistence & Privilege
always:false and default model invocation are used (normal for skills). The skill does not request persistent system privileges or modify other skills or global configs.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install swiftdata-code-review
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /swiftdata-code-review 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.2.1
- Introduced a new "Hard gates" section to clarify the step-by-step preconditions for issuing findings in reviews. - Hard gates now require explicit scope confirmation, reference usage or N/A statements, specific evidence for each finding, and citations formatted as [FILE:LINE] ISSUE_TITLE. - Instructions emphasize only reporting issues after these hard gates are satisfied, making reviews more precise and structured. - No changes to the reference content, checklist, or review questions.
v1.2.0
**Changelog for swiftdata-code-review v1.2.0:** - Added SKILL.md with detailed skill description and quick reference table. - Included a comprehensive review checklist covering model design, queries, concurrency, and migrations. - Added guidance on when to consult specific reference files. - Provided review questions to highlight common SwiftData pitfalls. - Enhanced documentation to clarify use cases for code reviews involving SwiftData constructs.
元数据
Slug swiftdata-code-review
版本 1.2.1
许可证 MIT-0
累计安装 1
当前安装数 1
历史版本数 2
常见问题

Swiftdata Code Review 是什么?

Reviews SwiftData code for model design, queries, concurrency, and migrations. Use when reviewing .swift files with import SwiftData, @Model, @Query, @ModelA... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 161 次。

如何安装 Swiftdata Code Review?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install swiftdata-code-review」即可一键安装,无需额外配置。

Swiftdata Code Review 是免费的吗?

是的,Swiftdata Code Review 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Swiftdata Code Review 支持哪些平台?

Swiftdata Code Review 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Swiftdata Code Review?

由 Kevin Anderson(@anderskev)开发并维护,当前版本 v1.2.1。

💬 留言讨论