Skills.Loader (fnord v0.9.29)
View SourceLoad and validate skill definitions from TOML files.
This module is responsible for file IO and TOML decoding. It returns
validated %Skills.Skill{} structs and includes file provenance so higher
layers can explain override behavior.
Summary
Functions
Load all *.toml skill definitions from the given directory.
Load a single skill TOML file.
Load a list of TOML files as skill definitions.
Types
@type loaded_skill() :: %{ skill: Skills.Skill.t(), name: String.t(), source: skill_source(), path: String.t() }
@type skill_source() :: :user | :project
Functions
@spec load_dir(String.t(), skill_source()) :: {:ok, [loaded_skill()]} | {:error, load_error()}
Load all *.toml skill definitions from the given directory.
Returns a list of loaded skill maps containing the validated skill struct and
provenance (source, path).
Duplicate names within the directory are returned as an error.
@spec load_file(String.t(), skill_source()) :: {:ok, loaded_skill()} | {:error, load_error()}
Load a single skill TOML file.
@spec load_files([String.t()], skill_source()) :: {:ok, [loaded_skill()]} | {:error, load_error()}
Load a list of TOML files as skill definitions.
Duplicate names within the file set are returned as an error.