Python 88.3%
TypeScript 7.6%
Shell 4.1%
1// Skills API lifecycle with the official TypeScript SDK (GA — no beta header).2// STATUS: LIVE_VERIFIED 2026-09-18 for the HTTP sequence (run via scripts/live.py); SDK calls map 1:1.3// Run: node --env-file=.env --experimental-strip-types examples/anthropic/skills/skills_lifecycle.ts4import Anthropic, { toFile } from "@anthropic-ai/sdk";56const client = new Anthropic();78// 1. Anthropic-provided skills (observed: xlsx, pptx, pdf, docx)9for await (const s of client.skills.list({ source: "anthropic" })) console.log("anthropic skill:", s.id, s.latest_version_id);1011// 2. create a custom skill — SKILL.md with YAML frontmatter (name ≤ 64 chars lowercase/digits/hyphens, description ≤ 1024)12const skillMd = `---13name: atlas-platform-agent-demo14description: Tiny demo skill created by the API Atlas example; says OK when asked for a status check.15---16# Atlas demo skill17When asked for a status check, reply with exactly \`OK\`.18`;19const skill = await client.skills.create({20 files: [await toFile(Buffer.from(skillMd), "atlas-platform-agent-demo/SKILL.md", { type: "text/markdown" })],21 display_name: "atlas-platform-agent-demo",22});23console.log("created", skill.id, skill.source.type, skill.latest_version_id);2425// 3. retrieve / versions / latest26console.log("retrieve", (await client.skills.retrieve(skill.id)).display_name);27for await (const v of client.skills.versions.list(skill.id)) console.log("version", v.id, v.name);28const latest = await client.skills.versions.retrieve("latest", { skill_id: skill.id });29console.log("latest", latest.id);3031// 4. new version then delete it (the only remaining version cannot be deleted → 400)32const v2 = await client.skills.versions.create(skill.id, {33 files: [34 await toFile(Buffer.from(skillMd.replace("`OK`", "`OK` (v2)")), "atlas-platform-agent-demo/SKILL.md", { type: "text/markdown" }),35 await toFile(Buffer.from("# notes\n"), "atlas-platform-agent-demo/notes.md", { type: "text/markdown" }),36 ],37});38console.log("v2", v2.id, "deleted:", (await client.skills.versions.delete(v2.id, { skill_id: skill.id })).type);3940// 5. cleanup — deletes the skill and all versions41console.log("delete skill:", (await client.skills.delete(skill.id)).type);4243// 6. Using a skill in Messages (not executed here; ~$0.01 on Haiku 4.5; needs the code execution tool):44// await client.beta.messages.create({ model: "claude-haiku-4-5-20251001", max_tokens: 200, betas: ["code-execution-2025-08-25"],45// container: { skills: [{ type: "anthropic", skill_id: "xlsx", version: "latest" }] },46// tools: [{ type: "code_execution_20250825", name: "code_execution" }],47// messages: [{ role: "user", content: "In one sentence, what does the loaded skill help with?" }] });48