Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

trigger

БесплатноБез исполняемых скриптовНе проверен

Use when building durable background tasks, AI agents, webhooks, or long-running workflows in TypeScript. Reach for this skill when you need to create tasks…

triggerdotdevот triggerdotdev★ 16 856 звёзд на GitHub

Об этом скилле

Trigger.dev Skill

Product summary

Trigger.dev is an open-source platform for building and running durable AI agents and workflows in TypeScript. Tasks run on Trigger.dev infrastructure (not inside your serverless functions), so they have no execution timeout and include built-in retries, queues, waits, full tracing, and elastic scaling. The core is Apache-2.0 licensed; use Trigger.dev Cloud or self-host.

Key files and commands:

  • trigger.config.ts — project configuration (task directories, retries, build settings, telemetry)
  • /trigger directory — where tasks and agents live
  • npx trigger.dev@latest init — initialize a project
  • npx trigger.dev@latest dev — run tasks locally
  • npx trigger.dev@latest deploy --env prod — deploy to production
  • @trigger.dev/sdk — main SDK package; @trigger.dev/sdk/ai for agents

Primary docs: https://trigger.dev/docs

When to use

Use this skill when:

  • Building background jobs, scheduled tasks, or long-running workflows that need to survive failures and retries
  • Creating durable multi-turn AI chat agents with chat.agent() that persist across page refreshes and deploys
  • Receiving webhooks from Stripe, GitHub, Linear, or 40+ other providers on hosted, verified endpoints
  • Triggering tasks from your backend, frontend, or from inside other tasks
  • Implementing human-in-the-loop workflows with approvals or waits
  • Needing full observability: logs, traces, spans, and run history in the dashboard
  • Building agents that need to pause and resume (waiting for external events, user approval, or time delays)

Do not use for: simple synchronous API calls, authentication setup, or dashboard-only operations.

Quick reference

Task definition

import { task } from "@trigger.dev/sdk";

export const myTask = task({
  id: "my-task",                    // Unique identifier
  retry: { maxAttempts: 3 },        // Retry config (optional)
  concurrency: { total: 1 },        // Concurrency limit (optional)
  machine: { preset: "large-1x" },  // CPU/RAM (optional)
  maxDuration: 300,                 // Max seconds (optional)
  run: async (payload, { ctx }) => {
    // Your code here; no timeout
    return { result: "data" };
  },
});

Triggering tasks

Context Method Type safety
Backend code tasks.trigger("task-id", payload) Type-only import
Backend code myTask.trigger(payload) Full import
Inside task childTask.trigger(payload) Full import
Inside task childTask.triggerAndWait(payload) Wait for result
Inside task childTask.batchTriggerAndWait([...]) Fan-out pattern
Frontend React hook useTrigger() Type-safe

Webhook endpoints

import { webhooks, webhook } from "@trigger.dev/sdk";

export const stripe = webhooks.endpoint.define({
  id: "stripe",
  source: webhooks.stripe(),
});

export const fulfillOrder = webhook({
  id: "fulfill-order",
  endpoint: stripe,
  filter: "event.type == 'checkout.session.completed'",
  onEvent: async ({ event }) => { /* ... */ },
});

Chat agents

import { chat } from "@trigger.dev/sdk/ai";
import { anthropic } from "@ai-sdk/anthropic";

export const supportAgent = chat.agent({
  id: "support-agent",
  run: async ({ messages, signal, streamText }) =>
    streamText({
      model: anthropic("claude-sonnet-5-5"),
      messages,
      abortSignal: signal,
    }),
});

CLI commands

Command Purpose
trigger dev Run tasks locally; watches for changes
trigger deploy --env prod Deploy to production
trigger deploy --env staging Deploy to staging
trigger tasks trigger <id> Trigger a task from CLI
trigger env list List environment variables
trigger login Authenticate with Trigger.dev

Configuration options (trigger.config.ts)

defineConfig({
  project: "<project-ref>",
  dirs: ["./trigger"],
  retries: { default: { maxAttempts: 3 } },
  machine: "large-1x",              // Default machine
  maxDuration: 300,                 // Default max duration
  ttl: "1h",                        // Default run TTL
  runtime: "node",                  // or "bun-1.4"
  build: {
    external: ["sharp", "wasm-pkg"],
    minify: false,
  },
  telemetry: {
    instrumentations: [/* ... */],
  },
});

Decision guidance

When to use X vs Y

Scenario Use Why
Task in same codebase myTask.trigger() Full type safety, direct import
Task in separate service tasks.trigger("id", payload) Avoids bundling task code
Need result immediately triggerAndWait() Blocks until child completes
Fan-out to many tasks batchTriggerAndWait() Parallel execution, single wait
Webhook from provider webhooks.endpoint.define() Hosted URL, verified, 40+ providers
Webhook from your app tasks.trigger() from handler Full control, no hosted endpoint
Chat with streami
Полный SKILL.md на GitHub

Установить trigger в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл trigger?

Use when building durable background tasks, AI agents, webhooks, or long-running workflows in TypeScript. Reach for this skill when you need to create tasks that survive failures, handle retries, run on schedules, receive webhooks, or build multi-turn AI chat agents.

Как установить скилл trigger?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл trigger запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить trigger с