|
1 | | -# Contentstack iOS CDA SDK – Agent Guide |
| 1 | +# Contentstack iOS (Objective-C) CDA SDK – Agent guide |
2 | 2 |
|
3 | | -This document is the main entry point for AI agents working in this repository. |
| 3 | +**Universal entry point** for contributors and AI agents. Detailed conventions live in **`skills/*/SKILL.md`**. |
4 | 4 |
|
5 | | -## Project |
| 5 | +## What this repo is |
6 | 6 |
|
7 | | -- **Name:** Contentstack iOS CDA SDK (contentstack-ios) |
8 | | -- **Purpose:** iOS client for the Contentstack **Content Delivery API (CDA)**. It fetches content (entries, assets, content types, sync, taxonomy) from Contentstack for iOS apps (Objective-C primary API; Swift-compatible headers). |
9 | | -- **Repo:** [contentstack-ios](https://github.com/contentstack/contentstack-ios) |
| 7 | +| Field | Detail | |
| 8 | +|--------|--------| |
| 9 | +| **Name:** | [contentstack-ios](https://github.com/contentstack/contentstack-ios) (CocoaPods **`Contentstack`**) | |
| 10 | +| **Purpose:** | Legacy **Objective-C** Content Delivery SDK for iOS; CocoaPods distribution. | |
| 11 | +| **Out of scope:** | **New** apps should use the **[Swift CDA SDK](https://github.com/contentstack/contentstack-swift)** (see `README.md` / `DEPRECATION.md`). This repo maintains existing integrations. | |
10 | 12 |
|
11 | | -## Tech stack |
| 13 | +## Tech stack (at a glance) |
12 | 14 |
|
13 | | -- **Languages:** Objective-C (public SDK surface), with Swift-callable APIs via generated/bridged headers |
14 | | -- **IDE / build:** Xcode, `Contentstack.xcodeproj` |
15 | | -- **Distribution:** CocoaPods (`Contentstack.podspec`); no Swift Package Manager manifest in-repo today |
16 | | -- **HTTP:** `NSURLSession` via `CSURLSessionManager` and `CSIOCoreHTTPNetworking` (internal) |
17 | | -- **Testing:** XCTest, target **ContentstackTest** (`ContentstackTest.xctest`), scheme **Contentstack** (tests enabled; code coverage for **Contentstack** framework) |
| 15 | +| Area | Details | |
| 16 | +|------|---------| |
| 17 | +| Language | Objective-C (and supporting headers); Xcode project **`Contentstack.xcodeproj`** | |
| 18 | +| Build | Xcode; CocoaPods **`Contentstack.podspec`** | |
| 19 | +| Tests | XCTest targets in the Xcode project (see schemes) | |
| 20 | +| Lint / coverage | Follow Xcode warnings and team standards—no separate SwiftLint for primary Obj-C sources | |
| 21 | +| CI | `.github/workflows/check-branch.yml`, `policy-scan.yml`, `issues-jira.yml`, `release-package.yml` | |
18 | 22 |
|
19 | | -## Main entry points |
| 23 | +## Commands (quick reference) |
20 | 24 |
|
21 | | -- **`Contentstack`** – Factory: `+[Contentstack stackWithAPIKey:accessToken:environmentName:]` and `stackWithAPIKey:accessToken:environmentName:config:` return a **`Stack`**. |
22 | | -- **`Stack`** – Main API surface: content types, entries, queries, assets, asset library, sync, taxonomy, etc. |
23 | | -- **`Config`** – Optional settings: host, region, version (read-only where applicable), branch, URL session delegate, early access headers. |
24 | | -- **Paths (source):** `Contentstack/` (public headers + implementation), `ContentstackInternal/` (HTTP, URLs, constants, internal helpers), `ThirdPartyExtension/` (networking session layer, markdown, ISO8601). |
25 | | -- **Paths (tests):** `ContentstackTest/` |
| 25 | +| Command type | Command | |
| 26 | +|--------------|---------| |
| 27 | +| Xcode | Open **`Contentstack.xcodeproj`**, select scheme, **Cmd+B** / **Cmd+U** | |
| 28 | +| CocoaPods | `pod install` in consuming apps; podspec defines SDK surface | |
26 | 29 |
|
27 | | -## Commands |
| 30 | +## Where the documentation lives: skills |
28 | 31 |
|
29 | | -- **Build framework:** |
30 | | - `xcodebuild -project Contentstack.xcodeproj -scheme Contentstack -destination 'generic/platform=iOS' -configuration Debug build` |
31 | | -- **Run tests:** |
32 | | - `xcodebuild -project Contentstack.xcodeproj -scheme Contentstack -destination 'platform=iOS Simulator,name=<Device>' test` |
33 | | - Pick a simulator you have installed (e.g. **iPhone 16**). Tests may require **`ContentstackTest/config.json`** (or equivalent) with stack credentials for integration-style cases—do not commit secrets. |
34 | | -- **CocoaPods lint (maintainers):** |
35 | | - `pod lib lint Contentstack.podspec` |
| 32 | +| Skill | Path | What it covers | |
| 33 | +|-------|------|----------------| |
| 34 | +| **Development workflow** | [`skills/dev-workflow/SKILL.md`](skills/dev-workflow/SKILL.md) | Xcode project, CI, deprecation context | |
| 35 | +| **iOS CDA SDK (Obj-C)** | [`skills/contentstack-ios-cda/SKILL.md`](skills/contentstack-ios-cda/SKILL.md) | Classes, headers, CocoaPods API | |
| 36 | +| **Objective-C & layout** | [`skills/objective-c/SKILL.md`](skills/objective-c/SKILL.md) | Project structure, naming, modules | |
| 37 | +| **Testing** | [`skills/testing/SKILL.md`](skills/testing/SKILL.md) | XCTest in this repo | |
| 38 | +| **Build & platform** | [`skills/framework/SKILL.md`](skills/framework/SKILL.md) | Xcode settings, pods, iOS baselines | |
| 39 | +| **Code review** | [`skills/code-review/SKILL.md`](skills/code-review/SKILL.md) | PR checklist, migration messaging | |
36 | 40 |
|
37 | | -Use **Product → Test** in Xcode as an alternative to `xcodebuild test`. |
| 41 | +## Using Cursor (optional) |
38 | 42 |
|
39 | | -## Rules and skills |
40 | | - |
41 | | -- **`.cursor/rules/`** – Cursor rules for this repo: |
42 | | - - **README.md** – Index of all rules and when each applies. |
43 | | - - **dev-workflow.md** – Branches, tests, PR expectations. |
44 | | - - **ios.mdc** – Applies to SDK Objective-C sources: style, structure, naming. |
45 | | - - **contentstack-ios-cda.mdc** – Applies to SDK core: CDA patterns, Stack/Config, HTTP/retry, callbacks, CDA alignment. |
46 | | - - **testing.mdc** – Applies to **ContentstackTest**: XCTest naming, unit vs integration-style tests. |
47 | | - - **code-review.mdc** – Always applied: PR/review checklist (aligned with other Contentstack CDA SDKs). |
48 | | -- **`skills/`** – Reusable skill docs: |
49 | | - - **contentstack-ios-cda** – CDA implementation and SDK core behavior. |
50 | | - - **testing** – Adding or refactoring tests. |
51 | | - - **code-review** – PR review or pre-submit checklist. |
52 | | - - **framework** – Config, HTTP session layer, retry behavior, and networking internals. |
53 | | - |
54 | | -Refer to `.cursor/rules/README.md` for the rule index and to `skills/README.md` for when to use each skill. |
55 | | - |
56 | | -For cross-SDK alignment, see the Java CDA SDK’s **AGENTS.md** and `.cursor/rules/` in [contentstack-java](https://github.com/contentstack/contentstack-java) (patterns are analogous; APIs and build tools differ). |
| 43 | +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