Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 3 additions & 21 deletions .cursor/rules/README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,5 @@
# Cursor Rules – Contentstack iOS CDA SDK
# Cursor (optional)

This directory contains Cursor AI rules that apply when working in this repository. Rules provide persistent context so the AI follows project conventions and Contentstack CDA patterns.
**Cursor** users: start at **[AGENTS.md](../../AGENTS.md)**. All conventions live in **`skills/*/SKILL.md`**.

## How rules are applied

- **File-specific rules** use the `globs` frontmatter: they apply when you open or edit files matching that pattern.
- **Always-on rules** use `alwaysApply: true`: they are included in every conversation in this project.

## Rule index

| File | Applies when | Purpose |
|------|--------------|---------|
| **dev-workflow.md** | (Reference only; no glob) | Development workflow: branches, running tests, PR expectations. Read for process guidance. |
| **ios.mdc** | `Contentstack/`, `ContentstackInternal/`, `ThirdPartyExtension/` `*.h` / `*.m` | Objective-C standards: naming, module layout, headers vs implementation, nullability, consistency with existing SDK style. |
| **contentstack-ios-cda.mdc** | `Contentstack/`, `ContentstackInternal/` `*.h` / `*.m` | CDA-specific patterns: Stack/Config, host/version/region/branch, HTTP entry points, retry behavior, blocks/callbacks, alignment with Content Delivery API. |
| **testing.mdc** | `ContentstackTest/**/*.h`, `ContentstackTest/**/*.m` | XCTest patterns: test class naming, unit vs network/integration-style tests, fixtures (`config.json`), stability. |
| **code-review.mdc** | Always | PR/review checklist: API stability, error handling, backward compatibility, dependencies and security (e.g. SCA). |

## Related

- **AGENTS.md** (repo root) – Main entry point for AI agents: project overview, entry points, commands, pointers to rules and skills.
- **skills/** – Reusable skill docs (Contentstack iOS CDA, testing, code review, framework) for deeper guidance on specific tasks.
This folder only points contributors to **`AGENTS.md`** so editor-specific config does not duplicate the canonical docs.
36 changes: 0 additions & 36 deletions .cursor/rules/code-review.mdc

This file was deleted.

36 changes: 0 additions & 36 deletions .cursor/rules/contentstack-ios-cda.mdc

This file was deleted.

27 changes: 0 additions & 27 deletions .cursor/rules/dev-workflow.md

This file was deleted.

43 changes: 0 additions & 43 deletions .cursor/rules/ios.mdc

This file was deleted.

33 changes: 0 additions & 33 deletions .cursor/rules/testing.mdc

This file was deleted.

77 changes: 32 additions & 45 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,56 +1,43 @@
# Contentstack iOS CDA SDK – Agent Guide
# Contentstack iOS (Objective-C) CDA SDK – Agent guide

This document is the main entry point for AI agents working in this repository.
**Universal entry point** for contributors and AI agents. Detailed conventions live in **`skills/*/SKILL.md`**.

## Project
## What this repo is

- **Name:** Contentstack iOS CDA SDK (contentstack-ios)
- **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).
- **Repo:** [contentstack-ios](https://github.com/contentstack/contentstack-ios)
| Field | Detail |
|--------|--------|
| **Name:** | [contentstack-ios](https://github.com/contentstack/contentstack-ios) (CocoaPods **`Contentstack`**) |
| **Purpose:** | Legacy **Objective-C** Content Delivery SDK for iOS; CocoaPods distribution. |
| **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. |

## Tech stack
## Tech stack (at a glance)

- **Languages:** Objective-C (public SDK surface), with Swift-callable APIs via generated/bridged headers
- **IDE / build:** Xcode, `Contentstack.xcodeproj`
- **Distribution:** CocoaPods (`Contentstack.podspec`); no Swift Package Manager manifest in-repo today
- **HTTP:** `NSURLSession` via `CSURLSessionManager` and `CSIOCoreHTTPNetworking` (internal)
- **Testing:** XCTest, target **ContentstackTest** (`ContentstackTest.xctest`), scheme **Contentstack** (tests enabled; code coverage for **Contentstack** framework)
| Area | Details |
|------|---------|
| Language | Objective-C (and supporting headers); Xcode project **`Contentstack.xcodeproj`** |
| Build | Xcode; CocoaPods **`Contentstack.podspec`** |
| Tests | XCTest targets in the Xcode project (see schemes) |
| Lint / coverage | Follow Xcode warnings and team standards—no separate SwiftLint for primary Obj-C sources |
| CI | `.github/workflows/check-branch.yml`, `policy-scan.yml`, `issues-jira.yml`, `release-package.yml` |

## Main entry points
## Commands (quick reference)

- **`Contentstack`** – Factory: `+[Contentstack stackWithAPIKey:accessToken:environmentName:]` and `stackWithAPIKey:accessToken:environmentName:config:` return a **`Stack`**.
- **`Stack`** – Main API surface: content types, entries, queries, assets, asset library, sync, taxonomy, etc.
- **`Config`** – Optional settings: host, region, version (read-only where applicable), branch, URL session delegate, early access headers.
- **Paths (source):** `Contentstack/` (public headers + implementation), `ContentstackInternal/` (HTTP, URLs, constants, internal helpers), `ThirdPartyExtension/` (networking session layer, markdown, ISO8601).
- **Paths (tests):** `ContentstackTest/`
| Command type | Command |
|--------------|---------|
| Xcode | Open **`Contentstack.xcodeproj`**, select scheme, **Cmd+B** / **Cmd+U** |
| CocoaPods | `pod install` in consuming apps; podspec defines SDK surface |

## Commands
## Where the documentation lives: skills

- **Build framework:**
`xcodebuild -project Contentstack.xcodeproj -scheme Contentstack -destination 'generic/platform=iOS' -configuration Debug build`
- **Run tests:**
`xcodebuild -project Contentstack.xcodeproj -scheme Contentstack -destination 'platform=iOS Simulator,name=<Device>' test`
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.
- **CocoaPods lint (maintainers):**
`pod lib lint Contentstack.podspec`
| Skill | Path | What it covers |
|-------|------|----------------|
| **Development workflow** | [`skills/dev-workflow/SKILL.md`](skills/dev-workflow/SKILL.md) | Xcode project, CI, deprecation context |
| **iOS CDA SDK (Obj-C)** | [`skills/contentstack-ios-cda/SKILL.md`](skills/contentstack-ios-cda/SKILL.md) | Classes, headers, CocoaPods API |
| **Objective-C & layout** | [`skills/objective-c/SKILL.md`](skills/objective-c/SKILL.md) | Project structure, naming, modules |
| **Testing** | [`skills/testing/SKILL.md`](skills/testing/SKILL.md) | XCTest in this repo |
| **Build & platform** | [`skills/framework/SKILL.md`](skills/framework/SKILL.md) | Xcode settings, pods, iOS baselines |
| **Code review** | [`skills/code-review/SKILL.md`](skills/code-review/SKILL.md) | PR checklist, migration messaging |

Use **Product → Test** in Xcode as an alternative to `xcodebuild test`.
## Using Cursor (optional)

## Rules and skills

- **`.cursor/rules/`** – Cursor rules for this repo:
- **README.md** – Index of all rules and when each applies.
- **dev-workflow.md** – Branches, tests, PR expectations.
- **ios.mdc** – Applies to SDK Objective-C sources: style, structure, naming.
- **contentstack-ios-cda.mdc** – Applies to SDK core: CDA patterns, Stack/Config, HTTP/retry, callbacks, CDA alignment.
- **testing.mdc** – Applies to **ContentstackTest**: XCTest naming, unit vs integration-style tests.
- **code-review.mdc** – Always applied: PR/review checklist (aligned with other Contentstack CDA SDKs).
- **`skills/`** – Reusable skill docs:
- **contentstack-ios-cda** – CDA implementation and SDK core behavior.
- **testing** – Adding or refactoring tests.
- **code-review** – PR review or pre-submit checklist.
- **framework** – Config, HTTP session layer, retry behavior, and networking internals.

Refer to `.cursor/rules/README.md` for the rule index and to `skills/README.md` for when to use each skill.

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).
If you use **Cursor**, [`.cursor/rules/README.md`](.cursor/rules/README.md) only points to **`AGENTS.md`**—same docs as everyone else.
Loading