data-modeling-and-sync

data-modeling-and-sync is a skill for Claude Code, Codex from mwd1234/ios-agentic-skills. It costs 32 tokens per session (490 once invoked), scanned A, original, MIT.

A review guide for keeping data consistent between an iPhone app and its Apple Watch companion when devices connect, disconnect, or change data at the same time.

In plain words
What is it for?
Use it when changing data models or WCSession communication, handling retries and offline behavior, resolving conflicts, or checking sync before App Store submission.
Why use it?
It helps prevent missing updates, incompatible stored data, and unclear outcomes when both devices work offline or send conflicting changes. It also covers migrations, which update older saved data to a newer format.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when changing data models or WCSession communication, handling retries and offline behavior, resolving conflicts, or checking sync before App Store submission.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mwd1234/ios-agentic-skills/data-modeling-and-sync
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add mwd1234/ios-agentic-skills --skill data-modeling-and-sync
Clone the repo
git clone --depth 1 https://github.com/mwd1234/ios-agentic-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for data-modeling-and-sync

README.md
[![agentmods](https://agentmods.dev/badge/skills/mwd1234/ios-agentic-skills/data-modeling-and-sync/github.svg)](https://agentmods.dev/skills/mwd1234/ios-agentic-skills/data-modeling-and-sync)
Your own site
<a href="https://agentmods.dev/skills/mwd1234/ios-agentic-skills/data-modeling-and-sync"><img src="https://agentmods.dev/badge/skills/mwd1234/ios-agentic-skills/data-modeling-and-sync/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for data-modeling-and-sync

Your own site · 80×15
<a href="https://agentmods.dev/skills/mwd1234/ios-agentic-skills/data-modeling-and-sync"><img src="https://agentmods.dev/badge/skills/mwd1234/ios-agentic-skills/data-modeling-and-sync.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 32 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 490 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00032 $0.00490
Opus 5 $0.00016 $0.00245
Sonnet 5 $0.00006 $0.00098
Haiku 4.5 $0.00003 $0.00049

Measured 10d ago against content hash d34b9ab45b45, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

data-modeling-and-sync scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agent/skills/data-modeling-and-sync/SKILL.md · 90 lines

What it actually says

Data Modeling & Sync

Ensure data integrity across iPhone and Apple Watch, with predictable conflict handling and resilient offline behavior.

When to use this skill

  • When adding new data models or persistence changes
  • After any WCSession messaging changes
  • Before App Store submission
  • When users report missing or out-of-sync data

Step 1: Model Stability & Migrations

Checklist:

  • Models have stable identifiers (UUID or stable hash)
  • Stored models include schema version
  • Migration strategy exists for added/removed fields

If using Codable + UserDefaults:

  • Provide default values for new fields
  • Handle missing keys gracefully

Step 2: WCSession Reliability

WATCH_DIR="YourApp Watch App"

# WCSession usage
rg --type swift 'WCSession|sendMessage|transferUserInfo|updateApplicationContext' "$WATCH_DIR/"
rg --type swift 'WCSession' YourApp/

Checklist:

  • WCSession.isReachable only used for interactive UI messages
  • transferUserInfo for eventual delivery
  • updateApplicationContext for latest state only
  • Retries or fallbacks for failures

Step 3: Conflict Resolution

Define a clear strategy:

  • Last-write-wins with timestamps, or
  • Merge by stable ID, or
  • User choice for conflicts

Ensure conflict handling is deterministic and tested.


Step 4: Offline & Edge Cases

Checklist:

  • App behaves predictably offline
  • Pending changes queued and replayed
  • No data loss if watch/app restarts mid-sync

Step 5: Data Integrity Tests

Suggested tests:

  • Encode/decode round-trip for each model
  • Migration tests between schema versions
  • Sync payload validation
  • Conflict-resolution unit tests

Output Format

Category Issues Status
Model stability X ✅/❌
Migration strategy X ✅/❌
WCSession reliability X ✅/❌
Conflict handling X ✅/❌
Offline behavior X ✅/❌
Integrity tests X ✅/❌
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 90 lines · 32 tokens per session scan A d34b9ab45b45

Subscribe to this mod's changes

data-modeling-and-sync is a skill published in the GitHub repository mwd1234/ios-agentic-skills (50 stars, last pushed 7mo ago), licensed MIT. It adds 32 tokens to every session and 490 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.