trigger-authoring-chat-agent

Author durable AI chat agents with chat.agent from the Trigger.dev SDK.

Updated Sep 19, 2026
One-click install
npx skills add https://github.com/paramcodes/autobro --skill trigger-authoring-chat-agent-paramcodes
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: trigger-authoring-chat-agent
Source: https://github.com/paramcodes/autobro/tree/main/.cursor/skills/trigger-authoring-chat-agent
Command: npx skills add https://github.com/paramcodes/autobro --skill trigger-authoring-chat-agent-paramcodes

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @trigger.dev/sdk.

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.

Frequently Asked Questions about trigger-authoring-chat-agent

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a durable AI chat agent with Trigger.dev?▼

Use chat.agent from @trigger.dev/sdk/ai, which provides a per-turn run loop with a managed streamText passed via the run argument. Pair it with the server actions chat.createStartSessionAction and auth.createPublicToken, and wire useChat to useTriggerChatTransport on the React side.

Why should I not import streamText from the ai package in chat.agent?▼

The streamText imported from ai lacks the managed options, so compaction, mid-turn steering, background injection, the system prompt, and telemetry silently no-op with no error. Always destructure streamText from the run argument, or use chat.toStreamTextOptions() in custom agents.

How do I migrate a plain AI SDK streamText route to chat.agent?▼

Move your model call into the agent's run function using the run argument's streamText, declare tools on chat.agent({ tools }) as well as on streamText, and forward abortSignal: signal. Then replace the route with the two server actions and the Trigger chat transport.

Why does my Trigger.dev chat agent crash with chat.local initialization errors?▼

Initializing chat.local in onChatStart causes crashes because that hook fires once per chat, so continuation runs skip it. Initialize chat.local in onBoot instead, which fires on every fresh worker.

Why does Stop not halt model generation in my chat agent?▼

Stop fails when the abort signal is not forwarded to streamText. Pass abortSignal: signal from the run argument so the server-side generation actually terminates when the user stops the response.