Token导航 LogoToken导航

Agent Skill · 研究检索

swiftdata-expert-skill(Swiftdata 专家技能)

用于辅助数据整理、表格处理、CSV/Excel 分析、指标计算和图表准备。它适合让 Agent 清洗字段、汇总数据、发现异常、生成统计口径或把分析结果转成可读说明。使用时需要确认数据来源、字段含义和时间范围,避免把样本数据当全量事实;涉及敏感数据、导出文件或批量写回时,应先确认权限和脱敏边界。

swiftdata-expert-skill 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证信息还不明确,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 32,196。

总安装 2,564周安装 109GitHub Stars 8下载 898核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:swiftdata-expert-skill(Swiftdata 专家技能)
来源仓库:https://github.com/vanab/swiftdata-agent-skill
仓库路径:skills/swiftdata-expert-skill
安装命令:
npx skills add https://github.com/vanab/swiftdata-agent-skill --skill swiftdata-expert-skill
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/vanab/swiftdata-agent-skill --skill swiftdata-expert-skill

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

swiftdata-expert-skill 用于辅助数据整理、表格处理、CSV/Excel 分析、指标计算和图表准备。适合让 Agent 清洗字段、汇总数据、发现异常、生成统计口径或把分析结果转成可读说明。使用时需要确认数据来源、字段含义和时间范围,避免把样本数据当全量事实。

涉及敏感数据、导出文件或批量写回时,应先确认权限和脱敏边界。通过 npx skills add 命令从指定 GitHub 仓库安装并使用。

来源仓库内路径:skills/swiftdata-expert-skill

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/vanab/swiftdata-agent-skill --skill swiftdata-…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

swiftdata-expert-skill 怎么安装?

在终端执行 npx skills add https://github.com/vanab/swiftdata-agent-skill --skill swiftdata-expert-ski…。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

swiftdata-expert-skill 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

swiftdata-expert-skill 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

swiftdata-expert-skill 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

swiftdata-expert-skill 用的人多吗?

公开数据是累计安装 2,564 次,近一周安装 109 次,下载 898 次,GitHub 8 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

swiftdata-expert-skill 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
swiftdata-expert-skill

Swiftdata 专家技能 · 本页

2,5648需要联网未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

SwiftData Expert Skill

Overview

Use this skill to build, review, and harden SwiftData persistence architecture with Apple-documented patterns from iOS 17 through current updates. Prioritize data integrity, migration safety, sync correctness, and predictable concurrency behavior.

Agent Behavior Contract (Follow These Rules)

  1. Identify the minimum deployment target before recommending APIs (notably #Index, #Unique, HistoryDescriptor, DataStore, inheritance examples).
  2. Confirm the app has real ModelContainer wiring before debugging data issues; without it, inserts fail and fetches are empty.
  3. Distinguish main-actor UI operations from background persistence operations; never assume one context fits both.
  4. Treat schema changes as migration changes: evaluate lightweight migration first, then SchemaMigrationPlan when needed.
  5. For CloudKit-enabled apps, verify schema compatibility constraints before proposing model changes.
  6. Prefer deterministic query definitions (shared predicates, explicit sort order, bounded fetches) over ad hoc filtering in views.
  7. Use persistent history tokens when reading cross-process changes; delete stale history to avoid storage growth.
  8. In code reviews, prioritize data loss risk, accidental mass deletion, sync divergence, and context-isolation bugs over style changes.

Analysis Commands (Use Early)

  • Search container setup:

- rg "modelContainer\\(|ModelContainer\\(" -n

  • Search model definitions:

- rg "^@Model|#Unique|#Index|@Relationship|@Attribute|@Transient" -n

  • Search context usage:

- rg "modelContext|mainContext|ModelContext\\(" -n

  • Search migrations and history:

- rg "SchemaMigrationPlan|VersionedSchema|MigrationStage|fetchHistory|deleteHistory|historyToken" -n

  • Search CloudKit and app groups:

- rg "cloudKitDatabase|iCloud|CloudKit|groupContainer|AppGroup|NSPersistentCloudKitContainer" -n

Project Intake (Before Advising)

  • Determine deployment targets: iOS, iPadOS, macOS, watchOS, and visionOS.
  • Locate container setup: .modelContainer(...) modifier or manual ModelContainer(...).
  • Verify whether autosave is expected and whether explicit save() is required.
  • Check if undo is enabled (isUndoEnabled) and whether operations occur on mainContext or custom contexts.
  • Check CloudKit capabilities and chosen container strategy (automatic, .private(...), .none).
  • Check if app group storage is required.
  • Check if Core Data coexistence is in scope.
  • Check if schema changes must be backward-compatible with existing user data.

Workflow Decision Tree

  1. Need a new model or schema shape:

- Read references/modeling-and-schema.md.

  1. Need create, update, delete behavior or context correctness:

- Read references/model-context-and-lifecycle.md.

  1. Need filtering, sorting, or dynamic list behavior:

- Read references/querying-and-fetching.md.

  1. Need relationship modeling or inheritance:

- Read references/relationships-and-inheritance.md.

  1. Need migration planning, release upgrades, or change tracking:

- Read references/migrations-and-history.md.

  1. Need iCloud sync or CloudKit compatibility:

- Read references/cloudkit-sync.md.

  1. Need incremental migration from Core Data:

- Read references/core-data-adoption.md.

  1. Need background isolation or actor-based persistence:

- Read references/concurrency-and-actors.md.

  1. Need quick diagnostics or API availability checks:

- Read references/troubleshooting-and-updates.md.

  1. Need end-to-end execution playbook for a concrete task:
  • Read references/implementation-playbooks.md.

Triage-First Playbook (Common Problems -> Next Move)

  • Insert fails or fetch is always empty:

- Confirm .modelContainer(...) is attached at app or window root and the model type is included.

  • Duplicate rows appear after network refresh:

- Add @Attribute(.unique) or #Unique constraints and rely on insert-upsert behavior.

  • Unexpected data loss during delete:

- Audit delete rules (.cascade vs .nullify) and check for unbounded delete(model:where:).

  • Undo or redo does nothing:

- Ensure isUndoEnabled: true and that changes are saved via mainContext (not only background context).

  • CloudKit sync not behaving:

- Check capabilities, remote notifications, and CloudKit schema compatibility; explicitly set cloudKitDatabase if multiple containers exist.

  • Widget or App Intent changes are not reflected:

- Use persistent history (fetchHistory) with token + author filtering.

  • historyTokenExpired appears:

- Reset local token strategy and rebootstrap change consumption from a safe point.

  • Query results are expensive or unstable:

- Use shared predicate builders, explicit sorting, and bounded FetchDescriptor settings.

Anti-Patterns (Reject by Default)

  • Building persistence logic before validating container wiring.
  • Performing broad deletes without predicate review and confirmation.
  • Mixing UI-driven editing and background write pipelines without isolation boundaries.
  • Relying on ad hoc in-memory filtering instead of store-backed predicates.
  • Enabling CloudKit sync without capability setup and schema compatibility checks.
  • Shipping schema changes without migration rehearsal on existing user data.
  • Consuming history without token persistence and cleanup policy.

Core Patterns

App-level container wiring (SwiftUI)

@main
struct MyApp: App {
    var body: some Scene {
        WindowGroup {
            RootView()
        }
        .modelContainer(for: [Trip.self, Accommodation.self])
    }
}

Manual container configuration

let config = ModelConfiguration(isStoredInMemoryOnly: false)
let container = try ModelContainer(
    for: Trip.self,
    Accommodation.self,
    configurations: config
)

Dynamic query setup in a view initializer

struct TripListView: View {
    @Query private var trips: [Trip]

    init(searchText: String) {
        let predicate = #Predicate<Trip> {
            searchText.isEmpty || $0.name.localizedStandardContains(searchText)
        }
        _trips = Query(filter: predicate, sort: \.startDate, order: .forward)
    }

    var body: some View { List(trips) { Text($0.name) } }
}

Safe batch delete pattern

do {
    try modelContext.delete(
        model: Trip.self,
        where: #Predicate { $0.endDate < .now },
        includeSubclasses: true
    )
    try modelContext.save()
} catch {
    // Handle delete and save failures.
}

Reference Files

  • references/modeling-and-schema.md
  • references/model-context-and-lifecycle.md
  • references/querying-and-fetching.md
  • references/relationships-and-inheritance.md
  • references/migrations-and-history.md
  • references/cloudkit-sync.md
  • references/core-data-adoption.md
  • references/concurrency-and-actors.md
  • references/troubleshooting-and-updates.md
  • references/implementation-playbooks.md

Best Practices Summary

  1. Keep model code as the source of truth; avoid hidden schema assumptions.
  2. Apply explicit uniqueness and indexing strategy for large or frequently queried datasets.
  3. Insert root models and let SwiftData traverse relationship graphs automatically.
  4. Keep query behavior deterministic with explicit predicates and sort descriptors.
  5. Bound fetches (fetchLimit, offsets, identifier-only fetches) for scalability.
  6. Treat delete rules as business rules; review them during schema changes.
  7. Use ModelConfiguration for environment-specific behavior (in-memory tests, CloudKit, app groups, read-only stores).
  8. Handle history as an operational system: token persistence, filtering, and cleanup.
  9. Use model actors or isolated contexts for non-UI persistence work.
  10. Gate recommendations by API availability and deployment target.

Verification Checklist (After Changes)

  • Build succeeds for target platforms and minimum deployment versions.
  • CRUD tests pass with real store and in-memory store.
  • Relationship deletes behave as intended (cascade, nullify, and others).
  • Query behavior is stable with realistic datasets and sort or filter combinations.
  • Migration path is validated on pre-existing data (not only clean installs).
  • CloudKit behavior is validated in a development container before release.
  • Cross-process changes (widgets, intents, extensions) are observed correctly.
  • Error paths and rollback behavior are covered for destructive operations.

Response Contract

  • For review tasks, report findings first by severity and include exact file paths and lines.
  • For implementation tasks, describe:

- container or context changes, - schema or migration changes, - query or performance changes, - verification steps run and any gaps.

  • If deployment target blocks a recommended API, provide the best fallback compatible with the current target.

平台分布

Codex

36.22%
按下载量换算325

Claude

28.8%
按下载量换算259

Cursor

20.77%
按下载量换算187

Gemini CLI

9.59%
按下载量换算86

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills