Documentation
¶
Index ¶
- Constants
- func GetBuiltinSkillsPath() string
- func GetManagedSkillsPath() string
- func GetSkillReposPath() string
- func GetSkillsRootPath() string
- func GetUserSkillsPath() string
- func GetUserSkillsPathForUser(userID string) string
- func MCPHealth() map[string]string
- func MCPServers() []string
- func ParseBooleanFrontmatter(value any) bool
- func ReadEnabled(path string) bool
- func RegisterAlias(alias string, target string)
- func SetExternalDirs(userID string, dirs []ExternalDir)
- func UserPath(userID string) string
- type Alias
- type ExternalDir
- type FrontmatterData
- type Skill
- func All(cwd string) ([]Skill, error)
- func AllForUser(cwd string, userID string) ([]Skill, error)
- func Bundled() []Skill
- func DiscoverMCP(ctx context.Context) ([]Skill, error)
- func ForContext(cwd string, filePaths []string, userID string) ([]Skill, error)
- func LoadExternalDir(path string, source string) ([]Skill, error)
- func MatchTrigger(userInput string, skills []Skill) *Skill
- type SkillSource
Constants ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 SetExternalDirs ¶ added in v1.11.8
func SetExternalDirs(userID string, dirs []ExternalDir)
SetExternalDirs makes the skills of other folders available to the agent of a user: Claude Code's and Codex's skill folders, or one of the person's own. They are read in place, never copied, and rank below the project's, the user's and the installed collections' skills of the same name. The folders set for the blank user are shared by every user. Call it again to change the list; an empty list removes it.
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.
type ExternalDir ¶ added in v1.11.8
type ExternalDir = internalskills.ExternalDir
ExternalDir is a folder of skills read where it lies (see SetExternalDirs).
func ExternalDirsFor ¶ added in v1.11.8
func ExternalDirsFor(userID string) []ExternalDir
ExternalDirsFor returns the external skill folders set for a user.
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 ¶
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 ¶
AllForUser is All for a given user: it also reads the skills of that user's own directory.
func DiscoverMCP ¶
DiscoverMCP returns the skills offered by the MCP servers that are connected: one per tool they expose. Cancelling ctx stops the listing.
func ForContext ¶
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 LoadExternalDir ¶ added in v1.11.8
LoadExternalDir loads the skills of a folder as the agent would, without the host's Skip filter, so a host can show what it leaves out and why. Hidden folders (.trash, .system...) are not read.
func MatchTrigger ¶
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.