Skip to content

Skills

A skill is text, not code. It changes what the model knows how to do, never what it is allowed to do: no scopes, no grants, no sandbox carve-outs, and no marketplace.

  • One directory per skill under a skill library. Precedence: the active profile’s own library <data root>/skills/<name>/SKILL.md first, the global ~/.ka-agent/skills/<name>/SKILL.md as the fallback ($KA_AGENT_HOME-aware; a pre-0.3 $XDG_CONFIG_HOME/ka-agent/skills still wins while it exists). A name present in both keeps the profile’s copy.
  • SKILL.md is the ecosystem format Ka already reads: TOML frontmatter (name, description, plus ka-agent’s own triggers, paths and allowed_tools, below) plus a Markdown body. A sample lives at examples/skills/review/.
  • Names are [a-z0-9-]{1,48}; anything else is ignored by scans and refused by enable.
  • Enabling copies the directory into the engine home (.config/ka/skills/<name>/), which the worker’s synthetic home exposes to the engine: the CLI’s --role <r> provisions into that role’s engine home (<data>/roles/<r>/engine-home), and the panel’s skills page toggles the same role-keyed provisioning, so a skill enabled for one role is invisible to the others (see roles). On the team edition, a skill proposal accepted from a user’s chat lands in that user’s engine home (<data>/users/<u>/engine-home), which is what their worker mounts. Progressive disclosure is Ka’s: the name and description ride in the prompt, the body is read on demand.
  • Bounds: at most 256 KiB and 64 files per skill; enable refuses beyond them. Re-enable replaces the provisioning; your source copy is never modified or deleted.
Terminal window
ka-agent skills list # both libraries, with [enabled] and [enabled@<role>] markers
ka-agent skills enable review # provision into the admin's engine home
ka-agent skills enable review --role guest # provision into that role's engine home
ka-agent skills disable review # remove the provisioning only

skills list marks [enabled, no source copy] for provisioned-without-source entries (for example after a restore).

  • /skills lists enabled skills, one line each.
  • /skill <name> <text> submits one turn with that skill attached; the engine injects the full SKILL.md body for that turn only. Fail-closed rules: the skill must be enabled, the session must be idle (a skill turn is never queued), and empty text is a usage error. Nothing is submitted on refusal. Trigger hits ride along: a /skill turn unions the explicit name with any trigger matches in the same message, under the same cap.
  • /skill-doctor prices the context cost (below).

Frontmatter: triggers, paths, allowed_tools

Section titled “Frontmatter: triggers, paths, allowed_tools”

Beyond name and description, the operator’s source SKILL.md may carry three ka-agent keys (TOML arrays):

  • triggers = ["deploy", "release"], at most 8, each [a-z0-9-]{1,32}. A plain-text message fires the skill when any trigger appears as a case-insensitive whole word (deploy does not fire inside deployment). All hits attach, name-ordered, at most 3 skills per turn, whether the message submits directly or drains from the durable queue. Cron, briefing and other scheduled submits are exempt: conversational turns only.
  • paths = ["docs/*"], at most 8 flat * globs. A tool call whose argument summary touches a matching path parks the skill; the next conversational submit attaches it (never mid-cycle: one writer per turn). The once-per-conversation marker is written at attach time, not at touch time, so a daemon restart between touch and attach simply forgets that touch. A compaction clears the session’s markers: the next matching touch re-parks and the next submit re-attaches. Nothing is re-injected eagerly across compaction, so no unbudgeted bytes cross the port.
  • allowed_tools = ["read", "grep"] (the Claude-style allowed-tools spelling is accepted too), at most 8 exact hand names. A /skill <name> <text> turn submits them as the worker protocol’s per-turn allowlist, which the runtime intersects with the role’s toolset: a skill can only narrow a turn, never widen it. ${SKILL_DIR}-style substitution is not supported.

Provenance join. Provisioning copies the directory into the engine home and strips exactly those three keys from the copied SKILL.md (comments and unrelated keys survive; the pinned engine never sees unknown keys), while the operator’s source copy keeps them. Trigger, path and tool binding therefore read the resolved view: names and descriptions from the provisioned engine copies, firing metadata from the operator library under normal library precedence. An [enabled, no source copy] skill resolves with empty firing metadata (explicit /skill only) and is marked by the doctor.

Per resolved skill: the estimated advertised cost (~N tok, from the name and description bytes: the engine assembles the prompt, so this is an estimate), the provisioned body size (XKiB), attach counts by route (N× (explicit), N× (trigger), N× (paths)), the last attach, and the skill’s trigger and path echo. Skills with no source copy carry a no source copy mark; triggerless skills show no trigger echo. A standing: line totals the advertised tokens and body bytes. Counts live in the store’s skill_usage table (schema v15) and are bumped only when a submit actually attached the skill.

The model can offer a reusable procedure as a new skill draft through the kagent__skill_propose tool. Nothing is installed until you accept: the draft surfaces as a proposal card (✅ Accept / ✖ Reject on Telegram), and /skills accept <id> / /skills reject <id> decide from any surface. An acceptance installs the draft into the library through the same validation as a manual skill; a rejection discards it.

The engine’s permission gates apply to skill turns exactly as to any other turn.