Help us improve
Share bugs, ideas, or general feedback.
From golang-boost
Wires NATS subscribers with queue groups and handles context.Background loss in boost Go functions.
npx claudepluginhub xgodev/boost --plugin golang-boostHow this skill is triggered — by the user, by Claude, or both
Slash command
/golang-boost:boost-bootstrap-adapter-natsThis 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 Go developers using the boost framework to subscribe to GCP Pub/Sub, covering the canonical apubsub.New path and a production workaround for the helper.go context.Background bug that prevents SIGTERM draining.
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.
Provides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.
Share bugs, ideas, or general feedback.
REQUIRED BACKGROUND:
boost-bootstrap-function — handler typing rule.boost-bootstrap-middleware — recovery/logger/publisher chain.boost-extra-middleware — NewAnyErrorWrapper for the workaround.boost-bootstrap-adapter-pubsub — same shape, full workaround pattern documented there.import (
anats "github.com/xgodev/boost/bootstrap/function/adapter/contrib/nats-io/nats.go/v1"
"github.com/xgodev/boost/bootstrap/function"
)
fn, _ := function.New[*cloudevents.Event](rec, lmi, pmi)
fn.Run(ctx, handle, anats.New[*cloudevents.Event](conn))
Subscriptions are configured via boost.bootstrap.function.adapter.nats.subjects (comma-separated) and boost.bootstrap.function.adapter.nats.queueGroup. Override at deploy via BOOST_BOOTSTRAP_FUNCTION_ADAPTER_NATS_*.
bootstrap/function/adapter/contrib/nats-io/nats.go/v1/helper.go:44/46 and subscriber.go:62 hard-code context.Background(). SIGTERM does not gracefully drain.
Apply the same workaround pattern documented in boost-bootstrap-adapter-pubsub: bypass fn.Run, build the chain via extra/middleware.NewAnyErrorWrapper, drive anats.NewSubscriber with a signal-aware ctx, and add the // TODO(boost-upstream): annotation naming the offending file.
NATS queue groups distribute messages across N subscribers (load balancing). Configure via boost.bootstrap.function.adapter.nats.queueGroup. Without a queue group, every subscriber gets every message (broadcast).
| Red flag | Fix |
|---|---|
nats.Conn.Subscribe(...) directly from the upstream SDK | Use anats.NewSubscriber(...).Subscribe(ctx) or function.New + fn.Run |
Bypass of fn.Run without // TODO(boost-upstream): naming helper.go:44/subscriber.go:62 | Add the comment, OR accept ungraceful shutdown |
| Multiple NATS connections per process | Construct one *nats.Conn at startup, share |
Config tunables read via os.Getenv | Use BOOST_BOOTSTRAP_FUNCTION_ADAPTER_NATS_* overrides |