Class: KairosMcp::SkillBuilder
- Inherits:
-
Object
- Object
- KairosMcp::SkillBuilder
- Defined in:
- lib/kairos_mcp/skills_dsl.rb
Instance Method Summary collapse
- #behavior(&block) ⇒ Object
- #build ⇒ Object
- #content(value) ⇒ Object
-
#definition(&block) ⇒ Object
Define structural layer (partial formalization as AST nodes).
- #depends_on(value) ⇒ Object
- #effect(name, &block) ⇒ Object
- #evolve(&block) ⇒ Object
-
#formalization_notes(value) ⇒ Object
Record provenance of formalization decisions (Markdown string).
- #guarantees(value = nil, &block) ⇒ Object
-
#initialize(id) ⇒ SkillBuilder
constructor
A new instance of SkillBuilder.
- #inputs(*args) ⇒ Object
- #requires(value) ⇒ Object
- #title(value) ⇒ Object
-
#tool(&block) ⇒ Object
Define MCP tool interface and implementation.
- #use_when(value) ⇒ Object
- #version(value) ⇒ Object
Constructor Details
#initialize(id) ⇒ SkillBuilder
Returns a new instance of SkillBuilder.
76 77 78 79 |
# File 'lib/kairos_mcp/skills_dsl.rb', line 76 def initialize(id) @id = id @data = { created_at: Time.now } end |
Instance Method Details
#behavior(&block) ⇒ Object
119 120 121 |
# File 'lib/kairos_mcp/skills_dsl.rb', line 119 def behavior(&block) @data[:behavior] = block end |
#build ⇒ Object
155 156 157 |
# File 'lib/kairos_mcp/skills_dsl.rb', line 155 def build SkillsDsl::Skill.new(id: @id, **@data) end |
#content(value) ⇒ Object
115 116 117 |
# File 'lib/kairos_mcp/skills_dsl.rb', line 115 def content(value) @data[:content] = value end |
#definition(&block) ⇒ Object
Define structural layer (partial formalization as AST nodes)
137 138 139 140 141 |
# File 'lib/kairos_mcp/skills_dsl.rb', line 137 def definition(&block) ctx = DefinitionContext.new ctx.instance_eval(&block) if block_given? @data[:definition] = ctx end |
#depends_on(value) ⇒ Object
111 112 113 |
# File 'lib/kairos_mcp/skills_dsl.rb', line 111 def depends_on(value) @data[:depends_on] = value end |
#effect(name, &block) ⇒ Object
123 124 125 126 127 128 |
# File 'lib/kairos_mcp/skills_dsl.rb', line 123 def effect(name, &block) @data[:effects] ||= {} ctx = EffectContext.new(name) ctx.instance_eval(&block) if block_given? @data[:effects][name] = ctx end |
#evolve(&block) ⇒ Object
130 131 132 133 134 |
# File 'lib/kairos_mcp/skills_dsl.rb', line 130 def evolve(&block) ctx = EvolveContext.new(@id) ctx.instance_eval(&block) if block_given? @data[:evolution_rules] = ctx end |
#formalization_notes(value) ⇒ Object
Record provenance of formalization decisions (Markdown string)
144 145 146 |
# File 'lib/kairos_mcp/skills_dsl.rb', line 144 def formalization_notes(value) @data[:formalization_notes] = value end |
#guarantees(value = nil, &block) ⇒ Object
101 102 103 104 105 106 107 108 109 |
# File 'lib/kairos_mcp/skills_dsl.rb', line 101 def guarantees(value = nil, &block) if block_given? ctx = GuaranteesContext.new ctx.instance_eval(&block) @data[:guarantees] = ctx.guarantees else @data[:guarantees] = value end end |
#inputs(*args) ⇒ Object
93 94 95 |
# File 'lib/kairos_mcp/skills_dsl.rb', line 93 def inputs(*args) @data[:inputs] = args.flatten end |
#requires(value) ⇒ Object
97 98 99 |
# File 'lib/kairos_mcp/skills_dsl.rb', line 97 def requires(value) @data[:requires] = value end |
#title(value) ⇒ Object
85 86 87 |
# File 'lib/kairos_mcp/skills_dsl.rb', line 85 def title(value) @data[:title] = value end |
#tool(&block) ⇒ Object
Define MCP tool interface and implementation
149 150 151 152 153 |
# File 'lib/kairos_mcp/skills_dsl.rb', line 149 def tool(&block) ctx = ToolContext.new ctx.instance_eval(&block) if block_given? @data[:tool_config] = ctx end |
#use_when(value) ⇒ Object
89 90 91 |
# File 'lib/kairos_mcp/skills_dsl.rb', line 89 def use_when(value) @data[:use_when] = value end |
#version(value) ⇒ Object
81 82 83 |
# File 'lib/kairos_mcp/skills_dsl.rb', line 81 def version(value) @data[:version] = value end |