SkillKit.Catalog (SkillKit v0.1.0)

Copy Markdown View Source

Aggregates kits from multiple providers and exposes skills, agents, tool definitions, and tool call classification.

Always Fresh

Every query calls providers via list_kits/1 — there is no internal caching. This ensures the catalog always reflects the current state of providers (important for Kit.Memory and other dynamic sources).

Summary

Functions

Returns the activate_skill tool definition filtered by :skills_remove_prefix, or nil if no skills remain after filtering. Used by sub-loops that opt into activate_skill exposure with optional namespace filtering.

Returns a specification to start this module under a supervisor.

Extracts the short name from a namespaced skill name.

Starts the catalog GenServer.

Returns {tool_module, metadata} for the given tool name, or nil if no matching tool is registered.

Functions

activate_skill_tool(agent_or_catalog, opts \\ [])

@spec activate_skill_tool(
  GenServer.server() | SkillKit.Agent.t(),
  keyword()
) :: SkillKit.Tool.t() | nil

Returns the activate_skill tool definition filtered by :skills_remove_prefix, or nil if no skills remain after filtering. Used by sub-loops that opt into activate_skill exposure with optional namespace filtering.

agent(agent_or_catalog)

@spec agent(GenServer.server() | SkillKit.Agent.t()) :: SkillKit.Agent.t() | nil

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

classify(agent_or_catalog, tool_name)

@spec classify(GenServer.server() | SkillKit.Agent.t(), String.t()) ::
  :tool | :activate_skill | :subagent

get_agent(agent_or_catalog, name)

@spec get_agent(GenServer.server() | SkillKit.Agent.t(), String.t()) ::
  {:ok, SkillKit.Agent.t()} | {:error, :not_found}

get_skill(agent_or_catalog, name)

@spec get_skill(GenServer.server() | SkillKit.Agent.t(), String.t()) ::
  {:ok, SkillKit.Skill.t()} | {:error, :not_found | :unauthorized}

list_agents(agent_or_catalog)

@spec list_agents(GenServer.server() | SkillKit.Agent.t()) :: [SkillKit.Agent.t()]

list_hooks(agent_or_catalog, event)

list_skills(agent_or_catalog)

@spec list_skills(GenServer.server() | SkillKit.Agent.t()) :: [
  {String.t(), String.t()}
]

skill_short_name(name)

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

Extracts the short name from a namespaced skill name.

Examples

iex> SkillKit.Catalog.skill_short_name("scheduler:schedule")
"schedule"

iex> SkillKit.Catalog.skill_short_name("standalone")
"standalone"

start_link(opts)

@spec start_link(keyword()) :: GenServer.on_start()

Starts the catalog GenServer.

Accepts two provider lists:

  • :tools — kit providers whose definition/0 becomes a first-class tool the LLM can call directly.
  • :skills — kit providers whose skills appear in the activate_skill enum. Skills are not callable directly; activation forks a child agent that has the skill's underlying tool module added to its tools list.

Backward-compatible: a single :providers keyword (the pre-split API) is accepted and treated as :skills.

tool_config(agent_or_catalog, tool_name)

@spec tool_config(GenServer.server() | SkillKit.Agent.t(), String.t()) ::
  {module(), map()} | nil

Returns {tool_module, metadata} for the given tool name, or nil if no matching tool is registered.

tool_definitions(agent_or_catalog, opts \\ [])

@spec tool_definitions(
  GenServer.server() | SkillKit.Agent.t(),
  keyword()
) :: [SkillKit.Tool.t()]