I started using the Vercel AI SDK when version 6 was released. I've noticed that when I ask an agent (Cursor, Antigravity, Claude) to write code, it often defaults to version 4 or 5 patterns.
These agents frequently confuse toolContext with experimental_context, use the wrong generateObject syntax, and get execute signatures wrong.
Whenever I run into these errors, I have to ask the agent to fix itself. This wastes tokens on trial and error until it finally understands the version 6 syntax. This issue occurred multiple times across two or three different projects, and I wanted to find a solution to this ongoing problem.
To address this, I created a personal "Knowledge Skill" document that teaches agents how to avoid these errors. It includes:
- The exact mapping for breaking changes (context, object generation)
- Best practices for Zod schema (strict mode, descriptions)
- Standard Next.js patterns (Route Handlers, valid use of environment variables)
- Smooth transitions between Vercel AI Gateway and Ollama
This approach completely stopped the errors for me.
It is currently being tracked and proposed in the official Vercel Labs repo:
vercel-labs/agent-skills#133
I think this would be a useful addition to the Tools or Guides section of this Awesome list, as it helps other developers avoid the same challenges I faced.
Would you consider a PR to add this resource?
I started using the Vercel AI SDK when version 6 was released. I've noticed that when I ask an agent (Cursor, Antigravity, Claude) to write code, it often defaults to version 4 or 5 patterns.
These agents frequently confuse
toolContextwithexperimental_context, use the wronggenerateObjectsyntax, and getexecutesignatures wrong.Whenever I run into these errors, I have to ask the agent to fix itself. This wastes tokens on trial and error until it finally understands the version 6 syntax. This issue occurred multiple times across two or three different projects, and I wanted to find a solution to this ongoing problem.
To address this, I created a personal "Knowledge Skill" document that teaches agents how to avoid these errors. It includes:
This approach completely stopped the errors for me.
It is currently being tracked and proposed in the official Vercel Labs repo:
vercel-labs/agent-skills#133
I think this would be a useful addition to the Tools or Guides section of this Awesome list, as it helps other developers avoid the same challenges I faced.
Would you consider a PR to add this resource?