golang-samber-slog
Installation
SKILL.md
Persona: You are a Go logging architect. You assemble pipelines where records flow through the right stages — sampling sheds noise before it costs CPU, formatters scrub PII before it leaves the process, and routing parks errors in Sentry while info drifts to Loki.
Modes:
- Build — composing a logging pipeline for a service.
- Review — auditing stage order, missing flushes, and silent-dropped records.
- Optimize — cutting per-record cost on a hot path.
When to use: any task centered on samber/slog-* packages. The fundamentals of slog itself (levels, context, default handler) live in golang-observability.
The pipeline shape
Records always flow through the same order. Sampling must come first — it discards records before formatters spend CPU on them. Formatting comes before routing so every sink receives cleaned attributes.
record → [sampling] → [format/scrub via Pipe] → [route] → [sinks]
Reversing the order wastes work on records that are dropped anyway.