skill

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 26, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LangPython = "python"
	LangNode   = "node"
	LangBash   = "bash"
)

Supported language runtimes.

Variables

This section is empty.

Functions

This section is empty.

Types

type Resources

type Resources struct {
	CPU    string `json:"cpu,omitempty" yaml:"cpu,omitempty"`
	Memory string `json:"memory,omitempty" yaml:"memory,omitempty"`
}

Resources describes the CPU and memory constraints for a skill execution.

type Skill

type Skill struct {
	Name         string
	Version      string
	Description  string
	Lang         string // python | node | bash
	Image        string // Docker image; empty means use DefaultImage()
	Timeout      time.Duration
	Resources    Resources
	Instructions string // body text after the frontmatter
}

Skill is the fully parsed and validated representation of a SKILL.md file.

func ParseSkillMD

func ParseSkillMD(data []byte) (*Skill, error)

ParseSkillMD extracts the YAML frontmatter (between two "---" lines) and the body from a SKILL.md file. It returns the parsed Skill with Validate() already called on it, or an error.

func (*Skill) DefaultImage

func (s *Skill) DefaultImage() string

DefaultImage returns the canonical Docker image for the skill's language. If a custom Image is already set on the Skill it is returned as-is.

func (*Skill) Validate

func (s *Skill) Validate() error

Validate checks that the skill's required fields are present and that enum and format constraints are satisfied.

type SkillMetadata

type SkillMetadata struct {
	Name         string    `json:"name"`
	Version      string    `json:"version"`
	Description  string    `json:"description"`
	Lang         string    `json:"lang"`
	Image        string    `json:"image,omitempty"`
	Instructions string    `json:"instructions,omitempty"`
	Timeout      string    `json:"timeout,omitempty"`
	Resources    Resources `json:"resources,omitempty"`
}

SkillMetadata is the subset of Skill returned in list/get API responses.

type SkillSummary

type SkillSummary struct {
	Name        string `json:"name"`
	Version     string `json:"version"`
	Description string `json:"description"`
	Lang        string `json:"lang"`
}

SkillSummary is the compact representation returned by list endpoints. It includes description so agents can decide which skill to use.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL