ai-sdk
Installation
SKILL.md
Prerequisites
Before searching docs, check the installed major version in package.json,
lockfiles, or node_modules/ai/package.json.
- AI SDK 7 implementation or migration work -> use
ai-sdk-7. - AI SDK 6 implementation work -> use
ai-sdk-6. - Unknown or mixed versions -> continue with this skill until the version is
clear. If starting fresh or no version is pinned, assume the current line
(AI SDK 7) and use
ai-sdk-7.
Before searching docs, check if node_modules/ai/docs/ exists. If not, install
only the ai package using the project's package manager (e.g., bun add ai).
Do not install other packages at this stage. Provider packages (e.g., @ai-sdk/openai) and client packages (e.g., @ai-sdk/react) should be installed later when needed based on user requirements.
Monorepo path note
In Bun / pnpm / Yarn workspace monorepos, dependencies are usually not hoisted to the repo root — they live inside each app's node_modules/. If node_modules/ai/docs/ doesn't exist at the working directory, check workspace locations before assuming docs are missing: