# trigger.basic

trigger.basic is a Claude Code rule for writing Trigger.dev tasks. It applies to TypeScript files matching **/trigger/**/*.ts.

- rule · `type=rule` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline · ★ 1120 repo stars
- Author: rerun-build
- License: AGPL-3.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/rerun-build/rerun/tree/HEAD/apps/ui/.cursor/rules/trigger.basic.mdc
- Updated: 2026-11-16
- Security check: automated, 2026-11-17 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/rules/triggerbasic

## What it does

The rule guides task creation with `@trigger.dev/sdk`, including regular tasks and schema-validated inputs. It also covers single and batch runs, debounce settings for repeated triggers, and child-task calls with result handling.

Waits can use a duration, a date, or a token. Waits longer than 5 seconds are checkpointed automatically and do not count toward compute usage. Do not put `triggerAndWait`, `batchTriggerAndWait`, or wait calls inside `Promise.all` or `Promise.allSettled`; the deprecated `client.defineJob` pattern is disallowed.

## Install

### Cursor (native platform)

**Manually: put the files in place**
- File: `.cursor/rules/trigger.basic.mdc` — Frontmatter: description, globs, alwaysApply

### Claude Code

**Manually: put the files in place**
- File: `.claude/rules/trigger.basic.md` — The paths frontmatter field limits the files: move globs from the source into paths

### Codex

**AGENTS.md**
- Codex reads AGENTS.md: paste the rule text there

### GitHub Copilot

**Manually: put the files in place**
- File: `.github/instructions/trigger.basic.instructions.md` — The applyTo field sets which files it applies to: move globs from the source into applyTo

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/rules/trigger.basic.md`

### Cline

**Manually: put the files in place**
- File: `.clinerules/trigger.basic.md`

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/rerun-build/rerun/tree/HEAD/apps/ui/.cursor/rules/trigger.basic.mdc

## When to use it
- create a Trigger.dev task with the current SDK
- validate and type task input
- handle success and failure from child tasks
- combine repeated triggers with a debounce key

## Example prompts
- Create a Trigger.dev task for processing data with the current SDK.
- Add schema validation to this task's input.
- Run a child task and handle its result or error.

## Similar
- [trigger-tasks](https://affpapa.org/en/nevibecode/skills/trigger-tasks.md) — skill · 3300 installs
- [trigger-setup](https://affpapa.org/en/nevibecode/skills/trigger-setup.md) — skill · 3000 installs
- [trigger-dev](https://affpapa.org/en/nevibecode/skills/trigger-dev.md) — skill · 93 installs
- [pp-trigger-dev](https://affpapa.org/en/nevibecode/skills/pp-trigger-dev.md) — skill · 144 installs
- [qwik-basic-cursorrules-prompt-file](https://affpapa.org/en/nevibecode/rules/qwik-basic-cursorrules-prompt-file.md) — rule · ★ 41178 repo stars
- [migrating-to-workflow-sdk](https://affpapa.org/en/nevibecode/skills/migrating-to-workflow-sdk.md) — skill · 792 installs

From the same set: [rerun-build/rerun](https://affpapa.org/en/nevibecode/by/rerun-build/rerun.md) — 25 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
