This repository contains skills for building durable background tasks and AI agents with Trigger.dev.
trigger-setup/
├── SKILL.md # Getting started
└── references/
├── project-structure.md
└── environment-setup.md
trigger-tasks/
├── SKILL.md # Core task patterns
└── references/
├── basic-tasks.md
├── advanced-tasks.md
└── scheduled-tasks.md
trigger-config/
├── SKILL.md # Build configuration
└── references/
└── config.md
trigger-agents/
├── SKILL.md # AI agent patterns
└── references/
├── orchestration.md
├── waitpoints.md
├── streaming.md
└── ai-tool.md
trigger-realtime/
├── SKILL.md # Realtime subscriptions
└── references/
└── realtime.md
trigger-cost-savings/
├── SKILL.md # Cost optimization analysis
└── references/
└── cost-reduction.md
Each skill follows the Agent Skills specification:
---
name: skill-name
description: When to use this skill and what it does
---
# Skill Title
Instructions for the agent...- trigger-setup: When adding Trigger.dev to a project for the first time
- trigger-tasks: When creating background jobs, async workflows, or scheduled tasks
- trigger-config: When setting up
trigger.config.tsor adding build extensions - trigger-agents: When building LLM-powered workflows, orchestration, or multi-step AI agents
- trigger-realtime: When building React UIs that show task progress or stream data
- trigger-cost-savings: When asked to reduce spend, optimize costs, audit usage, or review task efficiency
// ✅ Correct
import { task } from "@trigger.dev/sdk";
export const myTask = task({
id: "my-task",
run: async (payload) => { ... }
});
// ❌ Never use (deprecated v2)
client.defineJob({ ... });const result = await childTask.triggerAndWait(payload);
// ✅ Correct
if (result.ok) {
console.log(result.output);
}
// ❌ Wrong - result is not the output
console.log(result.someProperty);// ❌ Not supported
await Promise.all([
childTask.triggerAndWait(p1),
childTask.triggerAndWait(p2),
]);
// ✅ Use batchTriggerAndWait instead
const results = await childTask.batchTriggerAndWait([
{ payload: p1 },
{ payload: p2 },
]);