Windsurf Track
Module 26
Windsurf Track -- Module 26
New Features with Cascade: The developer uses Cascade to implement three new ShopMate features in one afternoon: a wishlist notification email generator, a "similar products" recommender prompt, and a returns reason classifier. Each would have taken half a day manually. Cascade handles the boilerplate; the developer reviews and ships.

Cascade -- The Agentic Core

Cascade is what makes Windsurf fundamentally different from autocomplete tools. It is a fully agentic system that perceives your entire codebase, plans multi-step solutions, and executes them across files and terminal sessions.

Codebase Awareness

Cascade indexes your entire repository and maintains semantic understanding of file relationships, dependencies, and architectural patterns. It knows what your code does, not just what it says -- enabling accurate multi-file edits without you specifying which files to touch.

Multi-File Editing

Cascade can atomically edit multiple files in a single action -- updating an interface definition and all its implementations simultaneously. Changes are presented as diffs for review before applying. Nothing is committed until you accept.

Terminal Integration

Cascade can run shell commands, execute tests, read output, and iterate. It installs dependencies, runs linters, executes migrations, and reacts to failures -- all within a single agentic session. You stay in the editor the entire time.

Self-Correction Loop

When Cascade encounters a test failure, compiler error, or lint warning after making changes, it reads the error and attempts to fix it automatically before reporting back. Complex tasks often complete with zero manual intervention.

Cascade Execution Flow

From Natural Language Goal to Committed Code
Goal Natural lang Cascade Plans steps Read Codebase Write Code Test & Lint git commit 01 02 03 04 05 Cascade iterates steps 03–05 until tests pass and code review is satisfied
!
Always Review the Plan Before Executing

Step 3 -- reviewing Cascade's plan before execution -- is your most important oversight point. A plan that targets the wrong files or uses an architectural approach you disagree with is far cheaper to redirect before execution than after. Invest 30 seconds here every time.

ShopMate -- Feature Flows

Text -- Flow: Email Campaign Generator
# Press Cmd+I and type:

Add a seasonal email campaign generator to ShopMate.

Feature: POST /campaigns/generate
Input: {"brand_id": "threadco", "season": "summer", "featured_products": ["Sunset Gradient Tee", "Wave Print Crop Tee"], "discount_code": "SUMMER15"}
Output: {"subject": "...", "preview_text": "...", "body_html": "..."}

Requirements:
- Use claude-sonnet-4-6 (campaign quality, Maya reviews these)
- Use the brand voice from brands.yaml for the given brand_id
- Subject line: under 50 characters, no emoji
- Preview text: under 90 characters
- Body: 150-200 words, mention both products, include discount code naturally
- Must go through logged_create() and safe_reply()

Tests in tests/test_campaign_generator.py:
- Mock Claude response and verify output structure
- Verify subject line length constraint
- Verify brand voice system prompt contains brand name
Text -- Flow: Size Recommendation Feature
# A simpler targeted flow

Add a size recommendation endpoint to ShopMate.

POST /sizing/recommend
Input: {"product_id": "sunset-gradient-tee", "height_cm": 170, "weight_kg": 65, "usual_size": "M", "fit_preference": "relaxed|fitted|standard"}
Output: {"recommended_size": "M", "reasoning": "...", "note": "..."}

Use claude-haiku (fast, cheap for this utility task).
Load sizing guide from data/sizing_guide.json and pass as context.
Add to logged_create() with feature="size_recommendation".
Two tests: standard recommendation + edge case (very tall, lightweight).