[Agents] Overhaul agent skills docs — split into SDK-agnostic and Think-specific pages#31282
[Agents] Overhaul agent skills docs — split into SDK-agnostic and Think-specific pages#31282thomasgauvin wants to merge 3 commits into
Conversation
…nk-specific pages - Overhaul /agents/runtime/execution/agent-skills/ as a reference page covering framework-agnostic primitives (SkillRegistry, sources, runner, parsers), AI SDK tool integration, and script execution. Adds DIY vs managed skills comparison table and examples for AIChatAgent and OpenAI SDK usage. - Create /agents/harnesses/think/skills/ covering Think-specific wiring: getSkills(), getSkillScriptRunner(), Vite plugin, R2 sources, custom sources, and how Think integrates the registry into the turn loop. - Update Think index, configuration, and tools pages to link to the new Think-specific skills page.
|
This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:
|
|
Reviewed PR #31282. Applied labels Summary: The PR correctly splits agent skills documentation into an SDK-agnostic concept/reference page ( Issues to fix:
No build breakers, broken links, missing imports, or incorrect frontmatter found. The heading hierarchy and sentence case are correct on both new and modified pages. |
- Wrap bare code fences in TypeScriptExample where appropriate - Fix SkillRunContext import from agents/skills (not @cloudflare/think) - Fix this.env.DB reference in custom SkillSource example (capture in closure) - Use TOML instead of JSONC in WranglerConfig
|
/bonk rereview |
The comment inside a TypeScriptExample code block causes Prettier's babel parser to fail during build rendering. Replace with a valid variable reference .
| | `fingerprint` | `string` (getter) | Composite hash of all sources — changes when any source changes | | ||
| | `systemPrompt()` | `string` or `null` | Markdown catalog of available skills and their descriptions, for injection into the system prompt | | ||
| | `snapshot()` | `SkillRegistrySnapshot` | `{ fingerprint, catalogPrompt }` — for caching and state management | | ||
| | `loadSkill(name)` | `Promise<SkillContent or null>` | Loads the full skill body, resource listing, and metadata by name | |
There was a problem hiding this comment.
Fix TypeScript type syntax and avoid or inside backticks:
| | `loadSkill(name)` | `Promise<SkillContent or null>` | Loads the full skill body, resource listing, and metadata by name | | |
| | `loadSkill(name)` | `Promise<SkillContent>` or `null` | Loads the full skill body, resource listing, and metadata by name | |
| | `systemPrompt()` | `string` or `null` | Markdown catalog of available skills and their descriptions, for injection into the system prompt | | ||
| | `snapshot()` | `SkillRegistrySnapshot` | `{ fingerprint, catalogPrompt }` — for caching and state management | | ||
| | `loadSkill(name)` | `Promise<SkillContent or null>` | Loads the full skill body, resource listing, and metadata by name | | ||
| | `readResource(name, path)` | `Promise<string or null>` | Reads a bundled resource by skill name and relative path | |
There was a problem hiding this comment.
Fix TypeScript type syntax:
| | `readResource(name, path)` | `Promise<string or null>` | Reads a bundled resource by skill name and relative path | | |
| | `readResource(name, path)` | `Promise<string>` or `null` | Reads a bundled resource by skill name and relative path | |
|
|
||
| | Tool | Available when | What it does | | ||
| | --- | --- | --- | | ||
| | `activate_skill` | Always (if skills exist) | Model calls with a skill `name` from the catalog. Returns the skill's full body plus a resource listing, wrapped in `<skill_content>` tags. | |
There was a problem hiding this comment.
Wrap angle-bracket text in backticks to prevent MDX parsing errors:
| | `activate_skill` | Always (if skills exist) | Model calls with a skill `name` from the catalog. Returns the skill's full body plus a resource listing, wrapped in `<skill_content>` tags. | | |
| | `activate_skill` | Always (if skills exist) | Model calls with a skill `name` from the catalog. Returns the skill's full body plus a resource listing, wrapped in `<skill_content>` tags. | |
| | Tool | Available when | What it does | | ||
| | --- | --- | --- | | ||
| | `activate_skill` | Always (if skills exist) | Model calls with a skill `name` from the catalog. Returns the skill's full body plus a resource listing, wrapped in `<skill_content>` tags. | | ||
| | `read_skill_resource` | Always (if skills exist) | Model reads a bundled resource by passing `{ name, path }` or a qualified path like `"release-notes/references/style-guide.md"`. | |
There was a problem hiding this comment.
Wrap braces in backticks to prevent MDX expression parsing:
| | `read_skill_resource` | Always (if skills exist) | Model reads a bundled resource by passing `{ name, path }` or a qualified path like `"release-notes/references/style-guide.md"`. | | |
| | `read_skill_resource` | Always (if skills exist) | Model reads a bundled resource by passing `{ name, path }` or a qualified path like `"release-notes/references/style-guide.md"`. | |
| <WranglerConfig> | ||
|
|
||
| export class SkillsAgent extends Think<Env> { | ||
| getSkills() { | ||
| return [skills.r2(this.env.SKILLS_BUCKET, { prefix: "skills/" })]; | ||
| } | ||
| ```jsonc | ||
| { | ||
| "worker_loaders": [{ "binding": "LOADER" }] | ||
| } | ||
| ``` | ||
|
|
||
| </WranglerConfig> |
There was a problem hiding this comment.
WranglerConfig must use TOML input per the style guide:
| <WranglerConfig> | |
| export class SkillsAgent extends Think<Env> { | |
| getSkills() { | |
| return [skills.r2(this.env.SKILLS_BUCKET, { prefix: "skills/" })]; | |
| } | |
| ```jsonc | |
| { | |
| "worker_loaders": [{ "binding": "LOADER" }] | |
| } | |
| ``` | |
| </WranglerConfig> | |
| <WranglerConfig> | |
| ```toml | |
| [[worker_loaders]] | |
| binding = "LOADER" |
|
Re-reviewed PR #31282. All issues from prior reviews have been addressed:
Posted 5 inline suggestions on
|
|
/full-review |
ReviewWarnings (9)
Suggestions (1)
CommandsOnly codeowners can run commands. Post a comment with the command to trigger it.
|
Summary
Restructures the Agent Skills documentation into two pages:
/agents/runtime/execution/agent-skills/— now a reference page covering the SDK-agnostic primitives (SkillRegistry, skill sources, script runner, parsers, types), the AI SDK tool integration (registry.tools()), and script execution. Adds a DIY vs managed skills comparison table and code examples for usingSkillRegistryinAIChatAgentand with the OpenAI SDK./agents/harnesses/think/skills/(new) — Think-specific configuration coveringgetSkills(),getSkillScriptRunner(), theagents:skillsVite plugin, R2 sources, custom sources, and how Think wires the registry into the turn loop with fingerprint caching and Session persistence.Updates Think index, configuration, and tools pages to link to the new Think-specific skills page.
Documentation checklist