Skip to content

laguagu/claude-code-nextjs-skills / skills/ai-sdk-7

ai-sdk-7

Verified

Vercel AI SDK v7 development and migration. Use when building or upgrading AI SDK 7 apps, especially ToolLoopAgent, WorkflowAgent, HarnessAgent, Claude Code/Codex/Pi harnesses, runtimeContext, toolsContext, toolApproval, telemetry, reasoning, file or skill uploads, realtime, video generation, or v6-to-v7 breaking changes. For version discovery, v6 code and general doc lookup use ai-sdk.

references/core-functions.md

View on GitHub
---
title: Core Functions in AI SDK 7
description: generateText, streamText, output, settings, streams, and result shape.
---

# Generation, stream and result contracts

Use text functions with `Output` for validated structured output. Keep system
instructions in top-level `instructions`; v7 rejects system messages in input
history by default. `allowSystemInMessages` is an explicit compatibility option
for trusted history, not browser-controlled instructions.

`streamText` exposes `stream` instead of `fullStream`. Its `onChunk` can
receive boundary, lifecycle and terminal parts as well as text/tool data.
Narrow the part before processing it.

Result response helpers are deprecated. Use
`createUIMessageStreamResponse({ stream: toUIMessageStream({ stream: result.stream, originalMessages, onEnd }) })`
for UI messages, or `toTextStream` + `createTextStreamResponse` for plain text.
The server output must match the client transport. Provider-executed tools
and file/reasoning parts need handling beyond text deltas.

Top-level usage/content/tool arrays aggregate all steps. Use `finalStep`
(awaited for a stream) for final-step metadata and usage. Choose intentionally
for accounting, storage and rendering.

Use top-level `reasoning` only when supported; overlapping provider settings
take precedence. Configure timeouts for the actual operation, distinguishing
total, step, chunk and tool deadlines where the installed API supports them.

Find exact options/defaults in installed docs/types and
[AI SDK Core](https://ai-sdk.dev/docs/ai-sdk-core/overview). For renamed fields
or changed semantics read the [migration reference](migration-v6-to-v7.md).
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall