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 fintech startup runs a Fastify REST API that handles payments, account lookups, and user authentication. During a recent compliance audit, the security team found two serious issues in the production logging setup.
First, raw sensitive fields are appearing in log output. The audit team pulled log samples and found entries containing plaintext passwords submitted in login requests, API keys in query parameters, and raw Authorization header values. This is a data protection violation and needs to be fixed before the next regulatory review.
Second, the logging style is inconsistent. Some developers log strings with variable interpolation ("User " + userId + " logged in"), others use template literals, and a few use console.log directly. This makes the logs impossible to search or aggregate in the company's log management tool, which expects structured JSON records with discrete fields.
You have been asked to build a clean Fastify application skeleton that demonstrates how logging should be set up across the codebase. The setup must redact sensitive information automatically at the logger level, enforce structured log output, make the log verbosity configurable for each environment without code changes, and use request-scoped loggers in route handlers so that every log line is correlated with its request. The application should also show how library/service code outside the request lifecycle should create its own logger with identifying context.
Produce the following files:
package.json — with type: "module" and scripts to install dependencies and run the appsrc/app.ts — Fastify application factory. This file must contain the logger configuration, including redaction rules. Export a buildApp function that accepts no arguments and returns the configured Fastify instancesrc/plugins/user-service.ts — a simple service module (not a Fastify plugin) that provides two functions: createUser(email, name) and getUser(id). These functions do not need a real database — use in-memory Maps. The service must use its own logger with identifying context that is created from the application loggersrc/routes/users.ts — a Fastify route plugin containing at minimum POST /users (creates a user) and GET /users/:id (retrieves a user). Route handlers must log meaningful events using the request-scoped logger, not with global or module-level loggerslogging-notes.md — a brief document (bullet list is fine) describing: what categories of data are being redacted from logs, how to change the log verbosity in a deployment, and why string interpolation in log calls is avoidedThe application does not need to connect to a real database or external service. Focus entirely on the logging configuration and patterns.
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