Skills.Skill (fnord v0.9.29)

View Source

A single skill definition loaded from a TOML file.

Skills are defined on disk as TOML and loaded at runtime.

Fields in the struct reflect the stable skill schema:

  • name, description, model, tools, system_prompt are required
  • response_format is optional

Validation is performed when loading a skill from TOML.

Summary

Functions

Convert a decoded TOML map into a validated skill struct.

Types

decode_error()

@type decode_error() ::
  {:missing_key, String.t()}
  | {:invalid_type, String.t(), expected :: String.t(), got :: term()}
  | {:invalid_value, String.t(), term()}

t()

@type t() :: %Skills.Skill{
  description: String.t(),
  model: String.t(),
  name: String.t(),
  response_format: map() | nil,
  system_prompt: String.t(),
  tools: [String.t()]
}

warning()

@type warning() :: {:dropped_non_strings, key :: String.t(), dropped :: [term()]}

Functions

from_map(map)

@spec from_map(map()) :: {:ok, t(), [warning()]} | {:error, decode_error()}

Convert a decoded TOML map into a validated skill struct.

The TOML parser is expected to decode keys as strings.