Class: AgentSkillsConfigurations::Agent
- Inherits:
-
Data
- Object
- Data
- AgentSkillsConfigurations::Agent
- Defined in:
- lib/agent_skills_configurations/agent.rb
Overview
Value object describing a configured agent and its skill locations.
An Agent represents a single AI coding agent configuration with information about where to find project-level skills and global skills for that agent. This is a read-only data structure returned by find and other query methods.
Agent Attributes
Each agent has four key attributes:
name- The canonical identifier used in code (e.g., "cursor", "claude-code")display_name- A human-friendly name for UI/display purposes (e.g., "Cursor", "Claude Code")skills_dir- A relative path for project-specific skills (e.g., ".cursor/skills")global_skills_dir- An absolute path to the user's global skill repository
Understanding Skill Directories
AI coding agents typically support two types of skills:
-
Project Skills (#skills_dir): These are specific to a single project and live alongside the project code. For example, a project might have a .cursor/skills directory containing skills tailored to that project.
-
Global Skills (#global_skills_dir): These are shared across all projects and typically live in the user's home directory. For example, ~/.cursor/skills contains reusable skills that work with any project.
When working with skills, you typically:
- Check the project's
skills_dirfor project-specific skills - Fall back to
global_skills_dirfor general-purpose skills - Combine both sources to give the agent full access to available skills
Accessing Agent Information
Since Agent is a Data object, all attributes are accessible via reader methods:
agent = AgentSkillsConfigurations.find("cursor")
agent.name # => "cursor"
agent.display_name # => "Cursor"
agent.skills_dir # => ".cursor/skills"
agent.global_skills_dir # => "/Users/username/.cursor/skills"
You can also convert to a Hash:
agent.to_h
# => { name: "cursor",
# display_name: "Cursor",
# skills_dir: ".cursor/skills",
# global_skills_dir: "/Users/username/.cursor/skills" }
Instance Attribute Summary collapse
-
#display_name ⇒ String
readonly
Human-friendly label for UI/display purposes.
-
#global_skills_dir ⇒ String
readonly
Absolute resolved path to global skills.
-
#name ⇒ String
readonly
Canonical agent name from
agents.yml. -
#skills_dir ⇒ String
readonly
Relative directory where project-specific skills live.
Instance Attribute Details
#display_name ⇒ String (readonly)
Human-friendly label for UI/display purposes. This is the name shown to users, e.g., in menus or configuration interfaces.
73 74 75 |
# File 'lib/agent_skills_configurations/agent.rb', line 73 def display_name @display_name end |
#global_skills_dir ⇒ String (readonly)
Absolute resolved path to global skills. This path is resolved from the YAML configuration, taking into account environment variables and fallbacks. It always begins with a slash.
73 74 75 |
# File 'lib/agent_skills_configurations/agent.rb', line 73 def global_skills_dir @global_skills_dir end |
#name ⇒ String (readonly)
Canonical agent name from agents.yml. This is the
identifier used when finding agents via AgentSkillsConfigurations.find.
73 74 75 |
# File 'lib/agent_skills_configurations/agent.rb', line 73 def name @name end |
#skills_dir ⇒ String (readonly)
Relative directory where project-specific skills live. This path is relative to the project root and should not start with a slash (e.g., ".cursor/skills", not "/.cursor/skills").
73 74 75 |
# File 'lib/agent_skills_configurations/agent.rb', line 73 def skills_dir @skills_dir end |