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

criteria.jsonevals/scenario-1/

{
  "context": "Tests whether the agent properly separates HTTP concerns to the controller and business logic to the service, uses constructor injection exclusively (no new), marks all services with @Injectable(), and avoids injecting HTTP objects into services.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "No new in service",
      "description": "NotificationsService does NOT instantiate SmsService or EmailService using new — no occurrence of `new SmsService` or `new EmailService` inside the service class",
      "max_score": 12
    },
    {
      "name": "Constructor injection in service",
      "description": "NotificationsService receives SmsService and EmailService via constructor parameters",
      "max_score": 10
    },
    {
      "name": "@Injectable on NotificationsService",
      "description": "NotificationsService has the @Injectable() decorator",
      "max_score": 8
    },
    {
      "name": "@Injectable on SmsService",
      "description": "SmsService has the @Injectable() decorator",
      "max_score": 8
    },
    {
      "name": "@Injectable on EmailService",
      "description": "EmailService has the @Injectable() decorator",
      "max_score": 8
    },
    {
      "name": "Controller delegates to service",
      "description": "The controller methods contain no business logic — they call the service and return the result",
      "max_score": 10
    },
    {
      "name": "No Request/Response in service",
      "description": "NotificationsService does NOT import or use Request, Response, or any HTTP-layer objects from @nestjs/common or express",
      "max_score": 12
    },
    {
      "name": "Providers registered in module",
      "description": "NotificationsModule's providers array includes NotificationsService, SmsService, and EmailService (or equivalent)",
      "max_score": 10
    },
    {
      "name": "Response envelope",
      "description": "Controller action(s) wrap their return values in { data: ... }",
      "max_score": 10
    },
    {
      "name": "No new in controller",
      "description": "NotificationsController does NOT instantiate any service using new",
      "max_score": 12
    }
  ]
}

evals

scenario-1

criteria.json

task.md

tile.json