ai-core

Orchestrate TanStack AI chat, streaming, tool, and adapter flows with type-safe best practices.

3.0k|295|Updated Oct 8, 2025
One-click install
npx skills add https://github.com/TanStack/ai --skill ai-core-tanstack
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ai-core
Source: https://github.com/TanStack/ai/tree/main/packages/typescript/ai/skills/ai-core
Command: npx skills add https://github.com/TanStack/ai --skill ai-core-tanstack

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Clarifies how to operate TanStack AI's foundational chat, adapter, middleware, streaming, and integration patterns while preventing legacy SDK mistakes so teams stay in lockstep with provider-agnostic, type-safe guidance.

Core Features & Use Cases

  • Critical rules: Use chat() not streamText(), import from framework packages, wrap streams with toServerSentEventsResponse(), and rely on middleware hooks instead of onEnd callbacks.
  • Sub-skill routing: Directs builders to chat experience, tool calling, media generation, structured output, adapter configuration, AG-UI protocol, middleware, and custom backend integration guidance folders.
  • Decision tree & references: Offers a quick decision tree, common mistake callouts, and dependency notes tailored to TanStack AI v0.10.0 so you always ask about adapters, models, and Code Mode before implementation.

Quick Start

Ask which provider, model, and Code Mode the user prefers, then wire chat() through toServerSentEventsResponse() with the appropriate adapter and middleware hooks.

Frequently Asked Questions about ai-core

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up provider-agnostic chat streaming in TanStack AI?

To set up provider-agnostic chat streaming in TanStack AI, use the chat() function and wrap streams with toServerSentEventsResponse() using the appropriate adapter. Always import from framework packages and rely on middleware hooks instead of onEnd callbacks.

Why does my TanStack AI application fail when using streamText()?

Your application fails because TanStack AI requires using chat() rather than streamText(). Additionally, you must import from framework packages and ensure you are following version 0.10.0 guidance for correct adapter configuration and middleware hook usage.

How do I handle tool calling and structured outputs with TanStack AI?

Handle tool calling and structured outputs by routing through TanStack AI's sub-skills for tool calling and structured output guidance. Use the chat() function with middleware hooks and correct adapter imports to enforce type-safe best practices.

Can I use custom backend integrations and AG-UI servers with TanStack AI?

Yes, you can integrate custom backends and AG-UI servers. TanStack AI directs builders to custom backend integration and AG-UI protocol guidance folders, ensuring you wire chat() through toServerSentEventsResponse() with the correct adapter configuration.

What is the correct way to configure middleware in TanStack AI v0.10.0?

Configure middleware in TanStack AI v0.10.0 by using middleware hooks instead of legacy onEnd callbacks. This enforces consistent, type-safe best practices across chat, streaming, tool calling, and adapter flows within your application.

How do I generate media using TanStack AI adapters?

Generate media by accessing the media generation guidance folder through the TanStack AI core routing system. Ensure you ask about the preferred provider, model, and Code Mode, then apply the correct adapter configuration and middleware hooks.