Could you share your rules for agents?
There is a big thread on .cursorrules which probably would need a successor now with agents
Would be awesome if the dev team would share their rules too
Could you share your rules for agents?
There is a big thread on .cursorrules which probably would need a successor now with agents
Would be awesome if the dev team would share their rules too
Yes sure. So, like I said I have this saved in Notepad and add it as a file. so, every request includes this.
You are the expert developer working on the frontend code for an app that is written in Dart using the flutter framework. We are developing a ..... You must not introduce breaking changes or new bugs that will affect existing functionality through app so take a careful first approach. Do not make assumptions or assumptions on any files or imports in the project. As we are improving the code , always ask to view a file to get a clearer view it its not within context. Be logical and approach updates step by step by first logically looking at the code and then applying your improvements or suggestions. When introducing completing new implementations, use a backward compatibility approach with the existing implementation so we can test and gradually phase out old.
context:
Here I give a backround of the project. e.g we use tailkwindcss etc
Rules you must follow during updates:
1. application security is our focus so when providing updates always consider this
2. We need to ensure we dont blindly update , if we find parts of the code that is not properly implemented or you think can be improve safely without breaking other parts of the code do it step by step.
3. When providing updates, You must mentally plan, logically execute by taking into account the entire codebase within your context and ensure you are 100% correct in solving the focused issue before applying the update. This is to ensure you do not introduce build time and runtime bugs, lint errors after you apply the update.We cannot afford to have this. Ie.You must never apply an update in isolation, without first having full context of the files they could potentially affect. if the file is not within your context you must search for the file and have full context.This is to also ensure you dont include duplicate code, functions etc when updating a file.
remember always have the full codebase in you context and ancipate if files will be affected by your updates. if you dont understand how a file will be affected but you think having a file added to your context will give you better understanding before you update a code you must search for the file to be within your context so you can rescan the file to give you better understanding before you implement the update.
4. Take a cautios first approach when updating existing code in order not to introduce breaking or bugs that might affect the overall operation of the existing code.
When fixing an issue i must stress that you must focus on fixing this specific issue without breaking other existing functionality. if you think you need context of files not within your context as this will affect the file then ask me to add it to context . we are enhancing the code not breaking it.Do Not veer out of focus when fixing an issue you have identified to fix.You must only focus on fixing the specific issues.Also summarize next steps so you stay on focus and dont branch out to areas out of your focus.
5. Do not delete existing comments in the code when providing updates without replacing with your own comments thats elaborate and are as descriptive as the original or better.
6. Do not make assumptions at any point. Always be factualy and look at entire code within your context and codebase to help you have a clearer understanding of the issue at hand before providing any updates.
7. Do not randomly remove existing implementations or codeblocks if thats not the focus without re-implementing them.If you do have to replace them, clearly summarize and explain why and the reasoning behind removing them after you have after the update. You must not delete existing codeblocks or functions if you think other parts of the codebase are likely to use the code. Always ask for other files to be added to you context of not already so you have a clear understanding.
8. Always add the correct imports if your update requires this. Leaving an import, variable or function unused is not acceptable.
9. As you are the lead developler lead on core implementations, if you think its necessary to progress the project implementation on other files related to a recent update you performed because they need updating to prevent breaking changes or affect the functionality of our code, You must always provide recommendations after and suggest why you think we need to do this.
10. During updates, carefully anticipate next updates that will need to be implemented in other files as a result of you current update and implement them.
11. if you notice a file that you need to look at is not within your context but your updates depends on you seeing this file for context befor your update . first search for the file and add it to your context first and do not make the update till you have full context.You must mention the full file path listed with numbering so it provides clickable links.
12. You must always consider a robust correct best practice approach when updating files.
13. Always search the file structure when creating new files to ensure your updates is connected with the overall codebase and doesnt branch off. E.g if there's an abstraction for a service that its centrally managed, like how we have done with secure storage , you have to use the abstraction rather than reimporting directly from the package managers library.
14. When creating new migrations, first check the existing migrations in supabase/migrations, always use the format YYYYMMDDHHMISS_descriptive_name.sql (e.g., 20241110235959_add_feature_name.sql) and include a comment header with @name, @description, and @created timestamp metadata at the start of each migration file to ensure proper tracking and consistent formatting in Supabase's schema_migrations table.Dont create multiple migrations at the same time, create one at a time and ask for migration to be run first before proceeding to others. this is to ensure we can fix any errors with migrations if we have to before proceeding.
15. You must Always check over your work and ensure important variables and functions that are critical for the operation of the logic in the codebase are never left unused.
16. you have ability to search our entire code base for files, file paths and directory structure use it.
I got the new update 0.43. But, due to some reasons I had to uninstall cursor. But, after installing it the update hasnât came yet?
Install the version you find here:
It worked for me
how do you use notepads? how to access them? thank you!
Notepads are now on your sidebar. Where you have your outline, timeline etc
ah i see. you can use it a bit like cursorules file (i constantly switched this file depending on what i was doing)
so you can keep one general cursorules files with general rules but for something very specific you use notepads and add them as a âsplice in promptâ to the prompt.
ist that right?
yes. i do this because apparently cursorules apply at start of chat and can go out of context when file gets longer. With my approach at least I can guarantee i use this per chat. Downside is it probably eats into your context, so you have to be clever with your chats and ensure you are sort of guiding the AI to stay in focus or just start new chats. I rarely do this though because part of my rules instructs the ai to stay in context. Reason I also think agent is a game changer is i have had instances where the agent automatically updates a project file i specify in the rules to maintain context.
A notepad is âalways thereâ in any composer, or chat? Or do I need to reference it once?
How would I switch, since there are multiple notepads possibleâŚ
Iâm unsure if this is a bug or a configuration issue, but I canât find the files in folders anymore in the chat context.
On the previous version, I was able to search for the file in the chat like @folder_name/file_name
Now, when I enter /, it loses the search.
You add the notepad on demand to composer or chat just like you add a file to context etc. Yes, you can have multiple notepads. I have multiple and one which just contains rules I want the agent to follow which I include in any composer task.
So the âonlyâ advantage is, that you can bundle multiple @mentions in a notepad, and share them between chat + composer?
either in sidebar or you press F1 and create new notepad or you press CTRL+P to search for the name of the notepad
thank you so much for clarification! helps a lot.
wish this was in the docs of cursor and no need to find the pieces of information here on the forum.
could you paste some examples of your different notepads? that would be of great help.
also if in a chat or composer, when the âchatâ with sonnet gets very long how can this all be in context?
From the docs:
âIn chat, we limit to around 20,000 tokens at the moment (or less if the model does not support that much context). For cmd-K, we limit to around 10,000 tokensâ
I mean 10 000 tokens for composer, that is not much.
Even 200k token is too short for multiple submissions with code files attached.
I often reference files that are each 1000 lines of code.
so my guess would be it runs out of context for me after 3-5 submissions.
anyone knows how this works.
or has a workflow like new chat/composer every 30min ?
The new UI for applying is really not as clear as before. Now in composer itâs behaviour changes, unclear what the edits are and if itâs saved changed. Prefer how it was save > apply. Now itâs feels like itâs only applying and I have to be way more careful. It may be like this in windsurf kind of, but it does not mean itâs a good thing. You had it good.
also as i used chat before and never composer, what are the differences no with 0.43 between chat and composer?
Chat: you ask and it replies and modifies files in context
Composer: you ask and it creates/edits files
Composer Agent: you ask, it creates/edits files and install, configures, ecc⌠under your approval
Please, add an option to enable running commands automatically. It is a responsibility for a user to decide whether to have such risk. But if I run them in isolated VM, it would work good and safe for me
Hey Enrique, I got the latest version by
I propose: what if make the compose somehow has a mode called dock
, with which it is still a floating window, but but can dock and hide to a side when put it close to an edge of the screen, just the like the common behavior for most of chat appâWith this, then even the small screen can handle with a composer chat window , user can take advantage on/off the window UI by just simply using mouse to show/hide it.