ai-sdk-7

ai-sdk-7 is a skill for Claude Code from laguagu/claude-code-nextjs-skills. It costs 103 tokens per session (1,322 once invoked), scanned A, original, MIT.

A development guide for version 7 of Vercel's AI SDK, a toolkit for adding AI features to JavaScript and TypeScript apps. It covers building, upgrading, and configuring AI agents and related features.

In plain words
What is it for?
Use it when creating or migrating AI SDK 7 applications, especially apps with agents, tools, workflows, approvals, telemetry, real-time features, or generated media.
Why use it?
It helps developers avoid applying instructions for the wrong SDK version and highlights important requirements such as Node.js 22 or newer and modern module imports.

Skill for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: mentions Claude Code; mentions Codex.

Part of the claude-code-nextjs-skills plugin — 24 skills, 2 agents, 2 MCP servers shipped together

Good fit Use it when creating or migrating AI SDK 7 applications, especially apps with agents, tools, workflows, approvals, telemetry, real-time features, or generated media.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/laguagu/claude-code-nextjs-skills/ai-sdk-7
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add laguagu/claude-code-nextjs-skills --skill ai-sdk-7
Clone the repo
git clone --depth 1 https://github.com/laguagu/claude-code-nextjs-skills

Made for: Claude Code.

Or install claude-code-nextjs-skills, the plugin that ships this one along with the rest of its 24 skills, 2 agents, 2 MCP servers.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ai-sdk-7

README.md
[![agentmods](https://agentmods.dev/badge/skills/laguagu/claude-code-nextjs-skills/ai-sdk-7/github.svg)](https://agentmods.dev/skills/laguagu/claude-code-nextjs-skills/ai-sdk-7)
Your own site
<a href="https://agentmods.dev/skills/laguagu/claude-code-nextjs-skills/ai-sdk-7"><img src="https://agentmods.dev/badge/skills/laguagu/claude-code-nextjs-skills/ai-sdk-7/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for ai-sdk-7

Your own site · 80×15
<a href="https://agentmods.dev/skills/laguagu/claude-code-nextjs-skills/ai-sdk-7"><img src="https://agentmods.dev/badge/skills/laguagu/claude-code-nextjs-skills/ai-sdk-7.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 103 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,322 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00103 $0.01322
Opus 5 $0.00051 $0.00661
Sonnet 5 $0.00021 $0.00264
Haiku 4.5 $0.00010 $0.00132

Measured 11d ago against content hash 76c2e9d14e5e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

ai-sdk-7 scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/ai-sdk-7/SKILL.md · 114 lines

How it starts

The opening of the file, as written. The whole thing — 114 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Vercel AI SDK v7 Development Guide

Use this skill for AI SDK 7-specific implementation, migrations, and agent architecture. For AI SDK 6 projects, use ai-sdk-6. For unknown versions, use ai-sdk first to inspect node_modules/ai/package.json and local docs.

First Checks

  1. Inspect package.json, lockfiles, and node_modules/ai/package.json.
  2. Confirm the installed ai major version is 7 before applying this guide.
  3. Search local docs first: node_modules/ai/docs/ and node_modules/ai/src/.
  4. In monorepos, check app/package workspaces such as apps/*/node_modules/ai/ and packages/*/node_modules/ai/.
  5. If local docs are missing or ambiguous, verify against ai-sdk.dev or the Vercel AI repository docs source before coding.

AI SDK 7 requires Node.js >=22 and AI SDK packages are ESM-only. Convert require() imports to import syntax before chasing downstream type errors.

Install

Use the project's package manager and install only packages needed by the task:

bun add ai @ai-sdk/react
bun add @ai-sdk/openai # or the provider already used by the project

For durable agents, add @ai-sdk/workflow and workflow. For harness agents, add @ai-sdk/harness, one harness adapter, and a sandbox provider.

Core v7 Patterns

Task Prefer in AI SDK 7
Text generation generateText / streamText
System prompt top-level instructions, not system
Structured output output: Output.object(...) on text functions
Loop limit stopWhen: isStepCount(n)
Shared server state runtimeContext
Per-tool state/secrets tool contextSchema + toolsContext
Sensitive tools toolApproval on generateText, streamText, or ToolLoopAgent
Durable long-running agents WorkflowAgent from @ai-sdk/workflow
Running Claude Code/Codex/Pi HarnessAgent from @ai-sdk/harness/agent
Observability registerTelemetry(new OpenTelemetry())
Stalled calls timeout number or object

Read the full file on GitHub · 114 lines

Files

What ships with it

9 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 114 lines · 103 tokens per session scan A 76c2e9d14e5e

Subscribe to this mod's changes

ai-sdk-7 is a skill published in the GitHub repository laguagu/claude-code-nextjs-skills (62 stars, last pushed 8d ago), licensed MIT. It adds 103 tokens to every session and 1,322 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

migrate-radix-to-base

Migrates React projects and components from Radix UI to Base UI. Use when asked to migrate from radix, move to base-ui, convert radix primitives, or switch a shadcn project's base library. Handles single components ("migrate accordion") and whole projects.

shadcn-ui/ui · 61 tokens

non-json-content-types

Handle FormData, file uploads, Blob, Uint8Array, and ReadableStream inputs in tRPC mutations. Use octetInputParser from @trpc/server/http for binary data. Route non-JSON requests with splitLink and isNonJsonSerializable() from @trpc/client. FormData and binary inputs only work with mutations (POST).

trpc/trpc · 75 tokens

trigger-authoring-tasks

Covers writing backend Trigger.dev tasks with @trigger.dev/sdk: defining task() and schemaTask(), the run function and its ctx, retries, waits, queues and concurrency, idempotency keys, run metadata, logging, triggering other tasks (and the Result shape), scheduled/cron tasks, and the essentials of trigger.config.ts.…

triggerdotdev/trigger.dev · 115 tokens

saas-builder

Clone, verify, map, and build on top of ixartz/SaaS-Boilerplate for a user's SaaS idea. Use when a user wants to reuse SaaS Boilerplate, evaluate how their product fits it, or build product-specific pages, database schema, roles, permissions, MVP features, and launch scope on top of the boilerplate.

ixartz/SaaS-Boilerplate · 75 tokens

arcgis-to-portaljs

Migrate a whole ArcGIS Hub site into a PortalJS Arc portal end-to-end. Harvests the Hub /data.json (DCAT-US) inventory, exports every FeatureService layer through the ArcGIS REST query API with resultOffset paging, converts each to the serverless dual tier (PMTiles render + GeoParquet query) with tabular items to…

datopian/portaljs · 134 tokens

fast-typescript-check

Keep www-sacred's TypeScript fast to type-check and fast to run. Use when touching the ASCII/canvas animation components (the only real per-frame code here), tightening type-check wall-clock, or auditing a change for runtime or compiler regressions. Scoped to this repo — a React 19 / Next.js 16 component library plus…

internet-development/www-sacred · 84 tokens