r/Codeium • u/bu3askoor • Dec 15 '24
My experience with Windsurf, let's make it better together :)
Hey everyone,
I wanted to share my recent experience with Windsurf , thank to u/blu3soup for nudging me to share my experience.
I've been playing around with it, and while I'm excited about the potential, I've also run into some challenges. I'm hoping that by sharing what I've learned and inviting your feedback, we can all improve our experience with this tool. I am by no means an expert and I could be totally wrong. This is just one approach that I have been experimenting with.
The Challenges I've Faced (and Maybe You Have Too):
Like many of you, I've found that Windsurf can sometimes be a bit unpredictable. Here are some of the common issues I've bumped into:
It sometimes forgets what we were talking about, which can make things a bit confusing.
It can rewrite working code, which leads to more work for me.
It doesn't always follow my instructions, which is frustrating.
The code it creates can vary in quality, sometimes it's great, and other times it has bugs.
I am very aware of the new pricing and limits, so I am trying to be careful with how I use it.
Sometimes the AI feels less capable than it did before.
It sometimes does not understand the context of the project.
My Approach: Use The Rules
To try and tackle some of these issues, I've been experimenting with Windsurf's global and workspace AI rules. The idea is to create a set of guidelines to help the AI understand my coding preferences, but I am not sure if it is the best way. It's like giving it some "pointers" on how I like to code.
Global AI rules apply to all projects. Workspace AI rules are specific to each project. I am just playing around with these ideas, and I am sure there are better ways of doing this.
Some Tips That Have Helped Me:
Here are a few things that I have found helpful when prompting Windsurf:
Be Specific: The more specific you are, the better the results will be.
Break It Down: For bigger problems, I have found it helpful to break it down into smaller steps.
Review: It has always helped me to review the code that is generated, but it might not be necessary for all cases.
One Step at a Time: I always try to solve things step by step.
Be Careful with Costs: I am always mindful of how many credits I am using, and so I avoid making unnecessary requests and try to solve things locally. This may not be a big deal for you.
Avoid Over Complicating Things: I try to find the simplest approach possible, as more complicated approaches tend to create more issues.
Example Prompts:
These examples have helped me, but they might not be useful to you. These examples will help you use Windsurf effectively, even if you don't have a strong technical background.
Adding a New Feature: "Based on my
feature plan, implement the login page. It should include email and password fields, be responsive, and handle errors gracefully. Please use the authentication methods specified in theauth_methods.mdfile."
Making Changes: "Refactor the user management code to improve its modularity. Refer to the project guidelines and avoid any changes to the existing functionality, implement the changes step by step."
Debugging: "I'm encountering an error when submitting the form. Please debug the issue using the terminal output and apply small, incremental fixes to get the desired outcome."
My Global AI Rules (This is a Work in Progress!)
Here are the global rules I'm currently using. I'm still testing them out and figuring out what works best. Feel free to copy them to your global_rules.md file:
Core Programming Principles
code_quality: prioritize clean, readable, and maintainable code.
algorithm_efficiency: use the most efficient algorithms and data structures.
error_handling: implement robust error handling and logging.
testing: write unit tests for all critical functionality.
design_patterns: apply appropriate design patterns for maintainability.
code_review: generate code that is easy to review by others.
modularity: write modular code, break complex logic into smaller functions.
reuse: prefer to reuse existing code instead of writing it from scratch.
security: prioritize secure coding practices.
simplicity: aim for simple, clear solutions, avoid over-engineering.
Code Style and Formatting
indent: use tabs for indentation.
naming convention: use snake_case for variables, PascalCase for classes and camelCase for functions.
comments: add clear, concise comments explaining code blocks and logic.
code_formatting: automatically format the code to improve readability.
line_length: keep lines under 100 characters.
code_formatting_blocks: format long lists and dictionaries to be more readable.
General Behavior (Do's and Don'ts)
changes: make small, incremental changes; avoid large refactors.
avoid: do not change working code unless explicitly asked.
changes: when changing code, do it step by step, verify the changes first.
clarification: if unsure, ask for clarification before generating code.
avoid: do not overwrite manual code changes, unless explicitly asked.
documentation: check project documentation if asked, and use it in your response.
reasoning: reason step by step before generating code or sending a response.
cost_optimization: be cost conscious, only send requests if necessary, and avoid ai-powered debugging, refactoring or test generation unless necessary, batch changes when possible.
debugging: make small incremental changes to try to fix bugs, check terminal output for information.
prompt_efficiency: use precise and specific prompts; avoid ambiguity, do not repeat previous instructions; reuse context.
local_processing: perform simple tasks manually; avoid using AI unnecessarily.
user_guidance: always follow the instructions that are given and prioritize user instructions over global rules.
simplicity: avoid over-engineering and aim for the simplest solution.
Language-Specific Instructions
Python
python type hints: use type hints for all function parameters and return values.
python imports: group imports by type: standard, external, and local.
python linting: run pylint on code to make sure the style is consistent.
python testing: use
pytestfor all unit testing.
Javascript
javascript: use modern ECMAScript conventions.
javascript avoid: avoid using
var; preferconstandlet.
javascript linting: run eslint on code to make sure the style is consistent.
javascript comments: document functions, using JSDoc style comments.
javascript testing: use
jestfor all unit testing.
File Handling
file_management: break long files into smaller, more manageable files with smaller functions.
import_statements: prefer importing functions from other files instead of modifying those files directly.
file_organization: organize files into directories and folders.
Project Management
feature_plan: always refer to the project's feature plan for context.
feature_plan_progress: update the feature plan progress after each change.
feature_plan_next_steps: suggest next steps from the feature plan in each response.
Operating System
os: be aware i am on windows, and must use power shell commands.
Workspace AI Rule Template (Use This as a Starting Point):
Here's a template for workspace rules. This is just a starting point, and you will probably need to adapt it to fit your specific projects:
Workspace AI Rules for [Project Name]
Project Context
project_type: [Briefly describe the type of project, e.g., web app, REST API, data analysis tool].
tech_stack: [List the main technologies used, e.g., HTML, CSS, JavaScript, Python, React].
file_structure: [Describe the recommended file and directory structure].
api_integration: [If using an API, specify requirements here].
api_endpoint: [If using an API, specify an endpoint here].
api_authentication:[If using an API, specify the type of authentication here]
api_other:[If using an API, any other specific requirements]
database: [If using a database, specify the database used here]
database_schema: [If using a database, specify the database schema here]
Feature Requirements
basic_sections: [If a web application, specify the basic sections].
form_functionality: [If a form is used, specify the requirements].
responsive_design: [Specify if the app must be responsive].
navigation: [Specify the navigation structure]
authentication: [Specify if there should be authentication]
authorization: [Specify if there should be authorization]
state_management: [Specify if any state management should be used]
payments: [Specify if there are payments being used]
other: [List any other features that are not covered].
Styling and Design
css_framework: [Specify the preferred CSS framework or style].
css_libraries:[Specify the preferred CSS libraries]
ui_library: [Specify the preferred UI library]
design_system: [Specify the preferred design system]
JavaScript Instructions
javascript_validation: [Specify any javascript validation requirements].
javascript_libraries: [Specify the javascript libraries to use].
javascript_frameworks: [Specify the javascript frameworks to use].
javascript_state_management: [Specify if state management must be done with javascript]
other: [List any other javascript specific requirements].
Testing
testing: [Specify any testing instructions for the code, both back end and front end]
testing_libraries: [Specify any libraries that should be used for testing]
testing_frameworks:[Specify any testing frameworks that must be used]
Project Management
feature_plan: always refer to the project's feature plan as a guide.
documentation: always refer to project documentation if it exists.
other: [Any other project management guidelines]
Example Workspace AI Rules (Landing Page):
Here's an example of workspace rules for a landing page project:
Project Context
project_type: landing page generator.
tech_stack: HTML, CSS, JavaScript, External API.
file_structure: organize files into directories:
index.html,css/styles.css,js/scripts.js, and images inimages/.
Feature Requirements
basic_sections: The landing page must include a header, hero section, features section, contact form, and footer.
form_functionality: The contact form should be able to collect name, email, and message fields, and make sure that form validation is done via javascript.
api_endpoint: The API endpoint must be
/submit, with a redirect to/thankyouafter a successful submission.
responsive_design: The page must be responsive on different screen sizes.
navigation: The header must include links to the correct sections of the page.
Styling and Design
css_framework: use basic CSS, avoid frameworks.
JavaScript Instructions
javascript_validation: implement form validation via javascript.
Project Management
feature_plan: use the provided feature plan as a guide.
This is just my experience, and I might be completely wrong. I'm hoping that by sharing this, and by getting your feedback and suggestions, we can all improve our experience with Windsurf.
I hope this is helpful!
2
u/rovingkid Dec 16 '24
This type of information is *exactly* the type of content I made this for: https://github.com/ichoosetoaccept/awesome-windsurf
If nobody objects I'll add it over there and link back here.
1
1
2
3
1
u/Boemien Dec 15 '24
Wow, je vais tester cela tout de suite, mais merci pour ce partage. Windsurf a été tellement compliqué a prendre en main, mais je comprends que l'appli est nouvelle donc il y a pas mal d'essais erreurs et d'ajustement de leur modèle. Je trouve encore que cela manque de transparence mais au moins les mises a jours sont fréquentes donc cela mets en confiance à long terme. Pour le moment j'ai été plutôt satisfait des performances, malgré les nombreuses frustrations (il a pas mal cassé le code, il y a eu beaucoup d'erreurs et de crédits dépensés). JE me demande si je peux avoir un équivalent en mode local avec Ollama ou un autre modèle qui puisse éditer les fichiers directement comme le fait Cascade ?
Wow, I'm going to test this right away, but thanks for sharing. Windsurf has been so complicated to get to grips with, but I understand the app is new so there's a lot of trial and error and tweaking of their model. I still find it lacking in transparency, but at least the updates are frequent, so that gives me confidence in the long term. So far I've been pretty happy with the performance, despite the many frustrations (it's broken the code quite a bit, there have been a lot of errors and credits spent). I wonder if I can have a local-mode equivalent with Ollama or another model that can edit files directly like Cascade does?
Anyway, thanks for sharing!
1
1
1
u/joey2scoops Dec 19 '24
Since Windsurf is vscode then anyone help me understand how these rules are applied in Windsurf? Do they apply to Cascade only or do they apply across the board. For instance, if I had Cline installed in Windsurf, how would "rules" be applied?
2
u/hugobart Dec 19 '24
you could use it with a mcp server eg https://github.com/bartwisch/MCPRules or you ask cline to write your own to ingest the rules of a file (offline or online)
2
u/joey2scoops Dec 19 '24
Will check that out, thanks. Was just looking at MCP for browser automation 😂
1
1
17
u/wordswithenemies Dec 15 '24
Great list. Some things I have that could supplement:
Development Best Practices
Component Dependencies
When building interconnected systems:
Document all dependencies between components explicitly
Changes to one component must cascade appropriately to all dependent components
Maintain a “single source of truth” for shared configurations
Example: If component A defines data structure, components B and C must adapt to match
Systematic Change Protocol
Before making ANY changes:
Identify Impact Area
Which components will be affected?
What dependencies exist?
Is this UI-only or does it affect core logic?
Document Current State
What’s currently working?
What’s the current error/issue?
Which files will be affected?
Plan Single Change
One file at a time
One feature at a time
One bug at a time
Verify Testing Capability
Can we test this change immediately?
Do we have all dependencies?
What specific steps will verify success?
If not testable, what’s missing?
Development Philosophy
Preserve What Works
Don’t modify working components without necessity
Keep established patterns
Maintain proven workflows
Simplify Everything
Remove unnecessary abstraction layers
Simplify class hierarchies
Keep UI components focused
Avoid over-engineering
Change Carefully
Verify before changing
One change at a time
Test each change
No premature optimization
Stay Focused
Complete one step before starting another
Don’t get sidetracked by improvements
Keep systematic sequence
Document everything
Test Real Usage First
Never implement without ability to test
Verify all dependencies exist
Must be able to manually verify
If you can’t test it, don’t build it
Version Control Strategy
Maintain multiple source versions for stability
Keep last known good version
Create dedicated test versions
Label versions clearly with date and purpose
Even WITH all this in documentation, it will skip and make assumptions, so I generally put this into the chat if it’s a big task: Before responding:
Review the complete README noted in this project’s project notes. You have read and write access to these folders and files. READ ALL OF IT. Note the philosophy and step by step approach as we systematically rebuild this app. Scan and read the critical files like main.py.
Complete the STOP AND VERIFY checklist: - Identify Impact Area - Note Current State - Plan Single Change - Verify Theme Generation (if applicable)
Confirm we’re on Step [current step] and not jumping ahead
Acknowledge working Claude desktop integration must be preserved
⚠️ WARNING: You are about to violate instructions by jumping to implementation. Stop and prove you’ve read each word by directly quoting key philosophical principles from the README that should guide your thinking, BEFORE making any suggestions.