Skip to content

Latest commit

History

History
53 lines (40 loc) · 3.74 KB

File metadata and controls

53 lines (40 loc) · 3.74 KB

Contentstack Utils (Java) – Agent guide

Universal entry point for contributors and AI agents. Detailed conventions live in skills/*/SKILL.md.

What this repo is

FieldDetail
Name:contentstack-utils-java — Maven com.contentstack.sdk:utils
Purpose:Library for rendering Rich Text Editor (RTE) content and embedded items from Contentstack entry JSON (REST/CDA-style with _embedded_items) and GraphQL-shaped responses. Consumed by the Contentstack Java Delivery SDK and apps that already hold entry JSON.
Out of scope (if any):No HTTP client in this package: no stack API calls, tokens, or includeEmbeddedItems() — those belong to the Delivery SDK or your app. Optional sample/ wires the SDK + Utils for manual testing only.

Tech stack (at a glance)

AreaDetails
LanguageJava 17maven-compiler-plugin<release>17</release> in root pom.xml (legacy 1.8 properties in pom.xml are not authoritative).
BuildMaven — root pom.xml; optional module sample/pom.xml.
TestsJUnit 4, Maven Surefire (src/test/java/com/contentstack/utils/**/*.java). Surefire testFailureIgnore is true — check target/surefire-reports/.
Lint / coverageNo Checkstyle/Spotless in repo — match existing style. JaCoCo (target/site/jacoco/ after mvn test).
OtherJSON: org.json, json-simple (provided). HTML: Jsoup. spring-web compile dependency — not a public REST client API for this module. Snyk on PRs (.github/workflows/sca-scan.yml).

Commands (quick reference)

Command typeCommand
Buildmvn clean compile
Testmvn clean test
Lint(none configured — rely on IDE and code review)
OptionalCommand / location
Single test classmvn test -Dtest=UtilTests
Javadocmvn javadoc:javadoc
Sample (after mvn install with skips if needed)mvn -f sample/pom.xml compile
CIJava 17 publish: .github/workflows/maven-publish.yml (GitHub Release for tag v*, draft releases skipped) · SCA: .github/workflows/sca-scan.yml · back-merge automation: .github/workflows/back-merge-pr.yml

Where the documentation lives: skills

SkillPathWhat it covers
Development workflowskills/dev-workflow/SKILL.mdBranches, CI, build/test commands, PR expectations, optional TDD.
Java (language & layout)skills/java/SKILL.mdJava 17, com.contentstack.utils packages, naming, JSON/Jsoup, dependencies.
Contentstack Utils APIskills/contentstack-utils-java/SKILL.mdPublic API: Utils, GQL, DefaultOption, JSON contracts, RTE/embedded boundaries.
Testingskills/testing/SKILL.mdJUnit 4, fixtures, Surefire/JaCoCo, offline tests vs sample/.
Code reviewskills/code-review/SKILL.mdPR checklist, optional Blocker/Major/Minor.
Framework (build & tooling)skills/framework/SKILL.mdMaven plugins, publishing, GPG, Central, sample/ dependency hygiene.

An index with when to use hints is in skills/README.md.

Using Cursor (optional)

If you use Cursor, .cursor/rules/README.md only points to AGENTS.md — same docs as everyone else.