manifest

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package manifest loads, validates, and saves the gskill.toml manifest that records install intent.

Index

Constants

View Source
const SchemaVersion = 1

SchemaVersion is the manifest schema this build understands (FR-006).

Variables

View Source
var (
	// ErrUnsupportedSchema is returned for a schema_version newer than this build.
	ErrUnsupportedSchema = errors.New("unsupported manifest schema version")
	// ErrInvalid is returned for a structurally or semantically invalid manifest.
	ErrInvalid = errors.New("invalid manifest")
)

Sentinel manifest errors.

Functions

func Marshal

func Marshal(m *Manifest) ([]byte, error)

Marshal serializes the manifest to TOML.

func Save

func Save(path string, m *Manifest) error

Save writes the manifest to path atomically.

Types

type Defaults

type Defaults struct {
	Agents      []string `toml:"agents,omitempty"`
	InstallMode string   `toml:"install_mode,omitempty"`
	Scope       string   `toml:"scope,omitempty"`
}

Defaults are project-wide defaults applied when a skill omits a setting.

type Manifest

type Manifest struct {
	SchemaVersion int              `toml:"schema_version"`
	Defaults      Defaults         `toml:"defaults,omitempty"`
	Skills        map[string]Skill `toml:"skills,omitempty"`
}

Manifest is the human-editable record of install intent (FR-002).

func Load

func Load(path string) (*Manifest, error)

Load reads and parses the manifest at path.

func New

func New() *Manifest

New returns an empty manifest at the current schema version.

func Unmarshal

func Unmarshal(data []byte) (*Manifest, error)

Unmarshal parses manifest bytes, rejecting a newer schema and unknown top-level sections, then validates (FR-002, FR-006).

func (*Manifest) Validate

func (m *Manifest) Validate() error

Validate checks schema, names, sources, and enum fields (FR-002, FR-013).

type Skill

type Skill struct {
	Source      string   `toml:"source"`
	Path        string   `toml:"path,omitempty"`
	Version     string   `toml:"version,omitempty"`
	Ref         string   `toml:"ref,omitempty"`
	Commit      string   `toml:"commit,omitempty"`
	Agents      []string `toml:"agents,omitempty"`
	InstallMode string   `toml:"install_mode,omitempty"`
}

Skill is one declared skill's intent.

Jump to

Keyboard shortcuts

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