Class: Ace::LLM::Providers::CLI::Molecules::SkillNameReader

Inherits:
Object
  • Object
show all
Defined in:
lib/ace/llm/providers/cli/molecules/skill_name_reader.rb

Overview

Reads skill names from SKILL.md frontmatter in a skills directory.

Scans ‘#skills_dir/*/SKILL.md` for YAML frontmatter with a `name:` field. Results are cached per directory path since skills don’t change during a session.

Instance Method Summary collapse

Constructor Details

#initializeSkillNameReader

Returns a new instance of SkillNameReader.



16
17
18
# File 'lib/ace/llm/providers/cli/molecules/skill_name_reader.rb', line 16

def initialize
  @cache = {}
end

Instance Method Details

#call(skills_dir) ⇒ Array<String>

Read skill names from a skills directory.

Parameters:

  • skills_dir (String)

    Path to the skills directory

Returns:

  • (Array<String>)

    Array of skill names (e.g. [“ace-onboard”, “ace-git-commit”])



24
25
26
27
28
# File 'lib/ace/llm/providers/cli/molecules/skill_name_reader.rb', line 24

def call(skills_dir)
  return [] unless skills_dir && Dir.exist?(skills_dir)

  @cache[skills_dir] ||= read_skill_names(skills_dir)
end