Documentation
¶
Index ¶
- Constants
- func AgentsSkillsRoot() (string, error)
- func ApplyScope(r *Registry, scope string, projHex string, skillKey string, e SkillEntry)
- func ConfirmInstall(in io.Reader, out io.Writer, meta *SkillsShMeta) (bool, error)
- func DescriptionFromFrontMatter(fm map[string]any) string
- func DisplayNameFromFrontMatter(fm map[string]any, fallback string) string
- func EnrichFrontMatterInteractive(in io.Reader, out io.Writer, fm map[string]any, displayOverride string) error
- func EnsureSkillsAddGlobalYes(cmdLine string) string
- func InstalledSkillCount(projHex, projRoot string) (int, error)
- func IsRemoteMarkdownURL(raw string) bool
- func IsSkillMarkdownSource(raw string) bool
- func ListInstalledSkills(w io.Writer, projHex, projRoot string) error
- func LocateSkillDir(repoRoot string, preferredSkill string) (relDir string, mdAbs string, err error)
- func NormalizeMarkdownSourceURL(raw string) (string, error)
- func NormalizeRepoURL(raw string) (string, error)
- func NormalizeSkillMarkdownSource(raw string) (string, error)
- func ParseAddArgs(parts []string) (*parsedAdd, error)
- func ParseRemoveArgs(parts []string) (string, error)
- func ParseSkillBytes(b []byte) (fm map[string]any, body []byte, err error)
- func ParseSkillFrontMatter(mdPath string) (map[string]any, error)
- func ProjectEntries(r *Registry, projHex string) map[string]SkillEntry
- func RepoOwner(canonicalRepoURL string) string
- func RequireNpm(ctx context.Context) (err error)
- func ReservedSlashCommandNames() map[string]struct{}
- func RunInstall(opts InstallOpts) (err error)
- func RunRemove(opts RemoveOpts) (err error)
- func SaveMirrorJSON(path string, m map[string]SkillEntry) error
- func SaveRegistry(path string, r *Registry) error
- func SkillHelpCommand(name string) string
- func SkillInputPrefillText(entry SkillEntry) (string, error)
- func SkillMarkdownBody(mdPath string) (string, error)
- func SkillUserMessagePayload(entry SkillEntry) (string, error)
- func StableKeyHex(canonicalRepoURL, skillRelPath string) string
- func UniqueDisplayName(r *Registry, canonical, baseDisplay, scope, projHex, skillKey string) string
- func WithRegistryLock(lockPath, registryPath string, fn func(*Registry) error) error
- func WriteInstalledSkillsSections(w io.Writer, r *Registry, projHex, projRoot string) error
- func WriteSkillMarkdown(path string, fm map[string]any, body []byte) error
- func WriteSkillsHelpSection(w io.Writer, cmdColMin int, projHex, projRoot string) error
- type InstallOpts
- type Registry
- type RemoveOpts
- type SkillEntry
- type SkillRefWithKey
- type SkillSearchHit
- type SkillSlashBinding
- type SkillsShMeta
Constants ¶
View Source
const ( DefaultRegistryLockTimeout = 2 * time.Second DefaultRegistryLockRetryDelay = 50 * time.Millisecond )
View Source
const ( ScopeGlobal = "global" ScopeProject = "project" ScopeLocal = "local" )
Variables ¶
This section is empty.
Functions ¶
func AgentsSkillsRoot ¶
func ApplyScope ¶
func ApplyScope(r *Registry, scope string, projHex string, skillKey string, e SkillEntry)
func ConfirmInstall ¶
func InstalledSkillCount ¶
func IsRemoteMarkdownURL ¶
func IsSkillMarkdownSource ¶
func LocateSkillDir ¶
func NormalizeRepoURL ¶
func ParseAddArgs ¶
func ParseRemoveArgs ¶
func ProjectEntries ¶
func ProjectEntries(r *Registry, projHex string) map[string]SkillEntry
func RequireNpm ¶
func ReservedSlashCommandNames ¶
func ReservedSlashCommandNames() map[string]struct{}
func RunInstall ¶
func RunInstall(opts InstallOpts) (err error)
func RunRemove ¶
func RunRemove(opts RemoveOpts) (err error)
func SaveMirrorJSON ¶
func SaveMirrorJSON(path string, m map[string]SkillEntry) error
func SaveRegistry ¶
func SkillHelpCommand ¶
func SkillInputPrefillText ¶
func SkillInputPrefillText(entry SkillEntry) (string, error)
func SkillMarkdownBody ¶
func SkillUserMessagePayload ¶
func SkillUserMessagePayload(entry SkillEntry) (string, error)
func StableKeyHex ¶
func UniqueDisplayName ¶
func WithRegistryLock ¶
func WriteSkillMarkdown ¶
Types ¶
type InstallOpts ¶
type Registry ¶
type Registry struct {
Global map[string]SkillEntry `json:"global"`
Projects map[string]map[string]SkillEntry `json:"projects"`
}
func LoadRegistry ¶
func NewRegistry ¶
func NewRegistry() *Registry
type RemoveOpts ¶
type SkillEntry ¶
type SkillEntry struct {
Name string `json:"name"`
SourceRepo string `json:"source_repo"`
SkillRelPath string `json:"skill_rel_path"`
ClonePath string `json:"clone_path"`
SkillMdPath string `json:"skill_md_path"`
FrontMatter map[string]any `json:"front_matter,omitempty"`
AuditSummary string `json:"audit_summary,omitempty"`
SkillSSHPage string `json:"skillssh_page,omitempty"`
InstalledAt string `json:"installed_at,omitempty"`
}
func LookupSkillBySlashCommand ¶
func LookupSkillBySlashCommand(slashLower string, projHex, projRoot string) (*SkillEntry, error)
func PartitionInstalledSkills ¶
func PartitionInstalledSkills(r *Registry, projHex, projRoot string) (local, project, global []SkillEntry)
func ResolveSkillForLoad ¶
func ResolveSkillForLoad(raw string, projHex, projRoot string) (*SkillEntry, string, error)
type SkillRefWithKey ¶
type SkillRefWithKey struct {
RegistryKey string
Entry SkillEntry
}
func OrderedSkillRefs ¶
func OrderedSkillRefs(r *Registry, projHex, projRoot string) []SkillRefWithKey
type SkillSearchHit ¶
type SkillSearchHit struct {
Name string `json:"name"`
Slash string `json:"slash"`
Description string `json:"description"`
Score float64 `json:"score"`
}
func SearchBestInstalledSkill ¶
func SearchBestInstalledSkill(query string, projHex, projRoot string, minNormalized float64) (*SkillSearchHit, error)
type SkillSlashBinding ¶
type SkillSlashBinding struct {
Slash string
Entry SkillEntry
}
func AssignSkillSlashCommands ¶
func AssignSkillSlashCommands(refs []SkillRefWithKey) []SkillSlashBinding
type SkillsShMeta ¶
type SkillsShMeta struct {
PageURL string
RepoURL string
PreferredSkill string
DisplayName string
AuditSummary string
}
func FetchSkillsShMeta ¶
func FetchSkillsShMeta(ctx context.Context, pageURL string) (*SkillsShMeta, error)
func (*SkillsShMeta) InstallShellCommand ¶
func (m *SkillsShMeta) InstallShellCommand() string
Click to show internal directories.
Click to hide internal directories.