Skip to content

Commit c0172d4

Browse files
authored
added cursor rules docs page (#1965)
1 parent 2c19693 commit c0172d4

File tree

3 files changed

+55
-6
lines changed

3 files changed

+55
-6
lines changed

docs/docs.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -272,10 +272,11 @@
272272
"guides/ai-agents/generate-translate-copy",
273273
"guides/ai-agents/route-question",
274274
"guides/ai-agents/respond-and-check-content",
275-
"guides/ai-agents/verify-news-article",
276-
"guides/ai-agents/translate-and-refine"
275+
"guides/ai-agents/translate-and-refine",
276+
"guides/ai-agents/verify-news-article"
277277
]
278278
},
279+
"guides/cursor-rules",
279280
"guides/frameworks/drizzle",
280281
"guides/frameworks/prisma",
281282
"guides/frameworks/sequin",

docs/guides/cursor-rules.mdx

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
title: "Using Cursor with Trigger.dev"
3+
sidebarTitle: "Cursor rules"
4+
description: "This guide shows how to add Cursor rules to a project to help you write Trigger.dev tasks faster and more accurately."
5+
icon: "hexagon"
6+
---
7+
8+
## Overview
9+
10+
[Cursor](https://www.cursor.com/) 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.
11+
12+
## Prerequisites
13+
14+
- [Cursor](https://www.cursor.com/) installed on your machine
15+
16+
## Installing our Cursor rules
17+
18+
1. Locate the `.cursor/rules` folder in your project root, or click the "add new rule" button in `Cursor Settings` > `Rules`.
19+
2. Download the [writing-tasks.mdc](https://github.com/triggerdotdev/trigger.dev/blob/main/.cursor/rules/writing-tasks.mdc) file and place it in the `.cursor/rules` folder
20+
3. For more help installing Cursor rules, see [Cursor's docs](https://docs.cursor.com/context/rules-for-ai)
21+
22+
<video
23+
src="https://content.trigger.dev/cursor-rules-write-task.mp4"
24+
preload="auto"
25+
controls={true}
26+
loop
27+
muted
28+
autoPlay={true}
29+
width="100%"
30+
height="100%"
31+
/>
32+
33+
| <span style={{ color: '#28BF5C' }}>Helps with</span> | <span style={{ color: '#E11D48' }}>Don't use it for</span> |
34+
| ---------------------------------------------------- | ---------------------------------------------------------- |
35+
| Creating basic tasks | Deploying |
36+
| Creating scheduled tasks | Project setup |
37+
| Creating schema tasks | Infrastructure configuration |
38+
| Triggering tasks from backend | API keys |
39+
| Task lifecycle functions | Using tags |
40+
| Using Realtime | |
41+
| Idempotency patterns | |
42+
| Metadata handling | |
43+
| Using build extensions | |
44+
45+
## Tips for making the most of Cursor
46+
47+
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._
48+
49+
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.
50+
51+
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.

docs/guides/introduction.mdx

+1-4
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Get set up fast using our detailed walk-through guides.
2626
| [AI Agent: News verification](/guides/ai-agents/verify-news-article) | Orchestrate fact checking of news articles |
2727
| [AI Agent: Route questions](/guides/ai-agents/route-question) | Route questions to different models based on complexity |
2828
| [AI Agent: Translation refinement](/guides/ai-agents/translate-and-refine) | Evaluate and refine translations with feedback |
29+
| [Cursor rules](/guides/cursor-rules) | Use Cursor rules to help write Trigger.dev tasks |
2930
| [Prisma](/guides/frameworks/prisma) | How to setup Prisma with Trigger.dev |
3031
| [Python image processing](/guides/python/python-image-processing) | Use Python and Pillow to process images |
3132
| [Python PDF form extractor](/guides/python/python-pdf-form-extractor) | Use Python, PyMuPDF and Trigger.dev to extract data from a PDF form |
@@ -80,10 +81,6 @@ Task code you can copy and paste to use in your project. They can all be extende
8081
| [Vercel AI SDK](/guides/examples/vercel-ai-sdk) | Use Vercel AI SDK to generate text using OpenAI. |
8182
| [Vercel sync environment variables](/guides/examples/vercel-sync-env-vars) | Automatically sync environment variables from your Vercel projects to Trigger.dev. |
8283

83-
## Cursor rules
84-
85-
If you use Cursor, we have a set of Cursor rules which will help you build your tasks. You can find our installation guide [here](https://trigger.dev/changelog/cursor-rules-writing-tasks/).
86-
8784
<Note>
8885
If you would like to see a guide for your framework, or an example task for your use case, please
8986
request it in our [Discord server](https://trigger.dev/discord) and we'll add it to the list.

0 commit comments

Comments
 (0)