Module: LittleGhost::Agent::Skills::ClassMethods

Defined in:
lib/little_ghost/agent/skills.rb

Overview

Exposes skill discovery declarations on agent classes. These methods become inheritable DSL entries when the capability is included.

Instance Method Summary collapse

Instance Method Details

#skills(*values, **options) ⇒ Object

:call-seq:

skills(*paths, **options) -> configuration
skills(paths: paths_or_resolver, **options) -> configuration

Enables skill discovery for this agent. paths may be paths or a callable resolved for each run. When omitted, the runtime's configured skill paths are used.



58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/little_ghost/agent/skills.rb', line 58

def skills(*values, **options)
  configured_paths = if options.key?(:paths)
    options.delete(:paths)
  elsif values.empty?
    nil
  else
    values.flatten
  end
  self.skills_configuration_value = options.merge(paths: configured_paths)
  tools CatalogTools
  prompt_local(:skills_prompt) do
    tool = tools.fetch("skills") if tools.names.include?("skills")
    tool&.catalog&.discovery_prompt.to_s
  end
  before_invocation :include_skills_prompt
end

#skills_configurationObject

:nodoc:



75
# File 'lib/little_ghost/agent/skills.rb', line 75

def skills_configuration = skills_configuration_value # :nodoc: