stark-logging

Reviews and writes structured application logs with correct levels, fields, and correlation.

Updated Mar 16, 2026
One-click install
npx skills add https://github.com/21StarkCom/stark-skills --skill stark-logging-21starkcom
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: stark-logging
Source: https://github.com/21StarkCom/stark-skills/tree/main/runtime-overrides/codex/skill/stark-logging
Command: npx skills add https://github.com/21StarkCom/stark-skills --skill stark-logging-21starkcom

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Most application logs are interpolated print statements that cannot be grepped, aggregated, or correlated, fire at arbitrary levels, duplicate errors up the stack, and occasionally leak secrets. This Skill provides concrete rules and a review checklist for writing structured, machine-queryable log events. ## Core Features & Use Cases - Structured logging rules: Enforces constant messages with typed fields, single-emission error handling, context binding via With, and canonical completion events. - Level selection framework: Maps DEBUG through FATAL to audience and required action rather than severity intuition, with heuristics for ERROR vs WARN disputes. - Review checklist: Applies references/review-checklist.md to reject diff lines with interpolated messages, missing correlation ids, secret leakage, or per-item loop spam. - Use Case: When reviewing a Go service diff that adds logging, use this Skill to catch fmt.Sprintf in messages, log-and-return duplication, and tokens passed to the logger before merge. ## Quick Start Ask the assistant to review the logging in a specific file or package, for example by requesting a logging review of the connector sync package.

Frequently Asked Questions about stark-logging

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write structured logs instead of printf-style messages?▼

Use a constant message string with data passed as typed fields, such as log.Error("connector sync failed", "connector", name, "error", err). Interpolated values create unique strings that cannot be aggregated or alerted on.

How to choose between ERROR and WARN log levels?▼

Choose by whether the operation failed or was handled: a retried timeout that succeeded or a skipped malformed row is WARN, while a failure the code could not paper over is ERROR. Levels reflect audience and required action, not how bad the event feels.

Does this logging guidance work with zerolog, zap, or pino?▼

Yes, the rules are language-agnostic and hold for slog, zerolog, zap, pino, structlog, and tracing. The reference implementation uses Go slog, but the principles of constant messages, fields, and level semantics port to any structured logger.

Why should I avoid logging and returning the same error?▼

Logging and returning the same error prints it N times at N stack depths, creating duplicate noise. Wrap and return the error deep in the stack, then log it once at the boundary that handles or swallows it.

How do I prevent secrets from appearing in application logs?▼

Never pass tokens, credentials, auth headers, or full request bodies to the logger, and log stable ids instead of emails or names. A handler-level denylist is only a backstop since it cannot catch secrets hidden in messages, error strings, or URLs.

What are the limits of log-based alerting?▼

Log levels label events but are not an alerting system; paging should come from SLOs and metrics like error rate and latency. A single ERROR log line is legitimate without paging anyone, so keep alerting and logging concerns separate.