Auto-generated tile from GitHub (10 skills)
92
94%
Does it follow best practices?
Impact
92%
1.16xAverage score across 44 eval scenarios
Advisory
Suggest reviewing before use
A small e-commerce startup needs a product catalog REST API. The frontend team works in TypeScript and wants the API to be type-safe end-to-end. The backend lead has noted that a previous prototype built with Express had two recurring issues: validation errors showed up at runtime with confusing messages because the schema and the TypeScript types drifted apart, and response payloads were leaking internal fields (like cost_price and supplier_id) to the public API.
You have been asked to build the catalog API in Fastify. The API must validate both incoming requests and outgoing responses using a single schema definition that also provides TypeScript types — so there is no possibility of the schema and the types drifting apart. Responses must be serialized using the fastest available method and must automatically strip any internal fields that are not part of the declared response schema.
The product resource has:
id (string UUID)name (string, 1–200 chars)description (string, optional)price (number, must be ≥ 0)stock (integer, must be ≥ 0)category (one of: "electronics", "clothing", "food", "books", "other")createdAt (ISO date-time string)Internal-only fields that must NOT appear in any API response: cost_price, supplier_id, internal_notes.
Produce:
package.jsonsrc/routes/products.ts — route plugin with at minimum: GET / (list all products), POST / (create a product), GET /:id (get one product)src/schemas/product.ts — TypeBox schema definitionssrc/app.ts — Fastify application factory that wires up the routesdemo.ts or test.ts script that starts the app, makes a request to POST / with a product that includes the internal fields, and logs whether cost_price and supplier_id appear in the response (they should not)In-memory storage is fine (a plain array or Map). The goal is the schema and serialization setup, not persistence.
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10
scenario-11
scenario-12
scenario-13
scenario-14
scenario-15
scenario-16
scenario-17
scenario-18
scenario-19
scenario-20
scenario-21
scenario-22
scenario-23
scenario-24
scenario-25
scenario-26
scenario-27
scenario-28
scenario-29
scenario-30
scenario-31
scenario-32
scenario-33
scenario-34
scenario-35
scenario-36
scenario-37
scenario-38
scenario-39
scenario-40
scenario-41
scenario-42
scenario-43
scenario-44
skills
documentation
fastify
init
linting-neostandard-eslint9
node
nodejs-core
rules
oauth
octocat
snipgrapher