Class: Generators::Avo::SkillsGenerator
- Inherits:
-
BaseGenerator
- Object
- Rails::Generators::Base
- BaseGenerator
- Generators::Avo::SkillsGenerator
- Defined in:
- lib/generators/avo/skills_generator.rb
Overview
Installs the Avo skills loader into the host app.
Only the loader is written — the skills themselves stay inside the gem, which is the point: a copied skill tree drifts from the locked Avo version with nothing to refresh it.
There is one way to run this and it asks. No flags: a flag per question is a second surface to document, keep in step with the screens, and get wrong.
Constant Summary collapse
- AGENTS =
Claude Code scans .claude/skills; .agents/skills is the cross-agent convention; .cursor/skills is what Cursor reads.
{ "agents" => {dir: ".agents/skills/avo", label: ".agents/skills", hint: "Codex, Gemini CLI, Goose, Amp, OpenCode"}, "claude" => {dir: ".claude/skills/avo", label: ".claude/skills", hint: "Claude Code"}, "cursor" => {dir: ".cursor/skills/avo", label: ".cursor/skills", hint: "Cursor"} }.freeze
- CANONICAL =
The copy the others link to. Vendor-neutral on purpose: the real file should not live in a directory named after one tool.
"agents"- LEGACY_ROOTS =
Where a pre-gem install of avo-hq/skills left its catalog, and where an early 4.1.1 install left the resolver we no longer ship.
[".claude/skills", ".agents/skills", ".cursor/skills"].freeze
- GLOBAL_LEGACY_ROOT =
"~/.claude/skills"
Instance Method Summary collapse
Methods inherited from BaseGenerator
Constructor Details
This class inherits a constructor from Generators::Avo::BaseGenerator
Instance Method Details
#clean_legacy_skills ⇒ Object
52 53 54 55 56 57 |
# File 'lib/generators/avo/skills_generator.rb', line 52 def clean_legacy_skills return if answers.cancelled? remove_or_report(legacy_skill_dirs, remove: remove_legacy?) remove_or_report(shared_legacy_skill_dirs, remove: remove_shared_legacy?) end |
#install_loader ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/generators/avo/skills_generator.rb', line 38 def install_loader return if answers.cancelled? canonical = nil destinations.each do |dir| if canonical.nil? || !link? copy_file "skills/SKILL.md", File.join(dir, "SKILL.md") canonical ||= dir else link_or_copy(canonical, dir) end end end |