Skills (fnord v0.9.29)

View Source

Skills are TOML-defined agent presets that can be executed by the coordinator.

This context module is the integration point that:

  • discovers skill definitions on disk,
  • applies precedence (user overrides project definitions by name),
  • applies enablement (via Settings.Skills), and
  • returns skill metadata suitable for dynamic tool specs and fnord skills list.

Disk locations:

  • User skills: ~/fnord/skills/*.toml
  • Project skills: ~/.fnord/projects/<project>/skills/*.toml

Enablement:

  • Global settings key: skills
  • Project settings key: projects.<project>.skills

Effective enablement is the union of the global and project lists.

Summary

Functions

Get a resolved skill by name.

Get an enabled skill by name. Returns {:ok, resolved_skill} if the skill is enabled in the current project context, {:error, :not_found | list_error} otherwise.

List all resolved skills available for the current project context.

List resolved skills that are enabled in the current project context.

Returns the project skills directory for the currently selected project.

Returns the user skills directory path.

Types

definition()

@type definition() :: %{
  skill: Skills.Skill.t(),
  source: Skills.Loader.skill_source(),
  path: String.t()
}

list_error()

@type list_error() :: Skills.Loader.load_error() | {:no_project_selected}

resolved_skill()

@type resolved_skill() :: %{
  name: String.t(),
  effective: definition(),
  definitions: [definition()]
}

Functions

get(name)

@spec get(String.t()) :: {:ok, resolved_skill()} | {:error, :not_found | list_error()}

Get a resolved skill by name.

Returns {:ok, resolved_skill} if found, {:error, :not_found} otherwise.

get_enabled(name)

@spec get_enabled(String.t()) ::
  {:ok, resolved_skill()} | {:error, :not_found | list_error()}

Get an enabled skill by name. Returns {:ok, resolved_skill} if the skill is enabled in the current project context, {:error, :not_found | list_error} otherwise.

list_all()

@spec list_all() :: {:ok, [resolved_skill()]} | {:error, list_error()}

List all resolved skills available for the current project context.

Returned entries include all definition locations and the effective definition after applying precedence rules.

This function does not filter to enabled skills.

list_enabled()

@spec list_enabled() :: {:ok, [resolved_skill()]} | {:error, list_error()}

List resolved skills that are enabled in the current project context.

Enablement is controlled by Settings.Skills.

project_skills_dir()

@spec project_skills_dir() :: {:ok, String.t()} | {:error, :no_project_selected}

Returns the project skills directory for the currently selected project.

user_skills_dir()

@spec user_skills_dir() :: String.t()

Returns the user skills directory path.

This uses Settings.get_user_home() at runtime so tests can override HOME.