Golem annotate agent effect

From golemcloud/golem · View interactive version

Golem annotate agent effect is an AI agent skill from the GitHub repository golemcloud/golem. Adding prompt hints and descriptions to Effect-based Golem agents and methods. Use when an @golemcloud/effect-golem agent needs AI/LLM discovery metadata or human-readable method documentation.

How to use this skill

Skill file

Annotating Effect Agents and Methods

Effect Golem agents declare AI/LLM discovery metadata as fields in their defineAgent(...) and

method(...) specs. Do not translate decorator syntax from another SDK: Effect agents do not use

annotation decorators.

Metadata Fields

The method name exposed by Golem is the key in the methods record, so use TypeScript camelCase

there. A request for a method's “prompt” annotation maps to the Effect SDK's promptHint field.

Agent and Method Metadata

Set agent metadata directly on the defineAgent spec and method metadata directly inside

method(...):

import { Effect, Schema } from "effect";
import { defineAgent, method } from "@golemcloud/effect-golem";

export const CounterAgent = defineAgent({
  name: "CounterAgent",
  description: "A test counter agent for tracking numeric values",
  mode: "durable",
  id: {
    count: Schema.Number,
  },
  methods: {
    getDouble: method({
      input: {},
      success: Schema.Number,
      promptHint: "Get the doubled value of the counter",
      description:
        "Returns the current count multiplied by two. Useful for scaling operations.",
    }),
  },
}).implement({
  init: ({ count }) => Effect.succeed(count),
  methods: (count) => ({
    getDouble: () => Effect.succeed(count * 2),
  }),
});

When editing an existing stateful agent, preserve its snapshot and implementation structure. Add

the method spec under methods, then add a matching Effect-returning handler to the object returned

by methods. Metadata belongs only on the specs; it does not change handler behavior.

Key Constraints

effect.

@golemcloud/golem-ts-sdk.

import from src/main.ts.

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.