Class: Nexo::Generators::SkillGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Defined in:
lib/generators/nexo/skill/skill_generator.rb

Overview

Scaffolds an Agent Skills package in a host Rails app:

rails g nexo:skill triage

creates app/skills/triage/SKILL.md (valid frontmatter + placeholder process steps, per agentskills.io/specification) and a kept app/skills/triage/references/ directory for supporting docs the skill can cite. Reference it from an agent with the skills :triage macro.

Rails-coupled, like Nexo's other generators: it requires rails/generators at load time and is never autoloaded by the plain-Ruby core, so require "nexo" with no Rails present neither defines nor fails on it.

Instance Method Summary collapse

Instance Method Details

#create_skill_packageObject

Generation step: scaffold app/skills/<name>/ with a kept references/ directory and a valid SKILL.md rendered from the template.



25
26
27
28
29
30
# File 'lib/generators/nexo/skill/skill_generator.rb', line 25

def create_skill_package
  empty_directory File.join(skill_root, "references")
  # An empty references/ would not survive git; .keep keeps it tracked.
  create_file File.join(skill_root, "references", ".keep")
  template "SKILL.md.tt", File.join(skill_root, "SKILL.md")
end