skills

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SourceBundled  = internalskills.SourceBundled
	SourceCommands = internalskills.SourceCommands
	SourcePlugin   = internalskills.SourcePlugin
	SourceManaged  = internalskills.SourceManaged
	SourceMCP      = internalskills.SourceMCP
)

Variables

This section is empty.

Functions

func GetBuiltinSkillsPath

func GetBuiltinSkillsPath() string

GetBuiltinSkillsPath returns the directory of the built-in skills under the skills root.

func GetManagedSkillsPath

func GetManagedSkillsPath() string

GetManagedSkillsPath returns the directory for admin-managed (policy) skills. Respects SESHAT_RUNTIME_ROOT so the path moves with the deployment.

func GetSkillReposPath

func GetSkillReposPath() string

GetSkillReposPath returns the directory where skill repositories are cloned, under the skills root.

func GetSkillsRootPath

func GetSkillsRootPath() string

GetSkillsRootPath returns the directory under the runtime root that holds all the skills.

func GetUserSkillsPath

func GetUserSkillsPath() string

GetUserSkillsPath returns the default single-user skill path (legacy CLI mode).

func GetUserSkillsPathForUser

func GetUserSkillsPathForUser(userID string) string

GetUserSkillsPathForUser returns the directory of the skills of a user: the shared user directory when userID is blank, a directory of that user otherwise.

func MCPHealth

func MCPHealth() map[string]string

MCPHealth reports the state of MCP for the skills: "not initialized", or the number and the names of the connected servers.

func MCPServers

func MCPServers() []string

MCPServers returns the names of the connected MCP servers, or an empty list when MCP is not initialised.

func ParseBooleanFrontmatter

func ParseBooleanFrontmatter(value interface{}) bool

ParseBooleanFrontmatter reads a boolean from a YAML header value: a boolean as it is, the text "true" (any case) or "1" as true, a non-zero integer as true, and anything else as false.

func ReadEnabled

func ReadEnabled(path string) bool

ReadEnabled reads the user-invocable (enabled) status of a skill.md file. Returns true when the file cannot be read or the field is absent.

func RegisterAlias

func RegisterAlias(alias string, target string)

RegisterAlias makes the skill tool accept alias as another name for the skill target: invoking alias through the skill tool runs target. Call it before the session starts; the registry is process-wide and not persisted.

func UserPath

func UserPath(userID string) string

UserPath returns the directory of the skills of a user: the shared user directory when userID is blank, a directory of that user otherwise.

Types

type Alias

type Alias = internalskills.SkillAlias

Alias maps a skill name to the skill it stands for: using the Alias name runs the Target skill.

func Aliases

func Aliases() []Alias

Aliases returns the skill aliases that were registered.

type FrontmatterData

type FrontmatterData = internalskills.FrontmatterData

FrontmatterData is the YAML header of a skill file (name, description, when to use it, allowed tools, arguments, model, invocation rules, version...), as it was written.

func ParseFrontmatter

func ParseFrontmatter(content string, filePath string) (FrontmatterData, string)

ParseFrontmatter splits a skill file into its YAML header and its body. A file that does not start with a "---" header gives an empty FrontmatterData and the whole content.

type Skill

type Skill = internalskills.Skill

Skill is a skill the model can use: its name and description, when to use it, the tools it may call, its arguments, the model and effort it asks for, whether the user or the model may invoke it, and the instructions it carries. Where it was loaded from is in Source and LoadedFrom.

func All

func All(cwd string) ([]Skill, error)

All returns the skills available for the working directory cwd: those found in files, with the project's overriding the managed, user and built-in ones, then the bundled skills, which have the lowest priority.

func AllForUser

func AllForUser(cwd string, userID string) ([]Skill, error)

AllForUser is All for a given user: it also reads the skills of that user's own directory.

func Bundled

func Bundled() []Skill

Bundled returns the skills that ship with the runtime.

func DiscoverMCP

func DiscoverMCP(ctx context.Context) ([]Skill, error)

DiscoverMCP returns the skills offered by the MCP servers that are connected: one per tool they expose. Cancelling ctx stops the listing.

func ForContext

func ForContext(cwd string, filePaths []string, userID string) ([]Skill, error)

ForContext returns skills active for the given file paths. Skills with a paths restriction are included only when a file matches; all others are always returned. Equivalent to AllForUser when filePaths is empty.

func MatchTrigger

func MatchTrigger(userInput string, skills []Skill) *Skill

MatchTrigger returns the first skill whose trigger phrases match userInput, or nil.

type SkillSource

type SkillSource = internalskills.SkillSource

SkillSource says where a skill comes from: bundled with the runtime, a command file, a plugin, managed, or an MCP server.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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