Module: Brute::Prompts
- Defined in:
- lib/brute/prompts/base.rb,
lib/brute/prompts/skills.rb,
lib/brute/prompts/autonomy.rb,
lib/brute/prompts/identity.rb,
lib/brute/prompts/max_steps.rb,
lib/brute/prompts/code_style.rb,
lib/brute/prompts/git_safety.rb,
lib/brute/prompts/tool_usage.rb,
lib/brute/prompts/conventions.rb,
lib/brute/prompts/doing_tasks.rb,
lib/brute/prompts/environment.rb,
lib/brute/prompts/objectivity.rb,
lib/brute/prompts/build_switch.rb,
lib/brute/prompts/instructions.rb,
lib/brute/prompts/plan_reminder.rb,
lib/brute/prompts/proactiveness.rb,
lib/brute/prompts/frontend_tasks.rb,
lib/brute/prompts/tone_and_style.rb,
lib/brute/prompts/code_references.rb,
lib/brute/prompts/task_management.rb,
lib/brute/prompts/editing_approach.rb,
lib/brute/prompts/editing_constraints.rb,
lib/brute/prompts/security_and_safety.rb
Defined Under Namespace
Modules: Autonomy, BuildSwitch, CodeReferences, CodeStyle, Conventions, DoingTasks, EditingApproach, EditingConstraints, Environment, FrontendTasks, GitSafety, Identity, Instructions, MaxSteps, Objectivity, PlanReminder, Proactiveness, SecurityAndSafety, Skills, TaskManagement, ToneAndStyle, ToolUsage
Constant Summary collapse
- TEXT_DIR =
File.("text", __dir__)
Class Method Summary collapse
-
.agent_prompt(name) ⇒ Object
Read a named agent prompt (e.g. “explore”, “compaction”).
-
.read(section, provider_name) ⇒ Object
Resolve a provider-specific text file.
Class Method Details
.agent_prompt(name) ⇒ Object
Read a named agent prompt (e.g. “explore”, “compaction”).
18 19 20 21 |
# File 'lib/brute/prompts/base.rb', line 18 def self.agent_prompt(name) path = File.join(TEXT_DIR, "agents", "#{name}.txt") File.exist?(path) ? File.read(path) : nil end |
.read(section, provider_name) ⇒ Object
Resolve a provider-specific text file. Looks for section/provider_name.txt, falls back to section/default.txt.
9 10 11 12 13 14 15 |
# File 'lib/brute/prompts/base.rb', line 9 def self.read(section, provider_name) provider = provider_name.to_s path = File.join(TEXT_DIR, section, "#{provider}.txt") path = File.join(TEXT_DIR, section, "default.txt") unless File.exist?(path) return nil unless File.exist?(path) File.read(path) end |