Skip to content
Merged
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
28 changes: 28 additions & 0 deletions .changeset/rename-code-mode-skills-to-snippets.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
'@tanstack/ai-code-mode-snippets': minor
'@tanstack/ai-code-mode': minor
'@tanstack/ai': minor
---

Rename Code Mode "skills" to "snippets" to disambiguate them from agent skills (the `SKILL.md` packaging system).

**Breaking — package rename.** `@tanstack/ai-code-mode-skills` is now published as **`@tanstack/ai-code-mode-snippets`**. Update your dependency and imports. The `/storage` subpath is unchanged.

**Breaking — API rename.** Every `Skill`/`skill` identifier in the package public API becomes `Snippet`/`snippet`, for example:

- `codeModeWithSkills()` → `codeModeWithSnippets()`
- `skillsToTools()` / `skillToTool()` → `snippetsToTools()` / `snippetToTool()`
- `skillsToBindings()` / `skillsToSimpleBindings()` → `snippetsToBindings()` / `snippetsToSimpleBindings()`
- `selectRelevantSkills()` → `selectRelevantSnippets()`
- `createSkillManagementTools()` → `createSnippetManagementTools()`
- `createSkillsSystemPrompt()` → `createSnippetsSystemPrompt()`
- `generateSkillTypes()` → `generateSnippetTypes()`
- `createFileSkillStorage()` / `createMemorySkillStorage()` → `createFileSnippetStorage()` / `createMemorySnippetStorage()`
- Types: `Skill`, `SkillStorage`, `SkillIndexEntry`, `SkillStats`, `SkillBinding`, `SkillsConfig`, `CodeModeWithSkillsOptions`/`Result` → the `Snippet…` equivalents
- Options: `skills` → `snippets`, `skillsAsTools` → `snippetsAsTools`, `maxSkillsInContext` → `maxSnippetsInContext`
- Runtime tools: `search_skills` / `get_skill` / `register_skill` → `search_snippets` / `get_snippet` / `register_snippet`
- Sandbox bindings are now exposed with the `snippet_` prefix (was `skill_`)

**Breaking — sandbox hook (`@tanstack/ai-code-mode`).** The `createCodeModeTool` config option `getSkillBindings` is renamed to **`getSnippetBindings`** (same signature — an optional `() => Promise<Record<string, ToolBinding>>` returning dynamic bindings merged at execution time).

**Breaking — wire contract (`@tanstack/ai`).** The Code Mode custom events are renamed: `code_mode:skill_call` / `_result` / `_error` → `code_mode:snippet_*` (payload field `skill` → `snippet`), and `skill:registered` → `snippet:registered`. The exported event types `CodeModeSkillCallEvent` / `CodeModeSkillResultEvent` / `CodeModeSkillErrorEvent` / `SkillRegisteredEvent` are renamed to their `Snippet` equivalents.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ Learn more in the
build low-latency realtime voice experiences.
- [Code Mode](https://tanstack.com/ai/latest/docs/code-mode/code-mode) - let
models write and execute TypeScript inside a secure isolate.
- [Code Mode with Skills](https://tanstack.com/ai/latest/docs/code-mode/code-mode-with-skills) -
- [Code Mode with Snippets](https://tanstack.com/ai/latest/docs/code-mode/code-mode-with-snippets) -
give Code Mode reusable runtime capabilities.

## Providers
Expand Down
2 changes: 1 addition & 1 deletion docs/code-mode/client-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -283,4 +283,4 @@ The `onCustomEvent` callback is available through `ChatClient` from `@tanstack/a
(eventType: string, data: unknown, context: { toolCallId?: string }) => void
```

See [Code Mode](./code-mode) for setting up the server side, and [Code Mode with Skills](./code-mode-with-skills) for adding persistent skill libraries.
See [Code Mode](./code-mode) for setting up the server side, and [Code Mode with Snippets](./code-mode-with-snippets) for adding persistent snippet libraries.
2 changes: 1 addition & 1 deletion docs/code-mode/code-mode-isolates.md
Original file line number Diff line number Diff line change
Expand Up @@ -348,5 +348,5 @@ You can implement this interface to build a custom driver — for example, a Doc

- [Code Mode](./code-mode) — Core setup, API reference, and getting started guide
- [Showing Code Mode in the UI](./client-integration) — Display execution progress in your React app
- [Code Mode with Skills](./code-mode-with-skills) — Add persistent, reusable skill libraries
- [Code Mode with Snippets](./code-mode-with-snippets) — Add persistent, reusable snippet libraries

Loading
Loading