Class: SkillBench::Models::Skill

Inherits:
Object
  • Object
show all
Defined in:
lib/skill_bench/models/skill.rb

Overview

Represents a reusable skill for agent evaluation

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, path:) ⇒ Skill

Initialize a new Skill

Parameters:

  • name (String)

    Skill name

  • path (String)

    Path to skill directory



14
15
16
17
# File 'lib/skill_bench/models/skill.rb', line 14

def initialize(name:, path:)
  @name = name
  @path = path
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



9
10
11
# File 'lib/skill_bench/models/skill.rb', line 9

def name
  @name
end

#pathObject (readonly)

Returns the value of attribute path.



9
10
11
# File 'lib/skill_bench/models/skill.rb', line 9

def path
  @path
end

Class Method Details

.discover(base_path = 'skills/') ⇒ Array<SkillBench::Models::Skill>

Discover skills from a directory recursively

Parameters:

  • base_path (String) (defaults to: 'skills/')

    Directory to search (default: “skills/”)

Returns:



22
23
24
25
26
27
28
29
# File 'lib/skill_bench/models/skill.rb', line 22

def self.discover(base_path = 'skills/')
  return [] unless Dir.exist?(base_path)

  Dir.glob(File.join(base_path, '**', 'SKILL.md')).map do |skill_md_path|
    skill_dir = File.dirname(skill_md_path)
    new(name: File.basename(skill_dir), path: skill_dir)
  end
end