Module: Brute::Prompts::Skills

Defined in:
lib/brute/prompts/skills.rb

Overview

The <available_skills> system-prompt section.

Uses skill objects from ctx when present (handed in via Brute::Middleware::Skills -> env[:skills]); falls back to scanning from ctx so the default stacks keep working unwired. Skills with disable_model_invocation? are loaded but hidden here. Returns nil when no skills are visible, dropping the section entirely.

Class Method Summary collapse

Class Method Details

.call(ctx) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/brute/prompts/skills.rb', line 16

def self.call(ctx)
  skills = ctx[:skills] || Brute::Skill.all(cwd: ctx[:cwd] || Dir.pwd)
  visible = skills.reject(&:disable_model_invocation?)
  return nil if visible.empty?

  Prompts.render("skills", ctx.merge(skills: visible))
end