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) 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 directory 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. Dotted directories (e.g. .git) and nested symlinks are skipped, and a SKILL.md sitting directly at root is not itself a skill. 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) 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.