spring-boot--kotlinlisted
Install: claude install-skill lgzarturo/codeconductor
# Spring Boot + Kotlin
## Project Structure
Use feature-oriented MVC. One package per feature, not one package per layer.
```
src/main/kotlin/{base-package}/{feature}/
controller/ # HTTP layer only — no business logic
service/ # Business logic
repository/ # Data access — extends JpaRepository or CrudRepository
domain/ # JPA entities
dto/ # Request/response objects — no @Entity here
src/test/kotlin/{base-package}/{feature}/
controller/ # MockMvc tests
service/ # Unit tests with MockK
repository/ # @DataJpaTest tests
src/main/resources/
application.yml
application-prod.yml # NOT in repo — use env vars
db/migration/ # Flyway scripts
```
Never use `src/main/kotlin/controllers/`, `src/main/kotlin/services/`, etc. That
is layer-first structure and it does not scale.
## Kotlin Idioms for Spring
**Data classes for DTOs.** No setters, no mutable state.
```kotlin
data class CreateUserRequest(
@field:NotBlank val email: String,
@field:Size(min = 2, max = 100) val name: String
)
data class UserResponse(
val id: UUID,
val email: String,
val name: String
)
```
**Sealed classes for domain results and errors.**
```kotlin
sealed class UserResult {
data class Found(val user: User) : UserResult()
data class NotFound(val id: UUID) : UserResult()
data class Conflict(val email: String) : UserResult()
}
```
**Null safety.** Never use `!!` unless you have a