SKILL.md, optionally with scripts and reference files. Attach skills to an agent instead of putting every procedure in its system prompt: the agent sees each skill’s short description on every turn and loads the full instructions only when a skill fits the task.
The TypeScript samples assume the rl client from Client setup.
Before you begin
- You need the organization developer or admin role to create, change, or delete skills and skill groups. The organization user role can view them. See Organizations and roles.
- For the API, create a key on API keys and export it as
RECURSION_API_KEY.
How an agent uses a skill
- When a session starts, it resolves the agent’s skills and skill groups and fixes the version of each skill for the whole session.
- Every turn lists each skill’s name and, while the budget allows, its description. See Preview prompt disclosure.
- When a skill fits, the agent calls
activate_skillwith the skill’sname. The full instructions and the list of bundled files enter the conversation and stay in effect for the rest of the session. - Bundled files are placed under
/workspace/.managed-agents/skillsin the sandbox. The agent reads or runs a file only when the instructions point it there.
activate_skill is offered only when the session has at least one usable skill.
Write SKILL.md
SKILL.md starts with YAML frontmatter on the first line, followed by Markdown instructions.
Any other key has no effect. The whole
SKILL.md can be at most 256 KiB, and it must have instructions below the frontmatter. When a session loads a skill, instructions longer than 64,000 bytes are cut off, and the agent is told they were cut off.
Create a skill
Creating a skill also creates version 1. Versions are immutable.- Console
- TypeScript
- cURL
- In the sidebar, click Skills.
- Click Create skill.
- Enter the document in SKILL.md, and optionally a Display title and a Group.
- Click Create skill.
Skill names are unique in your organization. A name that another live skill already uses returns
409 conflict on name.
A 200 response is the catalog entry. Keep skill_id to attach the skill and latest_skill_version_id to publish the next version. Some fields are left out here.
Upload a bundle
A bundle is a zip archive of the skill’s directory. PutSKILL.md at the root of the archive, or inside one wrapper directory. Put runnable helpers in scripts/, supporting documents in references/, and other files in assets/. Files under scripts/ are made executable in the sandbox; all other files are not.
If you use a wrapper directory, its name must match the skill’s name, and every file must be inside it. Symbolic links and other non-regular files are refused.
- Console
- cURL
- In Skills, click Create skill.
- Drop the zip on Upload a bundle, or pick it.
- Click Review and upload, check the file list, then click Create skill in the Upload bundle dialog.
skill_group_id, and metadata as a JSON string. The document, name, and description come from the SKILL.md inside the archive. The TypeScript SDK sends the JSON form only, so use the console or a multipart HTTP request for bundles.
Get a skill
- Console
- TypeScript
- cURL
- In the sidebar, click Skills.
- Click the skill to open its latest version.
List skills
The list is newest first, leaves out deleted skills, and omits instructions. Follownext_page_token to read the whole catalog.
- Console
- TypeScript
- cURL
- In the sidebar, click Skills.
- Search by name, description, or id, or expand a group in the catalog.
next_page_token is absent on the last page.
Publish a new version
Get the skill first, then send its currentlatest_skill_version_id as base_skill_version_id. The request is a full replacement: a display_title you leave out resets to the frontmatter name, and metadata you leave out is cleared. You cannot change the group here; use Move a skill to a group.
- Console
- TypeScript
- cURL
- In Skills, open the skill.
- Edit SKILL.md, or drop a new zip on Upload a bundle.
- Click Save new version. For a bundle, confirm in the Upload bundle dialog.
201 response is the new version. If another writer published first, the API returns 409 revision_conflict and saves nothing. Get the skill again, apply your change, and retry.
List and get versions
listSkillVersions returns every version, newest first, without pages and without instructions. getSkillVersion returns one version with its instructions.
- Console
- TypeScript
- cURL
- In Skills, open the skill.
- Use Compare with under Changes to see what changed between versions.
bundle.entries. mode is 493 (octal 0755) for files under scripts/ and 420 (octal 0644) for everything else.
Every version has a bundle, and bundle.entries always includes SKILL.md. A skill created from a document alone has a bundle that holds only SKILL.md. Some fields are left out of this sample.
Download a version’s files
getSkillVersionContent returns the version’s files as a gzipped tarball, exactly as a session receives them: SKILL.md plus any bundled files. The TypeScript SDK has no method for this call.
Organize skills in groups
A skill group is a folder in the catalog and a way to attach a whole set of skills to an agent in one entry. The model never sees the group. Filing a skill in a group never creates a skill version.Create a group
- Console
- TypeScript
- cURL
- In the sidebar, click Skills.
- Click New group.
- Fill in Name, and optionally Display title and Description.
- Click Save group.
name is required, follows the same rule as a skill name, and must be unique among your organization’s groups; a taken name returns 409 conflict on name. display_title is at most 256 characters and defaults to name. description is for people browsing the catalog, at most 1,024 characters. A 201 response is the group.
List, get, and update groups
listSkillGroups returns skill_groups newest first, with limit (default 100, at most 500) and page_token. getSkillGroup returns one group. updateSkillGroup changes only the fields you send, so renaming a group is safe: agents attach it by id.
- Console
- TypeScript
- cURL
- In Skills, open the group’s menu in the catalog.
- Click Edit group, change the fields, and click Save group.
Move a skill to a group
updateSkill files a skill under a group. Send an empty skill_group_id to take the skill out of its group. The skill’s versions don’t change.
- Console
- TypeScript
- cURL
- In Skills, open the skill.
- In the header, pick a group in Group, or Ungrouped. The change saves at once.
List the skills in a group
listSkillsInGroup returns the group’s skills in the order a group attachment expands them. That order decides whose description is dropped first when the disclosure budget runs out. It takes limit and page_token like listSkills.
- Console
- TypeScript
- cURL
In Skills, expand the group in the catalog.
Delete a group
- Console
- TypeScript
- cURL
- In Skills, open the group’s menu in the catalog.
- Click Archive group, then confirm.
{ "deleted": true }. The group’s skills stay in the catalog. Agents that attach the group keep the entry, and their next session runs without the group’s skills.
Attach skills to an agent
Skills are part of an agent version, in theskills field. Each entry is one of these:
An agent can have at most 100 entries. The API checks every id when you save the version; an unknown skill, version, or group returns
400 invalid_request naming the entry, such as skills[0].skill_id. Entry order matters, because descriptions past the disclosure budget are dropped from the end.
- Console
- TypeScript
- cURL
- Open the agent and stay on the Configuration tab.
- In Skills, pick a skill or group in Attach a skill or group. Reorder the cards so the most important skills come first.
- Click Save new version.
201 response is the agent at its new version. A version is a full replacement, so resend every other setting you want to keep. See Update an agent.
Preview prompt disclosure
Every turn lists the session’s skills within a character budget. When the descriptions don’t fit, the ones at the end of the list are dropped and the model sees only those skills’ names, which makes it less likely to pick them. The preview resolves groups exactly as a session start does and reports what fits.- Console
- TypeScript
- cURL
- Open the agent and stay on the Configuration tab.
- In Skills, attach the skills or groups you plan to use.
- Read the budget meter. Cards past the line marked “Past this line the model sees only skill names.” are flagged Name only.
release-checklist, so the response lists it after release-notes. An entry with description_included: false can still be activated, but the model sees only its name. Move important skills earlier, or shorten descriptions, until they fit. warnings also names entries that could not be resolved, such as a deleted skill or group. context_window_tokens is optional; omit it to use a conservative default of 8,000 characters, which is also what the console’s meter uses.
Delete a skill
A delete is a soft delete. The skill leaves the catalog and stops resolving into new sessions, and its versions can no longer be read through the API. A session that already started keeps the version it loaded. Agents that reference the skill keep the entry, and their next session runs without it. A deleted skill cannot be restored.- Console
- TypeScript
- cURL
- In Skills, open the skill.
- At the bottom of the page, click Archive skill, then confirm Archive skill.
What can go wrong
The full error catalog is on Errors.
Limits
See Limits for request sizes and rates.
Next steps
Agents
Publish an agent version with skills and groups attached.
Tools
See what else the agent can call once a skill is active.
Sessions
Start a session and watch the agent activate a skill.
Artifacts
Collect the files a skill tells the agent to produce.