Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .agent/commands
1 change: 1 addition & 0 deletions .agent/hooks
1 change: 1 addition & 0 deletions .agent/skills
63 changes: 63 additions & 0 deletions .agents/backup/2026-01-23T19-45-36-604Z/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"version": 1,
"createdAt": "2026-01-23T19:45:39.730Z",
"scope": "project",
"operation": "change-to-agents",
"entries": [
{
"originalPath": "/Users/mateonunez/source/mateonunez/ait/.agents/commands",
"kind": "dir",
"action": "create"
},
{
"originalPath": "/Users/mateonunez/source/mateonunez/ait/.claude/commands",
"kind": "symlink",
"action": "create"
},
{
"originalPath": "/Users/mateonunez/source/mateonunez/ait/.opencode/commands",
"kind": "symlink",
"action": "create"
},
{
"originalPath": "/Users/mateonunez/source/mateonunez/ait/.cursor/commands",
"kind": "symlink",
"action": "create"
},
{
"originalPath": "/Users/mateonunez/source/mateonunez/ait/.agents/hooks",
"kind": "dir",
"action": "create"
},
{
"originalPath": "/Users/mateonunez/source/mateonunez/ait/.claude/hooks",
"kind": "symlink",
"action": "create"
},
{
"originalPath": "/Users/mateonunez/source/mateonunez/ait/.agents/skills",
"kind": "dir",
"action": "create"
},
{
"originalPath": "/Users/mateonunez/source/mateonunez/ait/.claude/skills",
"kind": "symlink",
"action": "create"
},
{
"originalPath": "/Users/mateonunez/source/mateonunez/ait/.opencode/skills",
"kind": "symlink",
"action": "create"
},
{
"originalPath": "/Users/mateonunez/source/mateonunez/ait/.cursor/skills",
"kind": "symlink",
"action": "create"
},
{
"originalPath": "/Users/mateonunez/source/mateonunez/ait/.github/skills",
"kind": "symlink",
"action": "create"
}
]
}
53 changes: 53 additions & 0 deletions .agents/skills/ai-sdk/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
name: ai-sdk
description: 'Answer questions about the AI SDK and help build AI-powered features. Use when developers: (1) Ask about AI SDK functions like generateText, streamText, ToolLoopAgent, or tools, (2) Want to build AI agents, chatbots, or text generation features, (3) Have questions about AI providers (OpenAI, Anthropic, etc.), streaming, tool calling, or structured output.'
metadata:
author: Vercel Inc.
version: '1.0'
---

## AI SDK Documentation

When you need up-to-date information about the AI SDK:

### If using ai@6.0.34 or above

Search the bundled documentation and source code in `node_modules/ai/`:

1. **Documentation**: `grep "your query" node_modules/ai/docs/`
2. **Source code**: `grep "your query" node_modules/ai/src/`

To find specific files:

- `glob "node_modules/ai/docs/**/*.mdx"` for documentation files
- `glob "node_modules/ai/src/**/*.ts"` for source files

Provider packages (`@ai-sdk/openai`, `@ai-sdk/anthropic`, etc.) also include bundled docs in their respective `node_modules/@ai-sdk/<provider>/docs/` directories.

**When in doubt, update to the latest version of the AI SDK.**

### Otherwise

1. Search the docs: `https://ai-sdk.dev/api/search-docs?q=your_query`
2. The response includes matches with links ending in `.md`
3. Fetch those `.md` URLs directly to get plain text content (e.g. `https://ai-sdk.dev/docs/agents/building-agents.md`)

Use these resources for current API details, examples, and usage patterns.

For common errors and troubleshooting, see [Common Errors Reference](references/common-errors.md).

For using Vercel AI Gateway, see [AI Gateway Reference](references/ai-gateway.md).

## Provider-Specific Information (ai@6.0.34+)

For questions about specific providers (OpenAI, Anthropic, Google, etc.), search their dedicated packages:

1. **Provider documentation**: `grep "your query" node_modules/@ai-sdk/<provider>/docs/`
2. **Provider source code**: `grep "your query" node_modules/@ai-sdk/<provider>/src/`

To find provider files:

- `glob "node_modules/@ai-sdk/<provider>/docs/**/*.mdx"` for provider documentation
- `glob "node_modules/@ai-sdk/<provider>/src/**/*.ts"` for provider source files

This is especially important for `providerOptions`, which are provider-specific settings passed to model calls. Each provider has unique options documented in their package.
41 changes: 41 additions & 0 deletions .agents/skills/ai-sdk/references/ai-gateway.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
title: Vercel AI Gateway
description: Reference for using Vercel AI Gateway with the AI SDK.
---

# Vercel AI Gateway

The Vercel AI Gateway is the fastest way to get started with the AI SDK. It provides access to models from OpenAI, Anthropic, Google, and other providers through a single API.

## Authentication

Authenticate with OIDC (for Vercel deployments) or an [AI Gateway API key](https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai-gateway%2Fapi-keys&title=AI+Gateway+API+Keys):

```env filename=".env.local"
AI_GATEWAY_API_KEY=your_api_key_here
```

## Usage

The AI Gateway is the default global provider, so you can access models using a simple string:

```ts
import { generateText } from 'ai';

const { text } = await generateText({
model: 'anthropic/claude-sonnet-4.5',
prompt: 'What is love?',
});
```

You can also explicitly import and use the gateway provider:

```ts
// Option 1: Import from 'ai' package (included by default)
import { gateway } from 'ai';
model: gateway('anthropic/claude-sonnet-4.5');

// Option 2: Install and import from '@ai-sdk/gateway' package
import { gateway } from '@ai-sdk/gateway';
model: gateway('anthropic/claude-sonnet-4.5');
```
167 changes: 167 additions & 0 deletions .agents/skills/ai-sdk/references/common-errors.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
---
title: Common Errors
description: Reference for common AI SDK errors and how to resolve them.
---

# Common Errors

## `maxTokens` → `maxOutputTokens`

```typescript
// ❌ Incorrect
const result = await generateText({
model: 'anthropic/claude-opus-4.5',
maxTokens: 512,
prompt: 'Write a short story',
});

// ✅ Correct
const result = await generateText({
model: 'anthropic/claude-opus-4.5',
maxOutputTokens: 512,
prompt: 'Write a short story',
});
```

## `maxSteps` → `stopWhen: stepCountIs(n)`

```typescript
// ❌ Incorrect
const result = await generateText({
model: 'anthropic/claude-opus-4.5',
tools: { weather },
maxSteps: 5,
prompt: 'What is the weather in NYC?',
});

// ✅ Correct
import { generateText, stepCountIs } from 'ai';

const result = await generateText({
model: 'anthropic/claude-opus-4.5',
tools: { weather },
stopWhen: stepCountIs(5),
prompt: 'What is the weather in NYC?',
});
```

## `parameters` → `inputSchema` (in tool definition)

```typescript
// ❌ Incorrect
const weatherTool = tool({
description: 'Get weather for a location',
parameters: z.object({
location: z.string(),
}),
execute: async ({ location }) => ({ location, temp: 72 }),
});

// ✅ Correct
const weatherTool = tool({
description: 'Get weather for a location',
inputSchema: z.object({
location: z.string(),
}),
execute: async ({ location }) => ({ location, temp: 72 }),
});
```

## `generateObject` → `generateText` with `output`

`generateObject` is deprecated. Use `generateText` with the `output` option instead.

```typescript
// ❌ Deprecated
import { generateObject } from 'ai';

const result = await generateObject({
model: 'anthropic/claude-opus-4.5',
schema: z.object({
recipe: z.object({
name: z.string(),
ingredients: z.array(z.string()),
}),
}),
prompt: 'Generate a recipe for chocolate cake',
});

// ✅ Correct
import { generateText, Output } from 'ai';

const result = await generateText({
model: 'anthropic/claude-opus-4.5',
output: Output.object({
schema: z.object({
recipe: z.object({
name: z.string(),
ingredients: z.array(z.string()),
}),
}),
}),
prompt: 'Generate a recipe for chocolate cake',
});

console.log(result.output); // typed object
```

## Manual JSON parsing → `generateText` with `output`

```typescript
// ❌ Incorrect
const result = await generateText({
model: 'anthropic/claude-opus-4.5',
prompt: `Extract the user info as JSON: { "name": string, "age": number }

Input: John is 25 years old`,
});
const parsed = JSON.parse(result.text);

// ✅ Correct
import { generateText, Output } from 'ai';

const result = await generateText({
model: 'anthropic/claude-opus-4.5',
output: Output.object({
schema: z.object({
name: z.string(),
age: z.number(),
}),
}),
prompt: 'Extract the user info: John is 25 years old',
});

console.log(result.output); // { name: 'John', age: 25 }
```

## Other `output` options

```typescript
// Output.array - for generating arrays of items
const result = await generateText({
model: 'anthropic/claude-opus-4.5',
output: Output.array({
element: z.object({
city: z.string(),
country: z.string(),
}),
}),
prompt: 'List 5 capital cities',
});

// Output.choice - for selecting from predefined options
const result = await generateText({
model: 'anthropic/claude-opus-4.5',
output: Output.choice({
options: ['positive', 'negative', 'neutral'] as const,
}),
prompt: 'Classify the sentiment: I love this product!',
});

// Output.json - for untyped JSON output
const result = await generateText({
model: 'anthropic/claude-opus-4.5',
output: Output.json(),
prompt: 'Return some JSON data',
});
```
Loading