Help us improve
Share bugs, ideas, or general feedback.
From golang-boost
Composes a generic middleware chain outside fn.Run presets, typically for the Pub/Sub adapter ctx-loss workaround. Covers NewAnyErrorWrapper[T] and manual chain building.
npx claudepluginhub xgodev/boost --plugin golang-boostHow this skill is triggered — by the user, by Claude, or both
Slash command
/golang-boost:boost-extra-middlewareThis 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:**
Guides stacking function middleware in Go event-driven services using boost bootstrap packages. Covers recovery->logger->publisher chain order, error wrapping for deadletter routing, and ignore_errors middleware.
Provides idiomatic Go HTTP middleware for context propagation, structured slog logging, error handling, and panic recovery. Use when writing middleware, adding request tracing, or cross-cutting concerns.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Share bugs, ideas, or general feedback.
REQUIRED BACKGROUND:
boost-bootstrap-middleware — the middlewares this skill composes.boost-bootstrap-adapter-pubsub — the canonical reason this skill is reached for (production workaround).extra/middleware.NewAnyErrorWrapper[T](ctx, name, ...mws) is the generic chain composer. It returns a wrapper that you can apply to any handler typed compatibly. fn.Run uses it internally; you reach for it directly only when you can't use fn.Run (e.g., the documented Pub/Sub adapter workaround).
import (
"github.com/xgodev/boost/extra/middleware"
"github.com/xgodev/boost/bootstrap/function"
)
wrp := middleware.NewAnyErrorWrapper[*cloudevents.Event](
ctx, "bootstrap", rec, lmi, pmi,
)
wrappedHandler := function.Wrapper[*cloudevents.Event](wrp, handle)
// then drive wrappedHandler manually (e.g., apubsub.NewSubscriber)
The middleware order arguments here mirror the order semantics from boost-bootstrap-middleware: outermost-to-innermost is rec, lmi, pmi.
boost-bootstrap-adapter-pubsub).fn.Run.Don't use when the canonical function.New + fn.Run works — fn.Run already calls this internally with the right arguments.
| Red flag | Fix |
|---|---|
Used in place of fn.Run without a // TODO(boost-upstream): comment explaining why | Either add the comment + tracking issue, or use fn.Run |
Different T parameter than the rest of the chain | All on *cloudevents.Event |
| Custom middleware order that breaks the recovery-outermost rule | Mirror boost-bootstrap-middleware's canonical order |