drizzle
Use this skill when writing or modifying Drizzle ORM schemas, queries, or migrations in this repo — specifically the `@internal/dashboard-agent-db` package…
Author and run a durable AI chat agent with chat.agent from @trigger.dev/sdk/ai: the per-turn run loop, why you MUST take streamText from the run argument rather than importing it from ai, returning a StreamTextResult vs calling chat.pipe(), the two server actions
$ npx -y skills add triggerdotdev/trigger.dev --skill trigger-authoring-chat-agent --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/trigger-authoring-chat-agentContext preview
The summary Claude sees to decide when to auto-load this skill.
Author and run a durable AI chat agent with chat.agent from @trigger.dev/sdk/ai: the per-turn run loop, why you MUST take streamText from the run argument rather than importing it from ai, returning a StreamTextResult vs calling chat.pipe(), the two server actions
name: trigger-authoring-chat-agent description: > Author and run a durable AI chat agent with chat.agent from @trigger.dev/sdk/ai: the per-turn run loop, why you MUST take streamText from the run argument rather than importing it from ai, returning a StreamTextResult vs calling chat.pipe(), the two server actions (chat.createStartSessionAction + auth.createPublicToken), and wiring useChat to useTriggerChatTransport. Load this when building, modifying, or debugging a chat backend (the agent task or its lifecycle hooks) or its React transport, when declaring typed tools or custom data parts, or when migrating a plain AI SDK streamText route to chat.agent. type: core library: trigger.dev
The full, version-pinned reference ships **inside your installed `@trigger.dev/sdk`**. Read it before writing code — it always matches the SDK version in this project, so it never drifts:
If those paths don't exist, `@trigger.dev/sdk` isn't installed yet — install it first. In a non-hoisted layout, resolve the package with `node -p "require.resolve('@trigger.dev/sdk/package.json')"` and read `skills/` + `docs/` beside it.
// Wrong - compaction / steering / background injection silently no-op
import { streamText } from "ai";
run: async ({ messages, signal }) => streamText({ model, messages, abortSignal: signal });
// Correct - the run argument's streamText carries the managed options
run: async ({ messages, signal, streamText }) => streamText({ model, messages, abortSignal: signal });The SDK's one carries the `prepareStep` behind compaction, mid-turn steering and background injection, the system prompt from `chat.prompt()` or `chat.agent({ system })`, the registry-resolved model, and telemetry. The imported one carries none of it, with no error. `...chat.toStreamTextOptions()` does the same job by hand, and is what a custom agent has to use, since it has no `run` argument. A `chat.headStart` route gets a bound `streamText` too, and there it also owns `messages`, `stopWhen` and `abortSignal`.
back from `run`, and pass that set as `tools`. Otherwise each tool's `toModelOutput` runs on turn 1 but is dropped when history is re-converted on later turns.
model keeps generating server-side.
once per chat, so continuation runs skip it and crash with `chat.local can only be modified after initialization`. `onBoot` fires on every fresh worker.
the two server actions; the transport calls them.
only when the Session itself closes. It is sessionId-keyed, so clearing forces a resubscribe from `seq_num=0` that can hit the prior turn's stale `turn-complete` and close the stream empty.
stack traces). Return a sanitized string instead.
Sibling skills: **trigger-chat-agent-advanced** (Sessions primitive, custom transports, sub-agents, HITL, fast starts, resilience, testing, upgrades), **trigger-authoring-tasks** and **trigger-realtime-and-frontend** (the task + frontend foundations chat builds on).
The quickest way to get started is to create an account and project in our web app, and follow the instructions in the onboarding. Build and deploy your first task in minutes.
Repo: triggerdotdev/trigger.dev
Use this skill when writing or modifying Drizzle ORM schemas, queries, or migrations in this repo — specifically the `@internal/dashboard-agent-db` package…
End-to-end smoke test for the public Errors HTTP API (error groups). Seeds failed runs into ClickHouse so the error materialized views populate, then drives…
Use when adding, modifying, or debugging OTel span timeline events in the trace view. Covers event structure, ClickHouse storage constraints, rendering in…
Use this skill when writing, designing, or optimizing Trigger.dev background tasks and workflows. This includes creating reliable async tasks, implementing AI…
Covers writing backend Trigger.dev tasks with @trigger.dev/sdk: defining task() and schemaTask(), the run function and its ctx, retries, waits, queues and…
Advanced and operational chat.agent capabilities for Trigger.dev, loaded on demand. Load this when working on the raw Sessions primitive (sessions /…