
Add Function Examples
Add or extend `examples/ai-functions` entries in the Vercel AI SDK repo to exercise new features against live provider APIs.
Overview
Add function examples is an agent skill for the Build phase that adds typed Vercel AI SDK `examples/ai-functions` coverage for new features and validates with `pnpm type-check:full`.
Install
npx skills add https://github.com/vercel-labs/ai --skill add-function-examplesWhat is this skill?
- Scan branch diffs for features or bug fixes that need provider-backed examples
- Map each feature to model kind and top-level function (`generateText`, `streamText`, `generateImage`, etc.)
- Add language-model examples in both `generateText` and `streamText` variants when applicable
- Run `pnpm type-check:full` and fix TypeScript errors before considering the example done
- Examples double as live API tests and user-facing documentation
- Language-model examples require both generateText and streamText variants
- Finish gate: run pnpm type-check:full
Adoption & trust: 7 installs on skills.sh; 24.7k GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You shipped an AI SDK change but have no example that hits real provider APIs for the right model kind and top-level function.
Who is it for?
Contributors working on vercel-labs/ai who need consistent, testable function examples after a feature or fix branch.
Skip if: Application developers consuming the SDK in their own app repo without touching the monorepo examples directory.
When should I use this skill?
Branch adds or changes AI SDK features that need new `examples/ai-functions` coverage.
What do I get? / Deliverables
New or updated examples land in `examples/ai-functions` with correct generate/stream pairing and a passing full type-check.
- New or updated files under examples/ai-functions
- Clean pnpm type-check:full run
Recommended Skills
Journey fit
Example authoring is contributor tooling inside the SDK codebase during active development, not a ship or launch activity. Agent-tooling subphase fits maintainer workflows that shape how agents and apps call `generateText`, `streamText`, and other top-level AI functions.
How it compares
Maintainer workflow for SDK examples—not a end-user prompt library or MCP tool integration.
Common Questions / FAQ
Who is add-function-examples for?
Developers and agent-assisted contributors maintaining the Vercel AI SDK who add provider-backed samples under `examples/ai-functions`.
When should I use add-function-examples?
During Build (agent-tooling) after you change SDK behavior on a branch and need `generateText`/`streamText` (or image/speech) examples plus `pnpm type-check:full`.
Is add-function-examples safe to install?
Treat it like any repo skill: check this page’s Security Audits panel; examples may call external provider APIs using your local keys.
SKILL.md
READMESKILL.md - Add Function Examples
## Adding Function Examples Review the changes in the current branch, and identify new or modified features or bug fixes that would benefit from having an example in the `examples/ai-functions` directory. These examples are used for testing specific features against the actual provider APIs, and can also serve as documentation for users. Determine for which kind of model and top-level function the example should be added. For a language model, the example should be added in two variants, one for `generateText` and one for `streamText`. For any other models kinds, add the example for the relevant top-level function (e.g. `generateImage`, `generateSpeech`). After creating the example, run `pnpm type-check:full`; fix any errors encountered.