Golem annotate agent scala

From golemcloud/golem · View interactive version

Golem annotate agent scala is an AI agent skill from the GitHub repository golemcloud/golem. Adding prompt and description annotations to Scala agent methods. Use when the user asks to add descriptions, prompts, or documentation metadata to agent methods for AI/LLM discovery.

How to use this skill

Skill file

Annotating Agent Methods (Scala)

Overview

Golem agents can annotate methods with @prompt and @description annotations. These provide metadata for AI/LLM tool discovery — agents with annotated methods can be used as tools by LLM-based systems.

Annotations

Usage

import golem.runtime.annotations.{agentDefinition, description, prompt}
import golem.BaseAgent

import scala.concurrent.Future

@agentDefinition(mount = "/inventory/{warehouseId}")
trait InventoryAgent extends BaseAgent {
  class Id(val warehouseId: String)

  @prompt("Look up the current stock level for a product")
  @description("Returns the number of units in stock for the given product SKU. Returns 0 if the product is not found.")
  def checkStock(sku: String): Future[Int]

  @prompt("Add units of a product to inventory")
  @description("Increases the stock count for the given SKU by the specified amount. Returns the new total.")
  def restock(sku: String, quantity: Int): Future[Int]

  @prompt("Remove units of a product from inventory")
  @description("Decreases the stock count for the given SKU. Returns a Left if insufficient stock.")
  def pick(sku: String, quantity: Int): Future[Either[String, Int]]
}

Guidelines

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.