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 implements a catch-all exception filter that returns a consistent { error: { code, message } } envelope for all error types, logs unknown errors with console.error, and registers the filter globally.",
"type": "weighted_checklist",
"checklist": [
{
"name": "@Catch() no args",
"description": "The exception filter class uses @Catch() with NO arguments (not @Catch(HttpException) or any specific type)",
"max_score": 10
},
{
"name": "HttpException error shape",
"description": "For HttpException errors, the response body is exactly { error: { code: ..., message: ... } } — not { statusCode, message } or any other shape",
"max_score": 12
},
{
"name": "Unknown error shape",
"description": "For non-HttpException errors, the response body is also { error: { code: ..., message: ... } } (e.g. code: 'INTERNAL_ERROR')",
"max_score": 12
},
{
"name": "console.error for unknown",
"description": "The catch-all branch calls console.error (with the exception as an argument) before sending the 500 response — not console.log or console.warn",
"max_score": 10
},
{
"name": "Global filter in main.ts",
"description": "app.useGlobalFilters(new AllExceptionsFilter()) is called in main.ts (not on individual controllers or modules)",
"max_score": 10
},
{
"name": "Implements ExceptionFilter",
"description": "The filter class implements the ExceptionFilter interface from @nestjs/common",
"max_score": 8
},
{
"name": "HttpException status code",
"description": "For HttpException errors, the HTTP status code sent in the response matches the exception's status (not hardcoded as 500 for all errors)",
"max_score": 10
},
{
"name": "500 for unknown",
"description": "For non-HttpException errors, the HTTP response status is 500",
"max_score": 8
},
{
"name": "Filter file location",
"description": "The exception filter is placed in common/filters/ (not inline in main.ts or directly in a feature folder)",
"max_score": 8
},
{
"name": "ValidationPipe global",
"description": "main.ts also registers a global ValidationPipe (whitelist and/or transform options present)",
"max_score": 12
}
]
}evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
skills
nestjs-best-practices
verifiers