|
| 1 | +# Contentstack Java CDA SDK – Agent Guide |
| 2 | + |
| 3 | +This document is the main entry point for AI agents working in this repository. |
| 4 | + |
| 5 | +## Project |
| 6 | + |
| 7 | +- **Name:** Contentstack Java CDA SDK (contentstack-java) |
| 8 | +- **Purpose:** Java client for the Contentstack **Content Delivery API (CDA)**. It fetches content (entries, assets, content types, sync, taxonomy) from Contentstack and delivers it to Java applications. |
| 9 | +- **Repo:** [contentstack-java](https://github.com/contentstack/contentstack-java) |
| 10 | + |
| 11 | +## Tech stack |
| 12 | + |
| 13 | +- **Language:** Java 8 (source/target 1.8) |
| 14 | +- **Build:** Maven |
| 15 | +- **Testing:** JUnit 5, JaCoCo (coverage) |
| 16 | +- **HTTP:** Retrofit 2, OkHttp |
| 17 | +- **Other:** Gson, RxJava 3, Lombok, contentstack-utils |
| 18 | + |
| 19 | +## Main entry points |
| 20 | + |
| 21 | +- **`Contentstack`** – Static factory: `Contentstack.stack(apiKey, deliveryToken, environment)` returns a `Stack`. |
| 22 | +- **`Stack`** – Main API surface: entries, assets, content types, sync, live preview, etc. |
| 23 | +- **`Config`** – Optional configuration: host, version, region, branch, retry, proxy, connection pool, plugins. |
| 24 | +- **Paths:** `src/main/java/com/contentstack/sdk/` (production), `src/test/java/com/contentstack/sdk/` (tests). |
| 25 | + |
| 26 | +## Commands |
| 27 | + |
| 28 | +- **Build and test:** `mvn clean test` |
| 29 | +- **Single test class:** `mvn test -Dtest=TestEntry` |
| 30 | +- **Integration tests only:** `mvn test -Dtest='*IT'` |
| 31 | +- **Unit tests only:** `mvn test -Dtest='Test*'` |
| 32 | + |
| 33 | +Integration tests may require a `.env` with stack credentials (see `Credentials` and test README/docs). |
| 34 | + |
| 35 | +## Rules and skills |
| 36 | + |
| 37 | +- **`.cursor/rules/`** – Cursor rules for this repo: |
| 38 | + - **README.md** – Index of all rules. |
| 39 | + - **dev-workflow.md** – Development workflow (branches, tests, PRs). |
| 40 | + - **java.mdc** – Applies to `**/*.java`: Java 8 and SDK conventions. |
| 41 | + - **contentstack-java-cda.mdc** – Applies to SDK core: CDA patterns, Config, HTTP, retry, callbacks. |
| 42 | + - **testing.mdc** – Applies to `src/test/**/*.java`: JUnit 5, Test* / *IT, BaseIntegrationTest, JaCoCo. |
| 43 | + - **code-review.mdc** – Always applied: PR/review checklist. |
| 44 | +- **`skills/`** – Reusable skill docs: |
| 45 | + - Use **contentstack-java-cda** when implementing or changing CDA API usage or SDK core behavior. |
| 46 | + - Use **testing** when adding or refactoring tests. |
| 47 | + - Use **code-review** when reviewing PRs or before opening one. |
| 48 | + - Use **framework** when changing config, retry, or HTTP layer (Config, RetryOptions, RetryInterceptor, CSHttpConnection). |
| 49 | + |
| 50 | +Refer to `.cursor/rules/README.md` for when each rule applies and to `skills/README.md` for skill details. |
0 commit comments