Skip to content

feat: lk skills, installs LiveKit's agent skills and Docs MCP server - #996

Open
bcherry wants to merge 9 commits into
mainfrom
bcherry/livekit-agent-skills-commands-5833c9
Open

bcherry wants to merge 9 commits into
mainfrom
bcherry/livekit-agent-skills-commands-5833c9

Conversation

@bcherry

@bcherry bcherry commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Adds lk skills install|list|update|remove, which installs the skills from livekit/agent-skills into coding agents and adds the LiveKit Docs MCP server to their configs. Also: lk agent init offers to install skills into new agent projects, replacing the copies the starters used to commit.

lk skills install              # all skills + Docs MCP, for detected agents
lk skills install -a claude-code -a codex --global
lk skills list                 # installed / current / outdated / modified / untracked, plus MCP status
lk skills update               # latest skills, including renamed and new ones
lk skills remove

How it works

  • Source: the tip of livekit/agent-skills main, fetched as a tarball from codeload. No git or Node needed. A hidden --ref flag installs from a branch, for trying skill PRs before they merge.
  • Agents: Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf, Amp, Cline and Goose. They're detected from their config folders or their binaries on PATH; --agent overrides that, and interactive runs pick from a multi-select with detected agents preselected. Skill paths follow the npx skills table.
  • Files: skills are copied, never symlinked (symlinks break on Windows). Agents that read .agents/skills share one copy; Claude Code, Windsurf and Goose get their own.
  • Lock files: writes the same skills-lock.json (project) and ~/.agents/.skill-lock.json (global) that npx skills and gh skill use. Hashes are byte-identical to what npx skills computes, and the tree hash matches GitHub's folder SHA, so the three tools can manage each other's installs.
  • Safety:
    • Skills you've edited are left alone unless you pass --force.
    • LiveKit skills with no lock entry, such as copies committed to the old starters, are "untracked" and replaced after a confirmation (automatically without a terminal, or with -y).
    • Skills LiveKit stops publishing are removed.
    • Archive entries that are symlinks, or that would escape the skill folder, are ignored.
  • Docs MCP: added to each agent's project or user config. JSON/JSONC and TOML are edited in place, keeping existing formatting and comments. An existing livekit-docs entry is never replaced. For user-scope Claude Code it uses claude mcp add when claude is on PATH. Amp, Cline and Goose get manual setup instructions.
  • Scaffolding: lk agent init shows the agent picker (detected agents preselected, none to skip) to install skills into the new project. Without a terminal it installs for detected agents; --skills=false skips. lk app create is unchanged.

New dependency: github.com/tailscale/hujson, for editing JSON/JSONC without reformatting.

Testing

  • Unit tests in pkg/skills for archive parsing, hashing against vectors generated with Node's localeCompare and git write-tree, lock round-trips, install states, and MCP config edits. Command-level tests in cmd/lk/skills_test.go.
  • Checked manually with a scratch $HOME:
    • lk skills install over an existing npx skills install left skills-lock.json unchanged.
    • Global install; Codex TOML; the ~/.claude.json fallback when claude isn't on PATH.
    • A clone of today's agent-starter-python: update --ref bcherry/skills-refresh swapped the untracked livekit-agents copies for the new skills.
  • Not tested: the interactive prompts (they need a TTY), and Windows.

Related

`lk skills install|list|update|remove` installs the skills from
livekit/agent-skills into coding agents (Claude Code, Codex, Cursor,
Copilot, Gemini CLI, OpenCode, Windsurf, Amp, Cline, Goose) and adds the
LiveKit Docs MCP server to their configs.

- Fetches the latest main as a tarball; no git or Node required.
- Copies (never symlinks) into .agents/skills plus agent-specific dirs.
- Writes the same skills-lock.json / ~/.agents/.skill-lock.json that
  `npx skills` and `gh skill` use, with byte-identical hashes, so the tools
  interoperate.
- Never overwrites local edits without --force; removes skills LiveKit
  stops publishing; replaces untracked LiveKit skills (e.g. copies
  committed to starter templates) after confirming.
- Edits MCP configs (JSON/JSONC/TOML) in place, preserving formatting and
  comments, and never replaces an existing livekit-docs entry.

`lk agent init` and `lk app create` offer to install skills into new agent
projects (--skills to control).
lk agent init / lk app create now show the agent multi-select (detected
agents preselected, none to skip) instead of a yes/no, since detection
only means a config directory exists. Docs MCP results print as a single
line; paths remain in --json and lk skills list.
@bcherry
bcherry marked this pull request as ready for review September 24, 2026 04:19
@u9g

u9g commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Demo of lk skills built from this branch (7882cca), run in a scratch project: list on an empty project, install with the interactive agent picker, list showing skills and Docs MCP status, the MCP entries written to .mcp.json and .codex/config.toml, update leaving a hand-edited skill alone, and remove with its confirmation.

lk-skills.mp4

@bcherry
bcherry requested a review from u9g September 24, 2026 16:35
…-skills-commands-5833c9

# Conflicts:
#	autocomplete/fish_autocomplete
@u9g

u9g commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

lk skills remove deletes edited skills without saying so. You can see this in the demo, and it's in the code (skills.go#L808-L880). update protects edited skills, but remove lists them in its confirmation like every other folder.

Like install and update, lk skills remove now leaves skills with local
edits in place and names them in a warning; --force removes them too. The
confirmation marks untracked copies, and a skill whose edited copy is
kept stays in the lock file.
@bcherry

bcherry commented Sep 24, 2026

Copy link
Copy Markdown
Contributor Author

@u9g great catch, fixed

lk never used metadata.version to decide anything, since state comes
from content hashes, so stop showing it in output, lk skills list, and
--json. Skills that still carry the field are unaffected.
…-skills-commands-5833c9

# Conflicts:
#	autocomplete/fish_autocomplete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants