Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Portable Agent Skills (SKILL.md) for TanStack AI with @tanstack/ai-skills. Renders a skill catalog and a load_skill tool via the withSkills middleware so any tool-calling model loads skills on demand, on any provider. Covers the SkillSource interface, inlineSkill/skillDirectory/staticSkills, the aggregate/ dedupe/filter/cache combinators, read_skill_resource, and the conformance suite. Use for provider-agnostic runtime skills — NOT hosted provider skills (codeExecutionTool/shellTool), which run
.claude/skills/tanstack-ai-skills/SKILL.md| Model | Eval pass | Runs |
|---|---|---|
| gemini-3.6-flash | 100% | 10 |
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | -13% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 26% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 14% | 0% |
| case-04 | ✗→✓ | ▲ Improved | -12% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 49% | 0% |
> Builds on the ai-core skill in @tanstack/ai. Package: @tanstack/ai-skills.
Portable Agent Skills give a tool-calling model a library of SKILL.md skills it can load on demand, on any provider, with no server sandbox. This is separate from hosted Provider Skills (codeExecutionTool / shellTool), which run in the provider's sandbox and are referenced by ID.
| Need | Use | | ----------------------------------------------- | ------------------------------------- | | Model loads SKILL.md at runtime, any provider | withSkills (this package) | | Hosted skill runs in a provider sandbox by ID | codeExecutionTool / shellTool | | Teach a coding assistant how to use TanStack AI | Ship a SKILL.md, install via Intent |
The portable and hosted paths do not mix in one chat() call: withSkills throws if a code_execution/shell tool in the same call carries skills.
typescriptimport { chat, toServerSentEventsResponse } from '@tanstack/ai' import { anthropicText } from '@tanstack/ai-anthropic' import { inlineSkill, withSkills } from '@tanstack/ai-skills' const pptx = inlineSkill({ name: 'pptx-builder', description: 'Build and edit PowerPoint decks with python-pptx.', instructions: '# Building a deck\nUse python-pptx. Edit slides, then save.', }) export async function POST(request: Request) { const { messages } = await request.json() const stream = chat({ adapter: anthropicText('claude-sonnet-4-6'), messages, middleware: [withSkills(pptx)], }) return toServerSentEventsResponse(stream) }
withSkills adds a catalog to the system prompt and a load_skill tool whose name is constrained to your skill names. It renders <available_skills> XML for Anthropic models and markdown for the rest. Re-loading a skill in the same conversation returns a short "already loaded" marker.
A SkillSource is bytes only (no filesystem assumption), so the middleware runs on the edge too.
inlineSkill({ name, description, instructions, resources? }) — one skill incode or a DB row. Edge-safe.
skillDirectory(root, { strict? }) — walk a folder for SKILL.md. Import from@tanstack/ai-skills/node (uses node:fs). Strict by default.
staticSkills(catalog) — build-time bundle via skillsCatalogPlugin (Vite).Edge-safe, and .names is a typed union.
Combine with aggregate, dedupe, filter, cache. withSkills([a, b]) is sugar for dedupe(aggregate([a, b])). A single source is never auto-wrapped, so a tenant-scoped source is never cached into a shared bucket.
To let the model read a skill's bundled files, pass createResourceTool(source) in tools. withSkills detects it and advertises read_skill_resource. Paths that escape the skill root are rejected.
withSkills inventories a skill's scripts/ in the load_skill result but does NOT run them (script execution is a later phase). To let a skill run code, pass your own execution tool to chat({ tools }) alongside withSkills and write the skill so it tells the model to call that tool. withSkills composes with any tools you provide.
tsimport { toolDefinition } from '@tanstack/ai' import { z } from 'zod' // Your own runner: a provider sandbox, a Code Mode isolate, a remote worker. import { runSomewhere } from './shell' const executeShell = toolDefinition({ name: 'execute_shell', description: 'Run a shell command and return its stdout.', inputSchema: z.object({ command: z.string() }), outputSchema: z.object({ stdout: z.string() }), }).server(async ({ command }) => ({ stdout: await runSomewhere(command) })) // chat({ tools: [executeShell], middleware: [withSkills(source)] })
The skill supplies the command; your tool supplies the ability to run it. Swap in a provider sandbox, a Code Mode isolate, or a remote worker without changing the skill. For hosted skills that run in the provider's own sandbox, use codeExecutionTool / shellTool instead (see provider-skills).
Implement SkillSource (list + load, optional revision/listResources/ readResource), then validate it with the shipped conformance suite:
typescriptimport { runSkillSourceConformance } from '@tanstack/ai-skills/testing' // Your SkillSource implementation, seeded with the `alpha` / `beta` fixture // skills the suite expects. import { myS3Source } from './my-s3-source' import { fixtures } from './fixtures' runSkillSourceConformance(() => myS3Source(fixtures), 's3')
@tanstack/ai-skills — types, inlineSkill, combinators, withSkills,createResourceTool, validateSkill, staticSkills, SkillLimitError.
@tanstack/ai-skills/node — skillDirectory, skillsCatalogPlugin (node:fs).@tanstack/ai-skills/testing — runSkillSourceConformance.docs/skills/agent-skills.mddocs/skills/skill-sources.mddocs/skills/writing-adapters.mddocs/tools/provider-skills.md| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 15,700 | 12,137 | -23% | 1 | 1 | 0% | 3,059 | 2,656 | -13% | 0 | 0 | — |
case-02 | fail→pass | 19,546 | 21,810 | +12% | 1 | 1 | 0% | 3,728 | 4,694 | +26% | 0 | 0 | — |
case-03 | fail→pass | 20,294 | 9,275 | -54% | 1 | 1 | 0% | 2,629 | 2,985 | +14% | 0 | 0 | — |
case-04 | fail→pass | 23,511 | 13,050 | -44% | 1 | 1 | 0% | 3,041 | 2,665 | -12% | 0 | 0 | — |
case-05 | fail→pass | 14,268 | 6,300 | -56% | 1 | 1 | 0% | 1,595 | 2,378 | +49% | 0 | 0 | — |
case-06 | pass→fail | 22,661 | 19,262 | -15% | 1 | 1 | 0% | 2,897 | 3,633 | +25% | 0 | 0 | — |
case-07 | fail→pass | 28,052 | 17,041 | -39% | 1 | 1 | 0% | 3,900 | 3,384 | -13% | 0 | 0 | — |
case-08 | fail→pass | 20,255 | 13,154 | -35% | 1 | 1 | 0% | 3,124 | 2,722 | -13% | 0 | 0 | — |
case-09 | fail→pass | 25,373 | 6,736 | -73% | 1 | 1 | 0% | 3,659 | 2,674 | -27% | 0 | 0 | — |
case-10 | fail→pass | 19,110 | 16,801 | -12% | 1 | 1 | 0% | 3,042 | 3,240 | +7% | 0 | 0 | — |
case-11 | fail→pass | 17,741 | 12,567 | -29% | 1 | 1 | 0% | 2,000 | 2,872 | +44% | 0 | 0 | — |
case-12 | fail→pass | 16,838 | 13,788 | -18% | 1 | 1 | 0% | 2,178 | 2,691 | +24% | 0 | 0 | — |
case-13 | fail→pass | 17,536 | 12,571 | -28% | 1 | 1 | 0% | 1,844 | 2,606 | +41% | 0 | 0 | — |
case-14 | fail→pass | 24,731 | 11,597 | -53% | 1 | 1 | 0% | 3,169 | 2,442 | -23% | 0 | 0 | — |
case-15 | pass→pass | 11,928 | 8,102 | -32% | 1 | 1 | 0% | 773 | 1,899 | +146% | 0 | 0 | — |
case-16 | pass→pass | 11,800 | 2,760 | -77% | 1 | 1 | 0% | 1,343 | 1,785 | +33% | 0 | 0 | — |
case-17 | fail→pass | 16,460 | 7,869 | -52% | 1 | 1 | 0% | 2,395 | 1,746 | -27% | 0 | 0 | — |
case-18 | pass→pass | 21,062 | 10,315 | -51% | 1 | 1 | 0% | 2,429 | 2,150 | -11% | 0 | 0 | — |
case-19 | pass→pass | 14,660 | 7,866 | -46% | 1 | 1 | 0% | 1,391 | 1,746 | +26% | 0 | 0 | — |
case-20 | fail→pass | 17,725 | 13,691 | -23% | 1 | 1 | 0% | 2,701 | 2,598 | -4% | 0 | 0 | — |
case-21 | fail→pass | 13,195 | 8,679 | -34% | 1 | 1 | 0% | 1,988 | 1,871 | -6% | 0 | 0 | — |
case-22 | fail→pass | 19,268 | 7,699 | -60% | 1 | 1 | 0% | 2,886 | 1,731 | -40% | 0 | 0 | — |
case-23 | fail→pass | 23,397 | 7,266 | -69% | 1 | 1 | 0% | 3,390 | 2,423 | -29% | 0 | 0 | — |
case-24 | fail→pass | 18,625 | 8,815 | -53% | 1 | 1 | 0% | 1,926 | 1,879 | -2% | 0 | 0 | — |
case-25 | fail→pass | 21,695 | 5,413 | -75% | 1 | 1 | 0% | 2,705 | 2,102 | -22% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 25 cases were attempted. The headline lift of +76 percentage points is the difference between those two pass rates over the 25 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.