CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl-labs/fastify-best-practices

Fastify patterns — always apply schema-first validation, plugin encapsulation, structured error handling, hooks lifecycle, decorators, TypeScript type providers, production hardening (CORS, helmet, rate limiting), pino logging, graceful shutdown, and correct async handler patterns

89

2.75x
Quality

89%

Does it follow best practices?

Impact

91%

2.75x

Average score across 5 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

Evaluation results

97%

63%

Auth Gateway Service

Criteria
Without context
With context

decorate-request-for-user

0%

100%

prehandler-hook-for-auth

100%

100%

typescript-module-augmentation

0%

100%

body-schemas-on-auth-routes

0%

100%

structured-error-responses

40%

100%

auth-plugin-with-fastify-plugin

100%

100%

request-log-usage

25%

62%

401-short-circuits-request

75%

100%

response-schemas

0%

100%

graceful-shutdown

0%

100%

82%

16%

Blog API

Criteria
Without context
With context

type-provider-configured

100%

100%

as-const-on-schemas

62%

100%

shared-schemas-with-ref

30%

30%

comprehensive-body-schemas

66%

91%

querystring-schemas-with-pagination

100%

100%

response-schemas-prevent-leaks

100%

90%

no-as-any-casting

100%

12%

plugins-with-correct-typing

100%

83%

custom-error-handler

0%

100%

not-found-errors

50%

100%

pino-logging

66%

83%

graceful-shutdown

0%

100%

85%

65%

File Metadata Service

Criteria
Without context
With context

strict-body-schemas

0%

75%

webhook-schema-strict

0%

100%

response-schemas

0%

100%

separate-plugins-for-files-and-webhooks

100%

100%

custom-error-handler

0%

100%

not-found-on-missing-resources

100%

100%

webhook-idempotency

0%

20%

webhook-event-logging

0%

50%

pino-logger-enabled

66%

100%

security-plugins

0%

100%

graceful-shutdown

0%

100%

querystring-schemas

0%

100%

93%

73%

Notification Microservice

Criteria
Without context
With context

cors-with-explicit-origins

0%

100%

helmet-for-security-headers

0%

100%

rate-limiting

0%

100%

pino-logger-configured

20%

100%

graceful-shutdown-with-signals

0%

100%

listen-host-0000

100%

100%

body-schemas-on-routes

20%

90%

response-schemas-defined

0%

100%

routes-in-plugins

100%

100%

custom-error-handler

0%

100%

onclose-cleanup

0%

0%

100%

75%

Restaurant Order API

Criteria
Without context
With context

body-schema-with-constraints

0%

100%

params-schema-defined

0%

100%

querystring-schema-defined

0%

100%

response-schemas-defined

0%

100%

routes-in-registered-plugin

100%

100%

custom-error-handler

0%

100%

not-found-throws-404

50%

100%

pino-logger-not-console

62%

100%

async-return-pattern

100%

100%

additional-properties-false

0%

100%

graceful-shutdown

0%

100%

Evaluated
Agent
Claude Code
Model
Claude Sonnet 4.6

Table of Contents