Agent skill · AI & Agents

ai-sdk-agents

Expert guidance for building AI agents with ToolLoopAgent (AI SDK v6+). Use when creating agents, configuring stopWhen/prepareStep, callOptionsSchema/prepareCall, dynamic tool selection, tool loops, or agent workflows (sequential, routing, evaluator-optimizer, orchestrator-worker). Triggers: ToolLoopAgent, agent loop, stopWhen, stepCountIs, prepareStep, callOptionsSchema, prepareCall, hasToolCall, InferAgentUIMessage, agent workflows.

majiayu000github.com/majiayu000GitHub ↗
claude-codeMIT
Install
npx skills add majiayu000/claude-skill-registry --skill ai-sdk-agents-bjornmelin-dev-skills-2 --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 2
SKILL.md size: 3 KB
Bundled scripts: none
Path: skills/ai-llm/ai-sdk-agents-bjornmelin-dev-skills-2/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 534
Language: HTML

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# AI SDK Agents Build autonomous agents with ToolLoopAgent: reusable model + tools + loop control. ## Quick Start Assume Zod v4.3.5 for schema typing. ```ts import { ToolLoopAgent, tool } from 'ai'; import { anthropic } from '@ai-sdk/anthropic'; import { z } from 'zod'; const weatherAgent = new ToolLoopAgent({ model: anthropic('claude-sonnet-4-20250514'), tools: { weather: tool({ description: 'Get the weather in a location (F)', inputSchema: z.object({ location: z.string() }), execute: async ({ location }) => ({ location, temperature: 72 }), }), }, }); const result = await weatherAgent.generate({ prompt: 'What is the weather in San Francisco?', }); ``` ## When to Use ToolLoopAgent vs Core Functions - Use **ToolLoopAgent** for dynamic, multi-step tasks where the model decides which tools to call. - Use **generateText/streamText** for deterministic flows or strict ordering. ## Essential Patterns ### Structured Output ```ts import { ToolLoopAgent, Output } from 'ai'; import { z } from 'zod'; const analysisAgent = new ToolLoopAgent({ model: 'openai/gpt-4o', output: Output.object({ schema: z.object({ sentiment: z.enum(['positive', 'neutral', 'negative']), summary: z.string(), }), }), })

What's inside
Steps it walks through
  1. Quick Start
  2. When to Use ToolLoopAgent vs Core Functions
  3. Essential Patterns
  4. Structured Output
  5. Streaming Agent
  6. API Route
  7. Type-Safe Client Integration
  8. Loop Control Checklist
  9. Runtime Configuration
  10. Reference Files
Ships with 1 file
  • metadata.json
More from claude-skill-registry
All skills →
About this skill
What does the ai-sdk-agents skill do?

Expert guidance for building AI agents with ToolLoopAgent (AI SDK v6+). Use when creating agents, configuring stopWhen/prepareStep, callOptionsSchema/prepareCall, dynamic tool selection, tool loops, or agent workflows (sequential, routing, evaluator-optimizer, orchestrator-worker). Triggers: ToolLoopAgent, agent loop, stopWhen, stepCountIs, prepareStep, callOptionsSchema, prepareCall, hasToolCall, InferAgentUIMessage, agent workflows.

How do I install it?

Run `npx skills add majiayu000/claude-skill-registry --skill ai-sdk-agents-bjornmelin-dev-skills-2 --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going