Class: KairosMcp::SkillsDsl::Skill

Inherits:
Struct
  • Object
show all
Defined in:
lib/kairos_mcp/skills_dsl.rb

Overview

Extended Skill Struct with version, inputs, effects, evolution_rules, tool_config

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#behaviorObject

Returns the value of attribute behavior

Returns:

  • (Object)

    the current value of behavior



7
8
9
# File 'lib/kairos_mcp/skills_dsl.rb', line 7

def behavior
  @behavior
end

#contentObject

Returns the value of attribute content

Returns:

  • (Object)

    the current value of content



7
8
9
# File 'lib/kairos_mcp/skills_dsl.rb', line 7

def content
  @content
end

#created_atObject

Returns the value of attribute created_at

Returns:

  • (Object)

    the current value of created_at



7
8
9
# File 'lib/kairos_mcp/skills_dsl.rb', line 7

def created_at
  @created_at
end

#definitionObject

Returns the value of attribute definition

Returns:

  • (Object)

    the current value of definition



7
8
9
# File 'lib/kairos_mcp/skills_dsl.rb', line 7

def definition
  @definition
end

#depends_onObject

Returns the value of attribute depends_on

Returns:

  • (Object)

    the current value of depends_on



7
8
9
# File 'lib/kairos_mcp/skills_dsl.rb', line 7

def depends_on
  @depends_on
end

#effectsObject

Returns the value of attribute effects

Returns:

  • (Object)

    the current value of effects



7
8
9
# File 'lib/kairos_mcp/skills_dsl.rb', line 7

def effects
  @effects
end

#evolution_rulesObject

Returns the value of attribute evolution_rules

Returns:

  • (Object)

    the current value of evolution_rules



7
8
9
# File 'lib/kairos_mcp/skills_dsl.rb', line 7

def evolution_rules
  @evolution_rules
end

#formalization_notesObject

Returns the value of attribute formalization_notes

Returns:

  • (Object)

    the current value of formalization_notes



7
8
9
# File 'lib/kairos_mcp/skills_dsl.rb', line 7

def formalization_notes
  @formalization_notes
end

#guaranteesObject

Returns the value of attribute guarantees

Returns:

  • (Object)

    the current value of guarantees



7
8
9
# File 'lib/kairos_mcp/skills_dsl.rb', line 7

def guarantees
  @guarantees
end

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



7
8
9
# File 'lib/kairos_mcp/skills_dsl.rb', line 7

def id
  @id
end

#inputsObject

Returns the value of attribute inputs

Returns:

  • (Object)

    the current value of inputs



7
8
9
# File 'lib/kairos_mcp/skills_dsl.rb', line 7

def inputs
  @inputs
end

#requiresObject

Returns the value of attribute requires

Returns:

  • (Object)

    the current value of requires



7
8
9
# File 'lib/kairos_mcp/skills_dsl.rb', line 7

def requires
  @requires
end

#titleObject

Returns the value of attribute title

Returns:

  • (Object)

    the current value of title



7
8
9
# File 'lib/kairos_mcp/skills_dsl.rb', line 7

def title
  @title
end

#tool_configObject

Returns the value of attribute tool_config

Returns:

  • (Object)

    the current value of tool_config



7
8
9
# File 'lib/kairos_mcp/skills_dsl.rb', line 7

def tool_config
  @tool_config
end

#use_whenObject

Returns the value of attribute use_when

Returns:

  • (Object)

    the current value of use_when



7
8
9
# File 'lib/kairos_mcp/skills_dsl.rb', line 7

def use_when
  @use_when
end

#versionObject

Returns the value of attribute version

Returns:

  • (Object)

    the current value of 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

Returns:

  • (Boolean)


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

Returns:

  • (Boolean)


39
40
41
# File 'lib/kairos_mcp/skills_dsl.rb', line 39

def has_tool?
  !tool_config.nil? && tool_config.executor
end

#historyObject

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_hObject



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