Overview

Cursor is a powerful AI coding editor which understands your codebase and can help you write code faster and more accurately. This guide shows you how to add our Cursor rules to your project to help you write Trigger.dev tasks.

Prerequisites

  • Cursor installed on your machine

Installing our Cursor rules

  1. Locate the .cursor/rules folder in your project root, or click the “add new rule” button in Cursor Settings > Rules.
  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
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

Tips for making the most of Cursor

  1. Turn on auto-run in Cursor settings. This allows Cursor to act more like an agent that checks for errors, fixes them, runs commands to install packages, and it won’t stop until the code is error-free and running. NB: Use this mode with caution, as it can make changes without your approval.

  2. Use version control like GitHub or GitLab, and commit frequently, so you can roll-back if something changes unexpectedly. Cursor can make changes to multiple files at once, so it’s best to commit often to keep track of all your changes.

  3. 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.