mcpField
A
ai-sdk-core-v7

ai-sdk-core-v7

github.com/blockmaticDevelopment1224 installsUpdated 4w ago
Repository

About ai-sdk-core-v7

A skill for backend developers using Vercel AI SDK v7. It gives version-specific guidance and templates for text generation, streaming, and tool-using agents.

Key features

  1. 01Version-specific SDK guidance
  2. 02Text generation and streaming patterns
  3. 03Tool-loop and agent guidance
  4. 04Security rules for client messages
  5. 05Backend code templates

Use cases

  1. 01Implementing a request handler with generateText
  2. 02Building a streaming chat endpoint
  3. 03Adding tools to a durable agent

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/blockmatic/basilic-skills --skill ai-sdk-core-v7

After installing, type/ai-sdk-core-v7in Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
request-handlers.md
templates/
agent-with-tools.ts
generate-text-basic.ts
stream-text-chat.ts

Details

From the project README

Skill: ai-sdk-core

Scope

  • Applies to: Backend AI with Vercel AI SDK v7 (ai package)
  • Does NOT cover: React chat UIs (see ai-sdk-ui)

Assumptions

Principles

  • generateText / streamText for request handlers and one-shot API routes; instructions for system-style prompt
  • Request-handler tool loops: stopWhen: isStepCount(n) on generateText / streamText — not maxSteps, not stepCountIs
  • ToolLoopAgent + generate() / stream() for durable agents — not hand-rolled loops, not new Agent()
  • UI streams: createUIMessageStreamResponse + toUIMessageStream({ stream: result.stream }) from 'ai'. Use these for new handlers and for dedicated stream/SDK updates
  • result.toUIMessageStreamResponse() still works in v7 (deprecated). Leave it only when the task is unrelated to streaming or the SDK
  • Tool results must be JSON-serializable (no Date)
  • System prompt lives in instructions. Client messages must not include { role: 'system' } unless the server fully trusts the payload

Constraints

MUST
  • Read bundled docs before writing calls
  • convertToModelMessages when the client sends UI messages
  • Reject untrusted { role: 'system' } in messages. Do not set allowSystemInMessages: true for client-supplied chat
AVOID
  • toDataStreamResponse / pipeDataStreamToResponse
  • stepCountIs / maxSteps / result.fullStream / top-level system: (use isStepCount, result.stream, instructions)
  • Guessing model IDs

Interactions

Templates

References

Comments

Markdown supported