Skills.Toml (fnord v0.9.29)

View Source

Encode a skill definition as TOML.

Skills are stored as TOML files so they are easy to create and edit by hand.

This module intentionally implements only the subset of TOML we need for the skill schema:

  • strings
  • string arrays
  • a shallow response_format table (string/number/bool values)

If we need richer encoding later, we can expand this module or swap it for a dedicated encoder.

Summary

Functions

Encode a %Skills.Skill{} to a TOML string.

Types

encode_error()

@type encode_error() ::
  {:invalid_response_format_value, key :: String.t(), term()}
  | {:invalid_response_format_key, term()}

Functions

encode_skill(skill)

@spec encode_skill(Skills.Skill.t()) :: {:ok, String.t()} | {:error, encode_error()}

Encode a %Skills.Skill{} to a TOML string.

The output is stable (fixed key order) to minimize noisy diffs.