Use skills
A skill is a directory with a SKILL.md file. The agent reads it when it needs your business rules, a procedure or a script. Upload it once and attach it to as many agents as you like; to change the rules, upload a new version instead of editing the agent.
You need Bun or Node.js with native fetch and FormData, and an API Key for your organization (see API Keys). Set PRAXIS_API_KEY in the server process and keep the key out of web pages.
Upload a skill
Call POST /agent/v1/skills with multipart/form-data. Send one files part per file; the file name is its path, and every file sits under one top-level directory:
refund-policy/SKILL.mdrefund-policy/reference.mdrefund-policy/scripts/check.pySKILL.md starts with frontmatter:
---name: refund-policydescription: Use when a customer asks about refunds. Holds the refund window and the approval code.---
Body: what the agent reads when it needs this skill.| Rule | Detail |
|---|---|
| One top-level directory | Every path looks like <directory>/…. A file outside it, or a second top-level directory, returns 400 |
SKILL.md | Must be at <directory>/SKILL.md and start with frontmatter; a missing file returns 400 |
description | Required in the frontmatter. It tells the agent when to use the skill; write it as “Use when …” |
name | Optional; defaults to the directory name. It must be one folder name: 1 to 255 characters, no /, \ or NUL, not . or .., no leading or trailing space. A bad name returns 400 and states the allowed form |
display_name | Optional form field, used only in listings |
| Size | At most 8 MB in total and 200 files; paths must not contain .., be absolute or have empty segments |
The upload creates the skill and its first version. The response carries id (skill_…) and latest_version_id. A version ID is an increasing opaque string; use it as returned and do not parse it. Versions are immutable: to change content, upload a new version.
Versions and the latest version
POST /agent/v1/skills/{skill_id}/versions uploads a new version in the same format. The name in the new SKILL.md must equal the skill’s existing name, otherwise the call returns 400. After the upload:
- The skill’s
latest_version_idpoints to the new version. Older versions are unchanged and can still be read and downloaded. GET /agent/v1/skills/{skill_id}/versionslists versions newest first, each with thenameanddescriptionfrom that version’sSKILL.md.GET /agent/v1/skills/{skill_id}/versions/{version}/contentdownloads that version as a zip.- When you delete a version,
latest_version_idfalls back to the newest remaining one.
Attach to an agent
Set skills when you create or update an agent. Each entry is { "type": "custom", "skill_id": "skill_…", "version"?: "…" }:
| Form | Meaning |
|---|---|
version omitted, or "latest" | Each time a session is created, use the skill’s newest version at that moment |
version set to a version ID | Pinned to that version; later uploads do not affect it |
An agent holds at most 20 skills and the same skill_id cannot repeat. Only type: "custom" is supported; anthropic returns 400, so upload the skill and attach it as custom. The skill, and a pinned version, must exist in your organization. On update, omit skills to keep them, send an array to replace them as a whole, and send [] or null to clear them.
The attachment is part of the agent version, so changing it is saving a new version. Sessions that are already running do not change when a skill version is uploaded later.
Where it is installed
When a session has a machine (service agents use the node22 environment by default; see Runtime environments), each skill is installed when the session starts, at /home/user/.praxis/skills/<name>/, where <name> is the name in SKILL.md.
- If a skill with the same name is already on the machine it is not overwritten. The session receives a “not installed” notice and the existing skill stays in effect.
- A session without a machine (
environment_id: null) installs no skills. - Two skills with the same
nameon one agent install only one of them; upload one under another name.
Delete
| Action | Result |
|---|---|
| Delete a skill still used by a non-archived agent | 409 RESOURCE_IN_USE; the message lists up to 10 agent IDs. Remove the skill from those agents first |
| Delete a skill that no agent uses | The skill is deleted together with all its versions |
| Delete a version pinned by a non-archived agent | 409 RESOURCE_IN_USE |
| Delete the last version of a skill | 409 SKILL_LAST_VERSION: a skill keeps at least one version; delete the whole skill instead |
Change the agent first (use another version or remove the skill), then delete versions or the whole skill.
End-to-end example
The script uploads a skill, attaches it to a new agent, starts a session and asks the agent to read out an approval code that only the skill contains. Save it as skill-demo.mjs and run node skill-demo.mjs.
import assert from "node:assert/strict";import { setTimeout as delay } from "node:timers/promises";
const { PRAXIS_API_KEY } = process.env;assert(PRAXIS_API_KEY, "Set PRAXIS_API_KEY in the server process");const base = "https://api.deepraxis.com/agent/v1";async function request(path, { method = "GET", body, form } = {}) { const response = await fetch(`${base}${path}`, { method, headers: { Authorization: `Bearer ${PRAXIS_API_KEY}`, ...(form ? {} : { "Content-Type": "application/json" }), }, body: form ?? (body === undefined ? undefined : JSON.stringify(body)), signal: AbortSignal.timeout(30_000), }); const result = await response.json(); if (!response.ok) { throw new Error(`HTTP ${response.status}; request=${response.headers.get("X-Request-Id")}; ${result.error?.message ?? ""}`); } return result;}
// 1. Upload the skill: one top-level directory, SKILL.md with frontmatter.const skillMd = `---name: refund-policydescription: Use when a customer asks about refunds. Holds the refund window and the approval code.---
# Refund policy
Refunds are accepted within 30 days of purchase.Read reference.md for the approval code and quote it when asked.`;const form = new FormData();form.append("display_name", "Refund policy");form.append("files", new Blob([skillMd]), "refund-policy/SKILL.md");form.append("files", new Blob(["Approval code: RF-4417\n"]), "refund-policy/reference.md");const skill = await request("/skills", { method: "POST", form });assert(skill.latest_version_id, "The upload creates the first version");console.log({ skill: skill.id, version: skill.latest_version_id });
// 2. Attach it. Omitting version follows the newest version when a session starts.const agent = await request("/agents", { method: "POST", body: { name: "Refund assistant", kind: "service", model: "deepseek-flash", system: "Answer refund questions. Use your skills when they apply.", skills: [{ type: "custom", skill_id: skill.id }], },});assert.equal(agent.skills[0].skill_id, skill.id);
// 3. Start a session and ask for something only the skill knows.const session = await request("/sessions", { method: "POST", body: { agent: { type: "agent", id: agent.id, version: agent.version } },});await request(`/sessions/${session.id}/events`, { method: "POST", body: { events: [{ type: "user.message", content: [{ type: "text", text: "Use the refund-policy skill and tell me the approval code." }] }] },});
// 4. Wait for a reply that is followed by an idle status.const deadline = Date.now() + 180_000;let reply = "";while (Date.now() < deadline && !reply) { const { data } = await request(`/sessions/${session.id}/events?order=asc&limit=100`); const last = data.findLastIndex((event) => event.type === "agent.message"); if (last >= 0 && data.slice(last).some((event) => event.type === "session.status_idle")) { reply = data.filter((event) => event.type === "agent.message") .flatMap((event) => event.content ?? []).map((block) => block.text ?? "").join("\n"); } else await delay(2000);}assert(reply.includes("RF-4417"), `Expected the approval code in the reply, got: ${reply}`);console.log({ session: session.id, reply, verified: true });Expected: the skill ID and version ID first, then verified: true with RF-4417 in the reply. The code exists only in reference.md, so seeing it proves the skill was installed and read. Running the script again creates another skill, agent and session; clean up in the order above when you are done.
When it fails
| Symptom | What to do |
|---|---|
400 frontmatter field "description" is required | SKILL.md has no description |
400 <directory>/SKILL.md is required | The directory has no SKILL.md, or the file sits at the top level |
400 files must sit inside one top-level directory | A file has no directory prefix, or a second top-level directory appears |
400 skills[0].version … was not found | The version ID does not exist or was deleted; read it from GET /agent/v1/skills/{skill_id}/versions |
400 skills[0].type anthropic is not supported | Upload the skill and attach it as custom |
| The session does not have the skill | Check the events for a “not installed” notice: a same-name skill is already on the machine, or the session has no machine |
For every parameter see the Agent API. Next: Manage agent versions · Runtime environments