Documentation
¶
Overview ¶
Package skills implements skill packaging from git repositories into OCI artifacts.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PushSkill ¶
func PushSkill(ctx context.Context, result *BuildResult) error
PushSkill pushes a built skill OCI artifact to a remote registry. The BuildResult must contain a valid store and package result.
func ValidateSkill ¶
func ValidateSkill(ctx context.Context, spec *SkillSpec) (*gitresolver.ResolveResult, error)
ValidateSkill clones a skill from a git repository and validates its SKILL.md. Returns the resolved metadata without packaging.
Types ¶
type BuildResult ¶
type BuildResult struct {
// PackageResult from the OCI packager
PackageResult *ociskills.PackageResult
// Store is the local OCI store containing the built artifact
Store *ociskills.Store
// CommitHash is the git commit hash that was resolved
CommitHash string
// SkillName is the skill name from SKILL.md
SkillName string
// ImageRef is the full OCI reference for the artifact
ImageRef string
// contains filtered or unexported fields
}
BuildResult contains the result of building a skill into an OCI artifact.
func BuildSkill ¶
func BuildSkill(ctx context.Context, spec *SkillSpec) (*BuildResult, error)
BuildSkill clones a skill from a git repository and packages it as an OCI artifact.
func (*BuildResult) Cleanup ¶
func (r *BuildResult) Cleanup()
Cleanup removes the temporary directory containing the OCI store and skill files.
type SkillMetadata ¶
type SkillMetadata struct {
Name string `yaml:"name"`
Description string `yaml:"description,omitempty"`
}
SkillMetadata contains basic information about the skill.
type SkillProvenance ¶
type SkillProvenance struct {
RepositoryURI string `yaml:"repository_uri,omitempty"`
RepositoryRef string `yaml:"repository_ref,omitempty"`
}
SkillProvenance contains supply chain provenance information for a skill.
type SkillSourceSpec ¶
type SkillSourceSpec struct {
Repository string `yaml:"repository"` // HTTPS clone URL (e.g., "https://github.com/org/repo")
Ref string `yaml:"ref"` // Git tag, branch, or commit hash
Path string `yaml:"path,omitempty"` // Subdirectory within repo (empty = repo root)
Version string `yaml:"version"` // Version for OCI artifact tag
}
SkillSourceSpec defines the git source for a skill.
type SkillSpec ¶
type SkillSpec struct {
// Metadata about the skill
Metadata SkillMetadata `yaml:"metadata"`
// Spec defines the git source and version
Spec SkillSourceSpec `yaml:"spec"`
// Provenance information for supply chain security
Provenance SkillProvenance `yaml:"provenance,omitempty"`
}
SkillSpec defines the structure of a skill spec.yaml configuration file.
func LoadSkillSpec ¶
LoadSkillSpec loads and validates a skill spec.yaml file.
func (*SkillSpec) GitReferenceURI ¶
GitReferenceURI constructs a git:// URI from the spec fields for use with toolhive's gitresolver. Format: git://host/owner/repo[@ref][#path]