Class: LcpRuby::Generators::ClaudeSkillsGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/lcp_ruby/claude_skills_generator.rb

Overview

Installs LCP-specific Claude Code skills (‘.claude/skills/lcp-*`) into the host application by copying them from the gem’s bundled ‘.claude/skills/`. Re-running refreshes the skills to the version shipped with the currently installed gem (useful after `bundle update lcp`) and prunes any `lcp-*` skills the gem no longer ships. Non-`lcp-*` skills are never touched.

This is the skills-only in-app entry; ‘lcp_ruby:agent_setup` composes the same `SkillsInstaller` and additionally writes the CLAUDE.md/AGENTS.md entrypoint. Both call the installer directly (no generator-calls-generator).

Instance Method Summary collapse

Instance Method Details

#install_skillsObject



20
21
22
23
24
25
26
27
28
# File 'lib/generators/lcp_ruby/claude_skills_generator.rb', line 20

def install_skills
  @result = LcpRuby::SkillsInstaller.new(
    target: File.join(destination_root, ".claude", "skills")
  ).call

  @result.created.each { |n| say_status :create, ".claude/skills/#{n}", :green }
  @result.updated.each { |n| say_status :update, ".claude/skills/#{n}", :yellow }
  @result.removed.each { |n| say_status :remove, ".claude/skills/#{n}", :red }
end

#show_post_install_messageObject



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/generators/lcp_ruby/claude_skills_generator.rb', line 30

def show_post_install_message
  return if @result.nil? || !@result.any_changes?

  installed = (@result.created + @result.updated).sort
  say ""
  say "Installed #{installed.size} LCP Ruby Claude Code skill(s):", :green
  installed.each { |n| say "  - #{n}" }
  say ""
  say "Skills auto-trigger in Claude Code based on context (description keywords)."
  say "List available skills via /skills inside Claude Code."
  say ""
  say "Refresh after `bundle update lcp`:"
  say "  bin/rails generate lcp_ruby:claude_skills"
  say ""
end