Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions public/__redirects
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,10 @@
/agents/concepts/agent-class/ /agents/agent-class/internals/ 301
/agents/concepts/memory/ /agents/concepts/context/ 301
/agents/concepts/conversation-state-and-memory/ /agents/concepts/sessions/ 301
/agents/concepts/agent-skills/ /agents/concepts/skills/ 301
/agents/skills/sources/computer/ /agents/skills/sources/#workspace 301
/agents/skills/sources/r2/ /agents/skills/sources/#r2 301
/agents/skills/sources/code/ /agents/skills/sources/#code 301
/agents/getting-started/prompting/ /workers/get-started/prompting/ 301
/agents/platform/prompting/ /workers/get-started/prompting/ 301
/agents/platform/prompt.txt/ /workers/prompt.txt 301
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class MyAgent extends Think<Env> {

This release includes:

- **Three sources.** Load skills from a [Computer Workspace](/agents/skills/sources/computer/), an [R2 bucket](/agents/skills/sources/r2/), or [code](/agents/skills/sources/code/). Think lists every source again before each turn.
- **Three sources.** Load skills from a [Computer Workspace](/agents/skills/sources/#workspace), an [R2 bucket](/agents/skills/sources/#r2), or [code](/agents/skills/sources/#code). Think lists every source again before each turn.
- **The open format.** Every `SKILL.md` is checked against the [Agent Skills specification](https://agentskills.io/specification). As the specification's guide for agents recommends, a skill that breaks a rule still loads, with a logged warning. Use `parseSkill()` to check a skill before you write it.
- **Scripts in the Workspace.** Skill scripts are Workspace files, and the model runs them with the Workspace `exec` tool. Refer to [Execution](/agents/skills/execution/).
- **Skill tools for any harness.** Use the same `activate_skill` and `read_skill_resource` tools in Think, Pi Durable, or the AI SDK. Refer to [Skills tools](/agents/tools/skills/).
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/agents/agent-class/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ flowchart TD
| **Diagnostics channels** | `subscribe()`, diagnostics channels | [Diagnostics channels](/agents/runtime/observability/diagnostics-channels/) |
| **Sub-agents** | `subAgent()`, `abortSubAgent()`, `deleteSubAgent()` | [Sub-agents](/agents/agent-class/sub-agents/) |
| **Agents as tools** | `runAgentTool()`, `clearAgentToolRuns()`, `hasAgentToolRun()` | [Agents as tools](/agents/agent-class/agent-tools/) |
| **Agent Skills** | `SKILL.md` parser, Workspace, R2, and manifest sources, script runner | [Agent Skills](/agents/skills/) |
| **Skills** | `SKILL.md` parser, Workspace, R2, and manifest sources, script runner | [Skills](/agents/skills/) |
| **Sessions** | `Sessions` capability: message history, branches, compaction, search | [Sessions](/agents/runtime/capabilities/sessions/) |
| **Think** | `Think` base class, workspace tools, lifecycle hooks, extensions | [Think](/agents/harnesses/think/) |
| **Chat SDK** | `createChatSdkState()`, `ChatSdkStateAgent` | [Chat SDK](/agents/agent-class/communication-channels/chat-sdk/) |
Expand Down
4 changes: 2 additions & 2 deletions src/content/docs/agents/concepts/context.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Context is everything the model is told on a request besides the conversation it

**Tool descriptions.** Each tool's name, description, and input schema. The model reads them to decide which tool to call, so they go in every request, and a long tool list costs tokens on every turn.

**Skills.** A [skill](/agents/concepts/agent-skills/) is a set of instructions and files for one kind of task. The request carries a short catalog, one line per skill, and the model loads a skill's instructions with a tool call only when a task needs them. For most agents, skills are the way to add knowledge and procedures: they cost little until they are used, and other agents can read the same skill files.
**Skills.** A [skill](/agents/concepts/skills/) is a set of instructions and files for one kind of task. The request carries a short catalog, one line per skill, and the model loads a skill's instructions with a tool call only when a task needs them. For most agents, skills are the way to add knowledge and procedures: they cost little until they are used, and other agents can read the same skill files.

**Memory.** Facts the agent saves so they outlast the conversation that taught them, such as the user's time zone or the decision made last week. The agent writes them with a tool to storage you choose, such as SQLite in the Durable Object, and they reach the model again either in the system prompt or when the agent looks them up with a search tool. Memory is not the transcript: compaction can summarize the conversation that taught a fact, and the saved fact stays as it was.

Expand Down Expand Up @@ -65,5 +65,5 @@ To see whether you are hitting the cache, read the usage the provider returns wi
## Related

- [Sessions](/agents/concepts/sessions/): the transcript, and how it becomes a request.
- [Skills](/agents/concepts/agent-skills/): instructions and files the model loads on demand.
- [Skills](/agents/concepts/skills/): instructions and files the model loads on demand.
- [Think context](/agents/harnesses/think/context/): context blocks in Think.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Agent Skills
title: Skills
pcx_content_type: concept
description: What Agent Skills are, how agents load them through progressive disclosure, what the open SKILL.md format specifies, and what you can build with them.
description: What skills are, how agents load them through progressive disclosure, what the open Agent Skills format specifies, and what you can build with them.
tags:
- AI
sidebar:
Expand All @@ -10,9 +10,9 @@ products:
- agents
---

[Agent Skills](https://agentskills.io/) are an open format for giving an agent specialized knowledge and repeatable workflows. A skill is a folder with a `SKILL.md` file. The file holds a name, a description, and instructions for one kind of task. The folder can also hold scripts, reference documents, templates, and other files.
A skill gives an agent specialized knowledge or a repeatable workflow. Skills follow [Agent Skills](https://agentskills.io/), an open format: a skill is a folder with a `SKILL.md` file. The file holds a name, a description, and instructions for one kind of task. The folder can also hold scripts, reference documents, templates, and other files.

Agent Skills was released as an open standard. Many agents support the standard, so a skill written once works across compatible agents. The [specification](https://agentskills.io/specification) defines what goes inside a skill folder. It does not define where skills are stored or how an agent loads them.
Many agents support the format, so a skill written once works across compatible agents. The [specification](https://agentskills.io/specification) defines what goes inside a skill folder. It does not define where skills are stored or how an agent loads them.

## Why skills

Expand Down Expand Up @@ -119,19 +119,16 @@ A skill adds instructions to the agent's context, and its scripts can run code.

## Skills in the Agents SDK

The Agents SDK reads the open format in `agents/skills` and checks every `SKILL.md` against the specification. As the specification's guide for agents recommends, it loads skills that break a rule and logs a warning, so skills written for other agents still work. Skills that cannot be used, such as ones without a description, are skipped. To check a skill when you write it, parse it with `parseSkill()` and require no warnings. It loads skills from three sources:
The Agents SDK reads the format in `agents/skills` and checks every `SKILL.md` against the specification. As the specification's guide for agents recommends, it loads skills that break a rule and logs a warning, so skills written for other agents still work. Skills that cannot be used, such as ones without a description, are skipped. To check a skill when you write it, parse it with `parseSkill()` and require no warnings.

| Source | Use it when |
| ------------------------------------------------------ | ---------------------------------------------------------------------------------- |
| [Computer Workspace](/agents/skills/sources/computer/) | Skills should be files the agent, a user, or your code can add and edit at runtime |
| [R2](/agents/skills/sources/r2/) | Many agents share one set of skills managed outside your Worker |
| [Code](/agents/skills/sources/code/) | Tests, or a small fixed set of skills that ships with your Worker |
A skill is one kind of [context](/agents/concepts/context/), and it reaches the model in two parts. The catalog, one line per skill with its name and description, goes into the system prompt. The model then loads a skill's instructions with the `activate_skill` tool and its files with `read_skill_resource`. A loaded skill comes back as a tool result, so it is part of the [session](/agents/concepts/sessions/) from then on, like any other message.

The SDK uses the `.agents/skills/` folder convention that several agents share, so `/workspace/.agents/skills/` in a Workspace holds the agent's skills. The model loads skills with the [skill tools](/agents/tools/skills/) `activate_skill` and `read_skill_resource`. With a Workspace backend, the model runs skill scripts with the Workspace `exec` tool. Refer to [Execution](/agents/skills/execution/).
`agents/skills` builds the catalog and the tools. It does not decide where the catalog goes or how often it is reloaded: each harness does. Think puts the catalog in a [context block](/agents/harnesses/think/context/) and lists the sources again before each turn. Pi adds it as a section of its system prompt when its skills extension is built.

Skills come from three kinds of [source](/agents/skills/sources/): a Computer Workspace, an R2 bucket, or code. The SDK uses the `.agents/skills/` folder convention that several agents share, so `/workspace/.agents/skills/` in a Workspace holds the agent's skills. Refer to [Execution](/agents/skills/execution/) for running skill scripts.

## Related

- [Agent Skills](/agents/skills/): use skills in Think, Pi, and the AI SDK
- [Skills](/agents/skills/): load skills into an agent with `agents/skills`
- [Skills tools](/agents/tools/skills/): add the skill tools to your harness
- [Sessions](/agents/concepts/sessions/): the transcript, where a loaded skill's instructions are kept
- [Agent Skills specification](https://agentskills.io/specification): the full format
2 changes: 1 addition & 1 deletion src/content/docs/agents/harnesses/pi/extensions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ this.registry.install({

## Add skills

`skills(sources)` from `agents/harness/pi` turns [Agent Skills](/agents/skills/) sources from `agents/skills` into a Pi extension named `agents.skills`. Sources can read skills from a [Computer Workspace](/agents/skills/sources/computer/), [R2](/agents/skills/sources/r2/), or a [manifest](/agents/skills/sources/code/). The extension has two tools, `activate_skill` and `read_skill_resource`, and a `skills` section that lists the skills. It reads the sources, so install it in an `async` factory:
`skills(sources)` from `agents/harness/pi` turns [skills](/agents/skills/) sources from `agents/skills` into a Pi extension named `agents.skills`. Sources can read skills from a [Computer Workspace](/agents/skills/sources/#workspace), [R2](/agents/skills/sources/#r2), or a [manifest](/agents/skills/sources/#code). The extension has two tools, `activate_skill` and `read_skill_resource`, and a `skills` section that lists the skills. It reads the sources, so install it in an `async` factory:

```ts
import { skills } from "agents/harness/pi";
Expand Down
Loading