Token导航 LogoToken导航TokenDH.com
研究检索执行命令github未标认证来源可访问许可证需确认审计通过

swift-dataSwift 数据

Agent Skill

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

总安装

2,964

周安装

126

GitHub Stars

131

下载量

1,038
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/pproenca/dot-skills --skill swift-data

简介

swift-data 用于辅助数据整理、表格处理和指标计算,适合 CSV/Excel 分析。

  • 可清洗字段、汇总数据、发现异常并生成统计口径或分析说明。
  • 需确认数据来源、字段含义和时间范围,避免将样本当作全量事实。
  • 涉及敏感数据或批量写回时,应先确认权限和脱敏边界。
  • 支持导出文件或生成可读分析结果,适合数据驱动型任务。

SKILL.md

SwiftData Best Practices — Modular MVVM-C Data Layer

Comprehensive data modeling, persistence, sync architecture, and error handling guide for SwiftData aligned with the clinic modular MVVM-C stack.

Architecture Alignment

This skill enforces the same modular architecture mandated by swift-ui-architect:

┌───────────────────────────────────────────────────────────────┐
│ Feature modules: View + ViewModel, no SwiftData imports       │
├───────────────────────────────────────────────────────────────┤
│ Domain: models + repository/coordinator/error protocols        │
├───────────────────────────────────────────────────────────────┤
│ Data: @Model entities, SwiftData stores, repository impls,     │
│ remote clients, retry executor, sync queue, conflict handling  │
└───────────────────────────────────────────────────────────────┘

Key principle: SwiftData types (@Model, ModelContext, @Query, FetchDescriptor) live in Data-only implementation code. Feature Views/ViewModels work with Domain types and protocol dependencies.

Clinic Architecture Contract (iOS 26 / Swift 6.2)

All guidance in this skill assumes the clinic modular MVVM-C architecture:

  • Feature modules import Domain + DesignSystem only (never Data, never sibling features)
  • App target is the convergence point and owns DependencyContainer, concrete coordinators, and Route Shell wiring
  • Domain stays pure Swift and defines models plus repository, *Coordinating, ErrorRouting, and AppError contracts
  • Data owns SwiftData/network/sync/retry/background I/O and implements Domain protocols
  • Read/write flow defaults to stale-while-revalidate reads and optimistic queued writes
  • ViewModels call repository protocols directly (no default use-case/interactor layer)

When to Apply

Reference these guidelines when:

  • Defining @Model entity classes and mapping them to domain structs
  • Setting up ModelContainer and ModelContext in the Data layer
  • Implementing repository protocols backed by SwiftData
  • Writing stale-while-revalidate repository reads (AsyncStream)
  • Implementing optimistic writes plus queued sync operations
  • Configuring entity relationships (one-to-many, inverse)
  • Fetching from APIs and persisting to SwiftData via sync coordinators
  • Handling save failures, corrupt stores, and migration errors
  • Routing AppError traits to centralized error UI infrastructure
  • Building preview infrastructure with sample data
  • Planning schema migrations for app updates

Workflow

Use this workflow when designing or refactoring a SwiftData-backed feature:

  1. Domain design: define domain structs (Trip, Friend) with validation/computed rules (see model-domain-mapping, state-business-logic-placement)
  2. Entity design: define @Model entity classes with mapping methods (see model-*, model-domain-mapping)
  3. Repository protocol: define in Domain layer, implement with SwiftData in Data layer (see persist-repository-wrapper)
  4. Container wiring: configure ModelContainer once at the app boundary with error recovery (see persist-container-setup, persist-container-error-recovery)
  5. Dependency injection: inject repository protocols via @Environment (see state-dependency-injection)
  6. ViewModel: create @Observable ViewModel that delegates directly to repository protocols (see state-query-vs-viewmodel)
  7. CRUD flows: route all insert/delete/update through ViewModel -> Repository (see crud-*)
  8. Sync architecture: queue writes, execute via sync coordinator with retry policy (see sync-*)
  9. Relationships: model to-many relationships as arrays; define delete rules (see rel-*)
  10. Previews: create in-memory containers and sample data for fast iteration (see preview-*)
  11. Schema evolution: plan migrations with versioned schemas (see schema-*)

Troubleshooting

  • Data not persisting -> persist-model-macro, persist-container-setup, persist-autosave, schema-configuration
  • List not updating after background import -> query-background-refresh, persist-model-actor
  • List not updating (same-context) -> query-property-wrapper, state-wrapper-views
  • Duplicates from API sync -> schema-unique-attributes, sync-conflict-resolution
  • App crashes on launch after model change -> schema-migration-recovery, persist-container-error-recovery
  • Save failures silently losing data -> crud-save-error-handling
  • Stale data from network -> sync-offline-first, sync-fetch-persist
  • Widget/extension can't see data -> persist-app-group, schema-configuration
  • Choosing architecture pattern for data views -> state-query-vs-viewmodel, persist-repository-wrapper

Rule Categories by Priority

PriorityCategoryImpactPrefix
1Data ModelingCRITICALmodel-
2Persistence SetupCRITICALpersist-
3Querying & FilteringHIGHquery-
4CRUD OperationsHIGHcrud-
5Sync & NetworkingHIGHsync-
6RelationshipsMEDIUM-HIGHrel-
7SwiftUI State FlowMEDIUM-HIGHstate-
8Schema & MigrationMEDIUM-HIGHschema-
9Sample Data & PreviewsMEDIUMpreview-

Quick Reference

1. Data Modeling (CRITICAL)

2. Persistence Setup (CRITICAL)

3. Querying & Filtering (HIGH)

4. CRUD Operations (HIGH)

5. Sync & Networking (HIGH)

6. Relationships (MEDIUM-HIGH)

7. SwiftUI State Flow (MEDIUM-HIGH)

8. Schema & Migration (MEDIUM-HIGH)

9. Sample Data & Previews (MEDIUM)

How to Use

Read individual reference files for detailed explanations and code examples:

Reference Files

FileDescription
references/_sections.mdCategory definitions and ordering
assets/templates/_template.mdTemplate for new rules
metadata.jsonVersion and reference information

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

37.49%
按下载量换算389

Claude

28.84%
按下载量换算299

Cursor

21.53%
按下载量换算223

Gemini CLI

9.98%
按下载量换算104

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/pproenca/dot-skills --skill swift-data 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

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

来源信息

继续浏览同类 Skills