That's really nice. I think Cursor lets you add docs as well, which are basically custom bits of context you can `@`... I wonder where those fit into the system prompt/instructions, because that might give you what you asked for towards the end?
@@YifanBTH iterating on cursorrules is big. PS, we can prompt Claude/ChatGPT with current ruleset and ask to improve and add anything we haven’t thought of that might be useful. Cherry pick helpful additions - It’s like a free 2x level up
Hahaha, I also became a subscriber for the same reason.. What I saw is roughly what I imagined, but with some differences. In my opinion, these rules can be customized to suit specific needs.
@@YifanBTH Implmenting context and keep track on it was for sure the best part for me ! never tought of that and that so usefull ! after many prompt, many model get lost, boring to explain all again and again
Your point about only adding rule where the AI is getting things wrong is a good call out. There are websites that give sample cursorrules files, but using these can sometimes cause the AI to generate code that doesn't fit with your coding style or guidelines. Also remember that the cursorrules file will be included in the context so the bigger the file the less room for other information and the more expensive it will be to use
Hi Yifan, I absolutely adore your videos! I can tell you are passionated and knowledgeable about the topic you are presenting. While other channels try to sell their crap before even proving its validity, you just want to teach and inform and for that I thank you! Oh and I just subscribed... I guess you can call me Your Fan! Haha please don't lose the smile, its handsome! Looking forward to your next video!
Great! follow a similar workflow when working with Cursor. also use a monorepo (Nx) and always include a Docusaurus wiki, which I have the agent refine to maintain a longer version of rules and guidelines. I appreciate your presentation style - honest and to the point. Great work! Looking forward to seeing more videos.
great to see a fellow mono-repo-er. Having the refine wiki is a useful tip. For these workflow, I frequently use @docs as cursor can deal with the indexing and updating for it but the RAG occasionally misses the point.
@@YifanBTH absolutely. the wiki is an overly verbose resource. for each session with composer, i always ask the agent to update relevant docs with new changes or sometimes create a worklog to make it easier to cold start. been tinkering with formulating a visual workflow using excalidraw source files and iconography to further improved the documentation. it sure is an balance act. i really like the tip of getting the agent to state which rules its applying, going to test this out today. thanks again
🎯 Key points for quick navigation: 00:00 *🧩 Context is Key: AI can’t guess everything; providing clear and concise context ensures reliable results.* 00:14 *📄 One Rules File: A rules file can drastically improve AI coding assistants like VS Code, Cursor, or Windsurf.* 00:41 *⚙️ Rule Integration: Tools like Cursor and VS Code use specific files to include context for all AI sessions.* 01:35 *🔍 Verify Rules: Add a rule that makes the AI explicitly state which rules it followed for easy verification.* 02:16 *🎯 Project Context: Include a high-level project description to help AI understand its purpose.* 02:44 *🗂️ Code Structure: Outline the folder and file structure to guide the AI’s decisions.* 03:12 *🔧 Inferred Actions: AI will act based on rules file context, like placing a utility function in the correct folder.* 04:09 *🚫 Avoid Random Dependencies: Specify your tech stack to prevent AI from introducing unnecessary libraries.* 05:04 *🔐 Tailored Rules: Customize rules for specific frameworks or tools like Chrome Manifest V3.* 06:00 *📉 Concise Rules: Overloading the file with rules can confuse the AI and make maintenance harder.* 07:07 *📜 Git Commit Rules: Define commit message structures for consistent version control history.* 08:02 *📝 Comment Preferences: Limit comments to complex logic or critical sections to avoid inconsistency.* 08:29 *🔄 Iterative Updates: Continuously refine the rules file as new AI mistakes are identified.* 09:37 *🔗 Centralized Rules: Symbolically link one rules file across multiple editors for easier management.* 11:00 *🚀 Future Improvements: AI editors could auto-suggest rule updates based on repeated issues to streamline workflows.* 12:12 *🧠 AI Memory Potential: Future AI could infer preferences from chats, reducing manual rule maintenance.* 13:34 *🎉 Outcome: Following these steps makes AI coding assistants more consistent and reliable as projects grow.* Made with HARPA AI
great. doing something similar but I actually have sections in rules: if you are asked to fix.. start with analyzing what files you need in context and ask the user for them... do not make assumptions.. it solved many "halucinations" in interfaces and connected methods. Also, sometimes I move out of cursor to claude client or use o1 preview as it mostly better works with larger context. There was a research that models start performing worse after a few thousand input tokens; it's 300 lines of code. Without your prompt, prompt from cursor team and cursor rules. The hope is in agents to create custom context and rules for each task. But now it's not there. I's also like task management for LLM inside cursor. It ofter proposes steps and it could add them to tasks without need to read all history in chat.
That's a very useful rule to add in. I think the community will be building very strong rule files in the coming month. I'd also want to use o1-preview for this, but the pricing just doesn't quite work out for most of the tasks. I do like using that for the initial problem breakdown.
Thank you for this. I have been struggling with my WindsurfAI going off the rails. I took advantage of the new file when they added it but it was not working well. I am not a programmer and this app has helped me create my first app but its been a struggle at the end here with it being so complex. Thank you.
These AI code editors are great to get things off the ground, but you probably still have to have a certain degree of knowledge of coding to go further. I think we'll definitely get there with a fully autonomous AI coder, but that will still take some time.
@@YifanBTH I liken it to me telling monkeys how to drive via a cell phone 1000 miles away. We are getting down the road but its not without slamming into the guardrails or completely off the road most of the time. My iOS program is now running but still some issues when trying to get it to fix simple UI or other issues. Getting there slowly but surely. I cannot get Cursor to edit the code at all whereas Windsurf has been pretty good except for the monkey part.
Hello Yifan. New sub for sure. I am new at using AI driven IDE's and just started working with Cursor. Appreciate this workflow enhancement. I'm sure we will find other good tips and tricks on your channel. Kind regards and may you have a good time.
This is awesome man! New sub. I started building something before cursor to manage context. I stopped because cursor came out but what I did was hashed the codebase and then if the hash was broken it would include that file in the context. Also, used Gpt4o mini to describe every function and every function it calls to get a full control flow. If I had time I'd push it further but hopefully someone sees this lol
I'm doing a Flutter app. Most of these rules don't apply and is specific to grammar, coding style, etc but could be adjusted. The editors don't usually have a problem with naming conventions or understanding the structure of a Flutter/React app in terms of folders. I'm mostly interested in the optimal approach to reducing the coding iterations and errors. ie being explicit about the requirements for the app, libraries, doing it in stages, etc. Also using o1 or new gemini thinking for high level along with claude or 4o to do the coding.
These coded edge editors excel at common frameworks. The moment you venture slightly off the main course, things can get a bit hairy. I think the less popular the framework, the more rules you probably need to apply for it to do well.
Excellent work. I really liked the structure and clarity of the code editor rules. Congratulations. I would like to see your other works. Where can I find them?
One other thing I figured out is to symlink the .cursorrules to a non .dotfile version, this way windsurf can see the file (I don't think it sees .dotfiles by default), and can make self-improving updates. (i.e. ln -s .cursorrules cursorrules), then when theres a new change to the architecture, I ask it to update that file as well to self-improve.
Oh wow, I didn't know about that feature, this will help a lot with a ComfyUI project I am working on. I was having trouble getting Windsurf to stick to the standards I wanted.
I was looking for the windsurfrules option. Going back to our version control chat on your previous video. I asked windsurf to push a git commit after each update. But it forgot context after a while.. So the file should help. Thanks!
Maybe You can take your output with errors etc as a file and rules as a file and ask it what additions to add to rules to prevent the issues from occurring.
That's the workflow I've kind of ended up with. I was hoping that I could just add in that one rule so that I would do it automatically without that additional step.
Maybe You can take your output with errors etc as a file and rules as a file and ask it what additions to add to rules to prevent the issues from occurring. Love your content Yifan!!
Love the video... about the context files i have a success with them.. I am just giving the contet file in the directory where my project is and i am tagging it into the composer and saying ... you should look at this file and understand it deeply and than implement the ______ in our current project (you can put the context files in a sub folder named 'files' for example)
Yes, that workflow can work quite well if you want to. You can also use the native Notepad feature that references other files and stores the context directly in the cursor. The improvements I wish they made soon is to be able to automatically include those notepads depending on the work that you're specifying.
I liked these tips but i am specifically looking for "a feature where i don't have to type @docs -> @nextjs to use latest docs everytime " bcz everytime i don't type or explicitly mention the docs it uses the old code structure not the latest
@@YifanBTH My favorite tip was updating the rules file as you go when the ai makes mistakes. When the llm makes an error, I have it describe the error it made, and propose a rule change to keep it from happening in the future. That one trick has done so much to improve the reliability of the agent.
Really useful advices. From time to time I have to start a new composer and @codebase is not enough. I did a project analyzing script to help me with that, it uses Gemini flash. Basically scans all files from my project following a prompt, then I paste the report on Cursor. Mixing that with rules must be the next big thing for me.
Just rely on the @codebase along can be a hit and miss, especially with larger codebases and when you have very tailored coding styles. AI will likely miss that.
I saw another dev video do an @ mention to a url showin apples best practices and it incorporated it for a project if you cant get conditional rules as a potnetial workaround
You could always create a customGPT or notebookLM of different .cursorrules, etc, and just ask it to generate a new one when you have a vague idea for the next project
Also.. you mentioned you were doing a Chrome extension. From what I’ve seen. They don’t allow for loading remote scripts. I’m guessing you are just keeping everything local?
Thanks for the insightful video! While a general rules file is great for broad guidelines, wouldn't it be more efficient to leverage package.json to provide specific context for the tech stack in Node.js projects? I mean, it's automatically updated, eliminating the need for manual maintenance and reducing the risk of inconsistencies.
The package.dation can absolutely be referenced, but it still contains limited information, say things around directory structure and coding best practices.
nice, i always worry about the filesize knowing that the old llms eg gpt 3 used to only really handle a few instructions at once, i think cursor also has workspaces so you can have multiple rules files basically eg working on the backend or frontend and it will only use the one file, Im starting to keep a bunch of prompt files in the project these days too so i can manually @ them :D
yes, having multiple prompts files that you can just reference with an "@" is super convenient. I just wished that they'll be able to automatically figure out the files needed rather than having to manually put it in everytime.
@@YifanBTH Yea cline and the cursor in the new "agent" mode sometimes work to read files without having to ask, using the cursor codebase search too to understand new codebases which is working pretty well just not for the more arcane errors that involve navigating far through the codebase as well the agents still break down and its much better to have all the context there in files @ ed, trying to reorganize my code to be simpler and more demo/leetcode style understandable by AI these days for this reason
This is really good. I have a request. I am building a tools website that has 100s of tools in a single website. How can i automate it so AI can create all tools listed, including the different files needed to complete a working tool without me having to manually create one at a time. I am using windsurf ai.
Absolutely. I think the beauty of the file is that you can constantly add to it as you discover problems. You never have to have a fully fledged file from the get-go.
Great idea to talk about the most recent changes for your framework im using svelte 5 but it always tries to use svelte 4 syntax. Same thing used to happen with Next.js, especially since theyre always “improving” it
Yeah, it's like if you're using next.js 15 or react 19 - any latest versions. You'd really have to call things out explicitly otherwise it hallucinates some random stuff.
You can, but I specifically wanted something that allows me to mention them directly in the rules file so that cursor can automatically look it up without me manually mentioning it. I agree with you. Notepad is already a great feature.
I prefer the .windsurf local file as it can be committed to version control. As tech stack and style change across codebases, having individual settings is more convenient.
I think you should make your head window smaller, much much smaller as we lose a bit of a context looking at your editor when third of the screen is hidden by the talking head :) Otherwise - great vid.
I feel the pricing between the two is roughly on par with each other. So if you're already familiar with one and happy with it, I don't think there's any reason to move.
@YifanBTH In this case, I don't subscribe to either one, I used another one, between the $20 cursor pro with unlimited prompts or windsurf with $15 with limited prompts that last 2 days?
@ yes, I want to build a patient management system for a clinic where the user login into a dashboard to see a calendar with appointments, patient information, and some sort of productivity view. Thanks!
This is a light bulb moment for me. Does this mean you will need the rule files for every project? I'm thinking of a situation where for example you are working on a project that has a Python backend and Vue frontent. If i create the rules file for the python project and i switch to my frontend code, the rules now become irrelevant. No?
Can you ask o1 to write the best possible instruction file for you? - Although include a role, like: answer as the world-famous software development expert specializing in Angular with the prestigious "Top Angular Innovator Award." - apply CoT technique: Before generating the code, outline the key steps you will take to implement...
Absolutely, I actually started off one of my rule templates from doing that. You can also find a lot of these templates on the website cursor.directory
I made the effort to use both, mostly driven by my own curiosity. I don't think it's really necessary for the everyday workflow for most, but I keep this subscription open for both because people are releasing new features so quickly these days and I want to make sure that I have the ability to test them out.
You have to manually create it at the root of your repository. So just create an empty text file with that name and WinSurf will follow the rules. If you want to test just add in the "say hahaha" at the beginning of every output as your test.
However, going back to version 42.5 and adding 1200 code files to the context (even without .cursorrules ) works just fine, it supports my coding style. So you are wrong that more files make the output worse.
Very useful context! To me, I think it was more of a problem of how to maintain when the context is too long, so when it's shorter it's easy to spot mistakes. Glad to hear that still worked for you!
@YifanBTH Can you show us how to setup windsurf and cursor into vs code please man. Love the tutorial and the rules file, thankyou. Very much appreciated my friend
@YifanBTH thanks a million man for the response. I will give it a try tomorrow and hopefully I can make it work. I am still very much a noob at this. Wish me luck haha 😄
It can. Which is why you want to keep the rule file still concise. Given my current rules file is less than the average code file, it doesn't cause any issues.
It's a hard choice man. I currently spend time in all of VSCode, Cursor, and Windsurf. They're all great at slightly different things, but I think they are really catching up on each other. If you're already finding joy with one, I don't think there's any reason for you to switch!
@@YifanBTH Windsurf is my first AI coding assistant, and I really love it. However, their credit system doesn’t work well for me-I used up my credits pretty quickly. I’m considering switching to Cursor.
Interesting to hear you say that. On one side, I thought I was over-sharing by giving too much detail. Let me know what specific you'd like to find out more.
I think we've all been poisoned by a lot of the video out there that shows you how to create things from just one line. In fact, most real-life things are far more complicated. If you don't want to spend the time writing good prompts, you're not gonna get good results.
oo i was getting it to keep .md for these like project structure and code. i need to get it to atleast check it in rules by default i guess this much better ty. i didn't know i could fit THAT MUCH into my rules without it ruining output. did have all my handy git commands tho. ai git > cli git > gui git
That was my initial thought too. You just have to be really selective about what you put in the files. I've seen a lot of reports on Cursor's Community Forums that people are having bad experiences with ultra-long cursor rules, which is why in the video I constantly iterate: "You want to put the rules that stop AI from making mistakes." If it's doing fine, don't change anything!
@@YifanBTH had the agent build the structure like yours and that +the short description helped a lot. First try had too much info and I did notice it lost context but trimmed down to just that and now its alwaysssss using my types files and it can infer the rest ♥ THANKS COACH
The rules file I used: gist.github.com/yifanzz/3cfb8f9065769ffbf94348255f85597d
You save me 😊
pretty cool, thanks for this gist link.
Do you additionally use rules in Cursor settings? Or only the .cursorrules file?
Thanks!
That's really nice. I think Cursor lets you add docs as well, which are basically custom bits of context you can `@`... I wonder where those fit into the system prompt/instructions, because that might give you what you asked for towards the end?
Looking forward to following this channel. I think it's going to explode with a lot of people interested in this subject. Thanks for making this.
Glad you found it helpful. And thanks for the kind words!
Thanks!
I need to get on your level with these donations!
@ you’re on your way!
That is a big fat thanks! Really appreciate your support. I hope you found the content useful, and let me know what you particularly enjoyed.
@@YifanBTH iterating on cursorrules is big. PS, we can prompt Claude/ChatGPT with current ruleset and ask to improve and add anything we haven’t thought of that might be useful. Cherry pick helpful additions - It’s like a free 2x level up
What a great explanation about the process plan. Many thanks.
Man, I expected a clickbait but I am leaving as a subscriber. Good job!
I have to admit that title was very clickbaity. Glad you found value.
Same
Got my click and very informative video! Much appreciated from new subscriber.
Hahaha, I also became a subscriber for the same reason.. What I saw is roughly what I imagined, but with some differences. In my opinion, these rules can be customized to suit specific needs.
I clicked on this video without any hope to learn anything, i finish it with the best AI advice i never hear yet
Really glad to hear it. What was the most interesting thing you found?
@@YifanBTH Implmenting context and keep track on it was for sure the best part for me ! never tought of that and that so usefull ! after many prompt, many model get lost, boring to explain all again and again
My short experience of going around in circles shows me this is an absolute must.
We've all spent those sleepless nights trying to convince AI to do the right thing
@ I’ve also realised that putting windsurf into chat mode and having full discussions about what it’s about to do makes a lot of difference.
Your point about only adding rule where the AI is getting things wrong is a good call out. There are websites that give sample cursorrules files, but using these can sometimes cause the AI to generate code that doesn't fit with your coding style or guidelines. Also remember that the cursorrules file will be included in the context so the bigger the file the less room for other information and the more expensive it will be to use
I did also start off with one of those rule files and then quickly removed a lot of the unnecessary stuff
Hi Yifan,
I absolutely adore your videos! I can tell you are passionated and knowledgeable about the topic you are presenting. While other channels try to sell their crap before even proving its validity, you just want to teach and inform and for that I thank you!
Oh and I just subscribed... I guess you can call me Your Fan!
Haha please don't lose the smile, its handsome!
Looking forward to your next video!
Wow, thank you! I'm glad you found this much value. More content coming right up.
Sending you blessings. This is exactly what I needed to see at this moment to get over some blockages.
glad I helped! out of curiosity, what was your blockage?
Great! follow a similar workflow when working with Cursor. also use a monorepo (Nx) and always include a Docusaurus wiki, which I have the agent refine to maintain a longer version of rules and guidelines. I appreciate your presentation style - honest and to the point. Great work! Looking forward to seeing more videos.
great to see a fellow mono-repo-er. Having the refine wiki is a useful tip. For these workflow, I frequently use @docs as cursor can deal with the indexing and updating for it but the RAG occasionally misses the point.
@@YifanBTH absolutely. the wiki is an overly verbose resource. for each session with composer, i always ask the agent to update relevant docs with new changes or sometimes create a worklog to make it easier to cold start. been tinkering with formulating a visual workflow using excalidraw source files and iconography to further improved the documentation. it sure is an balance act.
i really like the tip of getting the agent to state which rules its applying, going to test this out today. thanks again
@@YifanBTH can you open a repository with the visa application bot? useful stuff, I'd be very grateful ;)
This is the solution I needed at the exact time I needed it. Liked and subscribed. Thanks!
Glad I made the video at the right time.
Please share the file
Where is the file?
Screenshot and tell Claude AI to extract the text with the exact formatting he used, ur welcome.
@@CarlosMateo-z3k that's illegal. stop right there!
@@CarlosMateo-z3k exactly my thought 😆 its almost 2025, just use ai...
@@CarlosMateo-z3k my slow self manually typed everything 😭
Thank you. Your video was perfect timing. VERY INSIGHTFUL!
Glad it was helpful!
thanks for this! great tips and recommendations
Glad it was helpful!
🎯 Key points for quick navigation:
00:00 *🧩 Context is Key: AI can’t guess everything; providing clear and concise context ensures reliable results.*
00:14 *📄 One Rules File: A rules file can drastically improve AI coding assistants like VS Code, Cursor, or Windsurf.*
00:41 *⚙️ Rule Integration: Tools like Cursor and VS Code use specific files to include context for all AI sessions.*
01:35 *🔍 Verify Rules: Add a rule that makes the AI explicitly state which rules it followed for easy verification.*
02:16 *🎯 Project Context: Include a high-level project description to help AI understand its purpose.*
02:44 *🗂️ Code Structure: Outline the folder and file structure to guide the AI’s decisions.*
03:12 *🔧 Inferred Actions: AI will act based on rules file context, like placing a utility function in the correct folder.*
04:09 *🚫 Avoid Random Dependencies: Specify your tech stack to prevent AI from introducing unnecessary libraries.*
05:04 *🔐 Tailored Rules: Customize rules for specific frameworks or tools like Chrome Manifest V3.*
06:00 *📉 Concise Rules: Overloading the file with rules can confuse the AI and make maintenance harder.*
07:07 *📜 Git Commit Rules: Define commit message structures for consistent version control history.*
08:02 *📝 Comment Preferences: Limit comments to complex logic or critical sections to avoid inconsistency.*
08:29 *🔄 Iterative Updates: Continuously refine the rules file as new AI mistakes are identified.*
09:37 *🔗 Centralized Rules: Symbolically link one rules file across multiple editors for easier management.*
11:00 *🚀 Future Improvements: AI editors could auto-suggest rule updates based on repeated issues to streamline workflows.*
12:12 *🧠 AI Memory Potential: Future AI could infer preferences from chats, reducing manual rule maintenance.*
13:34 *🎉 Outcome: Following these steps makes AI coding assistants more consistent and reliable as projects grow.*
Made with HARPA AI
🤯🤯🤯 You rock! Best tip for AI Dev IDE's ever!!
Everything he is explaining I am applying I understand how is works when you know that you will do a great team
great. doing something similar but I actually have sections in rules: if you are asked to fix.. start with analyzing what files you need in context and ask the user for them... do not make assumptions.. it solved many "halucinations" in interfaces and connected methods.
Also, sometimes I move out of cursor to claude client or use o1 preview as it mostly better works with larger context. There was a research that models start performing worse after a few thousand input tokens; it's 300 lines of code. Without your prompt, prompt from cursor team and cursor rules. The hope is in agents to create custom context and rules for each task. But now it's not there. I's also like task management for LLM inside cursor. It ofter proposes steps and it could add them to tasks without need to read all history in chat.
That's a very useful rule to add in. I think the community will be building very strong rule files in the coming month. I'd also want to use o1-preview for this, but the pricing just doesn't quite work out for most of the tasks. I do like using that for the initial problem breakdown.
Simple, useful, thought out video. Nice.
Glad you liked it!
Thank you for this. I have been struggling with my WindsurfAI going off the rails. I took advantage of the new file when they added it but it was not working well. I am not a programmer and this app has helped me create my first app but its been a struggle at the end here with it being so complex. Thank you.
These AI code editors are great to get things off the ground, but you probably still have to have a certain degree of knowledge of coding to go further. I think we'll definitely get there with a fully autonomous AI coder, but that will still take some time.
@@YifanBTH I liken it to me telling monkeys how to drive via a cell phone 1000 miles away. We are getting down the road but its not without slamming into the guardrails or completely off the road most of the time. My iOS program is now running but still some issues when trying to get it to fix simple UI or other issues. Getting there slowly but surely. I cannot get Cursor to edit the code at all whereas Windsurf has been pretty good except for the monkey part.
Hello Yifan. New sub for sure. I am new at using AI driven IDE's and just started working with Cursor. Appreciate this workflow enhancement. I'm sure we will find other good tips and tricks on your channel. Kind regards and may you have a good time.
Welcome!
This is awesome man! New sub.
I started building something before cursor to manage context. I stopped because cursor came out but what I did was hashed the codebase and then if the hash was broken it would include that file in the context.
Also, used Gpt4o mini to describe every function and every function it calls to get a full control flow.
If I had time I'd push it further but hopefully someone sees this lol
kudos on building that yourself. we are getting some amazing tools to help us along the way
Great advice !
I'm doing a Flutter app. Most of these rules don't apply and is specific to grammar, coding style, etc but could be adjusted. The editors don't usually have a problem with naming conventions or understanding the structure of a Flutter/React app in terms of folders. I'm mostly interested in the optimal approach to reducing the coding iterations and errors. ie being explicit about the requirements for the app, libraries, doing it in stages, etc. Also using o1 or new gemini thinking for high level along with claude or 4o to do the coding.
These coded edge editors excel at common frameworks. The moment you venture slightly off the main course, things can get a bit hairy. I think the less popular the framework, the more rules you probably need to apply for it to do well.
Solid advice. Great video bro keep it up. 🎉
Thanks! Will do!
This is great!!!! Going to use these tips
Let me know which one you found the most useful after implementing.
Excellent work. I really liked the structure and clarity of the code editor rules. Congratulations. I would like to see your other works. Where can I find them?
welcome, you should check out my other videos in the channel
One other thing I figured out is to symlink the .cursorrules to a non .dotfile version, this way windsurf can see the file (I don't think it sees .dotfiles by default), and can make self-improving updates. (i.e. ln -s .cursorrules cursorrules), then when theres a new change to the architecture, I ask it to update that file as well to self-improve.
That is a very interesting observation. I need to give that a try.
We demand the file!!
Screenshot and tell Claude AI to extract the text with the exact formatting he used, ur welcome.
The demand has been received: gist.github.com/yifanzz/3cfb8f9065769ffbf94348255f85597d
Oh wow, I didn't know about that feature, this will help a lot with a ComfyUI project I am working on. I was having trouble getting Windsurf to stick to the standards I wanted.
yeah, this principle applies to any system that has a rules file / setting. glad you found it helpful
Yifan, Thanks. Relaly, One of the most useful things .
Glad you found it useful.
I was looking for the windsurfrules option. Going back to our version control chat on your previous video. I asked windsurf to push a git commit after each update. But it forgot context after a while.. So the file should help. Thanks!
Great idea. I use the Git UI most of the time as it's straight forward enough.
You nailed it bro!
Glad it was helpful.
would love a guide on getting windsurf with replit with SSH !!
Let me have a test, and I will report back.
Amazing Job
Glad you found it useful.
Maybe You can take your output with errors etc as a file and rules as a file and ask it what additions to add to rules to prevent the issues from occurring.
That's the workflow I've kind of ended up with. I was hoping that I could just add in that one rule so that I would do it automatically without that additional step.
really really nice video
Thanks for this!
11:20 is already possible in Copilot. I posted a comments with more details but got automatically removed.
interesting, could you ellaborate?
@@YifanBTH Check copilot instruction documentation. There's 4 categories.
This was great. Subbed.
Welcome aboard!
Great video, thanks for sharing.
Thanks for watching!
Maybe You can take your output with errors etc as a file and rules as a file and ask it what additions to add to rules to prevent the issues from occurring. Love your content Yifan!!
Good suggestion. I really hope cursor will just make this automatic one day.
THNX, this is going to be great!
glad you found it useful!
Love the video... about the context files i have a success with them.. I am just giving the contet file in the directory where my project is and i am tagging it into the composer and saying ... you should look at this file and understand it deeply and than implement the ______ in our current project (you can put the context files in a sub folder named 'files' for example)
Yes, that workflow can work quite well if you want to. You can also use the native Notepad feature that references other files and stores the context directly in the cursor. The improvements I wish they made soon is to be able to automatically include those notepads depending on the work that you're specifying.
We need the file sir
Screenshot and tell Claude AI to extract the text with the exact formatting he used, ur welcome.
It's an independent comment now. gist.github.com/yifanzz/3cfb8f9065769ffbf94348255f85597d
Very Nice tutorial, are you able to Share à version of that cursorrule? Very interesting
I'll put one up in the pinned comments coming very soon.
I liked these tips but i am specifically looking for
"a feature where i don't have to type @docs -> @nextjs to use latest docs everytime "
bcz everytime i don't type or explicitly mention the docs it uses the old code structure not the latest
Yeah, the rules file doesn't allow you to directly mention the tools, which is kind of annoying. So we still have to do that manually, currently.
very helpful, thank you
Glad you found it helpful. Thanks for watching!
@@YifanBTH My favorite tip was updating the rules file as you go when the ai makes mistakes. When the llm makes an error, I have it describe the error it made, and propose a rule change to keep it from happening in the future. That one trick has done so much to improve the reliability of the agent.
Really useful advices. From time to time I have to start a new composer and @codebase is not enough. I did a project analyzing script to help me with that, it uses Gemini flash. Basically scans all files from my project following a prompt, then I paste the report on Cursor. Mixing that with rules must be the next big thing for me.
Just rely on the @codebase along can be a hit and miss, especially with larger codebases and when you have very tailored coding styles. AI will likely miss that.
Thank you
Glad you found it helpful.
I saw another dev video do an @ mention to a url showin apples best practices and it incorporated it for a project if you cant get conditional rules as a potnetial workaround
Indeed, the URL mentioning and docs mentioning are really powerful features in Cursor by giving you that optional context.
Can you show how you made your app, step by step
Definitely in my backlog. Thanks for watching
Explaine more about steps to write the file please
Where can i generate the file
you can find some templates here: cursor.directory/. you can also use the one I linked in my pinned commend.
Nice, Subscribed. Your file would be time saver, even though I would need to rewrite much of it. Thanks
Thanks for watching! This is also in the pinned comment now, and here's the link. gist.github.com/yifanzz/3cfb8f9065769ffbf94348255f85597d
Damn great, is this cursor rule different from what we set in settings in cursor?
the cursor rules file applies on a per project basis, the cursor setting applies globally
You could always create a customGPT or notebookLM of different .cursorrules, etc, and just ask it to generate a new one when you have a vague idea for the next project
Great idea. You can also find a decent list of templates here to get started: cursor.directory/
Also.. you mentioned you were doing a Chrome extension. From what I’ve seen. They don’t allow for loading remote scripts. I’m guessing you are just keeping everything local?
I'm not sure what you mean by "not allow for loading remote scripts?", I'm using these AI editors for local development.
Great explanation, please share the file to use as template.
Yessir, it's in the pinned comment now. gist.github.com/yifanzz/3cfb8f9065769ffbf94348255f85597d
@@YifanBTH Thank you. I would appreciate a NextJS 15 project folder structure video from you!
Thanks for the insightful video! While a general rules file is great for broad guidelines, wouldn't it be more efficient to leverage package.json to provide specific context for the tech stack in Node.js projects? I mean, it's automatically updated, eliminating the need for manual maintenance and reducing the risk of inconsistencies.
The package.dation can absolutely be referenced, but it still contains limited information, say things around directory structure and coding best practices.
nice, i always worry about the filesize knowing that the old llms eg gpt 3 used to only really handle a few instructions at once, i think cursor also has workspaces so you can have multiple rules files basically eg working on the backend or frontend and it will only use the one file,
Im starting to keep a bunch of prompt files in the project these days too so i can manually @ them :D
yes, having multiple prompts files that you can just reference with an "@" is super convenient. I just wished that they'll be able to automatically figure out the files needed rather than having to manually put it in everytime.
@@YifanBTH Yea cline and the cursor in the new "agent" mode sometimes work to read files without having to ask, using the cursor codebase search too to understand new codebases which is working pretty well just not for the more arcane errors that involve navigating far through the codebase as well the agents still break down and its much better to have all the context there in files @ ed, trying to reorganize my code to be simpler and more demo/leetcode style understandable by AI these days for this reason
This is really good. I have a request. I am building a tools website that has 100s of tools in a single website. How can i automate it so AI can create all tools listed, including the different files needed to complete a working tool without me having to manually create one at a time. I am using windsurf ai.
I'm not sure if I fully understand your need. Can you send me a link to the demo website or drawing? That would really help.
Great, we can use your template as a base to extend it to a generic standard template for programming languages such as C#, Python, and C++.
Absolutely. I think the beauty of the file is that you can constantly add to it as you discover problems. You never have to have a fully fledged file from the get-go.
Great idea to talk about the most recent changes for your framework
im using svelte 5 but it always tries to use svelte 4 syntax.
Same thing used to happen with Next.js, especially since theyre always “improving” it
Yeah, it's like if you're using next.js 15 or react 19 - any latest versions. You'd really have to call things out explicitly otherwise it hallucinates some random stuff.
@@YifanBTH 100%
11:21 Isnt cursor's notepad feature helpful here?
You can, but I specifically wanted something that allows me to mention them directly in the rules file so that cursor can automatically look it up without me manually mentioning it. I agree with you. Notepad is already a great feature.
Windsurf has a global and a local file. Any thoughts on different approaches? Love symlinks...
I prefer the .windsurf local file as it can be committed to version control. As tech stack and style change across codebases, having individual settings is more convenient.
Where this file needs to add? In a project root directory?
Yes, just at the root of the directory.
I think you should make your head window smaller, much much smaller as we lose a bit of a context looking at your editor when third of the screen is hidden by the talking head :)
Otherwise - great vid.
Good suggestion. We'll keep an eye on that for future videos.
Does Google AI studio have a rules file for Gemini flash?
I don't believe they have it just yet.
YES, we need that file :)
dont make me screen capture and type the hole thing please :)
Screenshot and tell Claude AI to extract the text with the exact formatting he used, ur welcome.
Thanks for watching! It's also in the pinned comment now.
gist.github.com/yifanzz/3cfb8f9065769ffbf94348255f85597d
@@YifanBTH yes sir!
ok, i just subscribe your channel because of this
Glad you found this useful. More coming!
Which is still better, windsurfing or cursor, after changing the value and adding the limit?
I feel the pricing between the two is roughly on par with each other. So if you're already familiar with one and happy with it, I don't think there's any reason to move.
@YifanBTH In this case, I don't subscribe to either one, I used another one, between the $20 cursor pro with unlimited prompts or windsurf with $15 with limited prompts that last 2 days?
In VS Code I currently use Cline. there are custom instructions for each prompt but no rules afaik
Yeah, having a committable file is bliss!
Thanks for the video and file.
Please, do a step by step tutorial!
thanks, anything specific you want to see in a more detailed tutorial?
@ yes, I want to build a patient management system for a clinic where the user login into a dashboard to see a calendar with appointments, patient information, and some sort of productivity view.
Thanks!
I do use .cursorrules but I can't fine the option to opt to use them in Windsurf
it's enabled by default, you can just place a .windsurfrules file in project root directory. or "ln -s .cursorrules .windsurfrules"
This is a light bulb moment for me. Does this mean you will need the rule files for every project? I'm thinking of a situation where for example you are working on a project that has a Python backend and Vue frontent. If i create the rules file for the python project and i switch to my frontend code, the rules now become irrelevant. No?
you can also apply a global setting for both windsurf and cursor. for things to apply across the board.
Can you ask o1 to write the best possible instruction file for you?
- Although include a role, like: answer as the world-famous software development expert specializing in Angular with the prestigious "Top Angular Innovator Award."
- apply CoT technique:
Before generating the code, outline the key steps you will take to implement...
Absolutely, I actually started off one of my rule templates from doing that. You can also find a lot of these templates on the website cursor.directory
Hi Yifan, just curious if you find using both cursor and windsurf made a difference in your productivity ?
I made the effort to use both, mostly driven by my own curiosity. I don't think it's really necessary for the everyday workflow for most, but I keep this subscription open for both because people are releasing new features so quickly these days and I want to make sure that I have the ability to test them out.
can you share your current cursor file?
It's now shed in the pinned comments. Thanks for watching! gist.github.com/yifanzz/3cfb8f9065769ffbf94348255f85597d
i cant find .windsurfrules file anywhere :(
You have to manually create it at the root of your repository. So just create an empty text file with that name and WinSurf will follow the rules. If you want to test just add in the "say hahaha" at the beginning of every output as your test.
@@YifanBTH thank you!
Starts off better prompts are not the answer… but include this context in your prompt to make it better
Haha, you caught me. I was referring to prompts as something that you have to manually write every single time. Thanks for calling it out
how to add the context file
You can just create the file at the project's root.
how can I use rules in vscode with github copilot?
for vscode, you can save the file to .github/copilot-instructions.md
I also mentioned it in the video at 0:51
However, going back to version 42.5 and adding 1200 code files to the context (even without .cursorrules ) works just fine, it supports my coding style. So you are wrong that more files make the output worse.
Very useful context! To me, I think it was more of a problem of how to maintain when the context is too long, so when it's shorter it's easy to spot mistakes. Glad to hear that still worked for you!
There is no .cursorrules file at the root of my repository.
It's one that you manually create. If it doesn't exist, Cursor basically ignores custom commands.
@@YifanBTH Thanks, Yifan! I figured that out later. I am using your template all the time now. It's great!
@YifanBTH Can you show us how to setup windsurf and cursor into vs code please man.
Love the tutorial and the rules file, thankyou. Very much appreciated my friend
you can run "ln -s ../.cursorrules copilot-instructions.md" inside the ".github" folder to link up the files
@YifanBTH thanks a million man for the response. I will give it a try tomorrow and hopefully I can make it work. I am still very much a noob at this.
Wish me luck haha 😄
Wouldn't this eat through the limited context window prvoided by the AI Text Editors?
Should be part of the system message. So shouldn’t be sent over and over. Think of it as instructions to the assistant.
It can. Which is why you want to keep the rule file still concise. Given my current rules file is less than the average code file, it doesn't cause any issues.
File brother please.
In the pinned comment now. Thanks for watching!
Tell me, which one is better, Windsurf or Cursor?
It's a hard choice man. I currently spend time in all of VSCode, Cursor, and Windsurf. They're all great at slightly different things, but I think they are really catching up on each other. If you're already finding joy with one, I don't think there's any reason for you to switch!
@@YifanBTH Windsurf is my first AI coding assistant, and I really love it. However, their credit system doesn’t work well for me-I used up my credits pretty quickly. I’m considering switching to Cursor.
Not bad son, not bad at all. . .
welcome
hey can you share the file ( thanks ) anyways also sub
Thanks for watching! I have included the file in the pinned comment.
Coloque seus áudios dublados
What language would you like to see it dubbed in?
Good information, but I don’t feel like you told us how to do anything. You told us what to do but not how to do it.
Interesting to hear you say that. On one side, I thought I was over-sharing by giving too much detail. Let me know what specific you'd like to find out more.
ai 100% does not guess everything. changing the way I instruct it has changed everything
I think we've all been poisoned by a lot of the video out there that shows you how to create things from just one line. In fact, most real-life things are far more complicated. If you don't want to spend the time writing good prompts, you're not gonna get good results.
People asking you to share this rule really are not serious or didn't watch the video at all....
Copy pasters, then say: nah it didn't work for me 😅
Thanks for watching until the end. I've included the file in the pinned comment.
m
m
@YifanBTH haha
Wow - I couldn't disagree more with this absurd thesis on creating unnecessary - and mostly useless and confusing work for yourself and the LLM.
what would be your go to method?
+1 for symlinking the files (i.e. ln -s .cursorrules .windsurfrules)
hello sir
can please send me the rule.md you are making i am working on auto visa system and i want to learn some stuff from your rule file
The basic rules files are linked in the video. What kind of system are you trying to create?
@@YifanBTH auto appointment system
oo i was getting it to keep .md for these like project structure and code. i need to get it to atleast check it in rules by default i guess this much better ty. i didn't know i could fit THAT MUCH into my rules without it ruining output. did have all my handy git commands tho.
ai git > cli git > gui git
That was my initial thought too. You just have to be really selective about what you put in the files. I've seen a lot of reports on Cursor's Community Forums that people are having bad experiences with ultra-long cursor rules, which is why in the video I constantly iterate: "You want to put the rules that stop AI from making mistakes." If it's doing fine, don't change anything!
@@YifanBTH had the agent build the structure like yours and that +the short description helped a lot.
First try had too much info and I did notice it lost context but trimmed down to just that and now its alwaysssss using my types files and it can infer the rest ♥ THANKS COACH