skills

package
v1.54.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExpandCommands added in v1.32.5

func ExpandCommands(ctx context.Context, content, workDir string) string

ExpandCommands replaces all !`command` patterns in the given content with the stdout of executing each command via the system shell. Commands are executed with the specified working directory. If a command fails, the pattern is replaced with an error message rather than failing the entire expansion.

Types

type Skill

type Skill struct {
	Name          string
	Description   string
	FilePath      string
	BaseDir       string
	Files         []string
	Local         bool // true for filesystem-loaded skills, false for remote
	License       string
	Compatibility string
	Metadata      map[string]string
	AllowedTools  []string
	Context       string // "fork" to run the skill as an isolated sub-agent
	// Model is an optional model override applied while the skill runs as
	// a sub-agent (context: fork). It accepts either a named model from the
	// agent config or an inline "provider/model" reference (e.g.
	// "openai/gpt-4o-mini"). It is ignored for non-fork skills.
	Model string
}

Skill represents a loaded skill with its metadata and content location.

func Load

func Load(sources []string) []Skill

Load discovers and loads skills from the given sources. Each source is either "local" (for filesystem-based skills) or an HTTP/HTTPS URL (for remote skills per the well-known skills discovery spec).

Local skills are loaded from (in order, later overrides earlier):

Global locations (under $HOME):

  • ~/.codex/skills/ (recursive)
  • ~/.claude/skills/ (flat)
  • ~/.agents/skills/ (recursive)

Project locations (under cwd, closest wins):

  • .claude/skills/ (flat, only at cwd)
  • .agents/skills/ (flat, scanned from git root to cwd)

The returned slice is sorted by skill name for deterministic ordering.

func (Skill) IsFork added in v1.32.5

func (s Skill) IsFork() bool

IsFork returns true when the skill should be executed in an isolated sub-agent context rather than inline in the current conversation. This matches Claude Code's `context: fork` frontmatter syntax.

Jump to

Keyboard shortcuts

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