Using Cursor with Trigger.dev
This guide shows how to add Cursor rules to a project to help you write Trigger.dev tasks faster and more accurately.
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
- Locate the
.cursor/rules
folder in your project root, or click the “add new rule” button inCursor Settings
>Rules
. - Download the writing-tasks.mdc file and place it in the
.cursor/rules
folder - For more help installing Cursor rules, see Cursor’s docs
Helps with | Don’t use it for |
---|---|
Creating basic tasks | Deploying |
Creating scheduled tasks | Project setup |
Creating schema tasks | Infrastructure configuration |
Triggering tasks from backend | API keys |
Task lifecycle functions | Using tags |
Using Realtime | |
Idempotency patterns | |
Metadata handling | |
Using build extensions |
Tips for making the most of Cursor
-
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.
-
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.
-
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.