Class: Pikuri::Skill::Catalog
- Inherits:
-
Object
- Object
- Pikuri::Skill::Catalog
- Defined in:
- lib/pikuri/skill/catalog.rb
Overview
Discovery + validation of skills — Markdown files with YAML frontmatter that the agent loads on demand via SkillTool.
A skill is a directory containing a SKILL.md whose frontmatter
declares name and description. Sibling files (scripts,
references, templates) are sidecar content the LLM pulls in via
the regular read tool against File.dirname(location). Pikuri
implements the Agent Skills standard leniently — only a missing description is fatal.
Two concrete subclasses ship: Empty (the EMPTY singleton)
and Bundled (the on-disk scanner). Hosts that read skills from
something other than the filesystem (virtual FS, hardcoded
registry) subclass directly.
Defined Under Namespace
Classes: Bundled, Empty, Skill
Constant Summary collapse
- MAX_NAME_LENGTH =
Frontmatter
namecap per the Agent Skills standard. 64- MAX_DESCRIPTION_LENGTH =
Frontmatter
descriptioncap per the Agent Skills standard. 1024- EMPTY =
Shared singleton for the no-skills case.
Empty.new.freeze
Instance Method Summary collapse
-
#empty? ⇒ Boolean
True when #list is empty; an empty catalog contributes no tool and no prompt block.
- #get(name) ⇒ Skill?
-
#list ⇒ Array<Skill>
Skills in discovery order (which equals precedence order).
-
#roots ⇒ Array<String>
Absolute paths of the skill directories this catalog covers.
-
#untrusted_level ⇒ Symbol
The
untrustedtrifecta leg SkillTool declares.
Instance Method Details
#empty? ⇒ Boolean
Returns true when #list is empty; an empty catalog contributes no tool and no prompt block.
85 86 87 |
# File 'lib/pikuri/skill/catalog.rb', line 85 def empty? list.empty? end |
#get(name) ⇒ Skill?
79 80 81 |
# File 'lib/pikuri/skill/catalog.rb', line 79 def get(name) raise NotImplementedError, "#{self.class}#get must be implemented" end |
#list ⇒ Array<Skill>
Returns skills in discovery order (which equals precedence order).
72 73 74 |
# File 'lib/pikuri/skill/catalog.rb', line 72 def list raise NotImplementedError, "#{self.class}#list must be implemented" end |
#roots ⇒ Array<String>
Absolute paths of the skill directories this catalog covers.
Hosts wire these into +Pikuri::Workspace::Filesystem+'s
readable: list so the LLM can read sidecar files.
95 96 97 |
# File 'lib/pikuri/skill/catalog.rb', line 95 def roots raise NotImplementedError, "#{self.class}#roots must be implemented" end |
#untrusted_level ⇒ Symbol
The untrusted trifecta leg SkillTool declares.
:hard in the base class: a subclass loading skills from somewhere
this class cannot see makes no claim about their provenance, and
silence buys the pessimistic value.
67 |
# File 'lib/pikuri/skill/catalog.rb', line 67 def untrusted_level = :hard |