Class: Clacky::AgentProfile
- Inherits:
-
Object
- Object
- Clacky::AgentProfile
- Defined in:
- lib/clacky/agent_profile.rb
Overview
Loads and represents an agent profile (system prompt + skill whitelist).
Lookup order for a profile named “coding”:
1. ~/.clacky/agents/coding/ (user override)
2. <gem>/lib/clacky/default_agents/coding/ (built-in default)
Each profile directory must contain:
- profile.yml — name, description, skills whitelist
- system_prompt.md — agent-specific system prompt content
Global files (shared across all agents), also with user-override support:
- SOUL.md — agent personality/values
- USER.md — user profile information
- base_prompt.md — universal behavioral rules (todo manager, tool usage, etc.)
Constant Summary collapse
- DEFAULT_AGENTS_DIR =
File.("../default_agents", __FILE__).freeze
- USER_AGENTS_DIR =
File.("~/.clacky/agents").freeze
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
-
.load(name) ⇒ AgentProfile
Load a named profile.
Instance Method Summary collapse
-
#base_prompt ⇒ String
Base prompt shared by all agents.
-
#initialize(name) ⇒ AgentProfile
constructor
A new instance of AgentProfile.
-
#soul ⇒ String
Soul content (user override → built-in default).
-
#system_prompt ⇒ String
Agent-specific system prompt content.
-
#user_profile ⇒ String
User profile content (user override → built-in default).
Constructor Details
#initialize(name) ⇒ AgentProfile
Returns a new instance of AgentProfile.
26 27 28 29 30 31 |
# File 'lib/clacky/agent_profile.rb', line 26 def initialize(name) @name = name.to_s profile_data = load_profile_yml @description = profile_data["description"] || "" @system_prompt_content = load_agent_file("system_prompt.md") end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
24 25 26 |
# File 'lib/clacky/agent_profile.rb', line 24 def description @description end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
24 25 26 |
# File 'lib/clacky/agent_profile.rb', line 24 def name @name end |
Class Method Details
.load(name) ⇒ AgentProfile
Load a named profile. Raises ArgumentError if profile directory not found.
36 37 38 |
# File 'lib/clacky/agent_profile.rb', line 36 def self.load(name) new(name) end |
Instance Method Details
#base_prompt ⇒ String
Returns base prompt shared by all agents.
46 47 48 |
# File 'lib/clacky/agent_profile.rb', line 46 def base_prompt load_global_file("base_prompt.md") end |
#soul ⇒ String
Returns soul content (user override → built-in default).
51 52 53 |
# File 'lib/clacky/agent_profile.rb', line 51 def soul load_global_file("SOUL.md") end |
#system_prompt ⇒ String
Returns agent-specific system prompt content.
41 42 43 |
# File 'lib/clacky/agent_profile.rb', line 41 def system_prompt @system_prompt_content end |
#user_profile ⇒ String
Returns user profile content (user override → built-in default).
56 57 58 |
# File 'lib/clacky/agent_profile.rb', line 56 def user_profile load_global_file("USER.md") end |