Agent SkillsTanStack/ai › ai-core

ai-core

GitHub

TanStack AI核心入口,路由至聊天、工具调用等子技能。强调类型安全及框架无关性。关键规则:使用chat()而非streamText();客户端需从特定框架包导入;通过middleware处理生命周期;避免手动实现SSE。

packages/ai/skills/ai-core/SKILL.md TanStack/ai

Trigger Scenarios

需要构建基于TanStack AI的聊天应用 配置AI提供商适配器 集成工具调用或结构化输出 调试AI流式响应问题

Install

npx skills add TanStack/ai --skill ai-core -g -y
More Options

Non-standard path

npx skills add https://github.com/TanStack/ai/tree/main/packages/ai/skills/ai-core -g -y

Use without installing

npx skills use TanStack/ai@ai-core

指定 Agent (Claude Code)

npx skills add TanStack/ai --skill ai-core -a claude-code -g -y

安装 repo 全部 skill

npx skills add TanStack/ai --all -g -y

预览 repo 内 skill

npx skills add TanStack/ai --list

SKILL.md

Frontmatter
{
    "name": "ai-core",
    "type": "core",
    "library": "tanstack-ai",
    "description": "Entry point for TanStack AI skills. Routes to chat-experience, tool-calling, media-generation, structured-outputs, adapter-configuration, ag-ui-protocol, middleware, custom-backend-integration, and debug-logging. Use chat() not streamText(), openaiText() not createOpenAI(), toServerSentEventsResponse() not manual SSE, middleware hooks not onEnd callbacks.\n",
    "library_version": "0.10.0"
}

TanStack AI — Core Concepts

TanStack AI is a type-safe, provider-agnostic AI SDK. Server-side functions live in @tanstack/ai and provider adapter packages. Client-side hooks live in framework packages (@tanstack/ai-react, @tanstack/ai-solid, etc.). Always import from the framework package on the client — never from @tanstack/ai-client directly (unless vanilla JS).

Sub-Skills

Need to... Read
Build a chat UI with streaming ai-core/chat-experience/SKILL.md
Add tool calling (server, client, or both) ai-core/tool-calling/SKILL.md
Generate images, video, speech, or transcriptions ai-core/media-generation/SKILL.md
Get typed JSON responses from the LLM ai-core/structured-outputs/SKILL.md
Choose and configure a provider adapter ai-core/adapter-configuration/SKILL.md
Implement AG-UI streaming protocol server-side ai-core/ag-ui-protocol/SKILL.md
Add analytics, logging, or lifecycle hooks ai-core/middleware/SKILL.md
Connect to a non-TanStack-AI backend ai-core/custom-backend-integration/SKILL.md
Turn on/off debug logging, pipe into pino/winston ai-core/debug-logging/SKILL.md
Set up Code Mode (LLM code execution) See @tanstack/ai-code-mode package skills

Quick Decision Tree

  • Setting up a chatbot? → ai-core/chat-experience
  • Adding function calling? → ai-core/tool-calling
  • Generating media (images, audio, video)? → ai-core/media-generation
  • Need structured JSON output? → ai-core/structured-outputs
  • Choosing/configuring a provider? → ai-core/adapter-configuration
  • Building a server-only AG-UI backend? → ai-core/ag-ui-protocol
  • Adding analytics or post-stream events? → ai-core/middleware
  • Connecting to a custom backend? → ai-core/custom-backend-integration
  • Turning on debug logging to trace chunks/tools/middleware? → ai-core/debug-logging
  • Debugging mistakes? → Check Common Mistakes in the relevant sub-skill

Critical Rules

  1. This is NOT the Vercel AI SDK. Use chat() not streamText(). Use openaiText() not createOpenAI(). Import from @tanstack/ai, not ai.
  2. Import from framework package on client. Use @tanstack/ai-react (or solid/vue/svelte/preact), not @tanstack/ai-client.
  3. Use toServerSentEventsResponse() to convert streams to HTTP responses. Never implement SSE manually.
  4. Use middleware for lifecycle events. No onEnd/onFinish callbacks on chat() — use middleware: [{ onFinish: ... }].
  5. Ask the user which adapter and model they want. Suggest the latest model. Also ask if they want Code Mode.
  6. Tools must be passed to both server and client. Server gets the tool in chat({ tools }), client gets the definition in useChat({ clientTools }).

Version

Targets TanStack AI v0.10.0.

Version History

  • 5deda27 Current 2026-07-05 10:52

Same Skill Collection

.claude/skills/gap-analysis/SKILL.md
packages/ai-code-mode/skills/ai-code-mode/SKILL.md
packages/ai-mcp/skills/ai-mcp/SKILL.md
packages/ai/skills/ai-core/ag-ui-protocol/SKILL.md
packages/ai/skills/ai-core/chat-experience/SKILL.md
packages/ai/skills/ai-core/custom-backend-integration/SKILL.md
packages/ai/skills/ai-core/debug-logging/SKILL.md
packages/ai/skills/ai-core/middleware/SKILL.md
packages/ai/skills/ai-core/tool-calling/SKILL.md
.claude/skills/triage-github/SKILL.md
packages/ai-sandbox/skills/ai-sandbox/SKILL.md
packages/ai/skills/ai-core/adapter-configuration/SKILL.md
packages/ai/skills/ai-core/media-generation/SKILL.md
packages/ai/skills/ai-core/structured-outputs/SKILL.md

Metadata

Files
0
Version
bcb1b93
Hash
1c11c9b7
Indexed
2026-07-05 10:52

ホーム - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-07-22 12:59
浙ICP备14020137号-1 $お客様$