new-backend

Adds pluggable backend adapters to gokit as nested contrib sub-modules with typed Register factories.

Updated Feb 15, 2026
One-click install
npx skills add https://github.com/kbukum/gokit --skill new-backend-kbukum
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: new-backend
Source: https://github.com/kbukum/gokit/tree/main/.github/skills/new-backend
Command: npx skills add https://github.com/kbukum/gokit --skill new-backend-kbukum

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Integrating a new provider (S3, GCS, Qdrant, Kafka, NATS, Redis, or an LLM/inference backend) into gokit requires following a strict registry + factory pattern; this Skill guides you through adding the adapter the canonical way without inventing a new registration mechanism. ## Core Features & Use Cases - Nested contrib sub-module scaffolding: Creates the adapter under its owner (e.g. storage/s3) with its own go.mod, replace directive, contrib.go.work entry, and domains.toml registration. - Typed Register factory pattern: Enforces an explicit Register(registry, cfg) factory closure with a validated typed Config — no init() side effects, no any-typed factory parameters, no global registries. - Production-grade adapter guidance: Covers context timeouts, bounded jittered retries for idempotent operations, circuit breaking, doc.go, and deterministic race/shuffle-safe tests. - Use Case: You want to add an S3 storage backend to gokit — the Skill walks you through creating storage/s3 as a nested module, defining its Config, implementing the adapter against storage's interface, and exposing Register while keeping the in-memory default in core. ## Quick Start Add a new S3 storage backend adapter to gokit following the contrib sub-module and typed Register factory pattern.

Frequently Asked Questions about new-backend

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new storage backend to gokit?▼

Create a nested contrib sub-module under the owner (e.g. storage/s3) with its own go.mod and a replace directive pointing two levels up. Define a typed Config, implement the adapter against the owner's interface, and expose an explicit Register(registry, cfg) factory.

How do I register a new provider in a Go registry pattern?▼

Expose a typed Register(registry, cfg) function that captures provider config in the factory closure and installs a typed factory func into the passed registry. Never use init() side effects, mutable package globals, or any-typed factory parameters.

Why should Go adapters avoid init() side effects?▼

Registration must be explicit and caller-driven so the registry is injected rather than global. This keeps the core module's in-memory default as the zero-config path and makes contrib backends selectable purely via configuration.

Can I add a Kafka or Redis backend without bloating gokit core?▼

Yes. Heavy SDK dependencies live in the nested contrib sub-module's own go.mod, so core stays light. Add the module path to contrib.go.work and register it under the owner's domain in domains.toml.

What testing requirements apply to new gokit backends?▼

Tests must be behavioral and deterministic with an injected clock instead of time.Sleep, cover failure paths, and pass under -race -shuffle. Integration tests needing a live broker or store must be gated or skipped without it.