Class: Iron::Generators::AgentsGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/iron/agents/agents_generator.rb

Constant Summary collapse

IRON_SECTION_HEADING =
"## Iron CMS".freeze

Instance Method Summary collapse

Instance Method Details

#create_skillObject



13
14
15
# File 'lib/generators/iron/agents/agents_generator.rb', line 13

def create_skill
  copy_file "SKILL.md", ".claude/skills/iron-cms/SKILL.md"
end

#display_instructionsObject



25
26
27
28
29
30
31
32
33
34
35
# File 'lib/generators/iron/agents/agents_generator.rb', line 25

def display_instructions
  return if options[:quiet]

  say "\n=== Iron CMS Agent Setup Complete ===\n", :green
  say "Created:"
  say "  - .claude/skills/iron-cms/SKILL.md (the full Iron CMS workflow for coding agents)"
  say "  - AGENTS.md with an Iron CMS section (command crib sheet)"
  say "\nNext steps:"
  say "1. Run bin/rails iron:schema:dump to materialize db/cms/schema.json."
  say "2. Read .claude/skills/iron-cms/SKILL.md for the schema and content workflow."
end

#update_agents_mdObject



17
18
19
20
21
22
23
# File 'lib/generators/iron/agents/agents_generator.rb', line 17

def update_agents_md
  if File.exist?(agents_md_path)
    append_to_file "AGENTS.md", "\n#{iron_section}" unless iron_section_present?
  else
    create_file "AGENTS.md", iron_section
  end
end