Every backend service MUST use structured logging — pino/structlog/slog, JSON format, request IDs, proper log levels. console.log is never acceptable.
88
85%
Does it follow best practices?
Impact
97%
3.03xAverage score across 4 eval scenarios
Passed
No known issues
{
"instruction": "Assign and propagate request IDs or job IDs through all log entries for traceability",
"relevant_when": "Agent creates or modifies an HTTP API server or background job processor",
"context": "Every HTTP service needs request ID middleware that assigns a unique ID per request (from x-request-id header or generated), propagates it to all log entries via child logger or context, and returns it in the response header. Background workers need job ID correlation. Without this, concurrent request/job logs are interleaved and impossible to trace.",
"sources": [
{
"type": "file",
"filename": "skills/structured-logging/SKILL.md",
"tile": "tessl-labs/structured-logging@0.2.0"
}
],
"checklist": [
{
"name": "request-id-assigned",
"rule": "Middleware assigns a unique request ID to each incoming HTTP request — reads from x-request-id header if present, otherwise generates a UUID or random value",
"relevant_when": "Agent creates an HTTP server or API with request handling"
},
{
"name": "request-id-in-response",
"rule": "The request ID is written back to the response via the x-request-id response header",
"relevant_when": "Agent creates request ID middleware"
},
{
"name": "request-id-in-logs",
"rule": "All log entries inside request handlers include the request_id field, achieved via child logger (pino), context variables (structlog), or context-stored logger (slog)",
"relevant_when": "Agent writes log statements in request handlers"
},
{
"name": "per-request-log-line",
"rule": "A middleware logs one structured line per completed request containing HTTP method, path, status code, and duration in milliseconds",
"relevant_when": "Agent creates HTTP middleware or request handling pipeline"
},
{
"name": "structured-fields-not-strings",
"rule": "Log calls pass data as separate key-value fields (e.g. logger.info({ order_id: id }, 'msg')) rather than string interpolation or concatenation",
"relevant_when": "Agent writes any log statement"
}
]
}