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
An e-commerce platform's product detail pages fetch live inventory and pricing from an upstream catalog API managed by a third-party logistics partner. The API is slow (average 300 ms per call) and rate-limited to 50 concurrent connections. During a recent flash sale, every page view triggered a fresh upstream call, resulting in thousands of simultaneous requests, a cascade of rate-limit errors, and a two-hour outage.
The backend team has been asked to build a TypeScript caching module that sits between the platform's product service and the upstream catalog API. The module must deduplicate concurrent requests for the same product (if ten users request product abc-123 at the same time, only one upstream call should go out), cache results with a configurable TTL, and enforce a hard cap on simultaneous upstream connections so the rate limit cannot be breached again.
The module should load its configuration (cache TTL, max concurrent connections, upstream base URL) from environment variables and fail fast with a clear error message if required variables are missing or invalid.
Write the module in TypeScript and run it directly under Node.js 22+ without a separate compilation step.
Deliver the following files:
src/catalog-cache.ts — the caching module (or split across multiple files if you prefer)src/config.ts — environment configuration loading and validationsrc/demo.ts — a short runnable script that demonstrates the module working: simulate several concurrent fetches for the same product and show that only one upstream call is made; then simulate a batch fetch across many products with the concurrency cap enforcedpackage.json — with a start script that runs src/demo.ts using nodeREADME.md — documents the environment variables and how to run the demoThe demo does not need a real upstream API; use a simulated fetch function with an artificial delay (e.g., setTimeout) that logs when it is called so the deduplication and concurrency limiting are observable in the output.
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