Class: AgentSkills::Generator

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

Constant Summary collapse

SKILL_TEMPLATE =
<<~SKILL
  ---
  name: %<name>s
  description: %<description>s
  ---

  # %<title>s

  ## Instructions

  [Add step-by-step instructions here]

  ## Examples

  ### Input
  [Example input]

  ### Output
  [Expected output]

  ## Guidelines

  - [Add guidelines here]
SKILL

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

#description ⇒ Object (readonly)

Returns the value of attribute description.



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

def description
  @description
end

#name ⇒ Object (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#options ⇒ Object (readonly)

Returns the value of attribute options.



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

def options
  @options
end

#path ⇒ Object (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

#create ⇒ Object



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