Help us improve
Share bugs, ideas, or general feedback.
From golang-boost
Writes and reviews event-driven Go services using github.com/xgodev/boost/bootstrap/function, covering function.New constructor, fn.Run wiring, and the strict function.Handler[T] generic typing rule.
npx claudepluginhub xgodev/boost --plugin golang-boostHow this skill is triggered — by the user, by Claude, or both
Slash command
/golang-boost:boost-bootstrap-functionThis 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`. For middleware → `boost-bootstrap-middleware`. For Pub/Sub adapter specifics (incl. ctx-loss workaround) → `boost-bootstrap-adapter-pubsub`.
Constructs CloudEvents HTTP receivers/senders using the boost factory SDK. Activates on imports of factory/contrib/cloudevents/sdk-go/ or questions about HTTP transport or NewHTTP.
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-start. For middleware → boost-bootstrap-middleware. For Pub/Sub adapter specifics (incl. ctx-loss workaround) → boost-bootstrap-adapter-pubsub.
function.Handler[T]The framework declares (bootstrap/function/handler.go):
type Handler[T any] func(context.Context, cloudevents.Event) (T, error)
Input is always cloudevents.Event by value. Instantiate T = *cloudevents.Event so the publisher / logger middlewares — which type-switch on *event.Event — fire correctly.
// CORRECT
func handle(ctx context.Context, in cloudevents.Event) (*cloudevents.Event, error)
// WRONG — return-by-value silently disables publisher middleware
func handle(ctx context.Context, in cloudevents.Event) (cloudevents.Event, error)
// WRONG — does not compile against function.Handler[*cloudevents.Event]
func handle(ctx context.Context, in *cloudevents.Event) (*cloudevents.Event, error)
import (
"github.com/xgodev/boost"
"github.com/xgodev/boost/bootstrap/function"
cloudevents "github.com/cloudevents/sdk-go/v2"
)
func main() {
boost.Start()
ctx := context.Background()
// ... build middlewares (see boost-bootstrap-middleware) ...
// ... build adapter (see boost-bootstrap-adapter-pubsub or analogous) ...
fn, err := function.New[*cloudevents.Event](rec, lmi, pmi)
if err != nil { log.Fatalf("function: %v", err) }
if err := fn.Run(ctx, handle, adapter); err != nil {
log.Fatalf("run: %v", err)
}
}
The whole chain must agree on T = *cloudevents.Event: function.New[*cloudevents.Event](...), lm.NewAnyErrorMiddleware[*cloudevents.Event](), apubsub.New[*cloudevents.Event](pb). Mixing T types yields cryptic compile errors at the wiring call.
| Red flag | Fix |
|---|---|
Handler returning cloudevents.Event (value) | Change return to *cloudevents.Event |
Handler with input *cloudevents.Event (pointer) | Change to value — framework signature is forced |
function.New[cloudevents.Event](...) (T = value) | Change to function.New[*cloudevents.Event](...) |
| One middleware in the chain parameterized differently from the rest | Pick *cloudevents.Event everywhere |
Verification by example: before claiming a handler signature is correct, grep bootstrap/function/handler.go and confirm the actual Handler[T] type signature. The framework is the source of truth; this skill can drift.