golem-add-config-scala

Adds typed configuration to Scala Golem agents using Config and AgentConfig traits.

1.5k|212|Updated Nov 24, 2023
One-click install
npx skills add https://github.com/golemcloud/golem --skill golem-add-config-scala
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golem-add-config-scala
Source: https://github.com/golemcloud/golem/tree/main/golem-skills/skills/scala/golem-add-config-scala
Command: npx skills add https://github.com/golemcloud/golem --skill golem-add-config-scala

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Scala Golem agents need a structured way to receive environment-specific settings like database hosts, ports, and application names without hardcoding values. This Skill guides you through declaring typed configuration schemas and wiring them into agent traits and implementations.

Core Features & Use Cases

  • Typed Config Schemas: Define configuration as Scala case classes with derived ZIO Blocks Schema instances for compile-time safety.
  • Agent Integration: Mix in the AgentConfig trait on the agent definition and accept Config[T] in the implementation constructor, accessing values lazily via .value.
  • Multi-Source Values: Set defaults in golem.yaml, override at agent creation with the Golem CLI, or pass overrides through generated RPC client helpers.
  • Use Case: You are building a Scala agent that connects to a database. Use this Skill to declare a DbConfig case class, wire it into your agent, and supply different host and port values per deployment environment.

Quick Start

Add typed configuration with a database host and port setting to my Scala Golem agent.

Frequently Asked Questions about golem-add-config-scala

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

FAQPage Schema
How do I add configuration to a Scala Golem agent?

Define config case classes with Schema.derived in their companion objects, mix AgentConfig[T] into the agent trait, and accept Config[T] in the implementation constructor. Access the resolved value lazily via config.value inside agent methods.

How do I set config values for a Golem agent?

Set defaults under the agents section in golem.yaml using camelCase keys matching Scala field names. Override at creation with golem agent new --config flags, or pass overrides through the generated client's getWithConfig method.

Does Golem agent config support nested case classes in Scala?

Yes, config case classes can nest other case classes, such as a DbConfig inside an app config. Each nested type needs its own companion object with an implicit Schema derived instance.

What is the config precedence order in Golem?

Config cascades from componentTemplates to components to agents to presets, with later levels overriding earlier ones. CLI and RPC overrides apply at agent creation time on top of these defaults.

How do I handle secrets in Scala Golem agent config?

Config fields can use Secret[T] types for sensitive values. When secrets are included, combine this with the golem-add-secret-scala guidance for secret-specific declaration and CLI usage.