Code Room
Vibe codingMediumvc-g419
Subject Ai prompt specLevel Mid–Senior~16 minCommon in Reliability & on-call interviewsIndustries Software development, Technology

Question

You're adding a structured logging helper to a Node/TypeScript service so logs flow cleanly into Datadog. You want an AI agent to write a `createLogger(context)` wrapper around `pino` that emits JSON, attaches a request-scoped trace ID, and redacts known PII fields. Write the prompt/spec you'd hand the agent so the result is correct on the first try — including the constraints, edge cases, and acceptance criteria. Then explain what a lazy one-line prompt ("write me a logger") would get wrong here.

What a strong answer looks like

Treat the AI’s output as a draft to verify, not an answer to trust. Name the specific flaw and the input that triggers it, say how you’d catch it — tests, edge cases, reading critically — and how you’d re-prompt or decompose to get it right.

Describe your solution

Vibe coding: describe the solution in plain language (or narrate it) and the coach grades your approach. Generating runnable code from your description is coming next.

Run or narrate your approach, then ask the coach.