Class: Riffer::Skills::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/riffer/skills/config.rb,
sig/generated/riffer/skills/config.rbs

Overview

Configuration object for the skills block DSL.

skills do
backend Riffer::Skills::FilesystemBackend.new(".skills")
adapter Riffer::Skills::XmlAdapter
activate ["code-review"]
end

Instance Method Summary collapse

Constructor Details

#initializeConfig

-- : () -> void



19
20
21
22
23
24
# File 'lib/riffer/skills/config.rb', line 19

def initialize
  @backend = nil
  @adapter = nil
  @activate = nil
  @activate_tool = nil
end

Instance Method Details

#activate(value = nil) ⇒ Array[String], ...

Gets or sets skill names to activate at startup (an array or a +context+-resolved Proc); activated skills' bodies are included in the system prompt without a tool call.

: (?(Array | Proc)?) -> (Array | Proc)?

Parameters:

  • (?(Array[String] | Proc), nil)

Returns:

  • (Array[String], Proc, nil)


48
49
50
51
# File 'lib/riffer/skills/config.rb', line 48

def activate(value = nil)
  return @activate if value.nil?
  @activate = value
end

#activate_tool(value = nil) ⇒ singleton(Riffer::Tool)?

Gets or sets the per-agent skill activation tool override, or nil when unset — the global fallback to Riffer.config.skills.default_activate_tool is applied by the agent at resolution, not here. Raises Riffer::ArgumentError on an invalid value.

: (?singleton(Riffer::Tool)?) -> singleton(Riffer::Tool)?

Parameters:

Returns:



59
60
61
62
63
# File 'lib/riffer/skills/config.rb', line 59

def activate_tool(value = nil)
  return @activate_tool if value.nil?
  raise Riffer::ArgumentError, "activate_tool must be a Riffer::Tool subclass" unless value.is_a?(Class) && value < Riffer::Tool
  @activate_tool = value
end

#adapter(value = nil) ⇒ singleton(Riffer::Skills::Adapter)?

Gets or sets a custom skill adapter class; defaults to the provider's preferred adapter.

: (?singleton(Riffer::Skills::Adapter)?) -> singleton(Riffer::Skills::Adapter)?

Parameters:

Returns:



38
39
40
41
# File 'lib/riffer/skills/config.rb', line 38

def adapter(value = nil)
  return @adapter if value.nil?
  @adapter = value
end

#backend(value = nil) ⇒ Riffer::Skills::Backend, ...

Gets or sets the skills backend (a Backend or a +context+-resolved Proc).

: (?(Riffer::Skills::Backend | Proc)?) -> (Riffer::Skills::Backend | Proc)?

Parameters:

Returns:



29
30
31
32
# File 'lib/riffer/skills/config.rb', line 29

def backend(value = nil)
  return @backend if value.nil?
  @backend = value
end