Class: Riffer::Skills::Adapter
- Inherits:
-
Object
- Object
- Riffer::Skills::Adapter
- Defined in:
- lib/riffer/skills/adapter.rb
Overview
Base class defining the interface for skill adapters.
A skill adapter encapsulates the provider-specific catalog rendering for skills — how the available-skills section appears in the system prompt.
Subclass and override render_catalog. The activation tool is set at construction time and is exposed via #skill_activate_tool for use in rendered output.
See Riffer::Skills::MarkdownAdapter for the default implementation. See Riffer::Skills::XmlAdapter for the Anthropic/Claude variant.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#skill_activate_tool ⇒ Object
readonly
The activation tool class for this adapter.
Instance Method Summary collapse
-
#initialize(skill_activate_tool:) ⇒ Adapter
constructor
Creates a new adapter.
-
#render_catalog(skills) ⇒ Object
Renders a skill catalog section for the system prompt.
Constructor Details
#initialize(skill_activate_tool:) ⇒ Adapter
Creates a new adapter.
- skill_activate_tool
-
the activation tool class — referenced by name in the rendered catalog so the LLM knows which tool to call.
– : (skill_activate_tool: singleton(Riffer::Tool)) -> void
27 28 29 |
# File 'lib/riffer/skills/adapter.rb', line 27 def initialize(skill_activate_tool:) @skill_activate_tool = skill_activate_tool end |
Instance Attribute Details
#skill_activate_tool ⇒ Object (readonly)
The activation tool class for this adapter.
17 18 19 |
# File 'lib/riffer/skills/adapter.rb', line 17 def skill_activate_tool @skill_activate_tool end |
Instance Method Details
#render_catalog(skills) ⇒ Object
Renders a skill catalog section for the system prompt.
- skills
-
array of Frontmatter objects to render.
Raises NotImplementedError if not implemented by subclass.
– : (Array) -> String
39 40 41 |
# File 'lib/riffer/skills/adapter.rb', line 39 def render_catalog(skills) raise NotImplementedError, "#{self.class} must implement #render_catalog" end |