Class: HunkReviewChanges::Installer::DirectoryInstaller

Inherits:
Base
  • Object
show all
Defined in:
lib/hunk_review_changes/installer/directory_installer.rb

Overview

Base for agents that have no install CLI (Codex, Cursor, OpenCode). They all scan a skills directory for <name>/SKILL.md, so installing means copying the skill out of the marketplace checkout into that directory. Subclasses supply the directory and how the agent is detected.

Direct Known Subclasses

Codex, Cursor, OpenCode

Instance Method Summary collapse

Methods inherited from Base

#detected?, #key, #label

Instance Method Details

#install!(source) ⇒ Object



17
18
19
20
21
22
23
24
25
26
# File 'lib/hunk_review_changes/installer/directory_installer.rb', line 17

def install!(source)
  target = File.join(skills_root, SKILL_NAME)
  FileUtils.mkdir_p(target)
  FileUtils.cp_r(File.join(source.skill_dir, "."), target)
  ok("copied skill to #{pretty(target)} (restart #{label} to pick it up)")
rescue SkillSource::Error => e
  failure(e.message)
rescue StandardError => e
  failure("could not copy skill: #{e.message}")
end

#skills_rootObject

Absolute path to the agent's user-level skills directory.

Raises:

  • (NotImplementedError)


15
# File 'lib/hunk_review_changes/installer/directory_installer.rb', line 15

def skills_root = raise NotImplementedError