Documentation
¶
Index ¶
- func Apply(cfg *types.Config, baseDir string) error
- func HarvestPack(root string) ([]types.Skill, error)
- func LoadRegistry(baseDir string) (*registry.Registry[Entry], error)
- func SkillsDir(baseDir string) string
- type Entry
- type Manager
- func (mgr *Manager) Install(src, ref string, link bool) (string, []types.Skill, error)
- func (mgr *Manager) InstallDir(dir, name, sourceURL string) (string, []types.Skill, error)
- func (mgr *Manager) LinkTarget(name string) (string, bool)
- func (mgr *Manager) List() ([]Entry, error)
- func (mgr *Manager) Remove(name string) error
- func (mgr *Manager) SetEnabled(name string, enabled bool) error
- func (mgr *Manager) Skills(name string) ([]types.Skill, error)
- func (mgr *Manager) Update(name string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Apply ¶
Apply merges every enabled pack's skills into cfg. Precedence is packs < user: a user skill of the same name wins; a pack-vs-pack clash is last-wins with a warning. Call this BEFORE plugin.Apply so packs also win over plugin skills (plugin.Apply skips names already present in cfg.Skills).
func HarvestPack ¶
HarvestPack walks a skill-pack root and returns every contributed skill. Discovery is recursive: any subdirectory containing a SKILL.md is a skill, its Name taken from the file's frontmatter (falling back to the directory name) and its Dir set to that directory so the load_skill tool can resolve bundled scripts and references. Once a directory is recognized as a skill its subtree is pruned — a skill's own references/examples cannot define further skills.
Precedence when the root itself holds a SKILL.md: subdirectory skills win. If the recursive walk finds ≥1 skill, those are returned and a root SKILL.md is treated as a pack overview and ignored — so a multi-skill pack that ships an overview SKILL.md at its root still contributes its real subdirectory skills. Only when the walk yields ZERO skills AND a root SKILL.md exists is the root itself the single skill (Name from its frontmatter, falling back to filepath.Base(root), Dir=root) — this supports a bare fetched SKILL.md / the agentskills.io single-file form installed via InstallDir.
Dotted directories (e.g. .git) and nested symlinks are skipped. A missing or unreadable directory yields no skills and no error.
func LoadRegistry ¶
LoadRegistry reads <baseDir>/skills.yaml, returning an empty registry if the file does not exist yet.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager performs skill-pack install/update/remove against a base directory.
func NewManager ¶
NewManager returns a Manager rooted at baseDir (use plugin.BaseDir() in prod).
func (*Manager) Install ¶
Install clones/copies a skill pack, verifies it contributes at least one skill, places it at skills/<name>, and records it in the registry as DISABLED. It returns the derived pack name and the harvested skills (with Dir set to their final on-disk location).
func (*Manager) InstallDir ¶ added in v0.4.0
InstallDir installs an already-prepared local skill directory (e.g. an unzipped archive or a fetched SKILL.md) as pack <name>, DISABLED. Unlike Install it does no git/link handling: dir is copied verbatim. sourceURL is recorded as the pack's registry provenance (the original .zip path or SKILL.md URL) — not dir, which is a throwaway extraction temp dir.
func (*Manager) LinkTarget ¶ added in v0.2.3
LinkTarget reports whether an installed pack is a symlink (a --link install) and, if so, the path it points at.
func (*Manager) SetEnabled ¶
SetEnabled flips a pack's enabled flag in the registry.