Documentation
¶
Index ¶
- Constants
- Variables
- type Discoverer
- type DiscoveryPath
- type GitProvider
- type GitSource
- type InstallOptions
- type InstalledSkill
- type LockEntry
- type LockFile
- type Parser
- type Skill
- type SkillManager
- func (i *SkillManager) Delete(name string) error
- func (i *SkillManager) Install(ctx context.Context, source *Source, opts InstallOptions) ([]*InstalledSkill, error)
- func (i *SkillManager) List() ([]*InstalledSkill, error)
- func (i *SkillManager) Update(ctx context.Context, name string) ([]*InstalledSkill, error)
- type SkillScope
- type Source
- type URLSource
Constants ¶
const ( SkillFileName = "SKILL.md" MaxNameLength = 64 MaxDescriptionLength = 1024 MinDescriptionLength = 1 )
Variables ¶
var ( ErrMissingName = errors.New("skill name is required") ErrMissingDescription = errors.New("skill description is required") ErrNameTooLong = fmt.Errorf("skill name must not exceed %d characters", MaxNameLength) ErrDescriptionTooLong = fmt.Errorf("skill description must not exceed %d characters", MaxDescriptionLength) ErrInvalidNameFormat = errors.New("skill name must be lowercase alphanumeric with hyphens only") ErrNameMismatch = errors.New("skill name must match directory name") ErrNoFrontmatter = errors.New("SKILL.md must contain YAML frontmatter delimited by ---") )
Functions ¶
This section is empty.
Types ¶
type Discoverer ¶
type Discoverer struct {
// contains filtered or unexported fields
}
func NewDiscoverer ¶
func NewDiscoverer(fs afero.Fs, userInfo shared.UserInfo) *Discoverer
type DiscoveryPath ¶
type DiscoveryPath struct {
Pattern string
Scope SkillScope
IsRelative bool
}
func DefaultDiscoveryPaths ¶
func DefaultDiscoveryPaths(userInfo shared.UserInfo) []DiscoveryPath
type GitProvider ¶
type GitProvider string
GitProvider identifies the git hosting service.
const ( GitProviderGitHub GitProvider = "github" GitProviderGitLab GitProvider = "gitlab" )
type GitSource ¶
type GitSource struct {
Provider GitProvider `json:"provider"`
CloneURL string `json:"clone_url"`
Path string `json:"path"`
Ref string `json:"ref"`
TreeHash string `json:"tree_hash"`
}
GitSource represents a skill installed from a git repository.
type InstallOptions ¶
type InstallOptions struct {
Force bool // Overwrite existing skills
SkillNames []string // Install only specific skill(s), empty means all
}
InstallOptions configures the installation behavior.
type InstalledSkill ¶
type InstalledSkill struct {
*Skill
InstalledAt time.Time
UpdatedAt time.Time
Git *GitSource
URL *URLSource
}
InstalledSkill represents a skill with its installation metadata.
type LockEntry ¶
type LockEntry struct {
InstalledAt time.Time `json:"installed_at"`
UpdatedAt time.Time `json:"updated_at"`
Git *GitSource `json:"git,omitempty"`
URL *URLSource `json:"url,omitempty"`
}
LockEntry represents a single skill entry in the lock file.
type Skill ¶
type Skill struct {
Name string `yaml:"name"`
Description string `yaml:"description"`
Location string `yaml:"-"`
Scope SkillScope `yaml:"-"`
}
type SkillManager ¶
type SkillManager struct {
// contains filtered or unexported fields
}
SkillManager handles skill installation, deletion, and updates.
func NewSkillManager ¶
func NewSkillManager(fs afero.Fs, userInfo shared.UserInfo) *SkillManager
func (*SkillManager) Delete ¶
func (i *SkillManager) Delete(name string) error
Delete removes an installed skill.
func (*SkillManager) Install ¶
func (i *SkillManager) Install(ctx context.Context, source *Source, opts InstallOptions) ([]*InstalledSkill, error)
Install installs skills from the given source.
func (*SkillManager) List ¶
func (i *SkillManager) List() ([]*InstalledSkill, error)
List returns all installed skills.
func (*SkillManager) Update ¶
func (i *SkillManager) Update(ctx context.Context, name string) ([]*InstalledSkill, error)
Update updates installed skills to their latest versions.
type SkillScope ¶
type SkillScope string
const ( SkillScopeRepo SkillScope = "repo" SkillScopeUser SkillScope = "user" SkillScopeSystem SkillScope = "system" )
type Source ¶
type Source struct {
Provider GitProvider
CloneURL string
Path string // path within repo
Ref string // branch/tag, default "main"
DirectURL string // direct URL to SKILL.md
}
Source is the parsed user input (used during install).
func ParseSource ¶
ParseSource parses a source string into a SourceInfo. Supported formats: - owner/repo (GitHub shorthand) - owner/repo/path (GitHub shorthand with path) - github.com/owner/repo/tree/branch/path - gitlab.com/owner/repo/-/tree/branch/path - Direct URL ending in /SKILL.md