Skip to content

[Agents] Overhaul agent skills docs — split into SDK-agnostic and Think-specific pages#31282

Open
thomasgauvin wants to merge 3 commits into
productionfrom
overhaul-agent-skills-docs
Open

[Agents] Overhaul agent skills docs — split into SDK-agnostic and Think-specific pages#31282
thomasgauvin wants to merge 3 commits into
productionfrom
overhaul-agent-skills-docs

Conversation

@thomasgauvin

Copy link
Copy Markdown
Contributor

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 using SkillRegistry in AIChatAgent and with the OpenAI SDK.

  • /agents/harnesses/think/skills/ (new) — Think-specific configuration covering getSkills(), getSkillScriptRunner(), the agents:skills Vite 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

  • The change adheres to the documentation style guide.
  • If a larger change - such as adding a new page- an issue has been opened in relation to any incorrect or out of date information that this PR fixes.

…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.
@github-actions github-actions Bot added product:agents Build and deploy AI-powered Agents on Cloudflare that can act autonomously. size/l labels Jun 7, 2026
@github-actions

github-actions Bot commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:

Pattern Owners
/src/content/docs/agents/ @irvinebroque, @rita3ko, @elithrar, @thomasgauvin, @threepointone, @whoiskatrin, @cloudflare/product-owners, @cloudflare/ai-agents, @cloudflare/dev-plat-leads

@thomasgauvin thomasgauvin marked this pull request as ready for review June 7, 2026 13:26
@ask-bonk ask-bonk Bot added documentation Documentation edits content:new Request for new/missing content content:edit Request for content edits labels Jun 7, 2026

@ask-bonk ask-bonk Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Posted 4 suggestions. The PR structure is sound — splitting SDK-agnostic primitives from Think-specific configuration is the right call. A few style-guide items to fix.

Comment thread src/content/docs/agents/runtime/execution/agent-skills.mdx
Comment thread src/content/docs/agents/runtime/execution/agent-skills.mdx
Comment thread src/content/docs/agents/harnesses/think/skills.mdx

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 potential issues.

View 3 additional findings in Devin Review.

Open in Devin Review

Comment thread src/content/docs/agents/harnesses/think/skills.mdx
Comment thread src/content/docs/agents/runtime/execution/agent-skills.mdx Outdated

@ask-bonk ask-bonk Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One follow-up: the OpenAI SDK example should also use TypeScriptExample.

Comment thread src/content/docs/agents/runtime/execution/agent-skills.mdx
@ask-bonk

ask-bonk Bot commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Reviewed PR #31282. Applied labels documentation, content:new, content:edit. Posted inline suggestions on 4 items.

Summary: The PR correctly splits agent skills documentation into an SDK-agnostic concept/reference page (agent-skills.mdx) and a Think-specific configuration page (skills.mdx). Link updates across Think index, configuration, and tools pages are accurate and consistent.

Issues to fix:

  • MEDIUMsrc/content/docs/agents/runtime/execution/agent-skills.mdx lines 65, 247, 300: Three runnable TypeScript examples added in this PR use bare ts fences. The style guide requires TypeScriptExample for Workers/Agents TS snippets.
  • MEDIUMsrc/content/docs/agents/harnesses/think/skills.mdx lines 155–163: The new WranglerConfig uses jsonc input. The style guide requires TOML input for WranglerConfig blocks.

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.

github run

- 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
@thomasgauvin

Copy link
Copy Markdown
Contributor Author

/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 .

@ask-bonk ask-bonk Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed. All prior issues have been addressed. Found 5 new issues in agent-skills.mdx — see inline suggestions.

| `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 |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix TypeScript type syntax and avoid or inside backticks:

Suggested change
| `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 |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix TypeScript type syntax:

Suggested change
| `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. |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrap angle-bracket text in backticks to prevent MDX parsing errors:

Suggested change
| `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"`. |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrap braces in backticks to prevent MDX expression parsing:

Suggested change
| `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"`. |

Comment on lines +330 to +338
<WranglerConfig>

export class SkillsAgent extends Think<Env> {
getSkills() {
return [skills.r2(this.env.SKILLS_BUCKET, { prefix: "skills/" })];
}
```jsonc
{
"worker_loaders": [{ "binding": "LOADER" }]
}
```

</WranglerConfig>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WranglerConfig must use TOML input per the style guide:

Suggested change
<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"
```

@ask-bonk

ask-bonk Bot commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Re-reviewed PR #31282. All issues from prior reviews have been addressed:

  • TypeScriptExample wrappers are present on all runnable TS snippets
  • skills.mdx uses TOML in WranglerConfig
  • Custom source this binding is fixed
  • SkillRunContext import uses agents/skills

Posted 5 inline suggestions on agent-skills.mdx:

  • Lines 89–90Promise<SkillContent or null> and Promise<string or null> use non-standard TS syntax and place prose or inside backticks
  • Line 199 — Unescaped <skill_content> in a table cell (MDX build risk)
  • Line 200 — Unescaped { name, path } in a table cell (MDX expression parsing risk)
  • Lines 330–338WranglerConfig uses jsonc input instead of TOML per the style guide

github run

@cloudflare cloudflare deleted a comment from cloudflare-docs-bot Bot Jun 8, 2026
@cloudflare cloudflare deleted a comment from cloudflare-docs-bot Bot Jun 8, 2026
@mvvmm

mvvmm commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

/full-review

@cloudflare-docs-bot

cloudflare-docs-bot Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Review

⚠️ 9 warnings and 1 suggestion found in full PR diff.

Warnings (9)
File Issue
agents/runtime/execution/agent-skills.mdx line 80 Tables must be introduced with a complete sentence ending in a colonKey methods: is a sentence fragment introducing a table. Fix: Rewrite as a complete sentence, for example SkillRegistry exposes the following key methods:
agents/runtime/execution/agent-skills.mdx line 109 Tables must be introduced with a complete sentence ending in a colonBuilt-in sources: is a sentence fragment introducing a table. Fix: Rewrite as a complete sentence, for example The following built-in sources are available:
agents/runtime/execution/agent-skills.mdx line 169 Tables must be introduced with a complete sentence ending in a colonLow-level utilities for reading and validating skill files: is a sentence fragment introducing a table. Fix: Rewrite as a complete sentence, for example The following low-level utilities read and validate skill files:
agents/runtime/execution/agent-skills.mdx line 205 Headings must use imperative mood instead of gerunds### Using skills in an AIChatAgent begins with a verb ending in -ing. Fix: Change to ### Use skills in an AIChatAgent
agents/runtime/execution/agent-skills.mdx line 247 Headings must use imperative mood instead of gerunds### Using skills with OpenAI SDK or other LLM clients begins with a verb ending in -ing. Fix: Change to ### Use skills with OpenAI SDK or other LLM clients
agents/runtime/execution/agent-skills.mdx line 305 Headings must use imperative mood instead of gerunds### Enabling script execution begins with a verb ending in -ing. Fix: Change to ### Enable script execution
agents/runtime/execution/agent-skills.mdx line 332 WranglerConfig must use TOML input; JSON is auto-generated<WranglerConfig> contains a ```jsonc fence instead of TOML. Fix: Replace the JSONC block with TOML (for example [[worker_loaders]]\nbinding = \"LOADER\") so the component auto-generates JSON.
agents/harnesses/think/skills.mdx line 15 Headings — Heading begins with a verb ending in -ing: ## Setting up skills Fix: Use imperative form: ## Set up skills
agents/harnesses/think/skills.mdx line 190 Headings — Heading begins with a verb ending in -ing: ## Disabling skills Fix: Use imperative form: ## Disable skills
Suggestions (1)
File Issue
agents/harnesses/think/skills.mdx line 17 Semicolons in prose — Line joins two independent clauses with a semicolon: Sources are applied in order; the first source to register a skill name wins... Fix: Break into two sentences instead of using a semicolon.
Commands

Only codeowners can run commands. Post a comment with the command to trigger it.

Command Description
/review Runs a review now. Incremental if a prior review exists, full if not.
/full-review Re-reviews the entire PR diff from scratch, ignoring incremental history. Useful after a rebase, when you want a fresh review, or if the bot gets out of sync and reports issues that no longer exist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

content:edit Request for content edits content:new Request for new/missing content documentation Documentation edits product:agents Build and deploy AI-powered Agents on Cloudflare that can act autonomously. size/l

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants