/mattpocock-skills:observabilityfrom mattpocock-skills
Design and implement structured logging, OpenTelemetry spans, correlation IDs, and operational metrics at seams and I/O boundaries. Use when adding telemetry, instrumenting HTTP endpoints, queues, or handlers, creating typed error taxonomies, or improving system observability.
Ships in mattpocock-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Discipline for production telemetry, structured logging, and distributed tracing at system boundaries.
When an application fails in production (such as intermittent timeouts, memory leaks, or third-party API rejections), bugs cannot be reproduced locally without runtime operational data. Relying on unstructured console.error calls produces unsearchable log dumps that lack request context, entity identifiers, and execution duration.
observability integrates telemetry into codebase-design and /implement.
Telemetry belongs at the edges and seams of your system, never scattered through pure domain functions:
Every log entry and trace span must be emitted as structured data (JSON or OpenTelemetry attributes) containing:
correlationId / requestId: Propagated across network calls to trace a request throughout its lifecycle.tenantId and userId: Mandatory for multi-tenant systems to isolate incidents to specific customer organizations.entityId and action: The domain object being operated on (for example: orderId: "ord_123", action: "process_payment").durationMs: Measured execution duration for all I/O calls to track latency regressions.Generic error handling is forbidden:
catch (e) { console.error(e); } without contextual attributes is prohibited.INVALID_PAYMENT_METHOD, INSUFFICIENT_FUNDS, UPSTREAM_GATEWAY_TIMEOUT, RECORD_NOT_FOUND).new OrderProcessingError("Payment failed", { cause: err })) so stack traces remain intact.At every critical seam, provide measurements for the four golden signals:
export class PostgresOrderStore implements OrderStore {
constructor(
private readonly pool: DbPool,
private readonly logger: Logger,
private readonly tracer: Tracer
) {}
async save(order: Order, ctx: RequestContext): Promise<void> {
const span = this.tracer.startSpan("PostgresOrderStore.save", {
attributes: {
"order.id": order.id,
"tenant.id": ctx.tenantId,
"correlation.id": ctx.correlationId,
},
});
const startTime = Date.now();
try {
await this.pool.query(
"INSERT INTO orders (id, tenant_id, total_amount) VALUES ($1, $2, $3)",
[order.id, ctx.tenantId, order.totalAmount]
);
this.logger.info("Order saved successfully", {
orderId: order.id,
tenantId: ctx.tenantId,
correlationId: ctx.correlationId,
durationMs: Date.now() - startTime,
});
} catch (err) {
this.logger.error("Failed to save order to database", {
orderId: order.id,
tenantId: ctx.tenantId,
correlationId: ctx.correlationId,
durationMs: Date.now() - startTime,
errorCode: "DATABASE_WRITE_FAILURE",
error: err instanceof Error ? err.message : String(err),
});
span.recordException(err as Error);
throw new DatabaseStoreError("Database persistence failed", { cause: err });
} finally {
span.end();
}
}
}
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
50 skills in this plugin
/ask-mattAsk which skill or flow fits your situation. A router over the skills in this repo./brownfield-onboardSurvey an existing brownfield codebase, detect conflicting domain terminology, and bootstrap GLOSSARY.md and foundational ADRs./chief-of-staffPursue a long-running goal in a single session by co-ordinating subagents./claude-handoffHand the current conversation off to a fresh background agent that picks up the work immediately.npx claudepluginhub op3616windows/superskills --plugin mattpocock-skills