Cascade is Windsurf's flagship agent — the pane on the right of the IDE. In Write mode it does the whole loop: reads your repo, plans a multi-file change, runs terminal commands, reads their output, and self-corrects until the goal is met. This pack is 24 prompts built specifically for that agentic control — how to make Cascade plan before it edits, stay inside a tight scope, steer on exact context, and remember your conventions so you stop re-explaining them.
These are distinct from single-shot debugging or refactoring asks. Every prompt below is a real Cascade message you paste into the pane (or a rule/workflow file where noted). Fill the [bracketed placeholders] with your paths and details. For the wider set, start with the 40 Best Windsurf AI Prompts roundup.
Plan-first agent runs
Before Cascade edits anything on a large task, make it think out loud. Ask for a plan, a checklist, and a risk estimate, then hold it at the gate until you approve. This is the single biggest lever for keeping an autonomous run on the rails.
1. Plan and wait for approval
Goal: [describe the feature or change in one sentence].
Do NOT write any code yet. First produce a step-by-step plan:
1. The exact files you will create or edit, with a one-line reason for each.
2. The order you will make the changes in.
3. Any assumptions you are making and open questions for me.
Stop after the plan and wait for my explicit "approved" before you touch a single file.Why it works: naming the files up front turns a vague goal into a reviewable diff plan, and the hard stop keeps Write mode from running ahead of you.
2. Break a big task into a checklist
@codebase Break this large task into a checklist of small, independently shippable steps: [describe the epic, e.g. "migrate auth from sessions to JWT"].
For each step give: a short title, the files involved, and a done-check I can verify. Keep each step under ~1 hour of work. Number them. Do not start implementing — just return the checklist so we can work through it one item at a time.Best for: epics too big for one agent run; you then feed steps back to Cascade one at a time.
3. Estimate risk and blast radius
Before we change [module or feature], assess the blast radius. Use @codebase to find every file that imports or depends on it. List:
- Which callers would break if I change the [function/signature/schema].
- Which changes are safe vs. which need a migration or a deprecation path.
- A risk rating (low/medium/high) with one line of reasoning.
Return the assessment only. Do not edit anything yet.Why it works: Cascade's repo index surfaces dependents you would miss by hand, so you learn the cost before committing to the change.
4. Draft the plan in Chat mode
[Switch Cascade to Chat/Ask mode first, then send:]
You are read-only for this message. Design an implementation approach for [feature]. Compare 2 possible designs, note the trade-offs, and recommend one with reasoning. Reference the real files in @folder [path/]. When I switch you to Write mode, I want you to follow the recommended design — so make it concrete and file-specific.Best for: exploring design options safely — Chat/Ask mode cannot edit files, so you plan without any risk of stray writes.
Autonomous implementation
Once the plan is agreed, hand Cascade the whole loop. Give it acceptance criteria and a done-condition tied to a real command, then let it build, run, read the output, and fix failures until everything passes.
5. Implement a feature to green tests
Implement [feature] end to end in @folder [path/].
Acceptance criteria:
- [criterion 1]
- [criterion 2]
- [criterion 3]
Write or update tests to cover these criteria, then run [npm test] and read the output. If any test fails, fix the code and re-run. Repeat until the suite is fully green. When done, summarize what you changed and paste the final passing test output.Why it works: a command-backed done-condition ("green") lets Cascade close the build-run-fix loop on its own instead of stopping at the first plausible edit.
6. Build a multi-file change from a ticket
Here is the ticket:
"""
[paste the full ticket / spec text]
"""
Implement it across whatever files are needed. Use @codebase to locate the right modules. Follow the existing patterns in this repo (routing, error handling, naming). Add tests for the new behavior. After each file, keep going until the ticket's acceptance criteria are all satisfied. List every file you touched at the end.Best for: turning a written ticket straight into a coherent multi-file PR without pre-locating files yourself.
7. Drive the build-run-fix loop
Get [the app / this package] building and running cleanly.
Run [the build command], read the errors, fix them, and re-run. Then run [the lint command] and [the test command] and do the same. Iterate the run-read-fix loop autonomously — do not stop to ask me between iterations unless you hit a decision that changes behavior. Stop only when build, lint, and tests all pass, then report what was broken and how you fixed it.Why it works: explicitly granting autonomy "between iterations" stops Cascade from pausing after every command, so a red build gets driven to green in one run.
8. Implement against acceptance criteria
Feature: [name]. Build it in @file [path/to/file] and any files it requires.
Definition of done (all must hold):
- Running [command] exits 0.
- [endpoint/behavior] returns [expected result] for input [example].
- No existing test regresses — run the full suite to confirm.
Work autonomously toward this definition of done. If you cannot satisfy a criterion, stop and explain why rather than marking it complete.Best for: handing off a self-contained feature where "done" is objectively checkable.
Scope & guardrails
Autonomy needs fences. These prompts pin Cascade to exact paths, protect your public interfaces, and force a stop-and-ask whenever it would step outside the agreed boundary or spend your time installing things.
9. Restrict Cascade to exact paths
Make this change: [describe it].
Hard constraint: you may only edit these files — [path/a.ts], [path/b.ts], and their test files. Do NOT modify, rename, or delete anything else. If completing the task correctly requires a change outside this list, stop and ask me first with the specific file and reason. Confirm you understand the scope before editing.Why it works: an explicit allowlist plus a stop-and-ask escape hatch keeps the diff small and reviewable.
10. Keep public APIs stable
Refactor the internals of @file [path/to/module] to [goal].
Non-negotiable: the public API stays exactly the same — same exported function names, signatures, and return types. Nothing that imports this module should need to change. After refactoring, use @codebase to confirm no caller was modified, and run the tests to prove behavior is unchanged.Best for: internal cleanup where breaking downstream callers is not acceptable.
11. Ask before installing dependencies
Implement [task]. Prefer the standard library and packages already in [package.json / requirements.txt].
If you believe a NEW dependency is genuinely required, stop and ask me first: name the package, why it is needed, and one lighter alternative you considered. Do not run any install command until I approve it.Why it works: Cascade runs terminal commands, so gating installs prevents silent additions to your dependency tree.
12. Stop-and-ask when uncertain
Work on [task]. Operating rule for this run: when you are less than ~80% confident about a decision — data shape, a business rule, which of two files owns this logic, or anything that changes behavior — STOP and ask me a specific question instead of guessing. I would rather answer three questions than review a wrong 200-line diff.Best for: ambiguous tasks where a confident wrong guess is more expensive than a quick clarifying question.
Context steering with @-mentions
@-mentions are the most reliable way to aim the agent. Instead of hoping Cascade finds the right code, point it at exact context: @codebase, @file, @folder, @docs, @terminal, and @git. For the full technique, see how to prompt Windsurf for coding.
13. Find where a concept lives with @codebase
@codebase Where is [concept, e.g. "rate limiting" or "the checkout total is calculated"] implemented? Return the specific files and functions, how they connect, and the single place I would change to [desired change]. Do not edit yet — just map it out so I know where to point you next.Why it works: @codebase runs semantic search over the indexed repo, so it finds the logic by meaning even when you don't know the filename.
14. Pin context with @file and @folder
Using @file [path/to/reference.ts] as the pattern to follow and everything in @folder [path/feature/] as the context, add [new capability]. Match the style, error handling, and test structure of the reference file exactly. Only work within @folder [path/feature/].Best for: keeping Cascade focused on one feature area and copying an established local pattern.
15. Use a library correctly with @docs
@docs [library name] Implement [task] using [library]. Follow the current, documented API — no deprecated methods and no invented options. If the docs show a recommended pattern for [use case], use it and cite the section. Then write a small test that exercises the integration and run it.Why it works: @docs grounds Cascade in the indexed library documentation, cutting the odds of a plausible-but-wrong API call.
16. Act on the last error with @terminal
@terminal Take the error I just hit in the terminal, find the root cause, and fix it. Explain in one line what caused it before you edit. After the fix, re-run the same command to confirm it is gone, and make sure no other test breaks.Best for: instantly turning the last stack trace into a fix — see the deeper set in Windsurf prompts for debugging.
17. Work from the current diff with @git
@git Review only the changes in my current diff. For each changed file, check for bugs, missing edge cases, and anything that breaks an existing test. Fix what you find within the already-changed files, then run the tests. Don't expand the scope beyond files I've already touched.Why it works: @git scopes the agent to your uncommitted work, so it polishes the PR you're building instead of wandering the repo.
Rules, Memories & Workflows
Stop re-explaining your conventions. Rules load every session, Memories survive across sessions, and Workflows package a repeated multi-step sequence behind a /slash command. Have Cascade author them for you.
18. Draft a .windsurf glob rule
Create a new rule file at .windsurf/rules/[testing].md. Set the trigger to Glob matching [**/*.test.ts]. In the body, write concise, imperative conventions for how tests in this repo must be written: [e.g. use Vitest, arrange-act-assert, no snapshot tests, mock network with msw].
Keep it short. Show me the full file contents including the trigger frontmatter before saving.Why it works: a scoped Glob rule activates only for matching files, so the convention applies exactly where it's relevant without bloating every prompt.
19. Create a memory of a convention
Create a memory: in this project we [state the durable decision, e.g. "always use the Result type for fallible functions instead of throwing" or "API responses are camelCase, DB columns are snake_case"]. Keep it to one or two sentences so it loads cheaply, and apply it automatically from now on without me repeating it.Best for: locking in a decision the moment you make it, so future sessions start warm instead of re-litigating it.
20. Author a /workflow recipe
Create a workflow file at .windsurf/workflows/ship-feature.md that I can invoke with /ship-feature. It should encode these steps in order:
1. Run the full test suite; stop if anything fails.
2. Run the linter and formatter; auto-fix what's safe.
3. Update the changelog with a one-line entry.
4. Create a conventional-commit message from the diff and show it to me before committing.
Write it as a clear Markdown recipe with numbered steps. Show me the file before saving.Why it works: a Workflow turns a sequence you'd otherwise retype weekly into one /ship-feature command Cascade executes step by step.
21. Invoke and refine a workflow
/[workflow-name]
[After it runs:] That mostly worked, but step [N] should also [adjustment, e.g. "run the type-checker before the linter" or "skip the changelog when the branch is a hotfix"]. Update .windsurf/workflows/[workflow-name].md to reflect that, and show me the diff of the workflow file.Best for: iterating a recipe in place — run it, spot the gap, and have Cascade edit its own workflow file.
Long-running & MCP
Cascade can drive a big migration over many steps and connect external tools through MCP servers. Give it a checklist to track progress against, and tell it explicitly when a tool is available to use.
22. Run a long migration with progress checks
We are migrating [from X to Y, e.g. "Moment.js to date-fns across the codebase"]. This is large — treat it as a long-running task.
First, use @codebase to build a checklist of every file that needs migrating. Then work through them in batches. After each batch: run the tests, report which items are done vs. remaining as a checklist, and continue to the next batch without waiting for me. Stop only if a batch fails tests you can't fix, and tell me exactly where you stopped.Why it works: a living checklist gives the agent a durable sense of "done so far," so a long run stays organized and you can see progress at a glance.
23. Resume a paused long-running task
Continue the [migration/task] from where we left off. Use @git to see what's already changed and @codebase to find what still matches the old pattern [describe it]. Re-derive the remaining checklist, then keep going through it. Confirm the remaining list with me first, then proceed autonomously and run the tests after each batch.Best for: picking up a big job in a fresh session without losing the thread — Cascade reconstructs state from the diff and the code.
24. Connect and use an MCP tool
I've connected the [name] MCP server in Windsurf (tools: [list the tools it exposes]). For this task — [describe it, e.g. "pull the open issues labeled 'bug' and scaffold a fix branch for each"] — use the MCP tool to fetch the data, then act on it in code. Show me which tool call you make and its result before you write any code based on it.Why it works: naming the connected MCP server and its tools tells Cascade exactly what external capability it has, and the "show the call first" step keeps the external data auditable. Ready to build whole apps this way? See Windsurf prompts for full-stack apps.
Frequently Asked Questions
What is Cascade in Windsurf?
Cascade is Windsurf's flagship agent, the chat pane on the right of the IDE. In Write mode it plans and executes multi-file, multi-step edits from a natural-language goal, runs terminal commands like builds and tests, reads the output, and self-corrects until the task is done.
How do I make Cascade plan before it edits?
Ask for a plan explicitly and tell it to stop. A prompt like "Produce a step-by-step plan with the exact files you will touch, then wait for my approval before writing any code" makes Cascade output a checklist first. You can also draft the plan in Chat/Ask mode, which is read-only, then switch to Write mode to execute.
How do I stop Cascade from touching unrelated files?
Scope the change in the prompt with exact paths: "Only edit src/api/users.ts and its test; do not modify any other file. If a change outside that scope is required, stop and ask first." Reinforce it with a .windsurf/rules glob rule so the constraint persists across sessions.
What are @-mentions in Windsurf?
@-mentions pin exact context into a Cascade prompt: @codebase for semantic search across the repo, @file and @folder for specific paths, @docs for indexed library docs, @terminal for recent terminal output, and @git for diffs and commit context. They are the most reliable way to steer the agent.
What is the difference between Rules, Memories, and Workflows?
Rules are durable instructions in .windsurf/rules or .windsurfrules that Cascade loads every session. Memories are short workspace-scoped notes that survive across sessions so you skip the warm-up prompt. Workflows are reusable Markdown recipes in .windsurf/workflows invoked with a /workflow-name slash command for repeated multi-step tasks.
Can Cascade run long migrations and use external tools?
Yes. In Write mode Cascade can drive long multi-step migrations, run commands, and report progress against a checklist you define. Through MCP servers it can also connect external tools and data sources and call them as part of a task.