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.
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.
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.