agentskills

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package agentskills validates the agentskills.io SKILL.md format.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanonicalRepoURL added in v0.4.0

func CanonicalRepoURL(repo string) (string, error)

CanonicalRepoURL converts a legacy owner/repo value or validates an HTTPS repository URL. Repository URLs intentionally identify the repository root, not a web UI tree path.

func ExtractName added in v0.4.0

func ExtractName(content []byte) (string, error)

ExtractName parses and validates the name independently of disabled-skill handling. Remote import uses it before deriving a destination path.

func GraftRemote added in v0.4.0

func GraftRemote(content []byte, remote Remote) ([]byte, error)

func InjectRemoteStatus added in v0.4.0

func InjectRemoteStatus(content []byte, status string) ([]byte, error)

func Normalize added in v0.4.0

func Normalize(dirName string, content []byte) (string, []byte, error)

Normalize converts imported skills to OpenLore's strict agentskills.io representation. dirName fixes the identity during sync; when empty, the destination name is derived from the upstream name.

func StripRemote added in v0.4.0

func StripRemote(content []byte) ([]byte, error)

func SurgicalRemoteEdit added in v0.4.0

func SurgicalRemoteEdit(stored, incoming []byte, dirName ...string) ([]byte, bool, error)

SurgicalRemoteEdit accepts a remote-only edit and clears commit when its target changes.

func ValidateName added in v0.4.0

func ValidateName(name string) error

func ValidateRemotePath added in v0.4.0

func ValidateRemotePath(remotePath string) error

ValidateRemotePath accepts only canonical relative repository paths.

Types

type Remote added in v0.4.0

type Remote struct {
	Repo   string `yaml:"repo" json:"repo"`
	Path   string `yaml:"path,omitempty" json:"path,omitempty"`
	Ref    string `yaml:"ref" json:"ref"`
	Commit string `yaml:"commit,omitempty" json:"commit,omitempty"`
	Kind   string `yaml:"kind,omitempty" json:"kind,omitempty"`
}

func ReadRemote added in v0.4.0

func ReadRemote(content []byte) (Remote, bool, error)

type Result

type Result struct{ Disabled bool }

Result describes a parseable skill. Disabled skills bypass ordinary skill fields, but reserved OpenLore fields are always validated.

func Validate

func Validate(dirName string, content []byte) (Result, error)

Validate validates content for the skill directory dirName.

Jump to

Keyboard shortcuts

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