|
| 1 | +# Contentstack iOS Persistence – Agent guide |
| 2 | + |
| 3 | +*Universal entry point* for contributors and AI agents. Detailed conventions live in **skills/*/SKILL.md**. |
| 4 | + |
| 5 | +## What this repo is |
| 6 | + |
| 7 | +| Field | Detail | |
| 8 | +| --- | --- | |
| 9 | +| *Name:* | https://github.com/contentstack/contentstack-ios-persistence | |
| 10 | +| *Purpose:* | iOS library that persists Contentstack sync data locally so apps can work offline. Ships a shared core plus Core Data and Realm adapters consumed via CocoaPods. | |
| 11 | +| *Out of scope (if any):* | Not a standalone HTTP client; network and sync protocol come from the **Contentstack** iOS SDK dependency. Does not ship the example app (see [contentstack-ios-persistence-example](https://github.com/contentstack/contentstack-ios-persistence-example)). | |
| 12 | + |
| 13 | +## Tech stack (at a glance) |
| 14 | + |
| 15 | +| Area | Details | |
| 16 | +| --- | --- | |
| 17 | +| Language | Objective-C (primary); Swift-compatible module imports documented in README. iOS deployment target **12.0** (see podspecs). | |
| 18 | +| Build | **Xcode** workspace `ContentstackPersistence.xcworkspace`; **CocoaPods** (`Podfile`, `pod install`). Key sources: `ContentstackPersistence/`, `ContentstackPersistenceCoredata/`, `ContentstackPersistenceRealm/`. Podspecs: `ContentstackPersistence.podspec`, `ContentstackPersistenceCoreData.podspec`, `ContentstackPersistenceRealm.podspec`. | |
| 19 | +| Tests | **XCTest** target `ContentstackPersistenceTests`; tests under `ContentstackPersistenceTests/`. | |
| 20 | +| Lint / coverage | No SwiftLint / shared coverage config in-repo; follow team standards if added later. | |
| 21 | +| Other | Dependencies: **Contentstack** iOS SDK, **Realm** (Realm subspec). Optional persistence: Core Data vs Realm via separate pods. | |
| 22 | + |
| 23 | +## Commands (quick reference) |
| 24 | + |
| 25 | +| Command Type | Command | |
| 26 | +| --- | --- | |
| 27 | +| Build | `pod install` then `xcodebuild -workspace ContentstackPersistence.xcworkspace -scheme ContentstackPersistence -sdk iphonesimulator build` | |
| 28 | +| Test | `xcodebuild -workspace ContentstackPersistence.xcworkspace -scheme ContentstackPersistence -destination 'platform=iOS Simulator,name=iPhone 16' test` (adjust simulator name to one installed locally) | |
| 29 | +| Lint | *(none configured)* | |
| 30 | + |
| 31 | +**CI:** PR checks include branch policy (`.github/workflows/check-branch.yml`), Snyk SCA (`.github/workflows/sca-scan.yml`), and policy scans (`.github/workflows/policy-scan.yml`). Jira linkage: `.github/workflows/issues-jira.yml`. |
| 32 | + |
| 33 | +## Where the documentation lives: skills |
| 34 | + |
| 35 | +| Skill | Path | What it covers | |
| 36 | +| --- | --- | --- | |
| 37 | +| Dev workflow & CI | [skills/dev-workflow/SKILL.md](skills/dev-workflow/SKILL.md) | Branches, build/test, PR expectations, CI overview | |
| 38 | +| SDK & public API | [skills/contentstack-ios-persistence-sdk/SKILL.md](skills/contentstack-ios-persistence-sdk/SKILL.md) | Entry points, pods, sync/persistence boundaries, versioning | |
| 39 | +| Objective-C / Swift & layout | [skills/objc-swift-ios/SKILL.md](skills/objc-swift-ios/SKILL.md) | Language conventions and repository layout | |
| 40 | +| Testing | [skills/testing/SKILL.md](skills/testing/SKILL.md) | XCTest layout, naming, fixtures, secrets | |
| 41 | +| Code review | [skills/code-review/SKILL.md](skills/code-review/SKILL.md) | PR checklist for this repo | |
| 42 | +| iOS platform & packaging | [skills/ios-persistence-platform/SKILL.md](skills/ios-persistence-platform/SKILL.md) | CocoaPods, Core Data, Realm, Xcode workspace | |
| 43 | + |
| 44 | +An index with “when to use” hints is in [skills/README.md](skills/README.md). |
| 45 | + |
| 46 | +## Using Cursor (optional) |
| 47 | + |
| 48 | +If you use *Cursor*, [.cursor/rules/README.md](.cursor/rules/README.md) only points to *AGENTS.md*—same docs as everyone else. |
0 commit comments