Adding a Configuration Property

Create or modify microservice configuration properties in service.yaml with Go-style signatures.

172|5|Updated Sep 9, 2022
One-click install
npx skills add https://github.com/microbus-io/fabric --skill adding-a-configuration-property
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Adding a Configuration Property
Source: https://github.com/microbus-io/fabric/tree/main/.claude/skills/microbus/add-config
Command: npx skills add https://github.com/microbus-io/fabric --skill adding-a-configuration-property

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill automates the creation or modification of a microservice configuration property, enabling clean externalization of settings and easier management across deployments.

Core Features & Use Cases

  • Define in service.yaml: Add or modify a configuration property's Go-style signature, default, and validation.
  • Boilerplate generation & getters: Generate boilerplate code and accessors via go generate, easing integration into the svc layer.
  • Callback wiring & testing: Implement and test the OnChanged callback to respond to configuration changes at runtime.

Quick Start

Define and implement a new configuration property by editing service.yaml and running go generate. Then add an OnChanged handler and test in your microservice repository.

Frequently Asked Questions about Adding a Configuration Property

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

FAQPage Schema
How do I add a configuration property to a Go microservice using service.yaml?

To add a configuration property, define its Go-style signature, default, and validation rules in service.yaml, then run go generate to automatically create the boilerplate code and expose getters on the svc receiver for your microservice.

How do I respond to runtime configuration changes in a Go microservice?

You respond to runtime configuration changes by implementing and wiring an OnChanged callback. This handler is automatically triggered when a configuration property defined in service.yaml is modified, allowing your microservice to react dynamically.

What is the process for externalizing microservice settings in service.yaml?

Externalizing microservice settings involves declaring properties with Go-style signatures in service.yaml. This Skill reads AGENTS.md, enforces the signatures, and uses code generation to build accessors, ensuring clean configuration management across deployments.

Do I need to manually write getter methods for config properties defined in service.yaml?

No, you do not need to manually write getter methods. The code generation workflow automatically generates the necessary boilerplate code and accessors on the svc receiver when you run go generate after updating service.yaml.

Can I validate configuration values when defining properties in service.yaml?

Yes, you can validate configuration values. When defining a configuration property in service.yaml, you specify its Go-style signature, default value, and validation rules, which are then enforced through the generated code.

What role does AGENTS.md play when modifying microservice configuration properties?

AGENTS.md provides context and guidelines that the configuration process reads before defining a property in service.yaml. It ensures the generated boilerplate code and OnChanged callbacks align with the microservice's operational rules.