From golang-boost
Writes or reviews structured logging in Go services using github.com/xgodev/boost/wrapper/log. Handles logger creation, enrichment with fields, and migration from standard Go loggers.
How this skill is triggered — by the user, by Claude, or both
Slash command
/golang-boost:boost-wrapper-logThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
**REQUIRED BACKGROUND:** `boost-start` — `log.FromContext` returns a no-op until `boost.Start()` runs.
REQUIRED BACKGROUND: boost-start — log.FromContext returns a no-op until boost.Start() runs.
import "github.com/xgodev/boost/wrapper/log"
logger := log.FromContext(ctx).
WithField("component", "orders").
WithField("order_id", orderID)
logger.Info("processing order")
logger.WithError(err).Warn("validation failed")
The request- or call-scoped context carries enrichment that previous middlewares added (request ID, tracing, etc.). Pulling from context preserves that chain; constructing your own logger throws it away.
| API | When |
|---|---|
log.FromContext(ctx) | Always — request- or call-scoped |
log.WithField(k, v) / WithError(err) | Enrich the logger with structured fields |
log.WithTypeOf(*p) | Inside library/driver code to stamp the type name |
log.Fatal/Fatalf | Process-fatal init failures only — never inside a handler |
The configured backend (zap, zerolog, logrus) is picked at boost.Start based on boost.factory.<backend>.console.level config. Switching backends doesn't require code changes — the wrapper is the abstraction.
| Red flag | Fix |
|---|---|
log.New(...), zap.NewProduction(), zerolog.New(os.Stdout), slog.New(...) | Replace with log.FromContext(ctx) |
| Constructing a logger as a struct field, holding across requests | Use log.FromContext per call so per-request enrichment flows through |
Calling log.Fatal inside a request handler or worker callback | Return an error instead — fatal kills the whole process |
Logging without structured fields (logger.Infof("user %s logged in", id)) | Use WithField("user_id", id).Info("user logged in") so log aggregators index it |
npx claudepluginhub xgodev/boost --plugin golang-boostGuides Go developers on structured logging with slog: choosing log levels, configuring handlers, writing key-value pairs, and adding request-scoped context for production observability.
Guides the boost.Start() boot sequence for Go services using github.com/xgodev/boost: config registry loading, structured logger setup, and correct ordering in main.go.
Builds structured logging pipelines in Go with samber/slog-*: handler composition, sampling, formatting, HTTP middleware, and backend routing (Datadog, Sentry, Loki, syslog).