* refactor(code-mode)!: rename Code Mode "skills" to "snippets"
Disambiguates Code Mode's runtime code library from the agent/provider
"skills" systems (the SKILL.md packaging feature). Breaking rename of the
package, its public API, and the Code Mode wire contract.
- Package: `@tanstack/ai-code-mode-skills` -> `@tanstack/ai-code-mode-snippets`
(dir `packages/ai-code-mode-skills` -> `packages/ai-code-mode-snippets`)
- API: `codeModeWithSkills`->`codeModeWithSnippets`, `snippetsToTools`,
`snippetsToBindings`, `selectRelevantSnippets`, `createSnippetManagementTools`,
`createSnippetsSystemPrompt`, `generateSnippetTypes`,
`createFile/MemorySnippetStorage`, all `Snippet*` types/options
- Runtime tools: `search_snippets`/`get_snippet`/`register_snippet`; sandbox
binding prefix `snippet_`
- Wire contract (`@tanstack/ai`): events `code_mode:snippet_*`,
`snippet:registered`; types `CodeModeSnippet*Event`/`SnippetRegisteredEvent`
- Sandbox hook (`@tanstack/ai-code-mode`): `createCodeModeTool` option
`getSkillBindings` -> `getSnippetBindings`
- Updated example `ts-code-mode-web`, docs, and reference docs
Agent/provider skills (packages/*/skills, SKILL.md, provider skills-wire)
are intentionally untouched.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* ci: apply automated fixes
* docs/test: address CodeRabbit review (rename-related fixes)
- Rename leftover test-cli id `SKL` -> `SNP` (skill abbreviation)
- Fix inaccurate "client-side" execution claim in provider-skills.md and
ai-core/tool-calling SKILL.md (snippets run in a local isolate, not
necessarily client-side)
- Package README: correct `registry` -> `toolsRegistry` return field; add
`text` language to bare fence
- code-mode-with-snippets.md: add `text` language to two bare fences (MD040)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix(code-mode-snippets): reject path traversal in snippet names
`createFileSnippetStorage` used the LLM-supplied snippet name directly as an
on-disk path segment (`join(directory, name)`) in get/save/delete, so a name
like `../../x` could read, write, or delete files outside the storage
directory. Snippet names are already identifier-shaped (they double as
`snippet_<name>` sandbox tool names), so names are now validated against
`/^[A-Za-z0-9_-]+$/`: save/delete throw and get returns null for unsafe names.
Addresses a CodeRabbit finding (pre-existing under the old skills storage).
Adds regression tests covering traversal attempts and ordinary names.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* ci: apply automated fixes
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-08-15 15:57:37 -07:00
Renamed from docs/reference/interfaces/CodeModeSkillErrorEvent.md (Browse further)