skill

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsName added in v0.2.4

func IsName(name string) bool

IsName reports whether name matches the Agent Skills kebab-case grammar.

func ParseDescription added in v0.2.4

func ParseDescription(body string) string

ParseDescription extracts the catalog description from SKILL.md content.

func ReadFile

func ReadFile(ctx context.Context, reg capsskill.Registry, name, rel string) (capsskill.Content, error)

ReadFile loads a supporting file from the skill directory identified by name.

func RenderLoaded

func RenderLoaded(content capsskill.Content) string

RenderLoaded formats a loaded skill for the model, including resource-base guidance.

func SanitizeRelativePath

func SanitizeRelativePath(rel string) (string, error)

SanitizeRelativePath rejects paths that escape a skill bundle directory.

Types

type InvocationPolicy added in v0.2.4

type InvocationPolicy struct {
	ModelInvocable bool
	UserInvocable  bool
}

InvocationPolicy controls whether a skill appears in model and user catalogs (DSH extension).

type ParseOptions added in v0.2.4

type ParseOptions struct {
	// DirName is the parent directory name for bundle skills. When set, name must match it.
	DirName string
}

ParseOptions configures Agent Skills frontmatter validation.

type Parsed added in v0.2.4

type Parsed struct {
	Name          string
	Description   string
	License       string
	Compatibility string
	AllowedTools  string
	WhenToUse     string
	Invocation    InvocationPolicy
	Metadata      map[string]string
	Content       string
}

Parsed is a validated SKILL.md after frontmatter removal.

func ParseFile added in v0.2.4

func ParseFile(raw string, opts ParseOptions) (Parsed, error)

ParseFile validates SKILL.md content against the Agent Skills spec and deepseek-harness extensions.

type RunResult

type RunResult struct {
	Name     string
	Path     string
	Script   string
	Args     []string
	ExitCode int
	Stdout   string
	Stderr   string
}

RunResult is the outcome of executing one script inside a skill directory.

func RunScript

func RunScript(ctx context.Context, reg capsskill.Registry, name, rel string, args []string, timeout time.Duration) (RunResult, error)

RunScript executes a script relative to the skill directory identified by name.

Jump to

Keyboard shortcuts

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