Class: ClaudeMemory::Commands::InstallSkillCommand

Inherits:
BaseCommand
  • Object
show all
Defined in:
lib/claude_memory/commands/install_skill_command.rb

Overview

Installs embedded skill files (agent definitions) to ~/.claude/commands/ for use as Claude Code slash commands.

Constant Summary collapse

SKILLS_DIR =
File.expand_path("../skills", __FILE__)
AVAILABLE_SKILLS =
{
  "memory-recall" => {
    file: "memory-recall.md",
    description: "Memory recall agent — chains recall → explain → fact_graph"
  },
  "distill-transcripts" => {
    file: "distill-transcripts.md",
    description: "Distill transcripts — extract facts/entities/decisions from undistilled content"
  }
}.freeze

Instance Attribute Summary

Attributes inherited from BaseCommand

#stderr, #stdin, #stdout

Instance Method Summary collapse

Methods inherited from BaseCommand

#initialize

Constructor Details

This class inherits a constructor from ClaudeMemory::Commands::BaseCommand

Instance Method Details

#call(args) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/claude_memory/commands/install_skill_command.rb', line 21

def call(args)
  opts = parse_options(args, {list: false, force: false}) do |o|
    OptionParser.new do |parser|
      parser.banner = "Usage: claude-memory install-skill [SKILL_NAME] [options]"
      parser.on("--list", "List available skills") { o[:list] = true }
      parser.on("--force", "Overwrite existing files") { o[:force] = true }
    end
  end
  return 1 if opts.nil?

  if opts[:list] || args.empty?
    return list_skills
  end

  skill_name = args.first
  install_skill(skill_name, force: opts[:force])
end