What problem does it solve? Building a durable, resumable AI chat backend with the AI SDK's streamText often breaks compaction, steering, and background injection because developers wire the wrong primitives. This Skill guides you through authoring a chat.agent from @trigger.dev/sdk/ai correctly, avoiding silent no-ops and lifecycle bugs. ## Core Features & Use Cases - Managed run loop: Explains why you must take streamText from the run argument rather than importing it from ai, so compaction, mid-turn steering, and telemetry actually work. - Server actions and transport: Covers the two server actions (chat.createStartSessionAction and auth.createPublicToken) and wiring useChat to useTriggerChatTransport in React. - Common mistake prevention: Documents pitfalls like declaring tools only on streamText, not forwarding the abort signal, initializing chat.local in onChatStart, and minting tokens in the browser. - Use Case: You are migrating a plain AI SDK streamText route to a durable chat.agent with typed tools and custom data parts, and need the per-turn run loop, lifecycle hooks, and React transport wired correctly. ## Quick Start Use the trigger-authoring-chat-agent skill to convert my existing streamText route into a durable chat.agent with the managed run loop and React transport.