CLAUDE.md
CLAUDE.mdCLAUDE.mdroot
Quality
99/100
Scores the file, not the repository.Length
839 words
23 headings · 4 code blocksRepository
950
— · pushed 1 days agoLast changed
3 days ago
First indexed 3 days ago.1# CLAUDE.md23This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.45## Project Structure67```8core/9├── dotCMS/ # Main backend Java code10│ └── src/main/java/com/11│ ├── dotcms/ # Modern domain-driven packages (prefer these)12│ └── dotmarketing/ # Legacy packages (15+ yr old code, still active)13├── core-web/ # Frontend (Angular/Nx monorepo) → see core-web/CLAUDE.md14├── dotcms-integration/ # Integration tests15├── dotcms-postman/ # Postman API tests16├── bom/application/pom.xml # Dependency versions (ONLY place for versions)17├── parent/pom.xml # Plugin management18└── .github/workflows/ # CI/CD pipelines19```2021## Environment Prerequisites2223```bash24sdk env install # Java 25 via SDKMAN (.sdkmanrc) — build fails with wrong version25nvm use # Node 22.15+ via nvm (.nvmrc) — frontend build fails with wrong version26```2728## Build & Test Commands2930```bash31# Build (choose based on scope)32./mvnw install -pl :dotcms-core --am -DskipTests # Core + in-project deps (~2-3 min) ✅33./mvnw install -pl :dotcms-core -DskipTests # ⚠️ Can fail: missing in-project deps34./mvnw clean install -DskipTests # Full rebuild (~8-15 min)35./mvnw clean install -DskipTests -Ddocker.skip # Full rebuild, skip Docker image3637# Test (⚠️ NEVER run full integration suite — 60+ min)38./mvnw verify -pl :dotcms-integration -Dcoreit.test.skip=false -Dit.test=MyTestClass # Specific class39./mvnw verify -pl :dotcms-integration -Dcoreit.test.skip=false -Dit.test=MyTest#testMethod # Specific method40./mvnw verify -pl :dotcms-postman -Dpostman.test.skip=false -Dpostman.collections=all # Postman4142# IDE Testing (fastest iteration)43just test-integration-ide # Start PostgreSQL + Elasticsearch + dotCMS44just test-integration-stop # Stop services when done4546# Run47just dev-run # Start dotCMS in Docker with Glowroot48cd core-web && yarn nx serve dotcms-ui # Frontend dev server only (use yarn nx, not nx)49```5051> All test modules need explicit `skip=false` flags or tests are silently skipped.5253## Essential Java Patterns5455```java56import com.dotmarketing.util.Config; // Config.getStringProperty("key", "default")57import com.dotmarketing.util.Logger; // Logger.info(this, "message")58import com.dotmarketing.util.UtilMethods; // UtilMethods.isSet(value)59UserAPI userAPI = APILocator.getUserAPI(); // Service access pattern60```6162> **Batch permission filtering**: prefer `permissionAPI.filterCollection(Collection<P>, int, User, boolean)` over per-item `doesUserHavePermission` loops — one SQL round-trip vs N. See [Java Standards → Permission Checks](docs/backend/JAVA_STANDARDS.md#permission-checks--batch-vs-scalar).6364## Critical Rules6566- **Config/Logger only**: Never `System.out`, `System.getProperty`, or `System.getenv`67- **Maven versions**: Add to `bom/application/pom.xml` ONLY, never `dotCMS/pom.xml`68- **Java version**: Core modules compile to Java 25 by default (`dotcms.core.compiler.release`; override e.g. `-Ddotcms.core.compiler.release=11` for older bytecode). Java 25 runtime. CLI may target lower for portability.69- **Security**: No hardcoded secrets, validate all input, never log sensitive data70- **REST @Schema**: Must match actual return type — see [REST API Guide](dotCMS/src/main/java/com/dotcms/rest/CLAUDE.md)71- **Frontend**: See [core-web/CLAUDE.md](core-web/CLAUDE.md) for Angular/TypeScript standards7273### OpenAPI / Swagger7475`openapi.yaml` is **auto-generated** by `swagger-maven-plugin` at compile phase — it writes directly to `src/main/webapp/WEB-INF/openapi/openapi.yaml`. The CI verifies the committed file matches what the build produces.7677- All description changes must go in Java `@Operation` / `@Parameter` annotations, not in the yaml directly78- Regenerate after annotation changes: `./mvnw compile -pl :dotcms-core -DskipTests` (no Docker needed)79- Commit the regenerated yaml alongside the Java changes8081### Progressive Enhancement8283When editing ANY code, improve incrementally:84- Add missing generics: `List<String>` not `List`85- Replace legacy: `Logger.info()` not `System.out.println()`86- Modern Angular: `@if` not `*ngIf`, `input()` not `@Input()`87- Add missing annotations: `@Override`, `@Nullable`8889## Tech Stack9091- **Backend**: Java 25 (runtime + core compile target, override-able), Maven, Spring/CDI92- **Frontend**: Angular 21+, Nx, PrimeNG, Tailwind CSS, Jest/Spectator — [core-web/CLAUDE.md](core-web/CLAUDE.md)93- **Infrastructure**: Docker, PostgreSQL, Elasticsearch, GitHub Actions9495## Documentation (Load On-Demand)9697### Core Architecture & Workflows98- [Architecture Overview](docs/core/ARCHITECTURE_OVERVIEW.md) — System design, modules, patterns99- [Git Workflows](docs/core/GIT_WORKFLOWS.md) — Branch naming, PR process, conventional commits100- [CI/CD Pipeline](docs/core/CICD_PIPELINE.md) — Build process, testing, deployment101- [Security Principles](docs/core/SECURITY_PRINCIPLES.md) — Input validation, secrets, logging102- [GitHub Issue Management](docs/core/GITHUB_ISSUE_MANAGEMENT.md) — Issues, PRs, epics103- [Rollback-Unsafe Change Categories](docs/core/ROLLBACK_UNSAFE_CATEGORIES.md) — DB schema, ES mapping, API contract risks104105### Backend Development (Java/Maven)106- [Java Standards](docs/backend/JAVA_STANDARDS.md) — Coding patterns, immutables, exceptions, utilities107- [REST API Patterns](docs/backend/REST_API_PATTERNS.md) — JAX-RS, Swagger, @Schema rules108- [Maven Build System](docs/backend/MAVEN_BUILD_SYSTEM.md) — Dependency management109- [Configuration Patterns](docs/backend/CONFIGURATION_PATTERNS.md) — Config.getProperty() usage110- [Database Patterns](docs/backend/DATABASE_PATTERNS.md) — DotConnect, transactions111- [Health Monitoring](docs/backend/HEALTH_MONITORING.md) — Health endpoints, log levels112113### Frontend Development (Angular/TypeScript)114- [Angular Standards](docs/frontend/ANGULAR_STANDARDS.md) — Modern syntax, signals, components115- [Testing Frontend](docs/frontend/TESTING_FRONTEND.md) — Spectator patterns, Jest config116- [Component Architecture](docs/frontend/COMPONENT_ARCHITECTURE.md) — Structure, organization117- [Styling Standards](docs/frontend/STYLING_STANDARDS.md) — SCSS, BEM, Tailwind118119### Testing120- [Backend Unit Tests](docs/testing/BACKEND_UNIT_TESTS.md) — JUnit, integration patterns121- [Integration Tests](docs/testing/INTEGRATION_TESTS.md) — API testing, database setup122- [E2E Tests](docs/testing/E2E_TESTS.md) — Playwright, user workflows123124### Infrastructure125- [Docker Build Process](docs/infrastructure/DOCKER_BUILD_PROCESS.md) — Container setup, optimization126127## Context Management128129### For Claude130- Use this guide for always-available context131- Load `/docs/` files on-demand with Read tool132- Use `/clear` between different work contexts133134### For Cursor135- Project rules: `.cursor/rules/` (`.mdc` files with globs); see `.cursor/rules/README.md`136- Use `@docs/path/file.md` syntax for detailed patterns137- Domain-specific rules load by file pattern (Java, Angular, tests, docs)138139## Documentation Maintenance140141- **CLAUDE.md**: Navigation hub + essential quick-reference only142- **`/docs/`**: Full patterns by domain — single source of truth143- **`.cursor/rules/`**: Short reminders with globs, link to `/docs/`144- When patterns are missing: update the relevant `/docs/{domain}/` file, not this file145
Also in dotCMS/core
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| dotCMS/core.cursor/rules/doc-updates.mdc · 950 | Cursor rules | docs | 30/100 | 3 days ago | |
| dotCMS/core.cursor/rules/dotcms-guide.mdc · 950 | Cursor rules | archdo-notdocs | 69/100 | 3 days ago | |
| dotCMS/core.cursor/rules/e2e-rules.mdc · 950 | Cursor rules | setupteststylearch+5 | 89/100 | 3 days ago | |
| dotCMS/core.cursor/rules/frontend-context.mdc · 950 | Cursor rules | teststyledocs | 78/100 | 3 days ago | |
| dotCMS/core.cursor/rules/java-context.mdc · 950 | Cursor rules | buildstyle | 44/100 | 3 days ago | |
| dotCMS/core.cursor/rules/test-context.mdc · 950 | Cursor rules | testtesting-strategy | 54/100 | 3 days ago | |
| dotCMS/core.github/copilot-instructions.md · 950 | Copilot instructions | setupbuildtestlint-format+11 | 84/100 | 3 days ago | |
| dotCMS/core.github/instructions/frontend.instructions.md · 950 | Copilot instructions | testlint-formatstylearch+3 | 69/100 | 3 days ago | |
| dotCMS/corecore-web/AGENTS.md · 950 | AGENTS.md | style | 63/100 | 3 days ago | |
| dotCMS/corecore-web/CLAUDE.md · 950 | CLAUDE.md | teststylearchtesting-strategy+3 | 100/100 | 3 days ago | |
| dotCMS/corecore-web/apps/dotcms-ui-e2e/AGENTS.md · 950 | AGENTS.md | setupstylearchtesting-strategy+2 | 78/100 | 3 days ago | |
| dotCMS/corecore-web/apps/dotcms-ui/AGENTS.md · 950 | AGENTS.md | buildteststyledependencies+3 | 94/100 | 3 days ago | |
| dotCMS/corecore-web/apps/mcp-server/CLAUDE.md · 950 | CLAUDE.md | setupbuildtestlint-format+5 | 89/100 | 3 days ago | |
| dotCMS/corecore-web/libs/block-editor/CLAUDE.md · 950 | CLAUDE.md | archdo-not | 69/100 | 3 days ago | |
| dotCMS/corecore-web/libs/new-block-editor/CLAUDE.md · 950 | CLAUDE.md | lint-formatstyledo-notagent-behaviour | 61/100 | 3 days ago | |
| dotCMS/corecore-web/libs/portlets/CLAUDE.md · 950 | CLAUDE.md | setupteststyleui+1 | 77/100 | 3 days ago | |
| dotCMS/corecore-web/libs/portlets/edit-ema/portlet/src/lib/store/CLAUDE.md · 950 | CLAUDE.md | teststylearchtypes+2 | 65/100 | 3 days ago | |
| dotCMS/corecore-web/libs/sdk/client/CLAUDE.md · 950 | CLAUDE.md | setupbuildtestlint-format+9 | 97/100 | 3 days ago | |
| dotCMS/corecore-web/libs/sdk/react/CLAUDE.md · 950 | CLAUDE.md | setupbuildtestlint-format+9 | 97/100 | 3 days ago | |
| dotCMS/coredotCMS/src/main/java/com/dotcms/rest/CLAUDE.md · 950 | CLAUDE.md | typesdatabaseapido-not+1 | 57/100 | 3 days ago |
Diff against .cursor/rules/doc-updates.mdc Diff against .cursor/rules/dotcms-guide.mdc Diff against .cursor/rules/e2e-rules.mdc Diff against .cursor/rules/frontend-context.mdc Diff against .cursor/rules/java-context.mdc Diff against .cursor/rules/test-context.mdc Diff against .github/copilot-instructions.md Diff against .github/instructions/frontend.instructions.md Diff against core-web/AGENTS.md Diff against core-web/CLAUDE.md Diff against core-web/apps/dotcms-ui-e2e/AGENTS.md Diff against core-web/apps/dotcms-ui/AGENTS.md Diff against core-web/apps/mcp-server/CLAUDE.md Diff against core-web/libs/block-editor/CLAUDE.md Diff against core-web/libs/new-block-editor/CLAUDE.md Diff against core-web/libs/portlets/CLAUDE.md Diff against core-web/libs/portlets/edit-ema/portlet/src/lib/store/CLAUDE.md Diff against core-web/libs/sdk/client/CLAUDE.md Diff against core-web/libs/sdk/react/CLAUDE.md Diff against dotCMS/src/main/java/com/dotcms/rest/CLAUDE.md
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| filamentphp/filamentCLAUDE.md · 32k | CLAUDE.md | buildtestlint-formatstyle+7 | 100/100 | 3 days ago | |
| dotCMS/corecore-web/CLAUDE.md · 950 | CLAUDE.md | teststylearchtesting-strategy+3 | 100/100 | 3 days ago | |
| microsoft/playwrightCLAUDE.md · 94k | CLAUDE.md | buildtestlint-formatstyle+7 | 100/100 | 3 days ago | |
| nimbalyst/nimbalystpackages/android/CLAUDE.md · 1.4k | CLAUDE.md | setupbuildstylearch+2 | 100/100 | 3 days ago | |
| Adit-Jain-srm/NightmareNetCLAUDE.md · 45 | CLAUDE.md | buildtestlint-formatstyle+6 | 100/100 | 3 days ago | |
| bagisto/bagistoCLAUDE.md · 28k | CLAUDE.md | setupbuildteststyle+5 | 100/100 | 3 days ago | |
| dotCMS/corecore-web/libs/sdk/react/CLAUDE.md · 950 | CLAUDE.md | setupbuildtestlint-format+9 | 97/100 | 3 days ago | |
| skillrecordings/egghead-nextCLAUDE.md · 1.4k | CLAUDE.md | setupbuildtestlint-format+8 | 97/100 | 3 days ago |
