10 ms·
Writing Cursor rules with a Cursor rule
- deleted 1y ago
- tyleo 1y agoI’ve been using more and more AI tools in my development and getting a lot of mileage. Cursor is the latest one I’ve adopted and it’s impressive even without rules. I’ll give this a try soon. Thanks for sharing!
- throwup238 1y agoDoes anyone have a variant on this meta rule file that isn't React specific?
- ziofill 1y agohttps://ghuntley.com/stdlib/ https://ghuntley.com/stdlib/
- behnamoh 1y agoHow long until such "rules" also become standardized (like we saw with MCP)? It feels redundant to have rules.cursorrules and rules.aiderrules where the rules content is the same. I predict companies will not only publish coding guidelines for their programmers, they'll publish these tiny coding rules for LLMs used in the company as well, so all code follows the same standards/idioms.
- christophilus 1y agoI have found Cursor to be frustrating and exhausting to work with, even with my rules file. When it works, it’s like magic. But most of the time, it feels like working with a Jr. dev who has a bit of a concussion. Code review is wearying work, and using Cursor means you’re doing a lot of code review. I have never once gotten into a flow state with it. That was a long preamble to this question: any senior devs out there (20+ years) who enjoy using Cursor? What’s the trick?
- athoun 1y agoThe trick I’ve been using is to copy the entire codebase into a text prompt with Repo Prompt and feed that into Grok with a specific request on what feature / change I want. Then paste that output into Cursor with Claude 3.7 and have it make the actual code changes and ask it to build/fix errors along the way with yolo mode enabled. The 2-step process is a lot better since Grok can refer to the entire context of your codebase in one shot and come up with a high quality implementation plan, which is then handed off to Cursor to autonomously make the code changes.
- insane_dreamer 1y agoOr Gemini Pro
- athoun 1y agoI don’t know if I’m doing something wrong, but Gemini 2.5 pro was substantially worse coding quality than Grok. Which is surprising since I’m working on a Golang codebase which I had assumed Gemini would excel at given that it’s made by Google
- sebmellen 1y agoGrok is quickly becoming my favorite model just because it’s so verbose, but at the same time low on BS.
- athoun 1y agoYes, Grok has become my go to model for general research and targeted coding tasks. Feels like its getting better over time vs ChatGPT which seemed to deteriorate over time. Claude 3.7 is excellent, and better at coding but I appreciate the context size of Grok and feel like I get better bang for my buck for general purpose research too.
- insane_dreamer 1y agoYeah. I’m finding Gemini to be very verbose. Getting better results with Claude Sonnet. But Gemini has the larger context window.
- aledalgrande 1y agoSeems like we're rediscovering/reinventing the same thing over and over, this is very close to Memory Bank from Cline https://docs.cline.bot/improving-your-prompting-skills/cline-memory-bank https://docs.cline.bot/improving-your-prompting-skills/cline... I have seen a number of articles and Youtube videos posting more or less the same thing.
- amiantos 1y agoThis feels like a bandaid on a gaping wound to me. Maybe you're making certain aspects of using Cursor/Copilot Agent Mode less annoying, but they're still there and still annoying. In the parts of the open source LLM community that are interested in roleplay chat, the veterans seem to have the viewpoint that spending a lot of time tinkering to try to overcome the inherent flaws in this technology is relatively pointless; at a certain point, it's random, and the technology just isn't that great, you're expecting too much. Just wait for the next great model. But don't waste your time putting bandaids all over the huge flaws in the technology, you're still not going to get the results you want consistently. I can't help but think of that here. I don't want to spend my time managing a junior engineer with amnesia, writing Rules files for it to follow, come on now. We're supposed to pay $20/mo with usage limits for that? The promise of "vibe coding" according to all the breathless media coverage and hype is that it'll supercharge me 100x. No one said anything about "Cursor rules files"! I'll stick with Copilot's "fancy auto-complete", that does speed me up quite a bit. My forays into Agent mode and Cursor left me feeling pretty annoyed, and, like I said, I don't want a junior developer I'm managing through a chat sidebar, I'll just do the programming myself. Get back to me when Cursor is at senior or principal engineer level.
- Sonnigeszeug 1y agoThey way they are doing it is wrong, nonetheless the general idea is something i do anyway. Documenting code style, how to work etc. makes a lot of sense for everyone and i normally have good documentation. The problem? I know what i do, i don't write the docs for myself but for others or for my future me who might forgotten things. The good thing? Writing it for me, others and LLMs makes it a lot more helpful day to day. Instead of explaining myself multiply times to AI OR a Junior / new Team Member, i write it down once.
- reissbaker 1y agoFWIW "vibe coding" is a term invented by Andrej Karpathy in a tweet in February of this year, describing his own personal coding workflow. I don't think Cursor has tried to promise automating every aspect of software development hands-free. My experience mirrors yours in the sense that most coding agents are very fast, but quite junior, engineers who sometimes struggle to fix their own bugs. Nonetheless there is an advantage to speed, and if you're working on a problem a junior engineer could solve, at this point why bother doing it yourself? One of the coding agents (I prefer Claude Code personally since it's a terminal-based tool, but Cursor is similar) can write out the code faster than I can. If it adds a bug, I can usually fix it quite quickly anyway; after all, I'm not using it for the more complex problems. Where they are today though, I wouldn't use them for hard problems, e.g. dealing with race conditions in complex codebases. For simpler webdev tasks though they're pretty useful: it's been a long time since I've hand-written an admin dashboard, for example.
- brylie 1y agoHopefully, we'll converge on a standard, product-agnostic file naming convention, similar to .editorconfig. Are there any existing/emerging generic conventions, like .llm-instructions, that products like Cursor and GitHub Copilot support? This could be useful for teams and orgs with diverse LLM usage.
- vemv 1y agoCursor in particular but also others are extremely flaky when it comes to applying rules. So the next generation of "rules" for Cursor, Claude Code, etc should have some predictability baked in, i.e. not be entirely driven by AI. Having rules driven by a vanilla, non-AI program ensures that they're actually, consistently applied, with some logs showing if/how they were applied. Of course, one can augment vanilla rules with some AI capabilities, but the main orchestration should resemble determinism. I suspect that the main reason why this isn't a reality yet is because costs could easily skyrocket. Personally I'd be willing to pay the extra buck if that means that my comprehensive rule system is actually doing something.
- apwell23 1y ago> non-AI program ensures that they're actually, consistently applied that would be ironic give ppl using these tools are using it write code that have consistent outputs.
- DeathArrow 1y agoIf someone needs a C#/.NET meta-rule, I shared one here: https://pastebin.com/EmNsTRwY https://pastebin.com/EmNsTRwY After quickly testing it seems to be reasonably good.
- jascha_eng 1y agoLLMs have shit memory and abstraction capabilities and just adding md files and more context is like trying to make a alzheimer patient learn to play the piano. Yes it kinda works to some degree to always repeat everything, but it's not true learning and just a bandaid.
- fragmede 1y agoI mean that's certainly one opinion, but I mean, as you say, it does work.
- viraptor 1y agoIt's an implementation detail though. For example when you do multiple tasks in the same repo with the same rules, your context stays cached and you're not "repeating everything" anymore. Does that make a difference?
- deleted 1y ago[deleted]
- ccppurcell 1y agoQuestion for users of such tools: can't you ask the LLM at the end of the session to choose the most important parts of the context, compress it using your favourite tool, then decompress at the beginning of the next session?
- ddkto 1y agoThis is basically what the OP is doing - just think of this of the cursor rule as a summary (aka a compression) of the session. I did something similar for a small vibe-coded app. After a few back and forths to develop the first working version, I asked the LLM summarize the requirements and state of the app so far. I saved that summary into a `description.md` file, and can include it in a fresh conversation. I was using simonw's llm so adding a new feature or making a change looks like: `llm -f description.md -f code.py "Instructions for making another change."`
- jredwards 1y agoI've found this a tractable approach, but sometimes not enough. My escalation pattern with cursor looks like this: 1. Document everything that you're doing and update a core architecture or technical doc that the LLM can read. 2. Update your .cursorrules with specific instructions for .cursor which can grow more specific as you nail down parts of your stack and the patterns you're following. This can be updated (by cursor itself) if you find the same problems recurring. 3. I have pre-commit script which runs some internal scripts. If I find the IDE is STILL making the same mistake after I've documented it and added cursor rules, the nuclear option is to add a script here which verifies the integrity of whatever construct is being violated (e.g. tests go into this folder structure, env variables are consistent between these files, import of this model that the LLMs like is forbidden) I would add: any time you expect to be working on a particular feature / enhancement / refactor, have the LLM create a temporary document with a description and an implementation plan and work from that. In addition: I have a specific workflow for resolving testing errors or pre-commit errors which follows the above pattern: Document each failure and work through them one at a time, running the test script and updating the document between runs. I've established these patterns slowly with usage, but it has improved my experience a lot.