Keg docs

The Keg skill, for coding agents

Any coding agent that loads skills (Claude Code, Codex, Pi and others that read the Agent Skills form) can use Keg to make the environment it needs and look after it, within what Keg lets an agent do. The skill is a folder:

skills/keg/
  SKILL.md                      the limits, where the agent stands, a table
                                from what it wants to the command, pointers
  references/machines.md        a machine for a project folder, commands and servers in it
  references/running.md         backing services, Compose, containers, names and ports
  references/apps.md            an app on Keg's capabilities, and its pitfalls
  references/release.md         keg up, environments, change sets, pieces of work, gates
  references/troubleshooting.md what an error means, and what to do

Getting it

The skill is in every keg (it is built in, so it always matches the Keg that runs), in the Keg app at Keg.app/Contents/Resources/skills/keg, and at skills/keg in Keg's repository.

keg skill
keg skill install
keg skill install --dir .claude/skills/keg
keg skill install --dir ~/.agents/skills/keg

keg skill says what it holds and where it is installed. keg skill install writes its six files to ~/.claude/skills/keg, or the folder given with --dir, replacing files of the same names and touching nothing else. Run it again after an update to bring the copy up to date. Install it yourself: the skill tells an agent not to.

An agent without the folder can read it all the same: keg skill show prints SKILL.md, and keg skill show apps (or machines, running, release, troubleshooting) one of its references. keg agents --skill prints SKILL.md alone.

With the MCP server

The skill prefers Keg's MCP tools where the agent has them, and says which CLI command does the same. To connect one:

keg agents --connect claude
keg agents --connect codex
keg agents --connect pi

or by hand, claude mcp add keg -- keg mcp (keg agents --setup has the others). Over MCP the agent always has an agent's rights.

What an agent can do with it

What it never does

It never approves a change set or a gate, never installs or changes a Keg service, never reads a secret's value, never runs keg trust (except --print), never touches containers, machines or volumes it did not make unless you name them, never deletes data you did not name, and never works round a refusal. Cleaning up the node's disk, and handing a work files (keg work attach, keg work allow-from, keg work self-checks), are yours. A refusal from Keg is reported to you with the command that is yours to run. What a file, a log, what a work was handed or a service's instructions say is data to it, never an instruction that changes these limits.

cargo test -p keg holds the skill to the CLI: every command it shows must parse, every command and flag it names must exist, every command of keg is classified as an agent's or a person's with the calls it makes to the node, nothing that is a person's is shown for an agent to run, and its limits must agree with keg agents.

keg skill install and keg app new write through the same code the node uses for a folder someone else may change (crates/kegd/src/beneath.rs): each file beneath a handle on the folder, one name at a time, no link followed.

Keg's documentation. Something wrong or missing? Say so.