implementation-lokstra-create-service

Generate @Service infrastructure implementations and wire dependency injection in Lokstra projects.

8|1|Updated Jun 21, 2025
One-click install
npx skills add https://github.com/primadi/lokstra --skill implementation-lokstra-create-service
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: implementation-lokstra-create-service
Source: https://github.com/primadi/lokstra/tree/main/.github/skills/implementation-lokstra-create-service
Command: npx skills add https://github.com/primadi/lokstra --skill implementation-lokstra-create-service

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill automates the creation of infrastructure services annotated with @Service, generating repository implementations, data access objects, and service factory functions with dependency injection after the domain models and database schema are defined.

Core Features & Use Cases

  • Scaffolding: Generate @Service implementations and their DI-ready constructors.
  • Swappable Implementations: Define multiple service implementations (e.g., PostgreSQL repository and in-memory) with config-driven selection.
  • Generated Wiring: Produce zz_generated.lokstra.go wrappers to register services and their dependencies.
  • Use Case: When expanding a domain module, quickly scaffold repository implementations and service factories to accelerate bootstrapping.

Quick Start

To get started, run the Lokstra code generation command for the new service, then integrate the generated files into your module and update your service definitions in config.yaml.

Frequently Asked Questions about implementation-lokstra-create-service

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

FAQPage Schema
How do I auto-generate repository implementations and service factories with dependency injection?

You can auto-generate repository implementations and service factories with dependency injection by using this Skill to scaffold @Service annotated infrastructure services and automatically update zz_generated.lokstra.go wiring files.

Can I define multiple service implementations and switch between them via config?

Yes, you can define multiple swappable service implementations, such as a PostgreSQL repository and an in-memory version, and use config-driven selection in your config.yaml to switch between them.

When do I need to generate zz_generated.lokstra.go files for my services?

You need to generate zz_generated.lokstra.go files when expanding a domain module to automatically register infrastructure services and wire their dependencies after the domain models and database schema are defined.

What's the best way to scaffold data access objects for a new domain module?

The best way to scaffold data access objects for a new domain module is to run the Lokstra code generation command, which produces DI-ready constructors and service factory stubs to accelerate bootstrapping.

Do I need to define my database schema before generating Lokstra services?

Yes, you must define your domain models and database schema first, because this Skill applies code generation for repository implementations and service factory wiring once that foundational structure is established.

How does dependency injection wiring work for generated Lokstra services?

Dependency injection wiring works by generating DI-ready constructors in the service stubs and producing wrapper files in zz_generated.lokstra.go to automatically register the services and resolve their dependencies.