Develop AI SDK examples with Develop AI Functions Example

Internal Claude skill inside the Vercel AI SDK repository: consistent naming patterns and templates for new AI SDK example scripts.

  • Skill Road
  • Develop AI SDK examples with Develop AI Functions Example

Published on 09.09.2026

Develop AI Functions Example is an internal skill inside the official Vercel AI SDK repository on GitHub. It is not aimed at end users of a finished app but at contributors who work on the AI SDK itself and maintain example scripts for individual SDK functions inside the examples/ai-functions folder. A skill in this sense is a SKILL.md file with a short description telling an AI coding assistant such as Claude Code when to pull it in automatically. According to the provider, this particular skill is marked internal, meaning it is not distributed as a standalone product but acts as a reference the assistant loads within the context of the Vercel repository whenever someone wants to create, run, or modify examples under examples/ai-functions/src.

What the skill is actually for

Its core job is to validate provider support, demonstrate features, and produce test fixtures. Examples are organized by SDK function: generateText for non-streaming text generation, streamText for streaming responses, generateObject and streamObject for structured output against a schema, plus sections for agents using tool loops, single and batch embeddings, image and speech generation, transcription, document reranking, and areas for middleware, provider registry setup, and OpenTelemetry integration. This structure makes it quick to see where a new example for a given use case belongs instead of scattering files arbitrarily.

Naming convention and structure

The skill enforces a clear file naming rule: the entry-point example for a function is always named basic.ts, while additional examples follow a pattern combining function, provider, and optionally sub-provider or feature, such as stream-text for the openai provider with a file called tool-call.ts for a specific tool-calling scenario. Flat files without a per-provider subfolder are explicitly disallowed so the structure stays consistent across dozens of providers. Every example uses a shared run wrapper from a library file that loads environment variables from an env file and logs errors with detailed API messages, so when testing a new model it is immediately clear why a call failed.

Requirements for using it

To make meaningful use of this skill you need a local clone of the vercel/ai repository, a working Node.js and TypeScript environment, and valid API keys for the relevant model providers stored in a local env file. The skill itself is not installed separately; it already lives in the repository and gets picked up automatically by a compatible coding agent whenever its description matches the current work context.

Security and credential handling

Because the examples make real API calls against model providers, keys and credentials end up in a local env file that should never be committed. Anyone creating new examples following this pattern should also double check that no real customer data or internal secrets end up inside prompt strings, since these files remain permanently visible in the repository history.

Practical value and limitations

The practical value lies mainly in giving new AI SDK contributors an immediately consistent structure, while a coding assistant automatically applies the correct naming patterns and templates when creating new examples, which speeds up code review. The limitation is equally clear: this skill is not a general-purpose tool for your own projects but exists solely to maintain the Vercel AI SDK example folder, and outside the context of that specific repository it offers no added value. Anyone maintaining their own SDK or example collection can still borrow the underlying idea: clear naming conventions plus a shared wrapper for environment variables and error handling save a lot of coordination effort in any larger repository.

Published on 09.09.2026

Categories

Frequently asked questions

What is this skill for?

According to the provider, it supports examples in the AI SDK directory for validating providers, demonstrating features, and creating test fixtures.

What structure does the source recommend?

Examples are grouped by AI SDK function and provider, with basic examples using the name basic.ts.

Does local execution keep data local?

Not automatically. A selected model provider may process prompts, files, or responses, so privacy and permissions need separate review.