NestJS patterns -- modules, DI, exception filters, validation pipes, guards, interceptors, testing, config
98
89%
Does it follow best practices?
Impact
100%
1.36xAverage score across 12 eval scenarios
Passed
No known issues
{
"context": "Tests whether the agent correctly implements nested DTO validation using both @ValidateNested and @Type, configures the global ValidationPipe with the required options, and wraps all controller responses in a { data: ... } envelope.",
"type": "weighted_checklist",
"checklist": [
{
"name": "@ValidateNested present",
"description": "The nested items array field in the DTO has the @ValidateNested({ each: true }) decorator",
"max_score": 10
},
{
"name": "@Type present",
"description": "The nested items array field also has @Type(() => <ItemDto>) from class-transformer — not just @ValidateNested alone",
"max_score": 12
},
{
"name": "whitelist: true",
"description": "ValidationPipe is configured with whitelist: true",
"max_score": 8
},
{
"name": "transform: true",
"description": "ValidationPipe is configured with transform: true",
"max_score": 8
},
{
"name": "forbidNonWhitelisted: true",
"description": "ValidationPipe is configured with forbidNonWhitelisted: true",
"max_score": 8
},
{
"name": "Global pipe in main.ts",
"description": "ValidationPipe is registered globally via app.useGlobalPipes() in main.ts (not on individual controllers)",
"max_score": 8
},
{
"name": "POST response envelope",
"description": "The POST orders controller action returns { data: <result> } rather than returning the raw service result",
"max_score": 10
},
{
"name": "GET response envelope",
"description": "Any GET endpoint(s) in the orders controller also return { data: <result> }",
"max_score": 8
},
{
"name": "Feature module structure",
"description": "Orders code is in a dedicated feature module folder (e.g. src/orders/) with separate module, controller, service, and DTO files",
"max_score": 8
},
{
"name": "Constructor injection",
"description": "OrdersService receives its dependencies via constructor parameters, not instantiated with new inside the class",
"max_score": 10
},
{
"name": "@Injectable on service",
"description": "OrdersService is decorated with @Injectable()",
"max_score": 10
}
]
}evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
skills
nestjs-best-practices
verifiers