#Convex Cursor docs

31 messages · Page 1 of 1 (latest)

wanton zodiac
mystic atlas
#

this has been @brittle stratus 's obsession over the last few days -- getting a great integration of cursor context / rules etc that we can talk about and share with everyone. he might have an update on when he's gonna have it ready

wanton zodiac
#

Awesomeness. Will be on the lookout. Thank you

brittle stratus
#

HEY EVERYBODY! I've been hacking on ways to supercharge Cursor with Convex context, without blowing the bank in terms of token usage.

Here's what I've got. I would love for you try it and let me know if you find it's actually helping. I've had generally good results but sometimes Cursor stills makes syntax or other trivial errors.

Step 1: .cursorrules - place this in the root of your projects.

Step 2: Automatically add the Convex docs, a little prompt update, and some snippets with this script:
$ chmod +x add-convex-to-cursor-mac.sh
$ ./add-convex-to-cursor-mac.sh

(Currently the script is only for Mac. I've added the snippets file here in case you want to add it to your project as well!)

Step 3: There is no step 3!

#

FYI, I turned ~3k tokens into ~1k by asking Claude to compress the prompt:

Compress the following text in a way such that you (Claude 3.5) can reconstruct it as close as possible to the original. This is for yourself. Do not make it human readable. Aggressively compress it, while still keeping ALL the information to fully reconstruct it. Also use the fewest token possible, your text should be way smaller than the one I give you.
I am going to clear your context and have you reconstruct it WITHOUT the original to refer to. You MUST be able to reconstruct it to 95% of the original. You must keep the code examples to eliminate all syntax errors.

## Text to compress:
[lots of Convex examples]

And it outputs this type of thing:

CVX^dev^spec^React,Vite,Shadcn,TW^3xchk^code^run1st^
Style:concise TS,func,decl,iter,mod,desc vars,struct:exp comp,subcomp,help,static,types
Name:dash-dir,named exp
TS:all,iface>type,no enum,func comp
Syntax:func kw,concise,decl JSX
Err:early,log,user-msg,Zod form,ret vals SA,err bound
UI:Shadcn,Radix,TW,resp,mobile1st
Perf:min useClient/Effect/State,RSC,Susp,dyn load,img opt
Key:nuqs URL,Web Vitals,lim useClient
CVX docs:data fetch,file store,HTTP Act
react-router-dom route,TW style,Shadcn if avail

It's pretty cool.

#

cc @wanton zodiac 🙂

wanton zodiac
#

Ok. Awesome. Will try today right after my meetings. Thanks so much for this @brittle stratus , Will revert back in a couple of hours.

scenic perch
#

@brittle stratus does that .sh script basically do the same as adding the convex docs url manually into cursor?

#

or is it doing a lot more?

brittle stratus
#

Yup it just added docs.convex.dev to Cursor docs, and a mini addition to the rules "Prefer Convex where appropriate", and finally the snippets

#

That's all it is

scenic perch
#

nice ok

#

ty

wanton zodiac
#

@scenic perch , is this what you are doing?

unborn sable
#
  1. I thought Claude 3.5 Sonnet was already trained on Convex documentation and repos. So, does this script of adding docs.convex.dev to context improve the accuracy of Claude 3.5 Sonnet further?

  2. Or, is this script fundamentally about enabling the other models like chat-gpt?

scenic perch
#

although I'm not sure if cursor is smart enough to web crawl docs?

#

@brittle stratus is that true?

brittle stratus
#

Yes it can! It crawls and indexes docs you provide.

@unborn sable It has some Convex context from it's base training but some is outdated and I'm not sure it references it "directly" in the same way as vectorizing and referencing the embeddings (which is what Cursor does when you give it docs)

wanton zodiac
#

@brittle stratus I can't tell if I did it correctly. Did not have JQ installed. So had to install and redo. Not sure if it did properly. Probably call out the brew install jq

brittle stratus
#

@wanton zodiac that is right! nice call! I will add that either readme or automate it if possible.

#

Did it run after you installed jq?

severe trout
#

@brittle stratus not sure if you've seen this: https://github.com/getcursor/crawler?tab=readme-ov-file

If I understand correctly we can get convex docs available in cursor by default (no script needed). Just need to submit a 1 line change to this file (https://github.com/getcursor/crawler/blob/main/docs.jsonl) to tell cursor to index all of convex's docs

there's only 1 engineer merging the changes and he's in no hurry to do that: https://github.com/getcursor/crawler/pulls. Might be worth pinging him directly to get convex docs into cursor. That would be so useful!

In the mean time I'm using Tom's script.

GitHub

Easily show documentation to Cursor's coding AI. Contribute to getcursor/crawler development by creating an account on GitHub.

GitHub

Easily show documentation to Cursor's coding AI. Contribute to getcursor/crawler development by creating an account on GitHub.

brittle stratus
severe trout
#

I just stumbled upon it today. Convex doc in cursor would be such a big win to me. I'll leave that big task to you Tom.

Or if you prefer I can try to make it happen too.

barren shell
#

Prompted by this thread, I just went into my Cursor settings today and tried to add them via the UI there, and it seemed to work

severe trout
silver tulip
severe trout
unborn sable
#

So to incorporate the latest convex version’s v.record(), do you just re-index in Cursor on docs.convex.dev and it would just work?