skills/ai/SKILL.md
AI SDK guidance for building AI-powered features. Loads correct patterns, warns about deprecated APIs, and guides through chat UIs, agents, structured output, and streaming. Use when building AI features, debugging AI SDK errors, or before implementing any AI work.
npx skillsauth add howells/arc aiInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
<tool_restrictions>
EnterPlanMode — BANNED. Do NOT call this tool. This skill has its own structured process. Execute the steps below directly.ExitPlanMode — BANNED. You are never in plan mode.
</tool_restrictions><arc_runtime> This workflow requires the full Arc bundle, not a prompts-only install.
Paths in this skill use these conventions:
agents/..., references/..., disciplines/..., templates/..., scripts/..., rules/..., skills/<name>/... are Arc-owned files at the plugin root. Resolve the plugin root from this skill's filesystem location — it's the directory containing agents/ and skills/../... is local to this skill's directory..ruler/..., docs/..., src/..., or any project-relative path refers to the user's project repository.
</arc_runtime>
───────────────────────────────────────────────────────────
AI SDK 6 guidance for building AI-powered features.
<required_reading> Read after detecting AI SDK (Step 1):
Check package.json for AI SDK:
grep -E '"ai"' package.json
If not found:
AI SDK (`ai` package) not found in this project.
1. Install it — `pnpm add ai @ai-sdk/react @openrouter/ai-sdk-provider`
2. Skip — I'll explain the patterns without a project context
Wait for user choice. If install, run the command and continue.
If found, extract version:
grep -A1 '"ai"' package.json | grep -oE '[0-9]+\.[0-9]+\.[0-9]+'
If version < 6:
⚠ AI SDK version [version] detected. Version 6 has breaking changes that affect
almost every API. The patterns I'll load are for v6+.
If you're migrating, I'll highlight what changed. If you're staying on v5, some
patterns won't apply.
Continue with v6 patterns? (recommended even for planning a migration)
Read the patterns reference:
Read: references/ai-sdk.md
Read the rules (MUST/NEVER constraints):
Read: rules/ai-sdk.md
Ask what they're working on:
AI SDK reference loaded. What are you building?
1. Chat UI — useChat, message rendering, streaming
2. Agent — tool loops, multi-step reasoning
3. Structured output — typed responses from LLMs
4. Streaming API — streamText, server routes
5. All of the above — full reference
6. Debugging — something isn't working
Use the AskUserQuestion interaction pattern with these options.
Based on user selection, highlight the most relevant sections from the reference:
Chat UI: Focus on useChat v6 setup (DefaultChatTransport, manual input state, sendMessage), toUIMessageStreamResponse, typed tool parts.
Agent: Focus on ToolLoopAgent, stopWhen: stepCountIs(n), InferAgentUIMessage, createAgentUIStreamResponse with uiMessages.
Structured output: Focus on Output.object, Output.array, Output.choice, accessing result.output.
Streaming: Focus on streamText, toUIMessageStreamResponse, createAgentUIStreamResponse.
All: Present the quick migration table and note which sections are available.
Debugging: Ask for the error message. Common issues:
toDataStreamResponse is not a function → renamed to toUIMessageStreamResponseCannot read property 'args' → renamed to inputgenerateObject is not a function → use generateText with Output.objectmaxSteps is not a valid option → use stopWhen: stepCountIs(n)Check for project rules:
ls .ruler/ai-sdk.md 2>/dev/null
If .ruler/ai-sdk.md exists, it's already loaded by build agents. Note this to the user.
If it doesn't exist but .ruler/ does exist:
Your project has coding rules (.ruler/) but no AI SDK rules yet.
Run /arc:rules to update, or I can copy them now.
AI SDK context loaded. Ready to build.
1. Start building → /arc:implement
2. Review existing AI code → I'll check for deprecated API usage
3. Set up from scratch → I'll scaffold the provider, route, and component
If user selects "Review existing AI code":
generateObject, maxTokens, maxSteps, toDataStreamResponse, addToolResult, part.args, part.result, tool-invocationdevelopment
Create, review, or revise a concise project vision document that captures what a project is, who it is for, why it exists, success criteria, constraints, non-goals, and decision principles. Use when starting a new project, clarifying product direction, aligning a codebase for future agent work, defining a north star, or turning a vague idea into docs/vision.md.
tools
Use when starting any conversation - establishes Arc's skill routing, instruction priority, and bootstrap rules
development
Characterization testing and safety-net backfill for existing code. Use when legacy, under-tested, or risky code needs tests before a refactor, bug fix, or behavior change. Captures current behavior through public interfaces, identifies coverage gaps, and adds focused unit, integration, or E2E tests without replacing TDD implementation workflows.
testing
Run expert review on a plan, spec, or implementation approach with parallel reviewer agents. Presents findings as Socratic questions. Use when asked to "review the plan", "check this approach", or before implementation to validate architectural decisions. Optional argument: reviewer name (e.g., `/arc:review daniel-product-engineer`)