Class: AgentSkills::Generator

Inherits:
Object
  • Object
show all
Defined in:
lib/agent_skills/generator.rb

Constant Summary collapse

SKILL_TEMPLATE =
"---\nname: %<name>s\ndescription: %<description>s\n---\n\n# %<title>s\n\n## Instructions\n\n[Add step-by-step instructions here]\n\n## Examples\n\n### Input\n[Example input]\n\n### Output\n[Expected output]\n\n## Guidelines\n\n- [Add guidelines here]\n"

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path:, name:, description:, **options) ⇒ Generator

Returns a new instance of Generator.



34
35
36
37
38
39
# File 'lib/agent_skills/generator.rb', line 34

def initialize(path:, name:, description:, **options)
  @path = path
  @name = name
  @description = description
  @options = options
end

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



32
33
34
# File 'lib/agent_skills/generator.rb', line 32

def description
  @description
end

#nameObject (readonly)

Returns the value of attribute name.



32
33
34
# File 'lib/agent_skills/generator.rb', line 32

def name
  @name
end

#optionsObject (readonly)

Returns the value of attribute options.



32
33
34
# File 'lib/agent_skills/generator.rb', line 32

def options
  @options
end

#pathObject (readonly)

Returns the value of attribute path.



32
33
34
# File 'lib/agent_skills/generator.rb', line 32

def path
  @path
end

Class Method Details

.create(path:, name:, description:, **options) ⇒ Object



41
42
43
# File 'lib/agent_skills/generator.rb', line 41

def self.create(path:, name:, description:, **options)
  new(path: path, name: name, description: description, **options).create
end

Instance Method Details

#createObject



45
46
47
48
49
50
# File 'lib/agent_skills/generator.rb', line 45

def create
  validate_inputs!
  create_directories
  create_skill_md
  skill_path
end