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
89%
Does it follow best practices?
Impact
91%
2.75xAverage score across 5 eval scenarios
Passed
No known issues
Build a Fastify API for a blogging platform. The API manages blog posts and comments.
A blog post has: id (string), title (string, 1-200 chars), content (string), authorId (string), tags (array of strings), published (boolean), and createdAt/updatedAt (ISO date strings).
A comment has: id (string), postId (string), authorName (string), content (string, 1-1000 chars), and createdAt.
POST /api/posts -- Create a blog post.GET /api/posts -- List posts. Accepts optional query params: published (boolean), tag (string), page (integer), limit (integer, max 50).GET /api/posts/:id -- Get a single post with its comments.PUT /api/posts/:id -- Update a post.DELETE /api/posts/:id -- Delete a post and its comments.POST /api/posts/:postId/comments -- Add a comment to a post.GET /api/posts/:postId/comments -- List comments for a post.Use in-memory arrays for storage.
Produce TypeScript files in a src/ directory:
src/app.ts -- Fastify app setup with TypeScript type providersrc/plugins/posts.ts -- Post routessrc/plugins/comments.ts -- Comment routessrc/services/postService.ts -- Post business logicsrc/services/commentService.ts -- Comment business logicsrc/schemas/post.ts -- Shared post schemassrc/schemas/comment.ts -- Shared comment schemassrc/server.ts -- Server startupDo not include test files or build configuration.
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
skills
fastify-best-practices
verifiers