CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl-labs/nestjs-best-practices

NestJS patterns -- modules, DI, exception filters, validation pipes, guards, interceptors, testing, config

98

1.36x
Quality

89%

Does it follow best practices?

Impact

100%

1.36x

Average score across 12 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

exception-handling.jsonverifiers/

{
  "instruction": "Use a global catch-all exception filter that returns a consistent { error: { code, message } } envelope",
  "relevant_when": "Agent implements error handling in a NestJS application",
  "context": "NestJS exception filters catch errors and format responses. The filter must use @Catch() with no arguments to catch ALL exception types. For HttpException, return { error: { code: exception.name, message: exception.message } }. For unknown errors, log with console.error before returning 500 with { error: { code: 'INTERNAL_ERROR', message: 'An unexpected error occurred' } }.",
  "sources": [
    {
      "type": "file",
      "filename": "skills/nestjs-best-practices/SKILL.md",
      "tile": "tessl-labs/nestjs-best-practices@0.2.0"
    }
  ],
  "checklist": [
    {
      "name": "catch-all-decorator",
      "rule": "Agent uses @Catch() with NO arguments on the exception filter class so it catches all exception types",
      "relevant_when": "Agent creates a NestJS exception filter"
    },
    {
      "name": "error-envelope-shape",
      "rule": "Agent returns JSON in the shape { error: { code: string, message: string } } for BOTH HttpException and unknown errors",
      "relevant_when": "Agent implements error response formatting in a NestJS exception filter"
    },
    {
      "name": "unknown-error-logging",
      "rule": "Agent calls console.error to log non-HttpException errors before returning a 500 response",
      "relevant_when": "Agent handles unknown/unexpected errors in a NestJS exception filter"
    },
    {
      "name": "global-filter-registration",
      "rule": "Agent registers the exception filter globally in main.ts using app.useGlobalFilters()",
      "relevant_when": "Agent sets up error handling in a NestJS application"
    }
  ]
}

tile.json