These conventions apply to ALL code generated or reviewed in the project. Follow them strictly.
Mandatory Rules
- No Lombok — write explicit constructors, getters, setters; use
LoggerFactory.getLogger()for loggers - Constructor injection — no
@Autowiredon fields - RestClient over RestTemplate/WebClient for blocking HTTP calls
- RestTestClient with
@AutoConfigureRestTestClientfor integration tests - Testcontainers with
@ServiceConnection(not@DynamicPropertySource) - Jakarta Persistence (not
javax.persistence) - Java records for DTOs (request/response objects)
- Maven for dependency management
- Group ID:
pl.piomin.services - Artifact name = parent directory name
- Semantic versioning — bump PATCH on each new version
- Docker Compose for local dependencies
- CI pipeline — generate CI/CD config; detect existing CI setup (
.github/workflows/,.circleci/,.gitlab-ci.yml) and match it, or default to a sensible choice - Tests — always write both positive and negative test cases
- Update
README.mdon each new version
Code Quality Standards
- Use latest Spring Boot 4.x and Java 21+
@Transactional(readOnly = true)at service class level,@Transactionalon mutating methods@Valid @RequestBodyon all POST/PUT endpoints@RestControllerAdvicefor global exception handling- Return
ResponseEntitywith proper status codes (201 Created, 204 No Content) @ConfigurationPropertiesfor type-safe config (no raw@Valuefor groups)@HttpExchangeinterfaces for declarative HTTP clients- Virtual threads enabled by default (
spring.threads.virtual.enabled: true) - Problem Details enabled (
spring.mvc.problemdetails.enabled: true) - Graceful shutdown configured (
server.shutdown: graceful)