service

Create and modify OpenMeter service packages with interfaces and implementation patterns.

2.2k|199|Updated Jun 6, 2023
One-click install
npx skills add https://github.com/openmeterio/openmeter --skill service-openmeterio
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: service
Source: https://github.com/openmeterio/openmeter/tree/main/.agents/skills/service
Command: npx skills add https://github.com/openmeterio/openmeter --skill service-openmeterio

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill streamlines the process of creating and updating service packages within the OpenMeter framework, ensuring adherence to established conventions and best practices.

Core Features & Use Cases

  • New Service Creation: Guides users through setting up the directory structure, interfaces (service.go, adapter.go), and implementation patterns for new domain packages.
  • Existing Service Modification: Provides a clear reference for adding new methods, input types, and validation to existing service and adapter layers.
  • Use Case: A developer needs to add a new feature to OpenMeter that tracks AI model usage. They would use this Skill to scaffold the necessary service/ and adapter/ code, defining the interfaces and implementing the core logic according to OpenMeter's standards.

Quick Start

Use the service skill to create a new domain package for managing user subscriptions.

Frequently Asked Questions about service

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

FAQPage Schema
How do I scaffold a new domain-driven service package in Golang?

To scaffold a domain-driven service package in Golang, define your domain types and interfaces in `service.go` and `adapter.go`, then implement the core logic following established conventions for multi-tenancy and structured logging.

What is the best way to add new methods to an existing Golang service and adapter layer?

Adding new methods to a Golang service and adapter layer involves updating the existing interfaces with new input types, adding necessary validation logic, and implementing the corresponding adapter patterns to maintain consistency.

Does this service development approach support dependency injection wiring?

Yes, this service development approach supports dependency injection wiring using Wire, automatically managing the initialization and dependency resolution for your domain types and adapter implementations.

How do I enforce multi-tenancy when creating a new OpenMeter service package?

To enforce multi-tenancy in an OpenMeter service package, structure your domain types and service interfaces to accept tenant identifiers, ensuring all core logic and adapter implementations properly scope data access and logging.

Can I publish domain events from the service and adapter layers?

Yes, you can publish domain events from the service and adapter layers by defining custom error definitions and utilizing the built-in event publishing mechanisms supported by the OpenMeter service package conventions.

When should I use the adapter pattern for service development in OpenMeter?

You should use the adapter pattern for service development in OpenMeter when you need to separate core domain logic from external infrastructure concerns, ensuring structured logging and dependency injection wiring remain decoupled and testable.