CodingAgent.Skill (CodingAgent v0.1.0)

Copy Markdown View Source

A single skill discovered on disk, in the same shape Claude Code uses:

my_skill/
  SKILL.md   # YAML frontmatter (name, description, ...) + Markdown body

The frontmatter description is what gets shown to the model so it can decide when to invoke the skill; the body is only loaded into the conversation once the skill is actually invoked.

Summary

Functions

Renders the system-prompt block listing available skills, in the same spirit as Claude Code's own "available skills" reminder: name + description only, so the model can decide which one (if any) is relevant.

Loads a skill from a SKILL.md file path.

Types

t()

@type t() :: %CodingAgent.Skill{
  allowed_tools: [String.t()] | nil,
  body: String.t(),
  description: String.t(),
  metadata: map(),
  name: String.t(),
  path: String.t()
}

Functions

catalog(skills)

@spec catalog([t()]) :: String.t()

Renders the system-prompt block listing available skills, in the same spirit as Claude Code's own "available skills" reminder: name + description only, so the model can decide which one (if any) is relevant.

load(skill_md_path)

@spec load(String.t()) :: {:ok, t()} | {:error, term()}

Loads a skill from a SKILL.md file path.

Returns {:ok, skill} or {:error, reason} if the file is missing or has no usable frontmatter.