Skip to main content
skill CX Codex

trigger-authoring-chat-agent — Claude Code skill

trigger-authoring-chat-agent is a skill for building and running a chat agent as a single long-lived Trigger.dev task.

no license 267 installs ★ 35 updated 2026-10-19

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add triggerdotdev/skills --skill trigger-authoring-chat-agent -a claude-code
Open on GitHub

What trigger-authoring-chat-agent does

A chat agent is built from three parts: the agent task using chat.agent from @trigger.dev/sdk/ai, two server actions (chat.createStartSessionAction and auth.createPublicToken), and the frontend transport useTriggerChatTransport. When a message arrives, the agent wakes, processes it through streamText (pulled from the run parameter, not imported from the ai module), and returns the result either via return StreamTextResult or through chat.pipe() if the streamText call lives deep in helper functions.

This skill covers the agent lifecycle: session startup, per-turn message handling, typed tools (declare once on chat.agent({ tools }) and pass back to streamText), custom data parts for context transfer, lifecycle hooks like onTurnComplete, error handling, and cancellation via AbortSignal. Supports Vercel AI SDK versions 5, 6, and 7 (on v7, install @ai-sdk/otel for model call tracing).

Load this when building or debugging the agent backend (the task itself, its hooks) or the frontend transport, when declaring typed tools or writing custom data parts, or when moving a plain streamText route to chat.agent architecture.

What it helps with

  • build a long-lived chat agent with server-side state
  • attach typed tools to an agent and control their visibility per turn
  • return a streamText result from a nested function inside the agent
  • sync message history between client and server
  • migrate an existing AI SDK route to Trigger.dev agent architecture

Example prompts for the agent

  • Help me set up a chat agent with two tools: docs search and code execution
  • How does the agent lifecycle work in trigger-authoring-chat-agent? What is onTurnComplete?
  • Show me how to return a streamText result through chat.pipe() instead of return

How to install trigger-authoring-chat-agent

1Skills CLI (Vercel)

npx skills add triggerdotdev/skills --skill trigger-authoring-chat-agent -a claude-code

2Manually: put the files in place

~/.claude/skills/trigger-authoring-chat-agent/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/trigger-authoring-chat-agent/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about trigger-authoring-chat-agent

How do I install trigger-authoring-chat-agent in Claude Code?

Run npx skills add triggerdotdev/skills --skill trigger-authoring-chat-agent -a claude-code, then open ~/.claude/skills/trigger-authoring-chat-agent/SKILL.md.

What does trigger-authoring-chat-agent do?

The skill teaches you how to write long-lived chat agents on Trigger.dev: structuring a task with chat.agent, binding typed tools, handling the streamText result (return or chat.pipe()), wiring server-side auth actions, and connecting the frontend via useTriggerChatTransport.

Which Vercel AI SDK versions does this skill cover?

It works with AI SDK v5, v6, and v7. On v7, also install @ai-sdk/otel so the SDK registers model call tracing automatically.

Similar skills

All skills for Agent setup: memory, context, orchestration →

From the same set6

Project sponsors

Companies that keep this analytics open