Microservice defaults
When to apply
Tasks in application/<group>/<service>/ unless user overrides in prompt.
Contracts: documentation/specifications/microservices/.... Patterns: reference.md. Open currencies-crud only if asked or new pattern.
Workflow (no re-exploration)
- Read reference.md — do not explore repo.
- Read target spec:
documentation/specifications/microservices/<group>/<service>/. - ADR from
documentation/ADR/index.mdif needed (topic only). - If service exists — read only
application/<group>/<service>/. - Implement per below + rule
microservice-implementation.mdc.
Requirements
- Stack: kotlin, spring-boot, kafka, postgres
- jOOQ: generated
com.vimpishsnorfle.jooq:*; no raw SQL; prefer DSL close to SQL, avoid imperative query assembly - REST: generated
com.vimpishsnorfle.rest:*DTO and*Api - Kafka: generated
com.vimpishsnorfle.messaging:* - Outbound REST: OpenFeign +
com.vimpishsnorfle.restDTO/interfaces - Logging (SLF4J/logback): log key decisions and outcomes; traceable what/why
- Tests: ≥70% line coverage (jacoco)
- DRY, SRP
Patterns
REST/Feign: controller implements *Api; Feign interface Client : V1*ControllerApi — no manual OpenAPI duplicates.
Kafka: Consumer<Message<Dto>> or generated consumer; producer uses messaging DTO.
Tests: jacoco 0.70 on check; database-test + Testcontainers — see reference.md.
Logging: LoggerFactory.getLogger(javaClass); info decisions/outcomes, debug inputs/steps, warn/error with entity ids + cause.
Deviations
If blocked (missing artifact, jOOQ table, etc.) and user did not allow — stop; state need: schema/migration/artifact or explicit prompt permission.