Cursor ? How to leverage this small little shIDE

Cursor ? How to leverage this small little shIDE

During the past few months, I have been trying to apply AI and LLMs into my day-to-day SWE life, but somehow something feel off, I still need to paste code into the browser, Copilot, ... in order to get the responses. That changed until I found out about Cursor.

Here's my really short 2 cents about the IDE:

  • It's really lightweight, feels like VSCode
  • AI native support with a lot of additional features ("Tab" engineering, conversation like Copilot, and this little stuff can actually run termnial commands :D)


Article content
Sang's enjoying sunset vibe coding with Cursor

It's bascially traditional IDE have a baby with LLMs and pop up a deus ex-machina-type of IDE. Though that's on paper things look really shiny and stuff, but there are some drawbacks, frustrations, tips & trick that I will post in here during my 2 months experiencing this IDE.


Cons:

  • You need a really good prompt each time you want Cursor to do anything, without detailed & focus prompt, the AI just wander their way to the wilderness and give you crap, sometimes it even went in circle trying to fix / debug / develop anything
  • Tho the free version looks promising, in order for you to access the juice, you still need to pay a hepty fees of 20$ / month for the Pro one. But only 500 reqs / monthly. Which is far from enough for your day-to-day Engineering stuff. Combine with your all (I assumed) existing toolings like ChatGPT, ... subscriptions things add up really quick.
  • It can lose context really fast, lost track of what you are doing (this depends on the LLM models as well).
  • Accidentally run commands that you don't want. For my personal one, that little sh*t actually delete my whole Kubernetes's namespace 🥹
  • Lacks of focused features for programming language like Java, Kotlin, Spring, Quarkus (You don't have that handy test runs, all the detailed feature dedicated for that particular languages (debugging, manage deps, ...). You need to install extra extension to solve the issues. But cmon' extension works better than Enterprise-ready solution? - I think not.

Welp that's for all the cons that I can think of, at least what I have experienced so far. Then with that in mind, how do we move forward? Rather introducing the cons part, I will just dump here what I did to improve my developing experience instead.

Costs

AI tools notoriously famous for subscriptions plans, and now you have a bazzilions of tool that you need to pay in order to get your hands on these nice features

But as a SWE and some CTF (WebSec) knowledge and some testing here are some tricks

  • Haven't you heard Gemini 2.5o exp still free of usage (mostly, free tier give you max 1.000.000 tokens / convo) https://aistudio.google.com/ check it here.
  • Google cloud offers a 300$ free Credit for newly created account

-> You add your free API Key of Google's AI Studio Tier 1 into your cursor which give you access for: 2.5o pro & flash. And you can basically vibe codings for days without the worry of that 500 requests / months.


Article content
Here's my setup.


Dump response & lost of context

You can actually fix this by doing 2 simple steps:

  • Use your brain even though you're asking the AI to do the work for you
  • Better promp (more detailed, tell it exactly how you want the AI to implement, design your implementation clearly & cohesivesly and using industry terminology rather than coming up with your own analogies)

Beside that, you can adjust the User's Prompt and Project Prompt, in order in every prompt you send to the Agent, the Agent will fully follow that context.

With User Prompt, here are some tips you can apply when trying to forge a prompts or ask GPT to forge a prompt: defines what is your code styles, princples you're using, conventions, what is your approachs to coding (for me it's first understand the context & the codebase regarding the problems, design a bit, then implement), some tiny details that tailor to you.

Then ask GPT / create the User Prompt yourself, here is the GPT-created version:

Article content
Just an example, my prompt is way different than this one.

Project's Prompt, it's dedicated to your project. Assume that you're using microservices, meaning that each repo has its own querks & details, you can add it there also. Cool thing is that you can add this to your Git repo as well, so that other team members can test & refine, and finally you have yourself a really nice Project's promp that working for that Project only.

Here's my frontend app Project's Prompt:

Article content
You get the idea.

With that it is increase the odds that the Agent will pick up the context way faster & don't lose focus. But you still need a detailed prompt whenever you ask the Agent something.

In Project's prompt, you can also add limitations, commands you don't want the AI to run like running yarn instead of npm, aliases, no rm -rf, ...

Focused prompts & context.

In developing features, if you project is well designed where all the components follow SRP to the core, meaning that you only need the context of a selective files to actually develop the features, in order to do it in Cursor use the @ annotation within the chat prompt:


Article content
Somewhat like this.

And before you actually do coding, add the related files to the chat windows, so that the Agent is more focused, ultimately more precise responses. The general conventions & other stuff you can defined in User's & Project Prompt, don't use it here.

In order to do that, you have to break down your task accordingly, and load these files in, example in the Login feature for examples:

Here're the breaked down requirements:

  • Forms
  • Validations
  • API definitions to send
  • Error handling
  • Tests

Then the order you should, or i least i would do is:

  1. Do forms and state management make sure the UI works, including eg: @/login.tsx, any useContext or providers you'd need.
  2. Include the login.tsx again, or you can re-use the previous one, add validations for those form..
  3. New conversation, include your OpenAPI specs, Api framework examples (Rest-hooks, react-query, ...)
  4. Incoperate everything (this is a big prompt, include all the @/pages @/apis, ...) so that Agent can glue everything together + handling edge cases & errors codes, ...
  5. And write test to cover those

More steps? Indeed, but this way you broke it down to tiny steps, so that at each steps if you want to add more juices to it (eg: UI improvments, animations, ...) you can seperate the concerns and most of my case, the Agent doesn't get confuse. And write precisely what I need.

No native programming language features

This is indeed a thing that I have not figure out yet, beside ask the AI to write you some sh scripts, or a Makefile so that you can automate this within Cursor, to be honest I don't have an solution for this yet. Since for Java Application, Intellij is so powerful in that matter. And I'm not a fan of adding extension so if i find something nice, I will share it here.


Reminders.

Here are some reminders regarding the AI Agent and all this new shiny stuff. Use it to enhance yourself, not dumbfoundedly ask the AI to do everything without understanding anything.


Article content

Imho, the AI is here to support you & speed up the learning rates / speed regarding SWE, especially in some of the topics where documentations are not clear / wonky and offloading a lot of reduntdant & tedious tasks.

Compliances & data security, make sure you don't accidentally put an .env in the Agent, or any files that contains sensitive information, you won't know whether those black hat hackers can ultilize it or not, and follow yours company compliances regarding this topic. I think most of the company already picked up on this topic.

Finally, use AI responsibly, with a good mindset in mind and a shit ton of tools you can basically do anything. Disclaimer! Don't use AI over 180 minutes / day it will dumb down your brain.


Article content
Let's vibe coding for days

Finally here is my recommendations model you can use:

  • Sonet 3.5 / Sonet 3.5 Max if you have the budget for that, really good code recommendations, clean one.
  • The rate Sonet 3.7 loses context is way faster than the rate girls loses interested in me. So not recommended
  • GPT o3 is fine, if you have the API keys, or else just use Sonet 3.5
  • Gemini 2.5o Pro is really good one highly recommend.
  • The other models i have not used yet so..


Harvey Spec

OSCP | Dvuln | President Deakin Information Security Club | Sydney, Australia

2mo

Hahahaha you just have to spread the vibe code spirit don’t you 😂

Like
Reply

To view or add a comment, sign in

Others also viewed

Explore topics