class Clacky::AgentProfile
-
base_prompt.md — universal behavioral rules (todo manager, tool usage, etc.)
- USER.md — user profile information
- SOUL.md — agent personality/values
Global files (shared across all agents), also with user-override support:
- system_prompt.md — agent-specific system prompt content
- profile.yml — name, description, skills whitelist
Each profile directory must contain:
2. <gem>/lib/clacky/default_agents/coding/ (built-in default)
1. ~/.clacky/agents/coding/ (user override)
Lookup order for a profile named “coding”:
Loads and represents an agent profile (system prompt + skill whitelist).
def self.load(name)
-
(AgentProfile)-
Parameters:
-
name(String, Symbol) -- profile name (e.g. "coding", "general")
def self.load(name) new(name) end
def base_prompt
-
(String)- base prompt shared by all agents
def base_prompt load_global_file("base_prompt.md") end
def default_agent_dir
def default_agent_dir oin(DEFAULT_AGENTS_DIR, @name)
def find_agent_file(filename)
def find_agent_file(filename) ath = File.join(user_agent_dir, filename) t_path = File.join(default_agent_dir, filename) e.exist?(user_path) && !File.zero?(user_path) _path File.exist?(default_path) ult_path
def initialize(name)
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
def load_agent_file(filename)
def load_agent_file(filename) find_agent_file(filename) "" unless path ead(path).strip
def load_global_file(filename)
def load_global_file(filename) ath = File.join(USER_AGENTS_DIR, filename) t_path = File.join(DEFAULT_AGENTS_DIR, filename) if File.exist?(user_path) && !File.zero?(user_path) user_path elsif File.exist?(default_path) default_path end "" unless path ead(path).strip
def load_profile_yml
def load_profile_yml find_agent_file("profile.yml") ArgumentError, "Agent profile '#{@name}' not found. " \ ked in #{user_agent_dir} and #{default_agent_dir}" unless path afe_load(File.read(path)) || {}
def soul
-
(String)- soul content (user override → built-in default)
def soul load_global_file("SOUL.md") end
def system_prompt
-
(String)- agent-specific system prompt content
def system_prompt @system_prompt_content end
def user_agent_dir
def user_agent_dir oin(USER_AGENTS_DIR, @name)
def user_profile
-
(String)- user profile content (user override → built-in default)
def user_profile load_global_file("USER.md") end