Agent skill
trigger-setup
Set up Trigger.dev in your project. Use when adding Trigger.dev for the first time, creating trigger.config.ts, or initializing the trigger directory.
Install this agent skill to your Project
npx add-skill https://github.com/triggerdotdev/skills/tree/main/trigger-setup
SKILL.md
Trigger.dev Setup
Get Trigger.dev running in your project in minutes.
When to Use
- Adding Trigger.dev to an existing project
- Creating your first task
- Setting up trigger.config.ts
- Connecting to Trigger.dev cloud
Prerequisites
- Node.js 18+ or Bun
- A Trigger.dev account (https://cloud.trigger.dev)
Quick Start
1. Install the SDK
npm install @trigger.dev/sdk
2. Initialize Your Project
npx trigger init
This creates:
trigger.config.ts- project configurationtrigger/directory - where your tasks livetrigger/example.ts- a sample task
3. Configure trigger.config.ts
import { defineConfig } from "@trigger.dev/sdk";
export default defineConfig({
project: "proj_xxxxx", // From dashboard
dirs: ["./trigger"],
});
4. Create Your First Task
// trigger/my-task.ts
import { task } from "@trigger.dev/sdk";
export const myFirstTask = task({
id: "my-first-task",
run: async (payload: { name: string }) => {
console.log(`Hello, ${payload.name}!`);
return { message: `Processed ${payload.name}` };
},
});
5. Start Development Server
npx trigger dev
6. Trigger Your Task
From your app code:
import { tasks } from "@trigger.dev/sdk";
import type { myFirstTask } from "./trigger/my-task";
await tasks.trigger<typeof myFirstTask>("my-first-task", {
name: "World",
});
Or from the Trigger.dev dashboard "Test" tab.
Project Structure
your-project/
├── trigger.config.ts # Required - project config
├── trigger/ # Required - task files
│ ├── my-task.ts
│ └── another-task.ts
├── package.json
└── ...
Environment Variables
Create .env or set in your environment:
TRIGGER_SECRET_KEY=tr_dev_xxxxx # From dashboard > API Keys
Common Issues
"No tasks found"
- Ensure tasks are exported from files in
dirsfolders - Check
trigger.config.tspoints to correct directories
"Project not found"
- Verify
projectin config matches dashboard - Check
TRIGGER_SECRET_KEYis set
"Task not registered"
- Restart
npx trigger devafter adding new tasks - Tasks must use
task()orschemaTask()from@trigger.dev/sdk
Next Steps
- Add retry logic → see trigger-tasks skill
- Configure build extensions → see trigger-config skill
- Build AI workflows → see trigger-agents skill
- Add real-time UI → see trigger-realtime skill
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
trigger-realtime
Subscribe to Trigger.dev task runs in real-time from frontend and backend. Use when building progress indicators, live dashboards, streaming AI/LLM responses, or React components that display task status.
trigger-agents
AI agent patterns with Trigger.dev - orchestration, parallelization, routing, evaluator-optimizer, and human-in-the-loop. Use when building LLM-powered tasks that need parallel workers, approval gates, tool calling, or multi-step agent workflows.
trigger-config
Configure Trigger.dev projects with trigger.config.ts. Use when setting up build extensions for Prisma, Playwright, FFmpeg, Python, or customizing deployment settings.
trigger-tasks
Build AI agents, workflows and durable background tasks with Trigger.dev. Use when creating tasks, triggering jobs, handling retries, scheduling cron jobs, or implementing queues and concurrency control.
trigger-cost-savings
Analyze Trigger.dev tasks, schedules, and runs for cost optimization opportunities. Use when asked to reduce spend, optimize costs, audit usage, right-size machines, or review task efficiency. Requires Trigger.dev MCP tools for run analysis.
span-timeline-events
Use when adding, modifying, or debugging OTel span timeline events in the trace view. Covers event structure, ClickHouse storage constraints, rendering in SpanTimeline component, admin visibility, and the step-by-step process for adding new events.
Didn't find tool you were looking for?