.agents/skills/service-registry/SKILL.md
Register and retrieve services at runtime using a thread-safe service registry pattern for loose coupling between plugins.
npx skillsauth add gobetterauth/go-better-auth service-registryInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
any back to specific interfacesServices are registered in plugin Init() methods using the registry interface:
// Get a core service
service, ok := ctx.ServiceRegistry.Get(models.ServiceXxx.String()).(ServiceInterface)
if !ok {
return errors.New("service not available")
}
// Register your plugin's service
ctx.ServiceRegistry.Register(models.ServicePlugin.String(), myService)
Always check the ok flag on type assertions. Store retrieved services in plugin struct for internal use.
See bootstrap.go for implementation.
ok flag on type assertionsmodels.ServiceXxx constantstools
Orchestrate services and repositories through use cases to implement application-level workflows and business scenarios.
development
Write unit tests in Go following Red-Green-Refactor TDD principles.
tools
Define and implement services that encapsulate business logic with proper constructor-based dependency injection.
data-ai
Implement repository interfaces for data persistence and abstraction over database operations using Bun ORM.