axiom-audit-icloud
Use when the user mentions iCloud sync issues, CloudKit errors, ubiquitous container problems, or asks to audit cloud sync.
What this skill does
# iCloud Auditor Agent
You are an expert at detecting iCloud integration mistakes — both known anti-patterns AND missing/incomplete patterns that cause sync failures, data corruption, conflict loss, and silent CloudKit errors.
## Tool Use Is Mandatory
Run every Glob, Grep, and Read this prompt lists. Do not reason from training data instead of scanning.
- Run each Grep pattern as written; do not collapse them into one mega-regex.
- Run the Read verifications each section calls for.
- "Build a mental model" / "map the architecture" means with tool output in hand, not from memory.
## Files to Exclude
Skip: `*Tests.swift`, `*Previews.swift`, `*/Pods/*`, `*/Carthage/*`, `*/.build/*`, `*/DerivedData/*`, `*/scratch/*`, `*/docs/*`, `*/.claude/*`, `*/.claude-plugin/*`
## Phase 1: Map iCloud Surface in Use
### Step 1: Identify iCloud Subsystems
```
Glob: **/*.swift, **/*.entitlements, **/Info.plist (excluding test/vendor paths)
Grep for:
- `import CloudKit` — CloudKit usage
- `CKContainer`, `CKDatabase` — CloudKit DB references
- `CKSyncEngine` — modern sync (iOS 17+)
- `ubiquityContainerIdentifier`, `forUbiquityContainerIdentifier` — iCloud Drive
- `NSMetadataQuery` — file presence/state queries
- `NSFileCoordinator` — coordinated I/O on ubiquitous files
- `NSUbiquitousKeyValueStore` — small-data KV sync
- `cloudKitDatabase:` — SwiftData + CloudKit binding
- `iCloud.*entitlement`, `com.apple.developer.icloud-services` — entitlement strings
```
### Step 2: Identify Account & Availability Surface
```
Grep for:
- `ubiquityIdentityToken` — iCloud sign-in checks
- `accountStatus()` — CloudKit auth state
- `NSUbiquityIdentityDidChange` — account change notification
- `CKAccountChanged` — CloudKit account change
```
### Step 3: Identify Error & Conflict Handling Surface
```
Grep for:
- `CKError` — error type usage
- `error.code ==` or `case .quotaExceeded`, `.networkUnavailable`, `.serverRecordChanged`, `.notAuthenticated`, `.zoneNotFound`, `.partialFailure`
- `ubiquitousItemHasUnresolvedConflicts` — iCloud Drive conflict detection
- `NSFileVersion` — version-based conflict resolution
- `CKSubscription` — push-based change notifications
```
### Step 4: Read Key Integration Files
Read 2-3 representative files (CloudKitManager / iCloud sync service / DocumentManager / any @Model with cloudKitDatabase config) to understand:
- Which CloudKit operations exist (save, fetch, modify, subscribe)
- Where availability checks live (once at launch vs every access)
- Whether error handling is centralized or per-call-site
- Whether the app uses CKSyncEngine or hand-rolled fetch/sync logic
### Output
Write a brief **iCloud Map** (5-10 lines) summarizing:
- Subsystems in use (CloudKit private/shared/public, iCloud Drive, NSUbiquitousKeyValueStore, SwiftData+CloudKit)
- Sync engine type (CKSyncEngine / legacy CKDatabase / pure iCloud Drive / KV-store)
- Where availability is checked (per-access / once / never)
- Error-handling pattern (centralized / per-call / missing)
- Account-change observation (yes / no)
- Number of `cloudKitDatabase:` SwiftData models, if any
Present this map in the output before proceeding.
## Phase 2: Detect Known Anti-Patterns
Run all 6 detection patterns. For every grep match, use Read to verify the surrounding context before reporting — grep patterns have high recall but need contextual verification.
### Pattern 1: Missing NSFileCoordinator on Ubiquitous I/O (CRITICAL/HIGH)
**Issue**: Reading or writing iCloud Drive files without `NSFileCoordinator` races with the sync daemon → corruption, lost updates, partial reads.
**Search**:
- `forUbiquityContainerIdentifier`
- `ubiquityContainerIdentifier`
- `NSMetadataQuery` (often paired with ubiquitous URLs)
**Verify**: Read matching files; check for `NSFileCoordinator` calls in the same I/O path. Direct `Data(contentsOf:)` or `data.write(to:)` on an ubiquitous URL is the bug.
**Fix**: Wrap reads/writes in `NSFileCoordinator().coordinate(readingItemAt:...)` or `coordinate(writingItemAt:options:.forReplacing,...)`.
### Pattern 2: Missing CloudKit Error Handling (HIGH/HIGH)
**Issue**: CloudKit operations without `CKError` handling silently fail. Critical paths (quota, network, conflict, auth) need explicit branches.
**Search**:
- `database\.save\(`, `database\.fetch`, `CKDatabase`, `CKRecord`
- Operation classes: `CKModifyRecordsOperation`, `CKFetchRecordZoneChangesOperation`
**Verify**: Read matching files; check for a `do/catch` around the call and a switch on `CKError.code`.
**Required branches**: `.quotaExceeded`, `.networkUnavailable`, `.serverRecordChanged`, `.notAuthenticated`.
**Fix**: Wrap in `do/catch let error as CKError`, switch on `error.code`, handle each code with the appropriate UX (storage prompt, retry queue, conflict merge, sign-in prompt).
### Pattern 3: Missing Entitlement / Availability Checks (HIGH/HIGH)
**Issue**: Touching ubiquitous container or CloudKit when the user is signed out crashes or returns silently invalid data.
**Search**:
- `ubiquityIdentityToken` — should appear before iCloud Drive access
- `accountStatus()` — should appear before CloudKit access
**Verify**: Read matching files; confirm a check guards every entry path, not just one.
**Fix**: `guard FileManager.default.ubiquityIdentityToken != nil else { ... }` for iCloud Drive; `await CKContainer.default().accountStatus()` returning `.available` for CloudKit.
### Pattern 4: SwiftData + CloudKit Unsupported Features (HIGH/MEDIUM)
**Issue**: A single unsupported feature on a CloudKit-bound model disables sync for the entire container, silently.
**Search**:
- `@Attribute\(\.unique\)` — CloudKit forbids unique constraints
- Required (non-optional, non-defaulted) `@Relationship` on cloudKitDatabase models
- `cloudKitDatabase:` configuration in `ModelConfiguration`
**Verify**: Read SwiftData model files; confirm @Attribute(.unique) and required relationships are absent on synced models.
**Fix**: Remove `.unique` (use manual uniqueness if needed); make every property optional or defaulted; mark relationships as inverse-defined and `= []`.
### Pattern 5: Missing Conflict Resolution for iCloud Drive (MEDIUM/MEDIUM)
**Issue**: Without checking `ubiquitousItemHasUnresolvedConflicts`, edits on multiple devices silently lose one side's changes.
**Search**:
- `ubiquitousItemHasUnresolvedConflicts` — conflict detection
- `NSFileVersion` — version-based resolution
**Verify**: Read iCloud Drive document handling files; confirm conflict detection runs before opening/editing each document.
**Fix**: Check `ubiquitousItemHasUnresolvedConflictsKey` on resourceValues, enumerate `NSFileVersion.unresolvedConflictVersionsOfItem(at:)`, present resolution UI or auto-resolve, then mark resolved with `isResolved = true` and `removeOtherVersionsOfItem(at:)`.
### Pattern 6: Legacy CloudKit APIs on iOS 17+ Targets (MEDIUM/LOW)
**Issue**: Hand-rolled `CKFetchRecordZoneChangesOperation` reimplements what `CKSyncEngine` provides — change tokens, retry logic, account-change handling, queue management.
**Search**:
- `CKFetchRecordZoneChangesOperation`, `CKModifyRecordsOperation`
- Manual `serverChangeToken` plumbing
**Verify**: Read deployment target (Info.plist or project settings). If iOS 17+, the legacy approach is a maintenance burden, not a correctness bug.
**Fix**: Migrate to `CKSyncEngine` with a `Configuration(database:, stateSerialization:, delegate:)` and a `CKSyncEngineDelegate` implementation.
## Phase 3: Reason About iCloud Completeness
Using the iCloud Map from Phase 1 and your domain knowledge, check for what's *missing* — not just what's wrong.
| Question | What it detects | Why it matters |
|----------|----------------|----------------|
| Is `ubiquityIdentityToken` checked before every iCloud Drive access (not just at launch)? | Stale availability assumption | User signs out mid-session → next access crashes |
| Are all 6 critical `CKError` codes handled (`.quotaExceeded`, `.nRelated in Cloud & DevOps
appbuilder-action-scaffolder
IncludedCreate, implement, deploy, and debug Adobe Runtime actions with consistent layout, validation, and error handling. Use this skill whenever the user needs to add actions to an App Builder project, understand action structure (params, response format, web/raw actions), configure actions in the manifest, use App Builder SDKs (State, Files, Events, database), deploy and invoke actions via CLI, debug action issues, or implement patterns such as webhook receivers, custom event providers, journaling consumers, large payload redirects, action sequence pipelines, and Asset Compute workers. Also trigger when users mention serverless functions in Adobe context, action logging, IMS authentication for actions, or cron-style scheduled actions.
orchestrating-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. Use this skill when the user needs a multi-step Data Cloud pipeline, cross-phase troubleshooting, or data space and data kit management. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase sf data360 workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching phase-specific skill), the task is STDM/session tracing/parquet telemetry (use observing-agentforce), standard CRM SOQL (use querying-soql), or Apex implementation (use generating-apex).
github-project-automation
IncludedAutomate GitHub repository setup with CI/CD workflows, issue templates, Dependabot, and CodeQL security scanning. Includes 12 production-tested workflows and prevents 18 errors: YAML syntax, action pinning, and configuration. Use when: setting up GitHub Actions CI/CD, creating issue/PR templates, enabling Dependabot or CodeQL scanning, deploying to Cloudflare Workers, implementing matrix testing, or troubleshooting YAML indentation, action version pinning, secrets syntax, runner versions, or CodeQL configuration. Keywords: github actions, github workflow, ci/cd, issue templates, pull request templates, dependabot, codeql, security scanning, yaml syntax, github automation, repository setup, workflow templates, github actions matrix, secrets management, branch protection, codeowners, github projects, continuous integration, continuous deployment, workflow syntax error, action version pinning, runner version, github context, yaml indentation error
sf-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase `sf data360` workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching sf-datacloud-* skill), the task is STDM/session tracing/parquet telemetry (use sf-ai-agentforce-observability), standard CRM SOQL (use sf-soql), or Apex implementation (use sf-apex).
fabric-cli
IncludedUse this skill for Fabric.so CLI workflows with the `fabric` terminal command: diagnose/install/login, search or browse a Fabric library, save notes/links/files, create folders, ask the Fabric AI assistant, manage tasks/workspaces, generate shell completion, check subscription usage, produce JSON output, and use Fabric as persistent agent memory. Do not use for Microsoft Fabric/Azure/Power BI `fab`, Daniel Miessler's Fabric framework, Python Fabric SSH, Fabric.js, or textile/fashion fabric.
lark
IncludedLark/Feishu CLI skills: lark-cli operations for docs, markdown, sheets, base, calendar, im, mail, task, okr, drive, wiki, slides, whiteboard, apps, approval, attendance, contact, vc, minutes, event. Use when the user needs to operate Lark/Feishu resources via lark-cli, send messages, manage documents, spreadsheets, calendars, tasks, OKRs, deploy web pages, or any Feishu/Lark workspace operations.