Contenido del curso
0:00/14:31
Windsurf Rules That Keep Cascade Consistent
Suscríbete para ver másCrea una página con un solo prompt escrito
Suscríbete para ver másBuilding a Blog Page with Voice Commands
Suscríbete para ver másUsa imágenes como referencia en Cascade
Suscríbete para ver másBuilding an About Page With One Prompt
Suscríbete para ver másWorking with Windsurf goes far beyond generating new features. One of its most practical uses is detecting and fixing design bugs, repeated code, and functionality issues across an existing project, all from the same editor. If you build with AI assistants and want cleaner, more maintainable code, this workflow shows you how to audit a website and refactor it without breaking it.
How can you spot visual bugs using the Windsurf preview?
The built-in preview lets you launch a local server and open the browser inside the IDE, so you can navigate the site while keeping the code one click away.
Once the preview runs, you choose between Chrome or the IDE view. From there, you browse each section like a regular user. In this project, the audit surfaced several issues worth fixing:
When you find a contrast problem, you can ask Cascade something like "this text has readability issues due to low contrast, fix it". Cascade analyzes whether to match by HTML tag or by text. Matching by tag updates every similar element, which is exactly what happened with the list item elements that became readable after the change.
What is Cascade in Windsurf? It is the AI agent that reads your project, edits files, and runs commands. You can talk to it in Spanish or English and switch between Chat mode (analysis only) and Code mode (real edits).
How do you ask Windsurf to scan a project for design and code issues?
Fixing bugs one by one inside the preview takes hours. A faster path is using Chat mode to request a full audit before touching any file.
First, stop the preview so the dev server is no longer running. Then, in Chat mode, send instructions like:
Windsurf now supports queued messages, so you can stack prompts without waiting for the first one to finish or canceling it. You can also reorder or delete them before execution.
The audit returned a detailed map of problems:
Why is duplicated header and footer code a problem? Every page repeats the same markup, so any change forces you to edit multiple files. Centralizing them in a layout reduces maintenance and bugs.
What does the final refactor plan include?
After processing the three queued prompts, Cascade merged everything into one comprehensive plan with concrete numbers:
A key lesson here: during the whole course, most of Cascade's suggestions were accepted without pushback. That is why so many issues piled up. Be critical with every recommendation the AI makes, otherwise you inherit problems disguised as progress.
How do you apply a refactor in Windsurf without breaking the app?
Instead of running the entire plan at once, the smart move is to slice it. A short prompt asks Cascade to start with part of phase one: create a layout with header and footer, and replace their usage on every page to avoid repetition.
Switching from Chat to Code mode lets Cascade actually modify files. The result:
During the edit, Cascade flagged some lint errors. React requires a single root element in the render, so removing the header temporarily broke the structure. Cascade cleaned those up on its own.
The diff covered seven files. Header and footer were new, so they only had additions. The existing layout gained 10 lines and lost four. Homepage, about, blog, and blog single each removed around 86 lines of duplicated markup, confirming the estimate of roughly 500 lines eliminated.
After accepting the changes, running the preview again shows the same header and footer rendering on every route. The visual output is identical, but the code base is dramatically lighter and easier to maintain.
Tell me in the comments how your own audit and refactor went. Your notes can help someone else in the community move faster.