Documentation
¶
Index ¶
- func ReadLocalSkillFiles(c Candidate) (map[string]string, error)
- type Adder
- func (a *Adder) Add(ctx context.Context, targetRepo string, candidates []Candidate) error
- func (a *Adder) AddPackageRef(ctx context.Context, targetRepo, packageRepo string) error
- func (a *Adder) DiscoverLocal(st *state.State) ([]Candidate, error)
- func (a *Adder) DiscoverRemote(targetManifest *manifest.Manifest, ...) []Candidate
- type Candidate
- type SkillAddErrorMsg
- type SkillAddedMsg
- type SkillAddingMsg
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadLocalSkillFiles ¶
ReadLocalSkillFiles reads all files from a local skill directory and returns them as a map of "skills/<name>/<relative-path>" → content string. Used when uploading a local-only skill to a registry. Rejects symlinks and files larger than maxFileSize.
Types ¶
type Adder ¶
Adder wires discovery and GitHub push together. Emits events via the Emit callback — the caller decides output format.
func (*Adder) Add ¶
Add pushes one or more skills to the target registry's scribe.yaml on GitHub in a single atomic commit. For each candidate: adds a source reference or uploads files + self-reference. Emits events throughout.
func (*Adder) AddPackageRef ¶
AddPackageRef fetches a package manifest from packageRepo and adds a package catalog entry to the target registry's scribe.yaml. The package's declared per-tool install commands (package.installs) are copied into the catalog entry; the global install field is used as a fallback if no per-tool commands are declared.
func (*Adder) DiscoverLocal ¶
DiscoverLocal scans ~/.claude/skills/ and ~/.scribe/skills/ for skills on disk. Cross-references state for source info. Deduplicates by name (first seen wins).
func (*Adder) DiscoverRemote ¶
func (a *Adder) DiscoverRemote(targetManifest *manifest.Manifest, otherManifests map[string]*manifest.Manifest) []Candidate
DiscoverRemote finds skills in other registries that are not in the target registry. Takes pre-fetched manifests to keep GitHub calls in the cmd layer.
type Candidate ¶
type Candidate struct {
Name string // skill name (directory basename)
Description string // short description from SKILL.md
RawDescription string // untruncated description from SKILL.md
Origin string // "local" or "registry:owner/repo"
Package string // parent package name if sub-skill (e.g. "gstack")
Source string // "github:owner/repo@ref" or empty for local-only
Attribution discovery.Source
LocalPath string // absolute path on disk, empty for remote-only
}
Candidate represents a skill that can be added to a registry.
func (Candidate) NeedsUpload ¶
NeedsUpload reports whether this candidate requires uploading files to the registry (as opposed to just adding a source reference to scribe.yaml).
type SkillAddErrorMsg ¶
SkillAddErrorMsg is sent when adding a skill fails.
type SkillAddedMsg ¶
SkillAddedMsg is sent when a skill is successfully added to the registry.
type SkillAddingMsg ¶
SkillAddingMsg is sent when a skill push to GitHub begins.