Class: RubyLLM::Skills::FilesystemLoader

Inherits:
Loader
  • Object
show all
Defined in:
lib/ruby_llm/skills/filesystem_loader.rb

Overview

Loads skills from a filesystem directory.

Supports two formats:

  1. Directory skills: subdirectories containing SKILL.md files
  2. Single-file commands: .md files with frontmatter at the root level

Examples:

Directory skills

app/skills/
└── pdf-report/
    └── SKILL.md

Single-file commands

app/commands/
└── write-poem.md

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Loader

#exists?, #find, #get, #reload!

Constructor Details

#initialize(path) ⇒ FilesystemLoader

Initialize with a directory path.

Parameters:

  • path (String, Pathname) —

    path to skills directory



26
27
28
29
# File 'lib/ruby_llm/skills/filesystem_loader.rb', line 26

def initialize(path)
  super()
  @path = path.to_s
end

Instance Attribute Details

#path ⇒ Object (readonly)

Returns the value of attribute path.



21
22
23
# File 'lib/ruby_llm/skills/filesystem_loader.rb', line 21

def path
  @path
end

Instance Method Details

#list ⇒ Array<Skill>

List all skills from the directory.

Returns:

  • (Array<Skill>) —

    skills found in directory



34
35
36
# File 'lib/ruby_llm/skills/filesystem_loader.rb', line 34

def list
  skills
end