Class: SkillBench::Models::Skill
- Inherits:
-
Object
- Object
- SkillBench::Models::Skill
- Defined in:
- lib/skill_bench/models/skill.rb
Overview
Represents a reusable skill for agent evaluation
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Class Method Summary collapse
-
.discover(base_path = 'skills/') ⇒ Array<SkillBench::Models::Skill>
Discover skills from a directory recursively.
Instance Method Summary collapse
-
#initialize(name:, path:) ⇒ Skill
constructor
Initialize a new Skill.
Constructor Details
#initialize(name:, path:) ⇒ Skill
Initialize a new Skill
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
#name ⇒ Object (readonly)
Returns the value of attribute name.
9 10 11 |
# File 'lib/skill_bench/models/skill.rb', line 9 def name @name end |
#path ⇒ Object (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
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 |