Changelog #94

·

Cursor rules

Use Cursor rules to automatically write your Trigger.dev tasks.

James Ritchie

James Ritchie

Co-founder, Trigger.dev

Image for Cursor rules

Cursor has become the go-to AI coding assistant for many developers, and with good reason. Adding custom rules to Cursor helps you code faster by giving the AI context about your project. Now, writing Trigger.dev tasks should mean fewer trips to the docs with our comprehensive Cursor rules.

What these rules help you do

These Cursor rules are specifically designed to help you write Trigger.dev tasks correctly. Here's what they do and don't cover:

Helps withDon't use it for
Creating basic tasksDeploying
Creating scheduled tasksProject setup
Creating schema tasksInfrastructure configuration
Triggering tasks from backendAPI keys
Task lifecycle functionsUsing tags
Using Realtime
Idempotency patterns
Metadata handling
Using build extensions

How to install Cursor rules

  1. Locate the .cursor/rules folder in your project root
  2. Download the writing-tasks.mdc file and place it in the .cursor/rules folder
  3. For more help installing Cursor rules, see Cursor's docs

Tips for making the most of Cursor rules

  1. Turn on Yolo mode in Cursor settings. This sounds scary, but it just means Cursor will act more like an agent that checks for errors, fixes them, runs commands to install packages, and won't stop until the code is error-free and running. Obviously, worth checking the changes to make sure you're happy.

  2. Explicitly add context when needed - Cursor should know when to use the rules file, but I recommend selecting it from the "@ Add context" button above the prompt window. Then select "Cursor Rules" and select your rules file.

  3. Check out Steve's tweet from Builder.io for more tips and tricks on how he uses Cursor.

New to Trigger.dev?

  1. Create a Trigger.dev account at cloud.trigger.dev
  2. Follow the quick start guide to install Trigger
  3. Download the cursor rules file

If you find anything missing or if it generates incorrect code, let me know! We'll keep these rules updated to be as useful as possible.

Ready to start building?

Build and deploy your first task in 3 minutes.

Get started now