Skip to content
Development
Skill

/ios-persistence

Implement local persistence with SwiftData, Core Data, and secure storage. Use when setting up SwiftData models, Core Data stacks, or local persistence in iOS.

From plugin
agent-skills-standard
583200 skills21 agents33 commands1 MCP

Claude Code

$ npx -y skills add hoangnguyen0403/agent-skills-standard --skill ios-persistence --agent claude-code

SKILL.md

ios-persistence.SKILL.md
name: ios-persistence
description: Implement local persistence with SwiftData, Core Data, and secure storage. Use when setting up SwiftData models, Core Data stacks, or local persistence in iOS.
metadata:
  triggers:
    files:
    - '**/*.xcdatamodeld'
    - '**/*Model.swift'
    keywords:
    - PersistentContainer
    - FetchRequest
    - ManagedObject
    - Query
    - ModelContainer
    - Repository

iOS Persistence

**Priority: P0 (CRITICAL)**

Implementation Workflow

1. **Choose storage tier** — SwiftData for iOS 17+, Core Data for legacy, Apple secure credential storage for secrets, UserDefaults for flags only. 2. **Define models** — Use `@Model` macro (SwiftData) or `.xcdatamodeld` (Core Data). 3. **Configure container** — Use `@MainActor` for `ModelContainer` (SwiftData) or `NSPersistentContainer` (Core Data). 4. **Perform background writes** — Use `newBackgroundContext()` (Core Data) to avoid UI lag; never heavy I/O on `viewContext`. 5. **Secure sensitive data** — Use secure storage for tokens and PII; never store in `UserDefaults`.

See [SwiftData and Core Data implementation examples](references/implementation.md)

Anti-Patterns

  • **No Heavy I/O on `viewContext`**: Use private background contexts
  • **No String-based Predicates**: Use KeyPaths or generated helpers
  • **No Missing Merge Strategy**: Set the merge policy (`mergePolicy`) explicitly (e.g., `mergeByPropertyObjectTrump`)

References

  • [SwiftData & Core Data Implementation](references/implementation.md)
Read more
@hoangnguyen0403
Ships withagent-skills-standard

The portable standards layer for AI coding agents. Sync once, then work in your own runtime.

583200 skills21 agents1 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
583
Star history of hoangnguyen0403/agent-skills-standard on GitHub, a chart by star-history.com

Other skills on agent-skills-standard.

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills10d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc12d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react1d252k
@facebook@facebookInstall Skill

Questions about ios-persistence.

Which coding agents can use ios-persistence?
ios-persistence installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.