Class: KairosMcp::SkillsDsl::Skill
- Inherits:
-
Struct
- Object
- Struct
- KairosMcp::SkillsDsl::Skill
- Defined in:
- lib/kairos_mcp/skills_dsl.rb
Overview
Extended Skill Struct with version, inputs, effects, evolution_rules, tool_config
Instance Attribute Summary collapse
-
#behavior ⇒ Object
Returns the value of attribute behavior.
-
#content ⇒ Object
Returns the value of attribute content.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#definition ⇒ Object
Returns the value of attribute definition.
-
#depends_on ⇒ Object
Returns the value of attribute depends_on.
-
#effects ⇒ Object
Returns the value of attribute effects.
-
#evolution_rules ⇒ Object
Returns the value of attribute evolution_rules.
-
#formalization_notes ⇒ Object
Returns the value of attribute formalization_notes.
-
#guarantees ⇒ Object
Returns the value of attribute guarantees.
-
#id ⇒ Object
Returns the value of attribute id.
-
#inputs ⇒ Object
Returns the value of attribute inputs.
-
#requires ⇒ Object
Returns the value of attribute requires.
-
#title ⇒ Object
Returns the value of attribute title.
-
#tool_config ⇒ Object
Returns the value of attribute tool_config.
-
#use_when ⇒ Object
Returns the value of attribute use_when.
-
#version ⇒ Object
Returns the value of attribute version.
Instance Method Summary collapse
-
#can_evolve?(field) ⇒ Boolean
Check if a field can be evolved based on evolution_rules.
-
#has_tool? ⇒ Boolean
Check if this skill defines an MCP tool.
-
#history ⇒ Object
Get history from VersionManager.
- #to_h ⇒ Object
Instance Attribute Details
#behavior ⇒ Object
Returns the value of attribute behavior
7 8 9 |
# File 'lib/kairos_mcp/skills_dsl.rb', line 7 def behavior @behavior end |
#content ⇒ Object
Returns the value of attribute content
7 8 9 |
# File 'lib/kairos_mcp/skills_dsl.rb', line 7 def content @content end |
#created_at ⇒ Object
Returns the value of attribute created_at
7 8 9 |
# File 'lib/kairos_mcp/skills_dsl.rb', line 7 def created_at @created_at end |
#definition ⇒ Object
Returns the value of attribute definition
7 8 9 |
# File 'lib/kairos_mcp/skills_dsl.rb', line 7 def definition @definition end |
#depends_on ⇒ Object
Returns the value of attribute depends_on
7 8 9 |
# File 'lib/kairos_mcp/skills_dsl.rb', line 7 def depends_on @depends_on end |
#effects ⇒ Object
Returns the value of attribute effects
7 8 9 |
# File 'lib/kairos_mcp/skills_dsl.rb', line 7 def effects @effects end |
#evolution_rules ⇒ Object
Returns the value of attribute evolution_rules
7 8 9 |
# File 'lib/kairos_mcp/skills_dsl.rb', line 7 def evolution_rules @evolution_rules end |
#formalization_notes ⇒ Object
Returns the value of attribute formalization_notes
7 8 9 |
# File 'lib/kairos_mcp/skills_dsl.rb', line 7 def formalization_notes @formalization_notes end |
#guarantees ⇒ Object
Returns the value of attribute guarantees
7 8 9 |
# File 'lib/kairos_mcp/skills_dsl.rb', line 7 def guarantees @guarantees end |
#id ⇒ Object
Returns the value of attribute id
7 8 9 |
# File 'lib/kairos_mcp/skills_dsl.rb', line 7 def id @id end |
#inputs ⇒ Object
Returns the value of attribute inputs
7 8 9 |
# File 'lib/kairos_mcp/skills_dsl.rb', line 7 def inputs @inputs end |
#requires ⇒ Object
Returns the value of attribute requires
7 8 9 |
# File 'lib/kairos_mcp/skills_dsl.rb', line 7 def requires @requires end |
#title ⇒ Object
Returns the value of attribute title
7 8 9 |
# File 'lib/kairos_mcp/skills_dsl.rb', line 7 def title @title end |
#tool_config ⇒ Object
Returns the value of attribute tool_config
7 8 9 |
# File 'lib/kairos_mcp/skills_dsl.rb', line 7 def tool_config @tool_config end |
#use_when ⇒ Object
Returns the value of attribute use_when
7 8 9 |
# File 'lib/kairos_mcp/skills_dsl.rb', line 7 def use_when @use_when end |
#version ⇒ Object
Returns the value of attribute version
7 8 9 |
# File 'lib/kairos_mcp/skills_dsl.rb', line 7 def version @version end |
Instance Method Details
#can_evolve?(field) ⇒ Boolean
Check if a field can be evolved based on evolution_rules
27 28 29 30 |
# File 'lib/kairos_mcp/skills_dsl.rb', line 27 def can_evolve?(field) return true unless evolution_rules evolution_rules.can_evolve?(field) end |
#has_tool? ⇒ Boolean
Check if this skill defines an MCP tool
39 40 41 |
# File 'lib/kairos_mcp/skills_dsl.rb', line 39 def has_tool? !tool_config.nil? && tool_config.executor end |
#history ⇒ Object
Get history from VersionManager
33 34 35 36 |
# File 'lib/kairos_mcp/skills_dsl.rb', line 33 def history return [] unless defined?(VersionManager) VersionManager.list_versions.select { |v| v[:filename].include?(id.to_s) } end |
#to_h ⇒ Object
43 44 45 46 47 48 49 50 51 |
# File 'lib/kairos_mcp/skills_dsl.rb', line 43 def to_h h = super h[:effects] = effects.transform_values(&:to_h) if effects h[:evolution_rules] = evolution_rules.to_h if evolution_rules h[:tool_config] = tool_config.to_h if tool_config h[:definition] = definition.to_h if definition h[:formalization_notes] = formalization_notes if formalization_notes h end |