agentleFS
poorvith-mppoorvith-mp/skills-agents/skills/trigger-dev/SKILL.md

trigger-dev

Skill0 starsChanged 2 months agoMITView on GitHub

Build Trigger.dev background jobs: task definitions, retries, scheduling and observability. For visual workflows use n8n. Use when writing code-first background tasks or Trigger.dev.

  • Reads credentials

13 other projects use a version of this, 9 of them edited.

Adopted by

Most recently taken up by

Used with

Projects with it also use new-client-system, setup-codex-precheck and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • yawningwhaleAISkill

    new-client-system

    Scaffold a new client's full stack — Next.js 16 frontend dashboard + Trigger.dev backend worker — from the Shiney automations template. Use when the user says "new client", "onboard a client", "scaffold a client system", "set up <client-name>", or wants to start a fresh frontend+backend project styled and structured like the Shiney automations dashboard. Produces structure only; no automations are scaffolded — those are added later.

    Also in 6 projects that use this

  • yawningwhaleAISkill

    setup-codex-precheck

    Install the codex pre-edit "double-check" hook into the current project — a PreToolUse hook that asks the codex CLI to review every Edit/Write/MultiEdit before it is written, blocking risky changes. Checks prerequisites (codex, python3, codex login) and installs anything missing, idempotently. Use when the user wants to "set up the codex check", "install the codex double-check / pre-check / review hook", "make Claude check with codex before editing", or "add the codex gate to this project".

    Also in 6 projects that use this

  • huyvpSkill

    cost-reducer

    Reduce cloud, infrastructure, and operational costs while maintaining performance. Use when writing database queries, configuring cloud resources, optimizing bundles, setting up caching, choosing between services, sizing instances, configuring CDN, managing storage, or reviewing code for cost inefficiencies. Covers AWS/GCP/Vercel pricing, database optimization, serverless tuning, image pipelines, observability costs, and FinOps practices.

    Also in 10 projects that use this

  • ffsshhttiikkSkill

    scalability

    Core foundational concepts and principles for Scalability

    Also in 10 projects that use this

  • RoxenRobloxSkill

    youtube-broll-maker

    Generate 10-second B-roll footage of yourself doing an action using the Higgsfield MCP (Seedance 2.0). Upload one photo of yourself, describe the action ("typing on laptop", "walking at night"), pick from 5 cinematography style presets, get an MP4. Use when the user wants B-roll, cutaway footage, "me doing X" video, YouTube B-roll, or any image-to-video of themselves performing an action.

    Also in 3 projects that use this

  • RoxenRobloxSkill

    youtube-popup-graphic

    Generate stunning Adobe-Premiere-Pro-style UI popup motion graphics for YouTube videos using the Higgsfield MCP. The user uploads a style reference image (any UI mockup, dashboard, glass card, design they love), names one skill/feature/item, and the skill produces an MP4 of a single card popping in styled to match the reference. Use when the user wants a "popup graphic", "popup animation", "card popup", "skill popup", "AE/Premiere-style animation", "stunning UI animation for YouTube", or says "make me a popup for <skill/feature/item> styled like <reference>".

    Also in 3 projects that use this

  • +4 more from yawningwhaleAI

The file

Show its rules and text

We split this skill into the rules it gives an agent

13 rules. 1 is common, 5 are distinctive, and 7 are very specific to this project.

  • 1

    Common

    Most of the 10 edited versions we read keep these.

  • 5

    Distinctive

    This author's own choices. Worth a look.

  • 7

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Common:

    Read the detailed reference files for comprehensive code patterns:

    line 12
  2. Very specific:

    If starting a new Trigger.dev project or adding to an existing one, refer to https://trigger.dev/docs/manual-setup and use the …

    line 17
  3. Very specific:

    Create trigger.config.ts at project root with defineConfig({ project: "<ref>", dirs: ["./src/trigger"] })

    line 19
  4. Very specific:

    Add TRIGGER_SECRET_KEY to .env

    line 20
  5. Very specific:

    Create task files in the configured dirs directory

    line 21
  6. Very specific:

    Run npx trigger.dev@latest dev for local development

    line 22
  7. Very specific:

    Use type-only imports: when triggering from backend: import type { myTask } from "~/trigger/my-task"

    line 75
  8. Very specific:

    Use $ARGUMENTS to understand what the user wants to build.

    line 103
  9. Distinctive:

    Use clear headings and bullet lists where helpful.

    line 109
  10. Distinctive:

    Call out assumptions and open questions at the end.

    line 110
  11. Distinctive:

    NEVER weaken or skip a failing test to make a change land.

    line 122
  12. Distinctive:

    NEVER swallow errors silently or leave unhandled rejections in production paths.

    line 123
  13. Distinctive:

    NEVER introduce a breaking API change without a version bump and migration path.

    line 124

“Common” is measured: kept by at least 6 in 10 of the 10 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Trigger Dev

You are an expert at building production-grade Trigger.dev v4 background tasks, workflows, and automations in TypeScript. Read the detailed reference files for comprehensive code patterns:

  • references/core-reference.md — Tasks, runs, triggering, queues, concurrency, retries, errors, idempotency, wait functions
  • references/config-reference.md — trigger.config.ts, build extensions, deployment, CLI, project structure, env vars, monorepos
  • references/advanced-reference.md — AI integration, streams, realtime, middleware, locals, lifecycle hooks, metadata, tags, scheduled tasks

Setup Checklist

If starting a new Trigger.dev project or adding to an existing one, refer to https://trigger.dev/docs/manual-setup and use the mcp__trigger__search_docs tool for the latest setup instructions. Core steps:

  1. Install packages: npm add @trigger.dev/sdk@latest and npm add -D @trigger.dev/build@latest
  2. Create trigger.config.ts at project root with defineConfig({ project: "<ref>", dirs: ["./src/trigger"] })
  3. Add TRIGGER_SECRET_KEY to .env
  4. Create task files in the configured dirs directory
  5. Run npx trigger.dev@latest dev for local development
  6. Deploy with npx trigger.dev@latest deploy

Core Patterns

Basic Task

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

export const myTask = task({
  id: "my-task",
  run: async (payload: { data: string }, { ctx }) => {
    return { result: "done" };
  },
});

Schema-Validated Task

import { schemaTask } from "@trigger.dev/sdk";
import { z } from "zod";

export const myTask = schemaTask({
  id: "my-task",
  schema: z.object({ name: z.string(), age: z.number() }),
  run: async (payload) => { /* payload is typed and validated */ },
});

Scheduled Task (Cron)

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

export const dailyCleanup = schedules.task({
  id: "daily-cleanup",
  cron: "0 0 * * *",
  run: async (payload) => {
    // payload.timestamp, payload.lastTimestamp, payload.timezone
  },
});

Trigger from Backend

import { tasks } from "@trigger.dev/sdk";
import type { myTask } from "~/trigger/my-task";

const handle = await tasks.trigger<typeof myTask>("my-task", { data: "hello" });

Trigger from Inside a Task

const result = await otherTask.triggerAndWait({ data: "hello" });
if (result.ok) console.log(result.output);

Critical Rules

  1. Task IDs must be unique across the entire project
  2. Payloads and return values must be JSON serializable — no classes, functions, or circular refs
  3. Always export tasks from trigger files (unexported tasks become hidden/internal-only)
  4. Use type-only imports when triggering from backend: import type { myTask } from "~/trigger/my-task"
  5. trigger.config.ts must be at the project root — it cannot be nested
  6. Use AbortTaskRunError to fail without retrying on permanent errors
  7. Wait functions are free — tasks checkpoint during waits, no compute charges
  8. Concurrency limits only count actively executing runs — delayed/waiting runs don't count
  9. Max 10 tags per run, max 256KB metadata per run, max 1000 items per batch
  10. Use idempotencyKeys.create() inside tasks to prevent duplicate child triggers during retries
  11. Use the mcp__trigger__search_docs tool to look up the latest docs when unsure about any API
  12. Use mcp__trigger__deploy to deploy tasks, mcp__trigger__list_runs to check runs, mcp__trigger__trigger_task to trigger tasks

Machine Presets

PresetvCPURAM
micro0.250.25 GB
small-1x (default)0.50.5 GB
small-2x11 GB
medium-1x12 GB
medium-2x24 GB
large-1x48 GB
large-2x816 GB

Key SDK Imports

import {
  task, schemaTask, schedules, batch, tasks, runs, queues,
  tags, metadata, wait, auth, idempotencyKeys, logger, streams,
  AbortTaskRunError, configure, query,
} from "@trigger.dev/sdk";
import { ai } from "@trigger.dev/sdk/ai";

Use $ARGUMENTS to understand what the user wants to build. Read the reference files for detailed patterns before writing code.

Output format

  • Lead with the result the user asked for.
  • Use clear headings and bullet lists where helpful.
  • Call out assumptions and open questions at the end.
  • Stay specific to the Trigger.dev workflow; avoid generic filler.

Verification & Quality Checklist

  • Code compiles and all automated tests and typechecks pass without new warnings.
  • Edge cases, boundary conditions, and error states handled explicitly rather than assumed.
  • No hardcoded secrets, credentials, or insecure defaults introduced.
  • Changes are covered by a test that fails without them.

Anti-Patterns & Constraints

  • NEVER weaken or skip a failing test to make a change land.
  • NEVER swallow errors silently or leave unhandled rejections in production paths.
  • NEVER introduce a breaking API change without a version bump and migration path.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.