Spring Boot project structure — package-by-feature, record DTOs, Flyway migrations, multi-profile config, actuator, proper test structure
84
76%
Does it follow best practices?
Impact
97%
4.04xAverage score across 5 eval scenarios
Passed
No known issues
{
"context": "Tests whether the agent proactively applies Spring Boot project structure best practices when building a multi-domain inventory service with three distinct domain concepts (Product, Warehouse, Inventory). The task does not mention how to organize code — criteria check for package-by-feature organization, record DTOs, Flyway migrations, proper configuration, test structure, and exception handling.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Package-by-feature layout",
"description": "Code is organized by feature/domain (product/, warehouse/, inventory/) rather than by layer. Each feature package contains its own controller, service, repository, and DTOs together. With three distinct domains, package-by-feature organization is clearly superior to package-by-layer.",
"max_score": 15
},
{
"name": "Record DTOs separate from entities",
"description": "Request and response DTOs are Java records. JPA entities are not returned directly from controllers. For example, ProductResponse is a record separate from the Product entity.",
"max_score": 12
},
{
"name": "Configuration classes in config package",
"description": "A dedicated config/ package contains @Configuration classes. They are not inside feature packages or the root package.",
"max_score": 8
},
{
"name": "Multi-profile application.yml",
"description": "application.yml with profile-specific files (at least dev and prod or test). Database URL uses environment variable placeholders for production. Dev profile may use H2 or embedded DB.",
"max_score": 10
},
{
"name": "Flyway or Liquibase migrations",
"description": "Database schema uses Flyway migration files (V1__*.sql) or Liquibase changelogs. Three tables (products, warehouses, inventory_records) are created via migrations, not schema.sql or ddl-auto.",
"max_score": 12
},
{
"name": "Global exception handler",
"description": "A @RestControllerAdvice handles exceptions globally with consistent error response format. Covers at least: not-found (404), validation (400), business rule violations (409 or 422), and unexpected errors (500 with no stack trace).",
"max_score": 10
},
{
"name": "Test directory mirrors main",
"description": "Test classes mirror the main source package structure. Tests exist in feature-aligned packages.",
"max_score": 8
},
{
"name": "Slice tests used",
"description": "Tests use @WebMvcTest for controllers or @DataJpaTest for repositories instead of @SpringBootTest for everything.",
"max_score": 7
},
{
"name": "Entity-DTO mapping",
"description": "Mapper interfaces or methods exist for entity-to-DTO conversion, not inline conversion in controllers.",
"max_score": 5
},
{
"name": "OSIV disabled and graceful shutdown",
"description": "spring.jpa.open-in-view is false. server.shutdown is graceful.",
"max_score": 5
},
{
"name": "Actuator configured",
"description": "spring-boot-starter-actuator dependency included and endpoints configured.",
"max_score": 3
},
{
"name": "Endpoints functional",
"description": "All eight endpoints are implemented with correct HTTP methods and status codes.",
"max_score": 5
}
]
}evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
skills
springboot-project-structure
verifiers