|
1 | | -# Contentstack Java CDA SDK – Agent Guide |
| 1 | +# Contentstack Java Delivery 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 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) |
| 7 | +| Field | Detail | |
| 8 | +|--------|--------| |
| 9 | +| **Name:** | [contentstack-java](https://github.com/contentstack/contentstack-java) (`com.contentstack.sdk:java`) | |
| 10 | +| **Purpose:** | Java SDK for the Contentstack Content Delivery API (stack, entries, assets, queries, sync, etc.). | |
| 11 | +| **Out of scope:** | Not the Android or Swift SDKs—use those repositories for mobile-specific clients. | |
10 | 12 |
|
11 | | -## Tech stack |
| 13 | +## Tech stack (at a glance) |
12 | 14 |
|
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 |
| 15 | +| Area | Details | |
| 16 | +|------|---------| |
| 17 | +| Language | Java **8** (`maven.compiler.source/target` in `pom.xml`) | |
| 18 | +| Build | Maven (`pom.xml`); JaCoCo for coverage | |
| 19 | +| Tests | JUnit 5; unit tests and `*IT` integration tests under `src/test/java/` | |
| 20 | +| Lint / coverage | JaCoCo (`jacoco:report` in CI); no separate Checkstyle in quick path—follow existing style | |
| 21 | +| CI | `.github/workflows/unit-testing.yml`, `check-branch.yml`, `sca-scan.yml`, `policy-scan.yml`, `codeql-analysis.yml`, publish workflows | |
18 | 22 |
|
19 | | -## Main entry points |
| 23 | +## Commands (quick reference) |
20 | 24 |
|
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 | +| Command type | Command | |
| 26 | +|--------------|---------| |
| 27 | +| Build / test | `mvn clean test -Dgpg.skip=true` (adjust `-Dtest` per `pom.xml` surefire notes) | |
| 28 | +| Coverage (CI-style) | `mvn clean test -Dtest='Test*' jacoco:report -Dgpg.skip=true` | |
25 | 29 |
|
26 | | -## Commands |
| 30 | +## Where the documentation lives: skills |
27 | 31 |
|
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 | +| Skill | Path | What it covers | |
| 33 | +|-------|------|----------------| |
| 34 | +| **Development workflow** | [`skills/dev-workflow/SKILL.md`](skills/dev-workflow/SKILL.md) | Branches, Maven, CI, JaCoCo | |
| 35 | +| **Java CDA SDK** | [`skills/contentstack-java-cda/SKILL.md`](skills/contentstack-java-cda/SKILL.md) | Public API: `Stack`, queries, callbacks, HTTP layer | |
| 36 | +| **Java style & layout** | [`skills/java/SKILL.md`](skills/java/SKILL.md) | `src/main/java` packages, Lombok, Retrofit/Rx usage | |
| 37 | +| **Framework / HTTP** | [`skills/framework/SKILL.md`](skills/framework/SKILL.md) | Config, RetryOptions, CSHttpConnection, OkHttp/Retrofit flow | |
| 38 | +| **Testing** | [`skills/testing/SKILL.md`](skills/testing/SKILL.md) | Unit vs integration tests, resources, credentials | |
| 39 | +| **Code review** | [`skills/code-review/SKILL.md`](skills/code-review/SKILL.md) | PR checklist for JVM SDK | |
32 | 40 |
|
33 | | -Integration tests may require a `.env` with stack credentials (see `Credentials` and test README/docs). |
| 41 | +## Using Cursor (optional) |
34 | 42 |
|
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. |
| 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