Class: Rubino::Skills::PromptIndex

Inherits:
Object
  • Object
show all
Defined in:
lib/rubino/skills/prompt_index.rb

Overview

Builds the “## Skills (mandatory)” block injected into the SYSTEM PROMPT.

This is the load-bearing trigger for skill auto-activation: surfacing the skill catalogue inside the system prompt (not just the ‘skill` tool’s description) is what makes the model proactively scan and load a relevant skill before replying. Mirrors the reference build_skills_system_prompt, adapted to rubino’s ‘skill(name)` invocation and flat name+description catalogue.

Always renders a block when the skills feature is on (the caller gates on that): the catalogue half is dropped when no skills exist, but the CREATION half is always present so even a fresh install with zero skills nudges the agent to distill repeatable work into a new skill. Never returns nil — an empty registry is a valid state that still wants the create nudge.

Constant Summary collapse

DEFAULT_SKILL_DIR =

Where a freshly authored skill should be written. Mirrors the Registry’s project-local default path; surfaced in the create nudge so the agent knows the exact destination + filename contract.

".rubino/skills"

Instance Method Summary collapse

Constructor Details

#initialize(registry: nil) ⇒ PromptIndex

Returns a new instance of PromptIndex.



26
27
28
# File 'lib/rubino/skills/prompt_index.rb', line 26

def initialize(registry: nil)
  @registry = registry || Registry.new
end

Instance Method Details

#renderObject

Renders the “## Skills (mandatory)” block: the available-skills catalogue (when any exist) followed by the proactive-creation nudge (always). Never nil — see the class comment.



33
34
35
# File 'lib/rubino/skills/prompt_index.rb', line 33

def render
  [catalogue, creation_nudge].compact.join("\n\n")
end