@@ -9,37 +9,19 @@ slug: "using-cursor"
9
9
maintain apps built with Convex. Let's walk through how to setup Cursor for the
10
10
best possible results with Convex.
11
11
12
- # Add Convex to Cursor’s Docs
12
+ ## Add Convex ` .cursor/rules `
13
13
14
- [ Cursor composer agent] ( https://docs.cursor.com/composer/overview#agent ) , the
15
- main AI coding agent built into Cursor, uses Claude as it's LLM model of choice.
16
- While Claude knows about Convex, its knowledge can be patchy or outdated.
14
+ To get the best results from Cursor put the model specific ` .mdc ` files in your
15
+ project's ` .cursor/rules ` directory.
17
16
18
- We need to give it a helping hand by using the
19
- [ Cursors Docs] ( https://docs.cursor.com/context/@-symbols/@-docs ) feature to give
20
- it the most up-to-date knowledge of Convex.
17
+ - [ Anthropic (Claude) Cursor Rules] ( https://convex.link/anthropic_convex_rules.mdc )
18
+ - [ OpenAI Cursor Rules] ( https://convex.link/openai_convex_rules.mdc )
21
19
22
- From ** ` Cursor Settings ` ** > ** ` Features ` ** > ** ` Docs ` ** add new doc, use the
23
- URL "https://docs.convex.dev/ "
24
-
25
- ![ Chat UI] ( /img/cursor-with-convex/adding_convex_docs.webp )
26
-
27
- Cursor will then index all of the Convex docs for the LLM to use.
28
-
29
- ![ Chat UI] ( /img/cursor-with-convex/indexed_docs.webp )
30
-
31
- You can then reference those docs in your prompt with the ` @Convex ` symbol.
32
-
33
- ![ Chat UI] ( /img/cursor-with-convex/reference_convex_docs.webp )
34
-
35
- <Admonition type = " tip" title = " Add more Convex knowledge" >
20
+ We're constantly working on improving the quality of these rules for Convex by
21
+ using rigorous evals. You can help by
22
+ [ contributing to our evals repo] ( https://github.com/get-convex/convex-evals ) .
36
23
37
- You can perform the above steps for https://stack.convex.dev/ too if you would
38
- like to provide even more context to the agent.
39
-
40
- </Admonition >
41
-
42
- # Install and run Convex yourself
24
+ ## Install and run Convex yourself
43
25
44
26
Keeping Convex running is crucial because
45
27
[ it automatically generates] ( https://docs.convex.dev/cli#run-the-convex-dev-server )
@@ -49,42 +31,18 @@ since it can't access the types for the queries and mutations it created.
49
31
We recommended that you install (` npm install convex ` ) and run convex
50
32
(` npx convex dev ` ) yourself in a terminal window.
51
33
52
- # Use a ` convex_instructions.md ` to fine-tune Convex behavior even further
53
-
54
- Despite Claude’s inbuilt knowledge of Convex plus referencing ` @Convex ` docs the
55
- LLM does still make silly Convex mistakes from time to time. To reduce this even
56
- more create a ` convex_instructions.md ` file in ` /instructions ` directory. Then
57
- reference it from your prompt.
58
-
59
- ![ Chat UI] ( /img/cursor-with-convex/convex_instructions.webp )
60
-
61
- To get you started see this one we have been using:
62
-
63
- [ convex_instructions.md] ( https://gist.github.com/mikecann/0dc25aeae0d06a88c3da71c1e026ae47 )
64
-
65
- Copy the above to your project then reference it in your prompts. You can edit
66
- it as needed.
67
-
68
- <Admonition type = " tip" title = " Cursor Notepads" >
69
-
70
- Cursor does have a beta feature called
71
- [ Notepads] ( https://docs.cursor.com/features/beta/notepads#notepads ) that may be
72
- a better way to do this in the future.
73
-
74
- </Admonition >
75
-
76
- # Keep your requests small and git commit frequently
34
+ ## Keep your requests small
77
35
78
36
The best results when using agentic LLMs can be found when keeping the amount of
79
- changes you want to make small. This lets you be more specific around the
80
- context you provide the agent and it means the agent doesn't need to do a lot of
81
- searching for context.
37
+ changes you want to make small and git commit frequently . This lets you be more
38
+ specific around the context you provide the agent and it means the agent doesn't
39
+ need to do a lot of searching for context.
82
40
83
41
After each successful prompt or series of prompts it is a good idea to commit
84
42
your changes so that its simple to rollback to that point should the next prompt
85
43
cause issues.
86
44
87
- # Update and reference your ` README.md `
45
+ ## Update and reference your ` README.md `
88
46
89
47
The agent needs context about the specific business goals for your project.
90
48
While it can infer some details from the files it reads, this becomes more
@@ -97,3 +55,28 @@ comprehensive README.md file in your project root and reference it.
97
55
[ Some people] ( https://youtu.be/2PjmPU07KNs?t=145 ) advocate for crafting a
98
56
Product Requirements Document (PRD), this may be a good idea for more complex
99
57
projects.
58
+
59
+ ## Add Convex docs
60
+
61
+ Adding Convex docs can let you specifically refer to Convex features when
62
+ building your app.
63
+
64
+ From ** ` Cursor Settings ` ** > ** ` Features ` ** > ** ` Docs ` ** add new doc, use the
65
+ URL "https://docs.convex.dev/ "
66
+
67
+ ![ Chat UI] ( /img/cursor-with-convex/adding_convex_docs.webp )
68
+
69
+ Cursor will then index all of the Convex docs for the LLM to use.
70
+
71
+ ![ Chat UI] ( /img/cursor-with-convex/indexed_docs.webp )
72
+
73
+ You can then reference those docs in your prompt with the ` @Convex ` symbol.
74
+
75
+ ![ Chat UI] ( /img/cursor-with-convex/reference_convex_docs.webp )
76
+
77
+ <Admonition type = " tip" title = " Add more Convex knowledge" >
78
+
79
+ You can perform the above steps for https://stack.convex.dev/ too if you would
80
+ like to provide even more context to the agent.
81
+
82
+ </Admonition >
0 commit comments