opencode-skills-collection 1.0.186 → 1.0.188

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/bundled-skills/.antigravity-install-manifest.json +5 -1
  2. package/bundled-skills/3d-web-experience/SKILL.md +152 -37
  3. package/bundled-skills/agent-evaluation/SKILL.md +1088 -26
  4. package/bundled-skills/agent-memory-systems/SKILL.md +1037 -25
  5. package/bundled-skills/agent-tool-builder/SKILL.md +668 -16
  6. package/bundled-skills/ai-agents-architect/SKILL.md +271 -31
  7. package/bundled-skills/ai-product/SKILL.md +716 -26
  8. package/bundled-skills/ai-wrapper-product/SKILL.md +450 -44
  9. package/bundled-skills/algolia-search/SKILL.md +867 -15
  10. package/bundled-skills/autonomous-agents/SKILL.md +1033 -26
  11. package/bundled-skills/aws-serverless/SKILL.md +1046 -35
  12. package/bundled-skills/azure-functions/SKILL.md +1318 -19
  13. package/bundled-skills/browser-automation/SKILL.md +1065 -28
  14. package/bundled-skills/browser-extension-builder/SKILL.md +159 -32
  15. package/bundled-skills/bullmq-specialist/SKILL.md +347 -16
  16. package/bundled-skills/clerk-auth/SKILL.md +796 -15
  17. package/bundled-skills/computer-use-agents/SKILL.md +1870 -28
  18. package/bundled-skills/context-window-management/SKILL.md +271 -18
  19. package/bundled-skills/conversation-memory/SKILL.md +453 -24
  20. package/bundled-skills/crewai/SKILL.md +252 -46
  21. package/bundled-skills/discord-bot-architect/SKILL.md +1207 -34
  22. package/bundled-skills/docs/integrations/jetski-cortex.md +3 -3
  23. package/bundled-skills/docs/integrations/jetski-gemini-loader/README.md +1 -1
  24. package/bundled-skills/docs/maintainers/repo-growth-seo.md +3 -3
  25. package/bundled-skills/docs/maintainers/skills-update-guide.md +1 -1
  26. package/bundled-skills/docs/users/bundles.md +1 -1
  27. package/bundled-skills/docs/users/claude-code-skills.md +1 -1
  28. package/bundled-skills/docs/users/gemini-cli-skills.md +1 -1
  29. package/bundled-skills/docs/users/getting-started.md +1 -1
  30. package/bundled-skills/docs/users/kiro-integration.md +1 -1
  31. package/bundled-skills/docs/users/usage.md +4 -4
  32. package/bundled-skills/docs/users/visual-guide.md +4 -4
  33. package/bundled-skills/email-systems/SKILL.md +646 -26
  34. package/bundled-skills/faf-expert/SKILL.md +221 -0
  35. package/bundled-skills/faf-wizard/SKILL.md +252 -0
  36. package/bundled-skills/file-uploads/SKILL.md +212 -11
  37. package/bundled-skills/firebase/SKILL.md +646 -16
  38. package/bundled-skills/gcp-cloud-run/SKILL.md +1117 -32
  39. package/bundled-skills/graphql/SKILL.md +1026 -27
  40. package/bundled-skills/hubspot-integration/SKILL.md +804 -19
  41. package/bundled-skills/idea-darwin/SKILL.md +120 -0
  42. package/bundled-skills/inngest/SKILL.md +431 -16
  43. package/bundled-skills/interactive-portfolio/SKILL.md +342 -44
  44. package/bundled-skills/langfuse/SKILL.md +296 -41
  45. package/bundled-skills/langgraph/SKILL.md +259 -50
  46. package/bundled-skills/micro-saas-launcher/SKILL.md +343 -44
  47. package/bundled-skills/neon-postgres/SKILL.md +572 -15
  48. package/bundled-skills/nextjs-supabase-auth/SKILL.md +269 -21
  49. package/bundled-skills/notion-template-business/SKILL.md +371 -44
  50. package/bundled-skills/personal-tool-builder/SKILL.md +537 -44
  51. package/bundled-skills/plaid-fintech/SKILL.md +825 -19
  52. package/bundled-skills/prompt-caching/SKILL.md +438 -25
  53. package/bundled-skills/rag-engineer/SKILL.md +271 -29
  54. package/bundled-skills/salesforce-development/SKILL.md +912 -19
  55. package/bundled-skills/satori/SKILL.md +54 -0
  56. package/bundled-skills/scroll-experience/SKILL.md +381 -44
  57. package/bundled-skills/segment-cdp/SKILL.md +817 -19
  58. package/bundled-skills/shopify-apps/SKILL.md +1475 -19
  59. package/bundled-skills/slack-bot-builder/SKILL.md +1162 -28
  60. package/bundled-skills/telegram-bot-builder/SKILL.md +152 -37
  61. package/bundled-skills/telegram-mini-app/SKILL.md +445 -44
  62. package/bundled-skills/trigger-dev/SKILL.md +916 -27
  63. package/bundled-skills/twilio-communications/SKILL.md +1310 -28
  64. package/bundled-skills/upstash-qstash/SKILL.md +898 -27
  65. package/bundled-skills/vercel-deployment/SKILL.md +637 -39
  66. package/bundled-skills/viral-generator-builder/SKILL.md +132 -37
  67. package/bundled-skills/voice-agents/SKILL.md +937 -27
  68. package/bundled-skills/voice-ai-development/SKILL.md +375 -46
  69. package/bundled-skills/workflow-automation/SKILL.md +982 -29
  70. package/bundled-skills/zapier-make-patterns/SKILL.md +772 -27
  71. package/package.json +1 -1
@@ -1,22 +1,28 @@
1
1
  ---
2
2
  name: trigger-dev
3
- description: "You are a Trigger.dev expert who builds reliable background jobs with exceptional developer experience. You understand that Trigger.dev bridges the gap between simple queues and complex orchestration - it's \"Temporal made easy\" for TypeScript developers."
3
+ description: Trigger.dev expert for background jobs, AI workflows, and reliable
4
+ async execution with excellent developer experience and TypeScript-first
5
+ design.
4
6
  risk: unknown
5
- source: "vibeship-spawner-skills (Apache 2.0)"
6
- date_added: "2026-02-27"
7
+ source: vibeship-spawner-skills (Apache 2.0)
8
+ date_added: 2026-02-27
7
9
  ---
8
10
 
9
11
  # Trigger.dev Integration
10
12
 
11
- You are a Trigger.dev expert who builds reliable background jobs with
12
- exceptional developer experience. You understand that Trigger.dev bridges
13
- the gap between simple queues and complex orchestration - it's "Temporal
14
- made easy" for TypeScript developers.
13
+ Trigger.dev expert for background jobs, AI workflows, and reliable async
14
+ execution with excellent developer experience and TypeScript-first design.
15
15
 
16
- You've built AI pipelines that process for minutes, integration workflows
17
- that sync across dozens of services, and batch jobs that handle millions
18
- of records. You know the power of built-in integrations and the importance
19
- of proper task design.
16
+ ## Principles
17
+
18
+ - Tasks are the building blocks - each task is independently retryable
19
+ - Runs are durable - state survives crashes and restarts
20
+ - Integrations are first-class - use built-in API wrappers for reliability
21
+ - Logs are your debugging lifeline - log liberally in tasks
22
+ - Concurrency protects your resources - always set limits
23
+ - Delays and schedules are built-in - no external cron needed
24
+ - AI-ready by design - long-running AI tasks just work
25
+ - Local development matches production - use the CLI
20
26
 
21
27
  ## Capabilities
22
28
 
@@ -29,44 +35,927 @@ of proper task design.
29
35
  - task-queues
30
36
  - batch-processing
31
37
 
38
+ ## Scope
39
+
40
+ - redis-queues -> bullmq-specialist
41
+ - pure-event-driven -> inngest
42
+ - workflow-orchestration -> temporal-craftsman
43
+ - infrastructure -> infra-architect
44
+
45
+ ## Tooling
46
+
47
+ ### Core
48
+
49
+ - trigger-dev-sdk
50
+ - trigger-cli
51
+
52
+ ### Frameworks
53
+
54
+ - nextjs
55
+ - remix
56
+ - express
57
+ - hono
58
+
59
+ ### Integrations
60
+
61
+ - openai
62
+ - anthropic
63
+ - resend
64
+ - stripe
65
+ - slack
66
+ - supabase
67
+
68
+ ### Deployment
69
+
70
+ - trigger-cloud
71
+ - self-hosted
72
+ - docker
73
+
32
74
  ## Patterns
33
75
 
34
76
  ### Basic Task Setup
35
77
 
36
78
  Setting up Trigger.dev in a Next.js project
37
79
 
80
+ **When to use**: Starting with Trigger.dev in any project
81
+
82
+ // trigger.config.ts
83
+ import { defineConfig } from '@trigger.dev/sdk/v3';
84
+
85
+ export default defineConfig({
86
+ project: 'my-project',
87
+ runtime: 'node',
88
+ logLevel: 'log',
89
+ retries: {
90
+ enabledInDev: true,
91
+ default: {
92
+ maxAttempts: 3,
93
+ minTimeoutInMs: 1000,
94
+ maxTimeoutInMs: 10000,
95
+ factor: 2,
96
+ },
97
+ },
98
+ });
99
+
100
+ // src/trigger/tasks.ts
101
+ import { task, logger } from '@trigger.dev/sdk/v3';
102
+
103
+ export const helloWorld = task({
104
+ id: 'hello-world',
105
+ run: async (payload: { name: string }) => {
106
+ logger.log('Processing hello world', { payload });
107
+
108
+ // Simulate work
109
+ await new Promise(resolve => setTimeout(resolve, 1000));
110
+
111
+ return { message: `Hello, ${payload.name}!` };
112
+ },
113
+ });
114
+
115
+ // Triggering from your app
116
+ import { helloWorld } from '@/trigger/tasks';
117
+
118
+ // Fire and forget
119
+ await helloWorld.trigger({ name: 'World' });
120
+
121
+ // Wait for result
122
+ const handle = await helloWorld.trigger({ name: 'World' });
123
+ const result = await handle.wait();
124
+
38
125
  ### AI Task with OpenAI Integration
39
126
 
40
127
  Using built-in OpenAI integration with automatic retries
41
128
 
129
+ **When to use**: Building AI-powered background tasks
130
+
131
+ import { task, logger } from '@trigger.dev/sdk/v3';
132
+ import { openai } from '@trigger.dev/openai';
133
+
134
+ // Configure OpenAI with Trigger.dev
135
+ const openaiClient = openai.configure({
136
+ id: 'openai',
137
+ apiKey: process.env.OPENAI_API_KEY,
138
+ });
139
+
140
+ export const generateContent = task({
141
+ id: 'generate-content',
142
+ retry: {
143
+ maxAttempts: 3,
144
+ },
145
+ run: async (payload: { topic: string; style: string }) => {
146
+ logger.log('Generating content', { topic: payload.topic });
147
+
148
+ // Uses Trigger.dev's OpenAI integration - handles retries automatically
149
+ const completion = await openaiClient.chat.completions.create({
150
+ model: 'gpt-4-turbo-preview',
151
+ messages: [
152
+ {
153
+ role: 'system',
154
+ content: `You are a ${payload.style} writer.`,
155
+ },
156
+ {
157
+ role: 'user',
158
+ content: `Write about: ${payload.topic}`,
159
+ },
160
+ ],
161
+ });
162
+
163
+ const content = completion.choices[0].message.content;
164
+ logger.log('Generated content', { length: content?.length });
165
+
166
+ return { content, tokens: completion.usage?.total_tokens };
167
+ },
168
+ });
169
+
42
170
  ### Scheduled Task with Cron
43
171
 
44
172
  Tasks that run on a schedule
45
173
 
46
- ## Anti-Patterns
174
+ **When to use**: Periodic jobs like reports, cleanup, or syncs
175
+
176
+ import { schedules, task, logger } from '@trigger.dev/sdk/v3';
177
+
178
+ export const dailyCleanup = schedules.task({
179
+ id: 'daily-cleanup',
180
+ cron: '0 2 * * *', // 2 AM daily
181
+ run: async () => {
182
+ logger.log('Starting daily cleanup');
183
+
184
+ // Clean up old records
185
+ const deleted = await db.logs.deleteMany({
186
+ where: {
187
+ createdAt: { lt: new Date(Date.now() - 30 * 24 * 60 * 60 * 1000) },
188
+ },
189
+ });
190
+
191
+ logger.log('Cleanup complete', { deletedCount: deleted.count });
192
+
193
+ return { deleted: deleted.count };
194
+ },
195
+ });
196
+
197
+ // Weekly report
198
+ export const weeklyReport = schedules.task({
199
+ id: 'weekly-report',
200
+ cron: '0 9 * * 1', // Monday 9 AM
201
+ run: async () => {
202
+ const stats = await generateWeeklyStats();
203
+ await sendReportEmail(stats);
204
+ return stats;
205
+ },
206
+ });
207
+
208
+ ### Batch Processing
209
+
210
+ Processing large datasets in batches
211
+
212
+ **When to use**: Need to process many items with rate limiting
213
+
214
+ import { task, logger, wait } from '@trigger.dev/sdk/v3';
215
+
216
+ export const processBatch = task({
217
+ id: 'process-batch',
218
+ queue: {
219
+ concurrencyLimit: 5, // Only 5 running at once
220
+ },
221
+ run: async (payload: { items: string[] }) => {
222
+ const results = [];
223
+
224
+ for (const item of payload.items) {
225
+ logger.log('Processing item', { item });
226
+
227
+ const result = await processItem(item);
228
+ results.push(result);
229
+
230
+ // Respect rate limits
231
+ await wait.for({ seconds: 1 });
232
+ }
233
+
234
+ return { processed: results.length, results };
235
+ },
236
+ });
237
+
238
+ // Trigger batch processing
239
+ export const startBatchJob = task({
240
+ id: 'start-batch',
241
+ run: async (payload: { datasetId: string }) => {
242
+ const items = await fetchDataset(payload.datasetId);
243
+
244
+ // Split into chunks of 100
245
+ const chunks = chunkArray(items, 100);
246
+
247
+ // Trigger parallel batch tasks
248
+ const handles = await Promise.all(
249
+ chunks.map(chunk => processBatch.trigger({ items: chunk }))
250
+ );
251
+
252
+ logger.log('Started batch processing', {
253
+ totalItems: items.length,
254
+ batches: chunks.length,
255
+ });
256
+
257
+ return { batches: handles.length };
258
+ },
259
+ });
260
+
261
+ ### Webhook Handler
262
+
263
+ Processing webhooks reliably with deduplication
264
+
265
+ **When to use**: Handling webhooks from Stripe, GitHub, etc.
266
+
267
+ import { task, logger, idempotencyKeys } from '@trigger.dev/sdk/v3';
268
+
269
+ export const handleStripeEvent = task({
270
+ id: 'handle-stripe-event',
271
+ run: async (payload: {
272
+ eventId: string;
273
+ type: string;
274
+ data: any;
275
+ }) => {
276
+ // Idempotency based on Stripe event ID
277
+ const idempotencyKey = await idempotencyKeys.create(payload.eventId);
278
+
279
+ if (idempotencyKey.isNew === false) {
280
+ logger.log('Duplicate event, skipping', { eventId: payload.eventId });
281
+ return { skipped: true };
282
+ }
283
+
284
+ logger.log('Processing Stripe event', {
285
+ type: payload.type,
286
+ eventId: payload.eventId,
287
+ });
288
+
289
+ switch (payload.type) {
290
+ case 'checkout.session.completed':
291
+ await handleCheckoutComplete(payload.data);
292
+ break;
293
+ case 'customer.subscription.updated':
294
+ await handleSubscriptionUpdate(payload.data);
295
+ break;
296
+ }
297
+
298
+ return { processed: true, type: payload.type };
299
+ },
300
+ });
301
+
302
+ ## Sharp Edges
303
+
304
+ ### Task timeout kills execution without clear error
305
+
306
+ Severity: CRITICAL
307
+
308
+ Situation: Long-running AI task or batch process suddenly stops. No error in logs.
309
+ Task shows as failed in dashboard but no stack trace. Data partially processed.
310
+
311
+ Symptoms:
312
+ - Task fails with no error message
313
+ - Partial data processing
314
+ - Works locally, fails in production
315
+ - "Task timed out" in dashboard
316
+
317
+ Why this breaks:
318
+ Trigger.dev has execution timeouts (defaults vary by plan). When exceeded, the
319
+ task is killed mid-execution. If you're not logging progress, you won't know
320
+ where it stopped. This is especially common with AI tasks that can take minutes.
321
+
322
+ Recommended fix:
323
+
324
+ # Configure explicit timeouts:
325
+ ```typescript
326
+ export const processDocument = task({
327
+ id: 'process-document',
328
+ machine: {
329
+ preset: 'large-2x', // More resources = longer allowed time
330
+ },
331
+ run: async (payload) => {
332
+ logger.log('Starting document processing', { docId: payload.id });
333
+
334
+ // Log progress at each step
335
+ logger.log('Step 1: Extracting text');
336
+ const text = await extractText(payload.fileUrl);
337
+
338
+ logger.log('Step 2: Generating embeddings', { textLength: text.length });
339
+ const embeddings = await generateEmbeddings(text);
340
+
341
+ logger.log('Step 3: Storing vectors', { count: embeddings.length });
342
+ await storeVectors(embeddings);
343
+
344
+ logger.log('Completed successfully');
345
+ return { processed: true };
346
+ },
347
+ });
348
+ ```
349
+
350
+ # For very long tasks, break into subtasks:
351
+ - Use triggerAndWait for sequential steps
352
+ - Each subtask has its own timeout
353
+ - Progress is visible in dashboard
354
+
355
+ ### Non-serializable payload causes silent task failure
356
+
357
+ Severity: CRITICAL
358
+
359
+ Situation: Passing Date objects, class instances, or circular references in payload.
360
+ Task queued but never runs. Or runs with undefined/null values.
361
+
362
+ Symptoms:
363
+ - Payload values are undefined in task
364
+ - Date objects become strings
365
+ - Class methods not available
366
+ - "Converting circular structure to JSON"
367
+
368
+ Why this breaks:
369
+ Trigger.dev serializes payloads to JSON. Dates become strings, class instances
370
+ lose methods, functions disappear, circular refs throw. Your task sees different
371
+ data than you sent.
372
+
373
+ Recommended fix:
374
+
375
+ # Always use plain objects:
376
+ ```typescript
377
+ // WRONG - Date becomes string
378
+ await myTask.trigger({ createdAt: new Date() });
379
+
380
+ // RIGHT - ISO string
381
+ await myTask.trigger({ createdAt: new Date().toISOString() });
382
+
383
+ // WRONG - Class instance
384
+ await myTask.trigger({ user: new User(data) });
385
+
386
+ // RIGHT - Plain object
387
+ await myTask.trigger({ user: { id: data.id, email: data.email } });
388
+
389
+ // WRONG - Circular reference
390
+ const obj = { parent: null };
391
+ obj.parent = obj;
392
+ await myTask.trigger(obj); // Throws!
393
+ ```
394
+
395
+ # In task, reconstitute as needed:
396
+ ```typescript
397
+ run: async (payload: { createdAt: string }) => {
398
+ const date = new Date(payload.createdAt);
399
+ // ...
400
+ }
401
+ ```
402
+
403
+ ### Environment variables not synced to Trigger.dev cloud
404
+
405
+ Severity: CRITICAL
406
+
407
+ Situation: Task works locally but fails in production. Env var that exists in Vercel
408
+ is undefined in Trigger.dev. API calls fail, database connections fail.
409
+
410
+ Symptoms:
411
+ - "Environment variable not found"
412
+ - API calls return 401 in production tasks
413
+ - Works in dev, fails in production
414
+ - Database connection errors in tasks
415
+
416
+ Why this breaks:
417
+ Trigger.dev runs tasks in its own cloud, separate from your Vercel/Railway
418
+ deployment. Environment variables must be configured in BOTH places. They
419
+ don't automatically sync.
420
+
421
+ Recommended fix:
422
+
423
+ # Sync env vars to Trigger.dev:
424
+ 1. Go to Trigger.dev dashboard
425
+ 2. Project Settings > Environment Variables
426
+ 3. Add ALL required env vars
427
+
428
+ # Or use CLI:
429
+ ```bash
430
+ # Create .env.trigger file
431
+ DATABASE_URL=postgres://...
432
+ OPENAI_API_KEY=sk-...
433
+ STRIPE_SECRET_KEY=sk_live_...
434
+
435
+ # Push to Trigger.dev
436
+ npx trigger.dev@latest env push
437
+ ```
438
+
439
+ # Common missing vars:
440
+ - DATABASE_URL
441
+ - OPENAI_API_KEY / ANTHROPIC_API_KEY
442
+ - STRIPE_SECRET_KEY
443
+ - Service API keys
444
+ - Internal service URLs
445
+
446
+ # Test in staging:
447
+ Trigger.dev has separate envs - configure staging too
448
+
449
+ ### SDK version mismatch between CLI and package
450
+
451
+ Severity: HIGH
452
+
453
+ Situation: Updated @trigger.dev/sdk but forgot to update CLI. Or vice versa.
454
+ Tasks fail to register. Weird type errors. Dev server crashes.
455
+
456
+ Symptoms:
457
+ - Tasks not appearing in dashboard
458
+ - Type errors in trigger.config.ts
459
+ - "Failed to register task"
460
+ - Dev server crashes on start
461
+
462
+ Why this breaks:
463
+ The Trigger.dev SDK and CLI must be on compatible versions. Breaking changes
464
+ between versions cause registration failures. The CLI generates types that
465
+ must match the SDK.
466
+
467
+ Recommended fix:
468
+
469
+ # Always update together:
470
+ ```bash
471
+ # Update both SDK and CLI
472
+ npm install @trigger.dev/sdk@latest
473
+ npx trigger.dev@latest dev
474
+
475
+ # Or pin to same version
476
+ npm install @trigger.dev/sdk@3.3.0
477
+ npx trigger.dev@3.3.0 dev
478
+ ```
479
+
480
+ # Check versions:
481
+ ```bash
482
+ npx trigger.dev@latest --version
483
+ npm list @trigger.dev/sdk
484
+ ```
485
+
486
+ # In CI/CD:
487
+ ```yaml
488
+ - run: npm install @trigger.dev/sdk@${{ env.TRIGGER_VERSION }}
489
+ - run: npx trigger.dev@${{ env.TRIGGER_VERSION }} deploy
490
+ ```
491
+
492
+ ### Task retries cause duplicate side effects
493
+
494
+ Severity: HIGH
495
+
496
+ Situation: Task sends email, then fails on next step. Retry sends email again.
497
+ Customer gets 3 identical emails. Or 3 Stripe charges. Or 3 Slack messages.
498
+
499
+ Symptoms:
500
+ - Duplicate emails on retry
501
+ - Multiple charges for same order
502
+ - Duplicate webhook deliveries
503
+ - Data inserted multiple times
504
+
505
+ Why this breaks:
506
+ Trigger.dev retries failed tasks from the beginning. If your task has side
507
+ effects before the failure point, those execute again. Without idempotency,
508
+ you create duplicates.
509
+
510
+ Recommended fix:
511
+
512
+ # Use idempotency keys:
513
+ ```typescript
514
+ import { task, idempotencyKeys } from '@trigger.dev/sdk/v3';
515
+
516
+ export const sendOrderEmail = task({
517
+ id: 'send-order-email',
518
+ run: async (payload: { orderId: string }) => {
519
+ // Check if already sent
520
+ const key = await idempotencyKeys.create(`email-${payload.orderId}`);
47
521
 
48
- ### Giant Monolithic Tasks
522
+ if (!key.isNew) {
523
+ logger.log('Email already sent, skipping');
524
+ return { skipped: true };
525
+ }
49
526
 
50
- ### ❌ Ignoring Built-in Integrations
527
+ await sendEmail(payload.orderId);
528
+ return { sent: true };
529
+ },
530
+ });
531
+ ```
51
532
 
52
- ### No Logging
533
+ # Alternative: Track in database
534
+ ```typescript
535
+ const existing = await db.emailLogs.findUnique({
536
+ where: { orderId_type: { orderId, type: 'order_confirmation' } }
537
+ });
53
538
 
54
- ## ⚠️ Sharp Edges
539
+ if (existing) {
540
+ logger.log('Already sent');
541
+ return;
542
+ }
55
543
 
56
- | Issue | Severity | Solution |
57
- |-------|----------|----------|
58
- | Task timeout kills execution without clear error | critical | # Configure explicit timeouts: |
59
- | Non-serializable payload causes silent task failure | critical | # Always use plain objects: |
60
- | Environment variables not synced to Trigger.dev cloud | critical | # Sync env vars to Trigger.dev: |
61
- | SDK version mismatch between CLI and package | high | # Always update together: |
62
- | Task retries cause duplicate side effects | high | # Use idempotency keys: |
63
- | High concurrency overwhelms downstream services | high | # Set queue concurrency limits: |
64
- | trigger.config.ts not at project root | high | # Config must be at package root: |
65
- | wait.for in loops causes memory issues | medium | # Batch instead of individual waits: |
544
+ await sendEmail(orderId);
545
+ await db.emailLogs.create({ data: { orderId, type: 'order_confirmation' } });
546
+ ```
547
+
548
+ ### High concurrency overwhelms downstream services
549
+
550
+ Severity: HIGH
551
+
552
+ Situation: Burst of 1000 tasks triggered. All hit OpenAI API simultaneously.
553
+ Rate limited. All fail. Retry. Rate limited again. Vicious cycle.
554
+
555
+ Symptoms:
556
+ - Rate limit errors (429)
557
+ - Database connection pool exhausted
558
+ - API returns "too many requests"
559
+ - Mass task failures
560
+
561
+ Why this breaks:
562
+ Trigger.dev scales to handle many concurrent tasks. But your downstream
563
+ APIs (OpenAI, databases, external services) have rate limits. Without
564
+ concurrency control, you overwhelm them.
565
+
566
+ Recommended fix:
567
+
568
+ # Set queue concurrency limits:
569
+ ```typescript
570
+ export const callOpenAI = task({
571
+ id: 'call-openai',
572
+ queue: {
573
+ concurrencyLimit: 10, // Only 10 running at once
574
+ },
575
+ run: async (payload) => {
576
+ // Protected by concurrency limit
577
+ return await openai.chat.completions.create(payload);
578
+ },
579
+ });
580
+ ```
581
+
582
+ # For rate-limited APIs:
583
+ ```typescript
584
+ export const callRateLimitedAPI = task({
585
+ id: 'call-api',
586
+ queue: {
587
+ concurrencyLimit: 5,
588
+ },
589
+ retry: {
590
+ maxAttempts: 5,
591
+ minTimeoutInMs: 5000, // Wait before retry
592
+ factor: 2, // Exponential backoff
593
+ },
594
+ run: async (payload) => {
595
+ // Add delay between calls
596
+ await wait.for({ milliseconds: 200 });
597
+ return await externalAPI.call(payload);
598
+ },
599
+ });
600
+ ```
601
+
602
+ # Start conservative:
603
+ - 5-10 for external APIs
604
+ - 20-50 for databases
605
+ - Increase based on monitoring
606
+
607
+ ### trigger.config.ts not at project root
608
+
609
+ Severity: HIGH
610
+
611
+ Situation: Running npx trigger.dev dev but CLI can't find config.
612
+ Or config exists but in wrong location (monorepo issue).
613
+
614
+ Symptoms:
615
+ - "Could not find trigger.config.ts"
616
+ - Tasks not discovered
617
+ - Empty task list in dashboard
618
+ - Works for one package, not another
619
+
620
+ Why this breaks:
621
+ The CLI looks for trigger.config.ts at the current working directory.
622
+ In monorepos, you must run from the package directory, not the root.
623
+ Wrong location = tasks not discovered.
624
+
625
+ Recommended fix:
626
+
627
+ # Config must be at package root:
628
+ ```
629
+ my-app/
630
+ ├── trigger.config.ts <- Here
631
+ ├── package.json
632
+ ├── src/
633
+ │ └── trigger/
634
+ │ └── tasks.ts
635
+ ```
636
+
637
+ # In monorepos:
638
+ ```
639
+ monorepo/
640
+ ├── apps/
641
+ │ └── web/
642
+ │ ├── trigger.config.ts <- Here, not at monorepo root
643
+ │ ├── package.json
644
+ │ └── src/trigger/
645
+
646
+ # Run from package directory
647
+ cd apps/web && npx trigger.dev dev
648
+ ```
649
+
650
+ # Specify config location:
651
+ ```bash
652
+ npx trigger.dev dev --config ./apps/web/trigger.config.ts
653
+ ```
654
+
655
+ ### wait.for in loops causes memory issues
656
+
657
+ Severity: MEDIUM
658
+
659
+ Situation: Processing thousands of items with wait.for between each.
660
+ Task memory grows. Eventually killed for memory.
661
+
662
+ Symptoms:
663
+ - Task killed for memory
664
+ - Slow task execution
665
+ - State blob too large error
666
+ - Works for small batches, fails for large
667
+
668
+ Why this breaks:
669
+ Each wait.for creates checkpoint state. In a loop with thousands of
670
+ iterations, this accumulates. The task's state blob grows until it
671
+ hits memory limits.
672
+
673
+ Recommended fix:
674
+
675
+ # Batch instead of individual waits:
676
+ ```typescript
677
+ // WRONG - Wait per item
678
+ for (const item of items) {
679
+ await processItem(item);
680
+ await wait.for({ milliseconds: 100 }); // 1000 waits = bloated state
681
+ }
682
+
683
+ // RIGHT - Batch processing
684
+ const chunks = chunkArray(items, 50);
685
+ for (const chunk of chunks) {
686
+ await Promise.all(chunk.map(processItem));
687
+ await wait.for({ milliseconds: 500 }); // Only 20 waits
688
+ }
689
+ ```
690
+
691
+ # For very large datasets, use subtasks:
692
+ ```typescript
693
+ export const processAll = task({
694
+ id: 'process-all',
695
+ run: async (payload: { items: string[] }) => {
696
+ const chunks = chunkArray(payload.items, 100);
697
+
698
+ // Each chunk is a separate task
699
+ await Promise.all(
700
+ chunks.map(chunk =>
701
+ processChunk.triggerAndWait({ items: chunk })
702
+ )
703
+ );
704
+ },
705
+ });
706
+ ```
707
+
708
+ ### Using raw SDK instead of Trigger.dev integrations
709
+
710
+ Severity: MEDIUM
711
+
712
+ Situation: Using OpenAI SDK directly. API call fails. No automatic retry.
713
+ Rate limits not handled. Have to implement all resilience manually.
714
+
715
+ Symptoms:
716
+ - Manual retry logic in tasks
717
+ - Rate limit errors not handled
718
+ - No automatic logging of API calls
719
+ - Inconsistent error handling
720
+
721
+ Why this breaks:
722
+ Trigger.dev integrations wrap SDKs with automatic retries, rate limit
723
+ handling, and proper logging. Using raw SDKs means you lose these
724
+ features and have to implement them yourself.
725
+
726
+ Recommended fix:
727
+
728
+ # Use integrations when available:
729
+ ```typescript
730
+ // WRONG - Raw SDK
731
+ import OpenAI from 'openai';
732
+ const openai = new OpenAI();
733
+
734
+ // RIGHT - Trigger.dev integration
735
+ import { openai } from '@trigger.dev/openai';
736
+
737
+ const openaiClient = openai.configure({
738
+ id: 'openai',
739
+ apiKey: process.env.OPENAI_API_KEY,
740
+ });
741
+
742
+ // Now has automatic retries and rate limiting
743
+ export const generateContent = task({
744
+ id: 'generate-content',
745
+ run: async (payload) => {
746
+ const response = await openaiClient.chat.completions.create({
747
+ model: 'gpt-4-turbo-preview',
748
+ messages: [{ role: 'user', content: payload.prompt }],
749
+ });
750
+ return response;
751
+ },
752
+ });
753
+ ```
754
+
755
+ # Available integrations:
756
+ - @trigger.dev/openai
757
+ - @trigger.dev/anthropic
758
+ - @trigger.dev/resend
759
+ - @trigger.dev/slack
760
+ - @trigger.dev/stripe
761
+
762
+ ### Triggering tasks without dev server running
763
+
764
+ Severity: MEDIUM
765
+
766
+ Situation: Called task.trigger() but nothing happens. No errors either.
767
+ Task just disappears into void. Dev server wasn't running.
768
+
769
+ Symptoms:
770
+ - Triggers don't run
771
+ - No task in dashboard
772
+ - No errors, just silence
773
+ - Works in production, not dev
774
+
775
+ Why this breaks:
776
+ In development, tasks run through the local dev server (npx trigger.dev dev).
777
+ If it's not running, triggers queue up or fail silently depending on
778
+ configuration. Production works differently.
779
+
780
+ Recommended fix:
781
+
782
+ # Always run dev server during development:
783
+ ```bash
784
+ # Terminal 1: Your app
785
+ npm run dev
786
+
787
+ # Terminal 2: Trigger.dev dev server
788
+ npx trigger.dev dev
789
+ ```
790
+
791
+ # Check dev server is connected:
792
+ - Should show "Connected to Trigger.dev"
793
+ - Tasks should appear in console
794
+ - Dashboard shows task registrations
795
+
796
+ # In package.json:
797
+ ```json
798
+ {
799
+ "scripts": {
800
+ "dev": "next dev",
801
+ "trigger:dev": "trigger.dev dev",
802
+ "dev:all": "concurrently \"npm run dev\" \"npm run trigger:dev\""
803
+ }
804
+ }
805
+ ```
806
+
807
+ ## Validation Checks
808
+
809
+ ### Task without logging
810
+
811
+ Severity: WARNING
812
+
813
+ Message: Task has no logging. Add logger.log() calls for debugging in production.
814
+
815
+ Fix action: Import { logger } from '@trigger.dev/sdk/v3' and add log statements
816
+
817
+ ### Task without error handling
818
+
819
+ Severity: ERROR
820
+
821
+ Message: Task lacks explicit error handling. Unhandled errors may cause unclear failures.
822
+
823
+ Fix action: Wrap task logic in try/catch and log errors with context
824
+
825
+ ### Task without concurrency limit
826
+
827
+ Severity: WARNING
828
+
829
+ Message: Task has no concurrency limit. High load may overwhelm downstream services.
830
+
831
+ Fix action: Add queue: { concurrencyLimit: 10 } to protect APIs and databases
832
+
833
+ ### Date object in trigger payload
834
+
835
+ Severity: ERROR
836
+
837
+ Message: Date objects are serialized to strings. Use ISO string format instead.
838
+
839
+ Fix action: Use date.toISOString() instead of new Date()
840
+
841
+ ### Class instance in trigger payload
842
+
843
+ Severity: ERROR
844
+
845
+ Message: Class instances lose methods when serialized. Use plain objects.
846
+
847
+ Fix action: Convert class instance to plain object before triggering
848
+
849
+ ### Task without explicit ID
850
+
851
+ Severity: ERROR
852
+
853
+ Message: Task must have an explicit id property for registration.
854
+
855
+ Fix action: Add id: 'my-task-name' to task definition
856
+
857
+ ### Trigger.dev API key hardcoded
858
+
859
+ Severity: CRITICAL
860
+
861
+ Message: Trigger.dev API key should not be hardcoded - use TRIGGER_SECRET_KEY env var
862
+
863
+ Fix action: Remove hardcoded key and use process.env.TRIGGER_SECRET_KEY
864
+
865
+ ### Using raw OpenAI SDK instead of integration
866
+
867
+ Severity: WARNING
868
+
869
+ Message: Consider using @trigger.dev/openai for automatic retries and rate limiting
870
+
871
+ Fix action: Replace with: import { openai } from '@trigger.dev/openai'
872
+
873
+ ### Using raw Anthropic SDK instead of integration
874
+
875
+ Severity: WARNING
876
+
877
+ Message: Consider using @trigger.dev/anthropic for automatic retries and rate limiting
878
+
879
+ Fix action: Replace with: import { anthropic } from '@trigger.dev/anthropic'
880
+
881
+ ### wait.for inside loop
882
+
883
+ Severity: WARNING
884
+
885
+ Message: wait.for in loops creates many checkpoints. Consider batching instead.
886
+
887
+ Fix action: Batch items and use fewer waits, or split into subtasks
888
+
889
+ ## Collaboration
890
+
891
+ ### Delegation Triggers
892
+
893
+ - redis|bullmq|traditional queue -> bullmq-specialist (Need Redis-backed queues instead of managed service)
894
+ - vercel|deployment|serverless -> vercel-deployment (Trigger.dev needs deployment config)
895
+ - database|postgres|supabase -> supabase-backend (Tasks need database access)
896
+ - openai|anthropic|ai model|llm -> llm-architect (Tasks need AI model integration)
897
+ - event-driven|event sourcing|fan out -> inngest (Need pure event-driven model)
898
+
899
+ ### AI Background Processing
900
+
901
+ Skills: trigger-dev, llm-architect, nextjs-app-router, supabase-backend
902
+
903
+ Workflow:
904
+
905
+ ```
906
+ 1. User triggers via UI (nextjs-app-router)
907
+ 2. Task queued (trigger-dev)
908
+ 3. AI processing (llm-architect)
909
+ 4. Results stored (supabase-backend)
910
+ ```
911
+
912
+ ### Webhook Processing Pipeline
913
+
914
+ Skills: trigger-dev, stripe-integration, email-systems, supabase-backend
915
+
916
+ Workflow:
917
+
918
+ ```
919
+ 1. Webhook received (stripe-integration)
920
+ 2. Task triggered (trigger-dev)
921
+ 3. Database updated (supabase-backend)
922
+ 4. Notification sent (email-systems)
923
+ ```
924
+
925
+ ### Batch Data Processing
926
+
927
+ Skills: trigger-dev, supabase-backend, backend
928
+
929
+ Workflow:
930
+
931
+ ```
932
+ 1. Batch job triggered (backend)
933
+ 2. Data chunked and processed (trigger-dev)
934
+ 3. Results aggregated (supabase-backend)
935
+ ```
936
+
937
+ ### Scheduled Reports
938
+
939
+ Skills: trigger-dev, supabase-backend, email-systems
940
+
941
+ Workflow:
942
+
943
+ ```
944
+ 1. Cron triggers task (trigger-dev)
945
+ 2. Data aggregated (supabase-backend)
946
+ 3. Report generated and sent (email-systems)
947
+ ```
66
948
 
67
949
  ## Related Skills
68
950
 
69
951
  Works well with: `nextjs-app-router`, `vercel-deployment`, `ai-agents-architect`, `llm-architect`, `email-systems`, `stripe-integration`
70
952
 
71
953
  ## When to Use
72
- This skill is applicable to execute the workflow or actions described in the overview.
954
+
955
+ - User mentions or implies: trigger.dev
956
+ - User mentions or implies: trigger dev
957
+ - User mentions or implies: background task
958
+ - User mentions or implies: ai background job
959
+ - User mentions or implies: long running task
960
+ - User mentions or implies: integration task
961
+ - User mentions or implies: scheduled task