Usamos cookies para mejorar tu experiencia en el sitio
CodeWorlds
Volver a colecciones
Guide21 min read

Windsurf

Windsurf is a revolutionary AI-first IDE from Codeium with agentic workflows, Cascade AI and Flows. Complete guide to the first code editor designed from ground up for AI-assisted programming.

Windsurf - complete guide to AI-first IDE

What is Windsurf?

Windsurf is a groundbreaking IDE (Integrated Development Environment) created by the makers of Codeium - a company known for its free AI coding assistant. Unlike traditional editors that add AI features as a plugin, Windsurf was designed from the ground up as an "AI-first" editor where artificial intelligence is an integral part of every aspect of a developer's workflow.

Windsurf introduces the concept of an "agentic IDE" - an editor in which AI doesn't just answer questions, but actively collaborates with the developer, navigates through code, executes multi-step tasks, and learns from the project's context. This is a fundamental shift in the approach to development tools.

Why Windsurf?

Key advantages of Windsurf

  1. Truly AI-first architecture - AI built into every aspect, not as an add-on
  2. Cascade - autonomous agent - Understands and navigates entire repositories
  3. Flows - task automation - Save and repeat complex workflows
  4. Free tier - Unlimited autocomplete at no cost
  5. Supercomplete - Context-aware completion from the entire project
  6. Performance - Optimized for speed
  7. Privacy - Option for local processing (self-hosted)

Windsurf vs traditional IDEs

AspectWindsurfVS Code + PluginCursor
AI integrationNativeAddedNative
Agent capabilitiesCascade (autonomous)NoneComposer
Workflow automationFlowsNoneNone
Free tierUnlimited autocompleteLimited$20/month
Project contextFullLimitedFull
Command executionBuilt-inLimitedBuilt-in
Code baseVS Code forkVS CodeVS Code fork

Cascade - revolutionary AI agent

Cascade is the heart of Windsurf - an autonomous AI agent that is fundamentally different from traditional chatbots or code assistants.

How is Cascade different from regular AI?

Traditional AI assistant:

Code
TEXT
User: How do I add dark mode?
AI: Here's the code for dark mode... [shows snippet]
User: Where do I put it?
AI: In the ThemeProvider file...
User: And how do I update the components?
AI: You need to... [another instruction]

Cascade in Windsurf:

Code
TEXT
User: Add dark mode to the application

Cascade:
1. Analyzing project structure...
   → Found Next.js App Router with Tailwind
2. Checking current styling system...
   → Tailwind with next-themes will work best
3. Creating dark theme configuration...
   → Updating tailwind.config.ts
4. Adding ThemeProvider...
   → Creating providers/ThemeProvider.tsx
5. Updating layout...
   → Modifying app/layout.tsx
6. Adding toggle in Header...
   → Creating components/ThemeToggle.tsx
7. Testing changes...
   → Checking in browser

✓ Dark mode added. Modified files:
  - tailwind.config.ts
  - providers/ThemeProvider.tsx
  - app/layout.tsx
  - components/ThemeToggle.tsx
  - package.json (added next-themes)

Cascade capabilities

1. Understanding the entire repository

Code
TEXT
User: Where are payments handled in this project?

Cascade:
I've analyzed the project structure. Payments are handled in:

1. API Endpoint: app/api/payments/route.ts
   - Creating Stripe sessions
   - Handling webhooks

2. Frontend: components/checkout/CheckoutForm.tsx
   - Payment form UI
   - Stripe Elements integration

3. Utils: lib/stripe.ts
   - Stripe client configuration
   - Helper functions

4. Types: types/payment.ts
   - TypeScript interfaces

Would you like me to explain the payment flow?

2. Executing multi-step tasks

Code
TEXT
User: Create a new API endpoint for handling newsletters with validation and database storage

Cascade:
Creating a complete newsletter endpoint...

[Step 1] Creating validation schema with Zod
→ lib/validations/newsletter.ts

[Step 2] Creating Prisma model
→ Updating prisma/schema.prisma
→ Running: npx prisma generate

[Step 3] Creating API endpoint
→ app/api/newsletter/subscribe/route.ts

[Step 4] Adding error handling
→ lib/errors/newsletter-errors.ts

[Step 5] Creating tests
→ __tests__/api/newsletter.test.ts

[Step 6] Running tests
→ npm test newsletter

Done! Newsletter endpoint is working:
POST /api/newsletter/subscribe
Body: { email: "user@example.com", name?: "Jan" }

3. Code navigation and analysis

Code
TEXT
User: Find all places where we use useEffect without cleanup

Cascade:
Searching the project for useEffect without cleanup...

Found 7 problematic cases:

1. components/Chat.tsx:45
   useEffect(() => {
     socket.on('message', handleMessage)
   }, []) // Missing cleanup for socket listener

2. hooks/useWindowSize.ts:12
   useEffect(() => {
     window.addEventListener('resize', handler)
   }, []) // Missing cleanup for event listener

3. components/Timer.tsx:23
   useEffect(() => {
     const id = setInterval(tick, 1000)
   }, []) // Missing clearInterval

[... remaining cases ...]

Should I fix these issues automatically?

4. Running terminal commands

Code
TEXT
User: Configure the project for deployment on Vercel

Cascade:
Configuring the project for Vercel...

[Terminal] Checking if Vercel CLI is installed
→ vercel --version
→ Not found, installing...
→ npm install -g vercel

[Terminal] Logging into Vercel
→ vercel login
→ Open browser to log in

[File] Creating vercel.json with configuration
→ Setting Node.js 20, regions, redirects

[File] Updating .env.example
→ Adding variables required in production

[Terminal] Linking project
→ vercel link

[Terminal] Setting environment variables
→ vercel env add DATABASE_URL production

Project ready for deployment!
Run 'vercel --prod' to deploy.

Cascade working modes

Write Mode (default)

Cascade can edit files and execute commands:

Code
TEXT
User: Add pagination to the product list

Cascade [Write Mode]:
→ Modifying ProductList.tsx
→ Adding usePagination hook
→ Updating API endpoint
→ Creating Pagination component

Chat Mode

Cascade only answers questions, without making modifications:

Code
TEXT
User: [Chat Mode] Explain how this sorting algorithm works

Cascade [Chat Mode]:
This algorithm is QuickSort with the following optimizations...
[explanation without code modifications]

Review Mode

Cascade analyzes code and suggests changes without applying them:

Code
TEXT
User: [Review] Check this PR for security issues

Cascade [Review Mode]:
Security analysis of PR #123:

⚠️ High risk:
1. SQL Injection on line 45
   Suggested fix: [code]

⚠️ Medium risk:
2. Missing rate limiting on endpoint
   Suggested fix: [code]

✓ Accept suggestions to apply them

Flows - workflow automation

Flows is a unique Windsurf feature that lets you save repeatable tasks as templates.

Creating a Flow

.windsurf/flows/new-component.yaml
YAML
# .windsurf/flows/new-component.yaml
name: New React Component
description: Creates a new React component with tests and storybook
author: team
version: 1.0.0

inputs:
  - name: componentName
    type: string
    description: Component name (PascalCase)
    required: true
  - name: withTests
    type: boolean
    default: true
  - name: withStorybook
    type: boolean
    default: true
  - name: componentType
    type: select
    options:
      - client
      - server
    default: client

steps:
  - name: Create component file
    action: create_file
    path: src/components/{{componentName}}/{{componentName}}.tsx
    template: |
      {{#if (eq componentType "client")}}
      'use client'

      {{/if}}
      import { cn } from '@/lib/utils'

      interface {{componentName}}Props {
        className?: string
        children?: React.ReactNode
      }

      export function {{componentName}}({ className, children }: {{componentName}}Props) {
        return (
          <div className={cn('', className)}>
            {children}
          </div>
        )
      }

  - name: Create index file
    action: create_file
    path: src/components/{{componentName}}/index.ts
    template: |
      export { {{componentName}} } from './{{componentName}}'

  - name: Create test file
    condition: "{{withTests}}"
    action: create_file
    path: src/components/{{componentName}}/{{componentName}}.test.tsx
    template: |
      import { render, screen } from '@testing-library/react'
      import { {{componentName}} } from './{{componentName}}'

      describe('{{componentName}}', () => {
        it('renders children correctly', () => {
          render(<{{componentName}}>Test content</{{componentName}}>)
          expect(screen.getByText('Test content')).toBeInTheDocument()
        })

        it('applies custom className', () => {
          const { container } = render(
            <{{componentName}} className="custom-class">Content</{{componentName}}>
          )
          expect(container.firstChild).toHaveClass('custom-class')
        })
      })

  - name: Create Storybook file
    condition: "{{withStorybook}}"
    action: create_file
    path: src/components/{{componentName}}/{{componentName}}.stories.tsx
    template: |
      import type { Meta, StoryObj } from '@storybook/react'
      import { {{componentName}} } from './{{componentName}}'

      const meta: Meta<typeof {{componentName}}> = {
        title: 'Components/{{componentName}}',
        component: {{componentName}},
        tags: ['autodocs'],
      }

      export default meta
      type Story = StoryObj<typeof {{componentName}}>

      export const Default: Story = {
        args: {
          children: '{{componentName}} content',
        },
      }

  - name: Update barrel export
    action: update_file
    path: src/components/index.ts
    insert_after: "// Components"
    content: |
      export { {{componentName}} } from './{{componentName}}'

Running a Flow

Code
Bash
# In Command Palette (Cmd+Shift+P)
> Windsurf: Run Flow

# Or directly
> Run Flow: New React Component

# Dialog:
Component Name: ProductCard
With Tests: ✓
With Storybook: ✓
Component Type: client

# Cascade executes the Flow:
→ Created src/components/ProductCard/ProductCard.tsx
→ Created src/components/ProductCard/index.ts
→ Created src/components/ProductCard/ProductCard.test.tsx
→ Created src/components/ProductCard/ProductCard.stories.tsx
→ Updated src/components/index.ts

Advanced Flows

Flow with conditions and loops

.windsurf/flows/crud-api.yaml
YAML
# .windsurf/flows/crud-api.yaml
name: CRUD API Endpoints
description: Generates complete CRUD API for an entity

inputs:
  - name: entityName
    type: string
    required: true
  - name: fields
    type: array
    items:
      - name: fieldName
        type: string
      - name: fieldType
        type: select
        options: [string, number, boolean, date]
    required: true
  - name: withAuth
    type: boolean
    default: true

steps:
  # Prisma schema
  - name: Update Prisma Schema
    action: update_file
    path: prisma/schema.prisma
    insert_before: "// END MODELS"
    template: |
      model {{entityName}} {
        id        String   @id @default(cuid())
        {{#each fields}}
        {{this.fieldName}} {{#if (eq this.fieldType "string")}}String{{/if}}{{#if (eq this.fieldType "number")}}Int{{/if}}{{#if (eq this.fieldType "boolean")}}Boolean{{/if}}{{#if (eq this.fieldType "date")}}DateTime{{/if}}
        {{/each}}
        createdAt DateTime @default(now())
        updatedAt DateTime @updatedAt
      }

  # API routes - iteration
  - name: Create List Endpoint
    action: create_file
    path: app/api/{{lowercase entityName}}s/route.ts
    template: |
      import { prisma } from '@/lib/prisma'
      import { NextResponse } from 'next/server'
      {{#if withAuth}}
      import { auth } from '@/lib/auth'
      {{/if}}

      export async function GET() {
        {{#if withAuth}}
        const session = await auth()
        if (!session) {
          return NextResponse.json({ error: 'Unauthorized' }, { status: 401 })
        }
        {{/if}}

        const items = await prisma.{{lowercase entityName}}.findMany()
        return NextResponse.json(items)
      }

      export async function POST(request: Request) {
        {{#if withAuth}}
        const session = await auth()
        if (!session) {
          return NextResponse.json({ error: 'Unauthorized' }, { status: 401 })
        }
        {{/if}}

        const data = await request.json()
        const item = await prisma.{{lowercase entityName}}.create({ data })
        return NextResponse.json(item, { status: 201 })
      }

  # Repeat for each endpoint...

Flow with AI integration

.windsurf/flows/ai-refactor.yaml
YAML
# .windsurf/flows/ai-refactor.yaml
name: AI-Powered Refactoring
description: Uses Cascade for intelligent refactoring

inputs:
  - name: targetFile
    type: file
    required: true
  - name: refactorType
    type: select
    options:
      - Extract Functions
      - Add TypeScript Types
      - Improve Performance
      - Add Error Handling
    required: true

steps:
  - name: Analyze with AI
    action: cascade_analyze
    file: "{{targetFile}}"
    prompt: |
      Analyze this file for: {{refactorType}}.
      Identify all areas that need improvement.

  - name: Apply Refactoring
    action: cascade_refactor
    file: "{{targetFile}}"
    instruction: |
      Based on the analysis, perform {{refactorType}}.
      Preserve existing functionality.
      Add comments where changes are significant.

  - name: Verify Changes
    action: run_command
    command: npm test -- --findRelatedTests {{targetFile}}

  - name: Format Code
    action: run_command
    command: npx prettier --write {{targetFile}}

Sharing Flows

Code
YAML
# Flows can be shared within a team:
# 1. Locally in .windsurf/flows/
# 2. Company flows repository
# 3. Windsurf Marketplace

# Installing from marketplace:
> Windsurf: Install Flow
> Search: "nextjs api crud"
> Install: "NextJS CRUD Generator by @company"

Supercomplete - intelligent autocomplete

Supercomplete is an advanced autocomplete system that understands the context of your entire project.

How does Supercomplete work?

Code
TypeScript
// Traditional autocomplete:
// Suggests only based on local context

const user = {
  na| // Suggests: "name", "navigate", "NaN"
}

// Windsurf Supercomplete:
// Understands the project structure

// If the project contains:
// types/user.ts: interface User { name: string; email: string; role: 'admin' | 'user' }

const user: User = {
  na| // Suggests: "name" (string) - with full type
}

// After selection:
const user: User = {
  name: '|' // Suggests values based on existing data in the project
}

Supercomplete in practice

Import completion

Code
TypeScript
// I start typing:
import { use|

// Supercomplete understands the project and suggests:
// → useAuth (from hooks/useAuth.ts)
// → useCart (from hooks/useCart.ts)
// → useToast (from @/components/ui/use-toast)
// → useState (from react)
// → useEffect (from react)

// The ordering is intelligent - local imports first, then dependencies

Functions with context

Code
TypeScript
// In file components/ProductCard.tsx
// Project uses TailwindCSS and shadcn/ui

function ProductCard({ product }: { product: Product }) {
  return (
    <Card className="|
    // Supercomplete suggests:
    // → "p-4 hover:shadow-lg" (pattern from other cards in the project)
    // → "flex flex-col gap-4" (common pattern)

API calls

Code
TypeScript
// Knowing the API structure in the project:

async function getProduct(id: string) {
  const response = await fetch|
  // Supercomplete:
  // → fetch(`/api/products/${id}`) - based on existing endpoints

Supercomplete configuration

.windsurf/settings.json
JSON
// .windsurf/settings.json
{
  "supercomplete": {
    "enabled": true,
    "debounceMs": 100,
    "maxSuggestions": 5,
    "contextDepth": "project", // "file" | "directory" | "project"
    "prioritizeLocal": true,
    "learnFromEdits": true,
    "excludePatterns": [
      "node_modules/**",
      "dist/**",
      ".git/**"
    ]
  }
}

Command Palette + AI

Windsurf integrates AI directly into the Command Palette.

Basic usage

Code
TEXT
Cmd+K → Opens AI Command

Examples:
"refactor this to use hooks"
"add error handling"
"convert to TypeScript"
"explain this code"
"add tests for this function"
"make this component responsive"

Inline AI actions

Code
TypeScript
// Select code and press Cmd+K

function processData(data) {  // ← Selected
  const result = [];
  for (let i = 0; i < data.length; i++) {
    if (data[i].active) {
      result.push(data[i].value * 2);
    }
  }
  return result;
}

// Cmd+K → "convert to functional style"

// Result:
const processData = (data: DataItem[]): number[] =>
  data
    .filter(item => item.active)
    .map(item => item.value * 2);

Multi-file commands

Code
TEXT
Cmd+Shift+K → AI Command for multiple files

"add loading states to all components in components/dashboard"
"update all API calls to use new error handling pattern"
"migrate class components to functional"

Terminal integration

Cascade has full integration with the terminal.

Automatic command execution

Code
TEXT
User: Install and configure TailwindCSS

Cascade:
[1/4] Installing dependencies...
> npm install -D tailwindcss postcss autoprefixer

[2/4] Initializing Tailwind...
> npx tailwindcss init -p

[3/4] Configuring tailwind.config.js...
→ Updating file with appropriate paths

[4/4] Adding directives to CSS...
→ Updating globals.css

✓ TailwindCSS configured!

Debugging with the terminal

Code
TEXT
User: Tests in auth.test.ts are failing, help me fix them

Cascade:
[1/3] Running tests to see the errors...
> npm test auth.test.ts

Error on line 45: "TypeError: Cannot read property 'user' of undefined"

[2/3] Analyzing the problem...
→ Mock for useSession returns undefined instead of a session object

[3/3] Fixing the test...
→ Updating mock in auth.test.ts

Re-running tests...
> npm test auth.test.ts

✓ All 12 tests passed!

Watching and reacting

Code
TEXT
User: Run tests in watch mode and fix errors automatically

Cascade:
> npm test -- --watch

[Watch] Test failed: ProductCard.test.tsx
→ Analyzing error...
→ Missing 'onAddToCart' prop
→ Updating test...
→ Test passed!

[Watch] Test failed: useCart.test.ts
→ Analyzing error...
→ State is not reset between tests
→ Adding beforeEach with reset...
→ Test passed!

[Watch] All tests passing ✓
Monitoring for further changes...

Installation and configuration

System requirements

SystemMinimumRecommended
macOS10.15+12.0+
WindowsWindows 10Windows 11
LinuxUbuntu 20.04+Ubuntu 22.04+
RAM8 GB16 GB
Disk2 GBSSD 5 GB+

Installation

macOS

Code
Bash
# Homebrew
brew install --cask windsurf

# Or download from windsurf.ai
curl -fsSL https://windsurf.ai/install.sh | sh

Windows

Code
POWERSHELL
# Winget
winget install Codeium.Windsurf

# Or download the installer from windsurf.ai

Linux

Code
Bash
# Ubuntu/Debian
wget -qO- https://windsurf.ai/gpg.key | sudo gpg --dearmor -o /usr/share/keyrings/windsurf.gpg
echo "deb [signed-by=/usr/share/keyrings/windsurf.gpg] https://windsurf.ai/apt stable main" | sudo tee /etc/apt/sources.list.d/windsurf.list
sudo apt update && sudo apt install windsurf

# Arch Linux (AUR)
yay -S windsurf-bin

# Flatpak
flatpak install flathub ai.windsurf.Windsurf

First-time setup

Code
Bash
# 1. Launch Windsurf
windsurf

# 2. Log in to Codeium (free account)
# → Click "Sign In" in the bottom-right corner
# → Authorize via GitHub/Google/Email

# 3. Configure your project
# → Open the project folder
# → Windsurf will automatically index the code

Configuring settings.json

.windsurf/settings.json
JSON
// .windsurf/settings.json (project)
// or ~/.config/windsurf/settings.json (global)

{
  // Cascade
  "cascade": {
    "enabled": true,
    "model": "gpt-4-turbo", // or "claude-3-opus", "custom"
    "temperature": 0.3,
    "maxTokens": 8192,
    "autoApprove": false, // true = automatically apply changes
    "showDiff": true
  },

  // Supercomplete
  "supercomplete": {
    "enabled": true,
    "debounceMs": 150,
    "maxSuggestions": 5,
    "contextDepth": "project"
  },

  // Terminal
  "terminal": {
    "cascadeIntegration": true,
    "autoRunSuggested": false,
    "shell": "/bin/zsh"
  },

  // Privacy
  "privacy": {
    "telemetry": false,
    "shareUsageData": false,
    "localIndexing": true
  },

  // Appearance
  "theme": "windsurf-dark",
  "fontSize": 14,
  "fontFamily": "JetBrains Mono"
}

Migrating from VS Code

Code
Bash
# Windsurf automatically imports:
# - Extensions (most are compatible)
# - Settings
# - Keybindings
# - Snippets

# Manual migration:
windsurf --import-from-vscode

# Or copy settings:
cp ~/.config/Code/User/settings.json ~/.config/windsurf/

Keyboard shortcuts

Basic

ShortcutAction
Cmd+KAI Command (inline)
Cmd+Shift+KAI Command (multi-file)
Cmd+IOpen Cascade
Cmd+Shift+ICascade in new panel
Cmd+EnterSend to Cascade
EscapeCancel AI action

Cascade

ShortcutAction
Cmd+LNew Cascade conversation
Cmd+Shift+LContinue last conversation
Cmd+.Stop generation
Cmd+YAccept all changes
Cmd+Shift+YReject all changes
TabAccept single change

Supercomplete

ShortcutAction
TabAccept suggestion
Cmd+]Next suggestion
Cmd+[Previous suggestion
EscapeDismiss suggestion
Cmd+SpaceForce suggestion

Flows

ShortcutAction
Cmd+Shift+FRun Flow
Cmd+Shift+RRepeat last Flow
Cmd+Alt+FEdit Flow

Navigation

ShortcutAction
Cmd+PQuick file open
Cmd+Shift+PCommand Palette
Cmd+GGo to line
Cmd+Shift+OGo to symbol
Cmd+TSearch symbol in workspace

Windsurf vs Cursor - detailed comparison

Functionality

FeatureWindsurfCursor
AI AgentCascadeComposer
AutonomyFullPartial
Flows/AutomationYesNo
AutocompleteSupercomplete (Codeium)Custom
Multi-file editNativeNative
Terminal integrationDeepBasic
Codebase understandingFullFull
Custom modelsYesYes

Pricing

PlanWindsurfCursor
FreeUnlimited autocompleteLimited
Pro$15/month$20/month
Teams$30/user/month$40/user/month
EnterpriseCustomCustom

AI quality

AspectWindsurfCursor
Context understanding⭐⭐⭐⭐⭐⭐⭐⭐⭐
Code quality⭐⭐⭐⭐⭐⭐⭐⭐⭐
Response speed⭐⭐⭐⭐⭐⭐⭐⭐⭐
Multi-step tasks⭐⭐⭐⭐⭐⭐⭐⭐
Customization⭐⭐⭐⭐⭐⭐⭐⭐⭐

When to choose Windsurf?

  • You need an autonomous agent for complex tasks
  • You want to automate workflows with Flows
  • You value free autocomplete
  • You prefer deep terminal integration

When to choose Cursor?

  • Code generation quality is your top priority
  • You need more control over AI
  • Flexibility in choosing models is important
  • You have a larger budget for tools

Tool integrations

Git integration

Code
TEXT
User: Prepare a commit with a meaningful description

Cascade:
Analyzing changes in the staging area...

Found changes:
- components/Cart.tsx: Added quantity validation
- hooks/useCart.ts: Error handling on update
- api/cart/route.ts: New DELETE endpoint

Proposed commit message:
---
feat(cart): add quantity validation and error handling

- Add min/max quantity validation in Cart component
- Implement error handling in useCart hook
- Add DELETE endpoint for removing items
---

Accept? (Y/n)

Docker integration

Code
TEXT
User: Create a Dockerfile for this Next.js project

Cascade:
Analyzing project structure...

→ Next.js 14 with App Router
→ Uses Prisma (requires generate)
→ Environment variables: DATABASE_URL, NEXTAUTH_SECRET

Creating an optimized Dockerfile:

[File] Dockerfile
[File] .dockerignore
[File] docker-compose.yml (with PostgreSQL)

Run the build? (docker build -t app .)

CI/CD integration

.github/workflows/windsurf-review.yml
YAML
# .github/workflows/windsurf-review.yml
name: AI Code Review

on:
  pull_request:
    types: [opened, synchronize]

jobs:
  cascade-review:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Windsurf AI Review
        uses: codeium/windsurf-action@v1
        with:
          api-key: ${{ secrets.CODEIUM_API_KEY }}
          review-mode: security,performance,best-practices

      - name: Post Review Comments
        uses: codeium/windsurf-comment@v1
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}

Best practices

Working effectively with Cascade

Code
Markdown
# 1. Be specific in your instructions

❌ "Fix this bug"
✅ "The calculateTotal function in Cart.tsx doesn't account for discounts.
   Add support for percentage discounts from the discount field."

# 2. Provide context

❌ "Add a form"
✅ "Add a user registration form matching the design
   in Figma (link). Use React Hook Form and Zod for validation.
   Fields: email, password, confirmPassword, name."

# 3. Break down complex tasks

❌ "Build the entire authentication system"
✅ "Step 1: Configure NextAuth with GitHub provider
   Step 2: Add middleware for protected routes
   Step 3: Create Login and Register components"

# 4. Use Review Mode for learning

"[Review] Check my code and explain what can be improved"

Organizing Flows

Code
YAML
# Directory structure
.windsurf/
├── flows/
│   ├── components/       # Component generation
│   │   ├── react-component.yaml
│   │   └── page-component.yaml
│   ├── api/             # API generation
│   │   ├── crud-endpoint.yaml
│   │   └── graphql-resolver.yaml
│   ├── testing/         # Test generation
│   │   ├── unit-test.yaml
│   │   └── e2e-test.yaml
│   └── refactoring/     # Refactoring
│       ├── to-typescript.yaml
│       └── extract-hook.yaml
├── templates/           # Templates for flows
│   ├── component.tsx.hbs
│   └── test.tsx.hbs
└── settings.json

Optimizing Supercomplete

Code
JSON
// For large projects
{
  "supercomplete": {
    "contextDepth": "directory", // Instead of "project"
    "excludePatterns": [
      "**/*.test.ts",
      "**/*.spec.ts",
      "**/__mocks__/**",
      "**/fixtures/**"
    ],
    "priorityPaths": [
      "src/components/**",
      "src/hooks/**",
      "src/lib/**"
    ]
  }
}

Troubleshooting

Cascade doesn't understand the project

Code
Bash
# 1. Reindex the project
Cmd+Shift+P → "Windsurf: Reindex Project"

# 2. Check .windsurfignore
# Make sure you're not ignoring important files

# 3. Add a CLAUDE.md or WINDSURF.md with a project description
echo "# Project: E-commerce
Tech: Next.js, Prisma, Tailwind
Structure: app/ (pages), components/, lib/" > WINDSURF.md

Slow autocomplete

Code
JSON
// Optimization for slower machines
{
  "supercomplete": {
    "debounceMs": 300,
    "contextDepth": "file",
    "maxSuggestions": 3
  }
}

Errors when executing commands

Code
Bash
# Check terminal permissions
# macOS: System Preferences → Security → Full Disk Access → Windsurf

# Check PATH
# .windsurf/settings.json
{
  "terminal": {
    "env": {
      "PATH": "/usr/local/bin:/usr/bin:$PATH"
    }
  }
}

Detailed pricing

Free plan

Price: $0/month

Includes:

  • Unlimited Supercomplete autocomplete
  • Basic Cascade access (daily query limit)
  • Project indexing
  • Basic Flows
  • Community support

Pro plan

Price: $15/month

Includes:

  • Everything in Free
  • Unlimited Cascade
  • Advanced AI models (GPT-4, Claude)
  • Unlimited Flows
  • Priority support
  • Real-time code analysis

Teams plan

Price: $30/user/month (min. 5 users)

Includes:

  • Everything in Pro for each member
  • Shared Flows within the team
  • Centralized management
  • SSO and SAML
  • Audit logs
  • Dedicated support

Enterprise plan

Price: Custom

Includes:

  • Everything in Teams
  • Self-hosted deployment
  • Custom AI models
  • 99.9% SLA
  • Custom integrations
  • On-premise support

FAQ - frequently asked questions

Is Windsurf free?

Yes, the basic version of Windsurf with unlimited autocomplete is completely free. The Pro plan ($15/month) unlocks full Cascade capabilities and advanced features.

Is my data safe?

Windsurf offers:

  • Local code indexing
  • Self-hosted option for enterprise
  • End-to-end encryption for cloud features
  • SOC 2 Type II compliance
  • GDPR compliance

Does Windsurf work offline?

Basic editor features work offline. AI features (Cascade, Supercomplete) require an internet connection, unless you use a self-hosted deployment with local models.

Can I use my own AI models?

Yes, in Pro and higher plans you can configure custom models:

  • OpenAI API
  • Anthropic Claude
  • Azure OpenAI
  • Local models (Ollama, LM Studio)

How does Windsurf compare to GitHub Copilot?

AspectWindsurfGitHub Copilot
AI AgentCascade (autonomous)None
FlowsYesNo
Free tierYesNo
IDEDedicatedPlugin
Multi-file editNativeLimited

Can I migrate projects from VS Code?

Yes, Windsurf automatically imports:

  • Extensions (most are compatible)
  • Settings
  • Keybindings
  • Snippets
  • Workspace configurations

Summary

Windsurf represents a new generation of development tools where AI is not an add-on, but a fundamental part of the coding experience. Thanks to Cascade - an autonomous agent, Flows - workflow automation, and Supercomplete - intelligent autocomplete, Windsurf allows developers to focus on solving problems instead of tedious tasks.

Key advantages of Windsurf:

  • Cascade - an AI agent that truly understands your project
  • Flows - automation of repetitive tasks
  • Free tier - unlimited autocomplete
  • Deep integration - AI in every aspect of the IDE
  • Active development - regular updates and new features

If you're looking for an IDE that doesn't just help you write code, but actively collaborates on solving problems, Windsurf is worth trying out.