servicepack
БесплатноЗапускает вложенные скриптыНе проверенBuild a Go service on psyb0t/servicepack: clone-and-own framework (not a `go get` library) providing a Service interface (Name/Run/Stop), a singleton…
от psyb0t2 414 установок в других каталогахОб этом скилле
servicepack: build a Go service on the framework
servicepack runs your Go services concurrently without you hand-rolling a supervisor loop. It is NOT a package you go get into an existing project, it's a template repo you clone and make your own, then you add services under internal/pkg/services/. This skill teaches you to build a service with it, not to run it as a standalone server (there's nothing to run until you write a service).
Security & safety
servicepack is source code you compile into your own binary. It has no runtime surface of its own, no network listener, no daemon to secure. Once cloned it's just Go files in your repo; whatever surface your SERVICE exposes (HTTP, gRPC, DB connections) is on you, same as any Go code you'd write by hand. The only things worth flagging:
make own MODNAME=...rewrites the clone into a new project and deletes its.git(full list in setup). It cannot be undone. Run it once, in a fresh clone you just made, and only when the user asked to start a new project. Never run it in an existing repository.internal/app/,internal/pkg/service-manager/,pkg/runner/, andcmd/main.goare framework-owned files thatmake servicepack-updateoverwrites. Never hand-edit them (see "Framework boundaries" below).- No secrets, tokens, or credentials live in the framework itself. Your services' env vars are your own to manage (
gonfiguration, notos.Getenv).
When to use
- Starting a new Go service/daemon that needs to run one or more long-lived workers concurrently, with clean shutdown on SIGINT/SIGTERM.
- You need retry-on-failure, non-fatal ("allowed failure") services, dependency-ordered startup, or readiness gating between services in the same process.
- You want per-service CLI subcommands (
./app <service> migrate) alongside the long-running./app run. - You're adding a new service to a repo that already has
servicepack.version,Makefile.servicepack, orinternal/pkg/service-manager/present.
When NOT to use
- You need a single, simple
main()with no concurrent workers: plain Go is less ceremony. - You're building an HTTP API only, no background workers: reach for
aichteeteapeedirectly in a plainmain.go; servicepack's value is the multi-service supervisor, not routing. - You want a library to import into an EXISTING app without restructuring around
cmd/,internal/app/,internal/pkg/services/. servicepack expects to own your project's top-level shape.
Quick start
Clone into a new directory, and run make own only after the user has asked to start a new project:
git clone https://github.com/psyb0t/servicepack
cd servicepack
make own MODNAME=github.com/yourname/yourproject
make service NAME=my-worker
make service scaffolds internal/pkg/services/my-worker/my-worker.go:
package myworker
import (
"context"
"github.com/psyb0t/ctxerrors"
"github.com/psyb0t/ctxscope"
"github.com/psyb0t/gonfiguration"
)
const ServiceName = "my-worker"
type Config struct {
Value string `env:"MYWORKER_VALUE" default:"default-value"`
}
type MyWorker struct {
config Config
}
func New() (*MyWorker, error) {
cfg := Config{}
if err := gonfiguration.Parse(&cfg); err != nil {
return nil, ctxerrors.Wrap(err, "parse my-worker config")
}
return &MyWorker{config: cfg}, nil
}
func (s *MyWorker) Name() string {
return ServiceName
}
func (s *MyWorker) Run(ctx context.Context) error {
ctx = ctxscope.Set(ctx, ctxscope.Attr("service", ServiceName))
logger := ctxscope.GetLogger(ctx)
logger.Info("starting service")
<-ctx.Done()
logger.Info("service context cancelled")
return nil
}
func (s *MyWorker) Stop(ctx context.Context) error {
serviceCtx := ctxscope.Set(ctx, ctxscope.Attr("service", ServiceName))
ctxscope.GetLogger(serviceCtx).Info("stopping service")
return nil
}
Edit the Run() body, then make service-registration regenerates internal/pkg/services/services.gen.go (auto-discovers every Service implementation via gofindimpl). Build and run:
make build
./build/yourproject run
The Service interface
Every service implements:
type Service interface {
Name() string
Run(ctx context.Context) error
Stop(ctx context.Context) error
}
Run() listens for ctx.Done() and returns cleanly on cancellation; a non-nil return from Run() stops all services (unless the service is an AllowedFailure, see below). Stop() runs during shutdown for cleanup.
Optional interfaces: opt into extra behavior
A service can implement any combination of these on top of Service:
// Retryable: service gets restarted on failure, up to MaxRetries times,
// waiting RetryDelay between attempts. A negative MaxRetries counts as 0.
type Retryable interface {
MaxRetries() int
RetryDelay() time.Duration
}
// AllowedFailure: service can die (even after exhausting retries)
// without killing the rest of the process.
type
Установить servicepack в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл servicepack?
Build a Go service on psyb0t/servicepack: clone-and-own framework (not a `go get` library) providing a Service interface (Name/Run/Stop), a singleton ServiceManager that runs services concurrently with dependency-ordered topological start, automatic retry (Retryable), non-fatal failures (AllowedFailure), readiness gating (ReadyNotifier), per-service CLI subcommands (Commander), an App singleton with OnPreRun/OnPostStop lifecycle hooks, gofindimpl-based service auto-discovery codegen, ctxscope/slogging structured logging, and a graceful-shutdown Runner. Import path github.com/psyb0t/servicepack. Use when the user wants related Go services debugged together locally, then deployed as one binary or split into separate microservices, with retry/dependency/readiness semantics. The one-time setup clones the repository and runs make own, which turns that fresh clone into the user's new project (rewrites the module path, removes the clone's .git and re-initializes it).
Как установить скилл servicepack?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл servicepack запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic