Skip to content

Commit c0c6f04

Browse files
Merge pull request #132 from contentstack/fix/dx-6046-update-cursor-rules-skills
docs(DX-6046): add AGENTS.md, skills, and Cursor rules entry
2 parents f37a57d + b9c674b commit c0c6f04

14 files changed

Lines changed: 130 additions & 418 deletions

File tree

.cursor/rules/README.md

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,5 @@
1-
# Cursor Rules – Contentstack Swift CDA SDK
1+
# Cursor (optional)
22

3-
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.
3+
**Cursor** users: start at **[AGENTS.md](../../AGENTS.md)**. All conventions live in **`skills/*/SKILL.md`**.
44

5-
## How rules are applied
6-
7-
- **File-specific rules** use the `globs` frontmatter: they apply when you open or edit files matching that pattern.
8-
- **Always-on rules** use `alwaysApply: true`: they are included in every conversation in this project.
9-
10-
## Rule index
11-
12-
| File | Applies when | Purpose |
13-
|------|--------------|---------|
14-
| **dev-workflow.md** | (Reference only; no glob) | Core development workflow: branches, running tests, PR expectations. Read for process guidance. |
15-
| **swift.mdc** | Editing any `**/*.swift` file | Swift standards: naming, `Sources`/`Tests` layout, module **ContentstackSwift**, logging, optionals and error style. |
16-
| **contentstack-swift-cda.mdc** | Editing `Sources/**/*.swift` | CDA-specific patterns: Stack/ContentstackConfig, host/version/region/branch, URLSession, `Result`/`ResultsHandler`, alignment with Content Delivery API. |
17-
| **testing.mdc** | Editing `Tests/**/*.swift` | Testing patterns: XCTest, unit vs integration tests, fixtures, DVR where used. |
18-
| **code-review.mdc** | Always | PR/review checklist: API stability, error handling, backward compatibility, dependencies and security (e.g. SCA). |
19-
20-
## Related
21-
22-
- **AGENTS.md** (repo root) – Main entry point for AI agents: project overview, entry points, and pointers to rules and skills.
23-
- **skills/** – Reusable skill docs (Contentstack Swift CDA, testing, code review, framework) for deeper guidance on specific tasks.
5+
This folder only points contributors to **`AGENTS.md`** so editor-specific config does not duplicate the canonical docs.

.cursor/rules/code-review.mdc

Lines changed: 0 additions & 36 deletions
This file was deleted.

.cursor/rules/contentstack-swift-cda.mdc

Lines changed: 0 additions & 35 deletions
This file was deleted.

.cursor/rules/dev-workflow.md

Lines changed: 0 additions & 29 deletions
This file was deleted.

.cursor/rules/swift.mdc

Lines changed: 0 additions & 45 deletions
This file was deleted.

.cursor/rules/testing.mdc

Lines changed: 0 additions & 34 deletions
This file was deleted.

AGENTS.md

Lines changed: 33 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,44 @@
1-
# Contentstack Swift CDA SDK – Agent Guide
1+
# Contentstack Swift CDA SDK – Agent guide
22

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`**.
44

5-
## Project
5+
## What this repo is
66

7-
- **Name:** Contentstack Swift CDA SDK (contentstack-swift)
8-
- **Purpose:** Swift client for the Contentstack **Content Delivery API (CDA)**. It fetches content (entries, assets, content types, sync, taxonomy, global fields) from Contentstack for iOS, macOS, tvOS, watchOS, and Swift Package Manager consumers.
9-
- **Repo:** [contentstack-swift](https://github.com/contentstack/contentstack-swift)
7+
| Field | Detail |
8+
|--------|--------|
9+
| **Name:** | [contentstack-swift](https://github.com/contentstack/contentstack-swift) (SwiftPM product **ContentstackSwift**) |
10+
| **Purpose:** | Swift Package for Contentstack Content Delivery—queries, entries, sync, etc.—for Apple platforms. |
11+
| **Out of scope:** | Not the legacy Objective-C iOS CocoaPods SDK (`contentstack-ios`); new apps should prefer this Swift SDK per product direction. |
1012

11-
## Tech stack
13+
## Tech stack (at a glance)
1214

13-
- **Language:** Swift (SPM minimum **swift-tools-version 5.6**; align with Xcode requirements in README)
14-
- **Build:** Swift Package Manager (`Package.swift`), **Xcode** (`ContentstackSwift.xcodeproj`) for multi-platform frameworks and CocoaPods (`ContentstackSwift.podspec`)
15-
- **Testing:** **XCTest** (`Tests/`), optional **DVR** (HTTP recording) for some tests; integration-style tests may use `Tests/config.json` / stack credentials
16-
- **HTTP:** **URLSession** (configured via `ContentstackConfig.sessionConfiguration`), optional **`CSURLSessionDelegate`** (SSL pinning / customization)
17-
- **Other:** [contentstack-utils-swift](https://github.com/contentstack/contentstack-utils-swift) (Rich text rendering)
15+
| Area | Details |
16+
|------|---------|
17+
| Language | Swift (Package.swift tools **5.6+**); platforms include iOS 13+, macOS 10.15+, tvOS, watchOS per `Package.swift` |
18+
| Build | SwiftPM; Xcode workspace **`ContentstackSwift.xcworkspace`**; Carthage used in CI |
19+
| Tests | XCTest in **`Tests/`**; CI runs `xcodebuild test` (see `.github/workflows/ci.yml`) |
20+
| Lint / coverage | SwiftLint **`.swiftlint.yml`** |
21+
| CI | `.github/workflows/ci.yml`, `check-branch.yml`, `sca-scan.yml`, `policy-scan.yml`, `publish-cocoapods.yml` |
1822

19-
## Main entry points
23+
## Commands (quick reference)
2024

21-
- **`Contentstack`** – Static factory: `Contentstack.stack(apiKey:deliveryToken:environment:region:host:apiVersion:branch:config:)` returns a `Stack`.
22-
- **`Stack`** – Main API surface: content types, entries, assets, sync, taxonomy, queries, cache policy, JSON decoding.
23-
- **`ContentstackConfig`** – Optional configuration: `URLSessionConfiguration`, date/time zone decoding, early access headers, `urlSessionDelegate`, user agent.
24-
- **Paths:** `Sources/` (library target **ContentstackSwift**), `Tests/` (test target **ContentstackTests**).
25+
| Command type | Command |
26+
|--------------|---------|
27+
| SPM | `swift build` / `swift test` |
28+
| Lint | `swiftlint` (if installed) |
29+
| Xcode (CI-style) | `xcodebuild test -workspace ContentstackSwift.xcworkspace -scheme "ContentstackSwift macOS Tests" ...` (see `ci.yml`) |
2530

26-
## Commands
31+
## Where the documentation lives: skills
2732

28-
- **SPM build:** `swift build`
29-
- **SPM tests:** `swift test`
30-
- **Xcode:** Open `ContentstackSwift.xcodeproj`, then build/test schemes such as **ContentstackSwift iOS**, **ContentstackSwift macOS**, **ContentstackSwift tvOS** (and matching test targets).
31-
- **xcodebuild (example – adjust simulator/OS):**
32-
`xcodebuild -project ContentstackSwift.xcodeproj -scheme "ContentstackSwift iOS" -destination 'platform=iOS Simulator,name=iPhone 16' build test`
33+
| Skill | Path | What it covers |
34+
|-------|------|----------------|
35+
| **Development workflow** | [`skills/dev-workflow/SKILL.md`](skills/dev-workflow/SKILL.md) | Branches, CI, Carthage, SPM resolve |
36+
| **Swift CDA SDK** | [`skills/contentstack-swift-cda/SKILL.md`](skills/contentstack-swift-cda/SKILL.md) | Public API, Stack types, dependencies on utils |
37+
| **Swift style & layout** | [`skills/swift-style/SKILL.md`](skills/swift-style/SKILL.md) | `Sources/`, `Tests/`, SwiftLint |
38+
| **Testing** | [`skills/testing/SKILL.md`](skills/testing/SKILL.md) | XCTest, DVR, `Tests/config.json` for CI |
39+
| **Build & platform** | [`skills/framework/SKILL.md`](skills/framework/SKILL.md) | Workspace, schemes, CocoaPods publish |
40+
| **Code review** | [`skills/code-review/SKILL.md`](skills/code-review/SKILL.md) | PR checklist |
3341

34-
Run tests before opening a PR. API/integration tests that hit a live stack need valid credentials (see test helpers and `Tests/config.json` where applicable); do not commit secrets.
42+
## Using Cursor (optional)
3543

36-
## Rules and skills
37-
38-
- **`.cursor/rules/`** – Cursor rules for this repo:
39-
- **README.md** – Index of all rules and when each applies (globs / always-on).
40-
- **dev-workflow.md** – Development workflow (branches, tests, PR expectations).
41-
- **swift.mdc** – Applies to `**/*.swift`: Swift style, module layout, logging, optionals.
42-
- **contentstack-swift-cda.mdc** – Applies to `Sources/**/*.swift`: CDA patterns, Stack/Config, host/version/region/branch, callbacks, alignment with Content Delivery API.
43-
- **testing.mdc** – Applies to `Tests/**/*.swift`: test naming, unit vs integration, XCTest.
44-
- **code-review.mdc** – Always applied: PR/review checklist (aligned with other Contentstack CDA SDKs).
45-
- **`skills/`** – Reusable skill docs:
46-
- Use **contentstack-swift-cda** when implementing or changing CDA API usage or SDK core behavior.
47-
- Use **testing** when adding or refactoring tests.
48-
- Use **code-review** when reviewing PRs or before opening one.
49-
- Use **framework** when changing config, URL session setup, or HTTP-related behavior (`ContentstackConfig`, `Stack` networking).
50-
51-
Refer to `.cursor/rules/README.md` for when each rule applies and to `skills/README.md` for skill details.
44+
If you use **Cursor**, [`.cursor/rules/README.md`](.cursor/rules/README.md) only points to **`AGENTS.md`**—same docs as everyone else.

skills/README.md

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)