Documentation
¶
Overview ¶
Package skills installs LiveKit's agent skills (https://agentskills.io) and the LiveKit Docs MCP server into coding agents such as Claude Code, Codex and Cursor.
Installs are plain copies, never symlinks, and are recorded in the same lock files the `skills` CLI (github.com/vercel-labs/skills) and `gh skill` use, so any of the three tools can manage what another installed.
Index ¶
- Constants
- Variables
- func AgentIDs() []string
- func AgentNames(agents []*Agent) string
- func ContentHash(files []File) string
- func TreeHash(files []File) string
- type Agent
- type Bundle
- type Copy
- type Env
- type File
- type Frontmatter
- type Installer
- func (in *Installer) Delete(c Copy) error
- func (in *Installer) Forget(name string) error
- func (in *Installer) Inspect(names []string, dirs []SkillsDir) ([]Copy, error)
- func (in *Installer) InstalledLiveKitSkills(dirs []SkillsDir) ([]string, error)
- func (in *Installer) Orphans(dirs []SkillsDir) ([]string, error)
- func (in *Installer) Record(s *Skill)
- func (in *Installer) Save() error
- func (in *Installer) Write(c Copy) error
- type Lock
- type LockEntry
- type MCPState
- type MCPStatus
- type Scope
- type Skill
- type SkillsDir
- type State
Constants ¶
const ( // MCPServerName is the name the Docs MCP server is registered under, // matching the setup instructions on docs.livekit.io. MCPServerName = "livekit-docs" MCPServerURL = "https://docs.livekit.io/mcp" // MCPDocsURL covers manual setup for agents lk can't configure. MCPDocsURL = "https://docs.livekit.io/intro/mcp-server/" )
const ( // SourceRepo is the GitHub repo LiveKit's skills are published from. SourceRepo = "livekit/agent-skills" // DefaultRef is the branch installs track. Skills are written to stay // valid as the SDKs evolve, so the tip of main is what everyone gets. DefaultRef = "main" )
Variables ¶
var Agents = []*Agent{ { ID: "claude-code", Name: "Claude Code", // contains filtered or unexported fields }, { ID: "codex", Name: "Codex", // contains filtered or unexported fields }, { ID: "cursor", Name: "Cursor", // contains filtered or unexported fields }, { ID: "github-copilot", Name: "GitHub Copilot", // contains filtered or unexported fields }, { ID: "gemini-cli", Name: "Gemini CLI", // contains filtered or unexported fields }, { ID: "opencode", Name: "OpenCode", // contains filtered or unexported fields }, { ID: "windsurf", Name: "Windsurf", // contains filtered or unexported fields }, { ID: "amp", Name: "Amp", // contains filtered or unexported fields }, { ID: "cline", Name: "Cline", // contains filtered or unexported fields }, { ID: "goose", Name: "Goose", // contains filtered or unexported fields }, }
Agents is every agent lk knows how to install into, in display order. Skill paths follow the `skills` CLI's table so installs from either tool land in the same place.
var ArchiveURL = func(ref string) string { return "https://codeload.github.com/" + SourceRepo + "/tar.gz/" + ref }
ArchiveURL is the tarball for a ref. It is a variable so tests can serve their own archive.
Functions ¶
func AgentNames ¶
AgentNames joins agents' display names for messages.
func ContentHash ¶
ContentHash is the `skills` CLI's project lock hash (computedHash): SHA-256 over each file's relative path followed by its contents, in the order JavaScript's String.prototype.localeCompare sorts the paths. Matching it exactly lets lk recognize skills that `npx skills` installed, and vice versa.
Types ¶
type Agent ¶
type Agent struct {
ID string // stable identifier, matching the `skills` CLI's agent names
Name string // display name
// contains filtered or unexported fields
}
Agent describes one coding agent: where it reads skills from, how to tell it is installed, and how to register an MCP server with it.
func DetectAgents ¶
DetectAgents returns the agents that appear to be installed.
type Bundle ¶
type Bundle struct {
Ref string
Commit string // full SHA, when the archive carries it
Skills []*Skill
// Skipped explains skill directories that failed validation, so one bad
// skill upstream doesn't block installing the rest.
Skipped []string
}
Bundle is every skill at one commit of the source repo.
func ParseArchive ¶
ParseArchive reads a GitHub source tarball (one top-level directory holding the repo) and returns the skills under skills/<name>/.
type Copy ¶
type Copy struct {
Skill string
Dir SkillsDir
State State
Upstream *Skill // nil when the skill is no longer published
}
Copy is one skill in one skills directory.
type Env ¶
type Env struct {
Home string // user home directory
Root string // project root (the working directory)
// Getenv and LookPath default to os.Getenv and exec.LookPath.
Getenv func(string) string
LookPath func(string) (string, error)
}
Env is the filesystem context an install runs against. Tests point it at temporary directories.
func DefaultEnv ¶
DefaultEnv returns an Env for the real user and working directory.
type Frontmatter ¶
type Frontmatter struct {
Name string `yaml:"name"`
Description string `yaml:"description"`
Metadata map[string]any `yaml:"metadata"`
}
Frontmatter is the subset of SKILL.md frontmatter lk reads.
func ParseFrontmatter ¶
func ParseFrontmatter(data []byte) (*Frontmatter, error)
ParseFrontmatter reads the YAML block at the top of a SKILL.md.
type Installer ¶
Installer compares and applies skills for one scope.
func NewInstaller ¶
NewInstaller loads the scope's lock file. bundle may be nil for operations that don't need upstream (remove).
func (*Installer) Forget ¶
Forget drops name from the lock unless a copy remains in one of the scope's known directories.
func (*Installer) InstalledLiveKitSkills ¶
InstalledLiveKitSkills finds LiveKit skills present in dirs: those the lock attributes to LiveKit, those upstream publishes, and any SKILL.md whose frontmatter names LiveKit as its author.
func (*Installer) Orphans ¶
Orphans lists LiveKit skills installed in dirs that upstream no longer publishes (removed or renamed).
type Lock ¶
type Lock struct {
Path string
// contains filtered or unexported fields
}
Lock is a lock file loaded for editing.
func LoadLock ¶
LoadLock reads the lock file for scope. A missing file is an empty lock; a file that isn't valid JSON is an error rather than something to overwrite.
func (*Lock) LiveKitSkills ¶
LiveKitSkills lists the names of entries installed from LiveKit's repo. Names are joined into paths that get deleted, so only valid skill names are returned: a lock file comes from whatever repo was cloned.
type LockEntry ¶
type LockEntry struct {
Source string `json:"source"`
SourceType string `json:"sourceType"`
SourceURL string `json:"sourceUrl,omitempty"`
Ref string `json:"ref,omitempty"`
SkillPath string `json:"skillPath,omitempty"`
ComputedHash string `json:"computedHash,omitempty"`
SkillFolderHash string `json:"skillFolderHash,omitempty"`
InstalledAt string `json:"installedAt,omitempty"`
UpdatedAt string `json:"updatedAt,omitempty"`
}
LockEntry is one skill's record. Fields are the union of both lock formats.
func (*LockEntry) FromLiveKit ¶
FromLiveKit reports whether the entry was installed from LiveKit's repo, by any tool.
type MCPState ¶
type MCPState string
MCPState is whether an agent has the Docs MCP server configured.
type MCPStatus ¶
type MCPStatus struct {
Agent *Agent
State MCPState
Path string
Err error // the config exists but couldn't be read
// Added is set by ConfigureMCP when it added the server (rather than
// finding it already there).
Added bool
}
MCPStatus reports an agent's Docs MCP setup and the file it lives in.
type Scope ¶
type Scope int
Scope selects where skills and MCP config are written: the current project, or the user's home directory.
type SkillsDir ¶
SkillsDirs groups agents by the directory they read skills from, so a shared directory like .agents/skills gets a single copy. Order follows agents.
type State ¶
type State string
State is how an installed copy of a skill compares to upstream.
const ( StateMissing State = "missing" // not installed in this directory StateCurrent State = "current" // matches upstream StateOutdated State = "outdated" // unchanged since install; upstream has moved on StateModified State = "modified" // differs from both upstream and what was installed StateRemoved State = "removed" // installed from LiveKit, but no longer published // StateUntracked is a LiveKit skill (by its frontmatter) that no lock file // records, e.g. one committed to a starter template. It can't be told // apart from an edited copy, so replacing it asks first. StateUntracked State = "untracked" )