vercel-ai-sdk
Guide for Vercel AI SDK v5 implementation patterns including generateText, streamText, useChat hook, tool calling, embeddings, and MCP integration. Use when implementing AI chat interfaces, streaming responses, tool/function calling, text embeddings, or working with convertToModelMessages and toUIMessageStreamResponse. Activates for AI SDK integration, useChat hook usage, message streaming, or tool calling tasks.
What this skill does
# Vercel AI SDK v5 Implementation Guide
## When to Use This Skill
Use this skill when:
- Implementing AI chat interfaces with `useChat` hook
- Creating API routes that generate or stream AI responses
- Adding tool calling / function calling capabilities
- Generating text embeddings for semantic search or RAG
- Migrating from AI SDK v4 to v5
- Integrating Model Context Protocol (MCP) servers
- Working with streaming responses or message persistence
## Structured Implementation Workflow
<workflow>
<step id="1" name="verify-requirements">
<description>Understand the task requirements</description>
<actions>
- Identify what AI functionality is needed (chat, generation, tools, embeddings)
- Determine if client-side (useChat) or server-side (API route) implementation
- Check if streaming or non-streaming response is required
- Verify model provider (OpenAI, Anthropic, etc.)
</actions>
</step>
<step id="2" name="check-documentation">
<description>Verify current API patterns if uncertain</description>
<actions>
- Use WebFetch to check https://ai-sdk.dev/docs/ if API patterns are unclear
- Confirm model specification format for the provider
- Verify function signatures for complex features
</actions>
</step>
<step id="3" name="implement">
<description>Implement using correct v5 patterns</description>
<actions>
- Use string-based model specification ('provider/model-id')
- For chat: use sendMessage (not append), parts-based messages
- For tools: MUST import and use tool() helper from 'ai', MUST use inputSchema (NOT parameters), MUST use zod
- For streaming: use toUIMessageStreamResponse() or toTextStreamResponse()
- For embeddings: use provider.textEmbeddingModel()
</actions>
</step>
<step id="4" name="verify-types">
<description>Ensure TypeScript types are correct</description>
<actions>
- Check for proper imports from 'ai' package
- Verify message types (UIMessage for useChat)
- Ensure tool parameter types are inferred correctly
- Add explicit types for async functions
</actions>
</step>
<step id="5" name="install-dependencies">
<description>Install any missing dependencies with the CORRECT package manager</description>
<actions>
- **CRITICAL: Detect which package manager the project uses FIRST**
* Check for lockfiles: pnpm-lock.yaml → use pnpm, package-lock.json → use npm, yarn.lock → use yarn, bun.lockb → use bun
* If pnpm-lock.yaml exists, you MUST use pnpm (NOT npm!)
- Check if all imported packages are installed
- If build fails with "Module not found", identify the package name from the error
- Add the package to package.json dependencies
- Install using the CORRECT package manager:
* If pnpm-lock.yaml exists: `pnpm install [package]` or `pnpm add [package]`
* If package-lock.json exists: `npm install [package]`
* If yarn.lock exists: `yarn add [package]`
* If bun.lockb exists: `bun install [package]` or `bun add [package]`
- Re-run build to verify installation succeeded
</actions>
<critical>
**NEVER use the wrong package manager!**
- Using npm when the project uses pnpm creates package-lock.json alongside pnpm-lock.yaml
- This causes dependency version mismatches and breaks the build
- ALWAYS check for existing lockfiles and use the matching package manager
NEVER accept "Module not found" errors as environment issues
YOU must install the required packages with the CORRECT package manager
Common packages needed:
- ai (core AI SDK)
- @ai-sdk/openai (OpenAI provider)
- @ai-sdk/anthropic (Anthropic provider)
- @modelcontextprotocol/sdk (MCP integration)
- zod (for tool schemas)
</critical>
</step>
<step id="6" name="verify-build">
<description>Run build and fix ALL errors until it passes</description>
<actions>
- Run: npm run build (or bun run build)
- If build fails, read the FULL error message carefully
- Common fixes:
* "Module not found" → Install the package (go back to step 5)
* Type errors → Fix TypeScript types
* Config errors → Check next.config.js/ts
* Framework errors → Research the error, try different approaches
- Apply fix and re-run build
- REPEAT until build passes
</actions>
<critical>
NEVER stop at "build fails but code is correct"
NEVER blame "environment" or "framework bugs" without debugging
KEEP ITERATING until the build PASSES
If you encounter a framework error, research it, try workarounds, debug it
DO NOT give up until you have a passing build
</critical>
</step>
<step id="7" name="verify-tests">
<description>Run tests and debug ALL failures until they pass</description>
<actions>
- Run: npm run test (or bun run test)
- If tests fail, read the FULL error message carefully
- Debug the failure:
* Check what the test expects vs what you're providing
* Look at test assertions
* Verify your implementation matches the requirements
* Check for type mismatches or missing properties
- Fix the implementation
- Re-run tests
- REPEAT until all tests pass
</actions>
<critical>
NEVER accept test failures without debugging
NEVER dismiss failures as "test framework bugs" without investigation
Each test failure is telling you something - LISTEN to it
KEEP DEBUGGING until all tests pass
Test failures are NOT acceptable - they mean your implementation is incomplete
</critical>
</step>
<step id="8" name="final-verification">
<description>Verify EVERYTHING passes</description>
<actions>
- Run: npm run build && npm run lint && npm run test
- All three must pass: ✅ Build, ✅ Lint, ✅ Tests
- If any fail, go back and fix them
- Do not consider the task complete until ALL checks pass
</actions>
<critical>
The task is NOT complete until:
- ✅ Build passes
- ✅ Lint passes
- ✅ Tests pass
"Code is correct" is NOT enough
You must achieve FULL PASSING status
This is what it means to be an autonomous agent
</critical>
</step>
</workflow>
## ⚠️ AUTONOMOUS AGENT MINDSET
**You are not just writing code - you are COMPLETING TASKS AUTONOMOUSLY.**
This means:
1. ✅ Write correct implementation
2. ✅ **Install any required dependencies**
3. ✅ **Run build and fix ALL errors**
4. ✅ **Run tests and debug ALL failures**
5. ✅ **Iterate until EVERYTHING passes**
6. ✅ **Never make excuses or give up**
### Common Failure Patterns to AVOID
❌ **WRONG:** "The code is correct, but the package isn't installed - that's an environment issue"
✅ **CORRECT:** "Build failed due to missing package - installing it now with npm install [package]"
❌ **WRONG:** "Tests pass but build fails - not my problem"
✅ **CORRECT:** "Build is failing - debugging the error and fixing it now"
❌ **WRONG:** "There's a framework bug, can't fix it"
✅ **CORRECT:** "Framework error detected - researching the issue, trying workarounds, debugging until I find a solution"
❌ **WRONG:** "The implementation is complete" (with failing tests)
✅ **CORRECT:** "Tests are failing - debugging and fixing until they all pass"
### Dependency Installation Workflow
When you encounter "Module not found" errors:
1. **Detect the package manager FIRST** - Check for lockfiles:
```bash
ls -la | grep -E "lock"
# Look for: pnpm-lock.yaml, package-lock.json, yarn.lock, bun.lockb
```
2. **Identify the package** from the import statement
```
Error: Cannot find module '@ai-sdk/openai'
Import: import { openai } from '@ai-sdk/openai'
Package needed: @ai-sdk/openai
```
3. **Install with the CORRECT package manager**
```bash
# If pnpRelated in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.