AGENT SKILL

windsurf-performance-tuning

Optimize Windsurf API performance with caching, batching, and connection pooling. Use when experiencing slow API responses, implementing caching strategies, or optimizing request throughput for Windsurf integrations. Trigger with phrases like "windsurf performance", "optimize windsurf", "windsurf latency", "windsurf caching", "windsurf slow", "windsurf batch".

License 许可
MIT
最近更新
2026-05-26
Stars
★ 0
Forks
0

01 前言 Front Matter

name
windsurf-performance-tuning
author
Jeremy Longshore <jeremy@intentsolutions.io>
license
MIT
version
1.0.0
description
Optimize Windsurf API performance with caching, batching, and connection pooling. Use when experiencing slow API responses, implementing caching strategies, or optimizing request throughput for Windsurf integrations. Trigger with phrases like "windsurf performance", "optimize windsurf", "windsurf latency", "windsurf caching", "windsurf slow", "windsurf batch".
allowed-tools
Read, Write, Edit
compatible-with
claude-code, codex, openclaw

03 SKILL.md 正文

Windsurf Performance Tuning

Overview

Optimize Windsurf (Codeium) AI-assisted development workflows. Focus on Cascade flow configuration, context window management, workspace indexing performance, and efficient use of AI completions to minimize latency.

Prerequisites

  • Windsurf IDE installed
  • Understanding of Cascade AI flows
  • Workspace with codebase indexed
  • Familiarity with Windsurf settings

Instructions

Step 1: Optimize Workspace Indexing

// .windsurf/settings.json - Exclude large directories from indexing
{
  "codeium.indexing.excludePatterns": [
    "node_modules/**",
    "dist/**",
    "build/**",
    ".git/**",
    "*.min.js",
    "**/*.map",
    "coverage/**",
    "vendor/**",
    ".next/**"
  ],
  "codeium.indexing.maxFileSize": 1048576,  # 1048576 = configured value
  "codeium.indexing.enableSemanticIndexing": true
}

Step 2: Configure Cascade Flow for Speed

// .windsurf/cascade.json - Tune Cascade behavior
{
  "cascade.contextWindow": {
    "maxFiles": 10,
    "maxTokensPerFile": 2000,  # 2000: 2 seconds in ms
    "preferOpenFiles": true,
    "includeImports": true
  },
  "cascade.suggestions": {
    "debounceMs": 150,
    "maxSuggestions": 3,
    "inlineSuggestionsEnabled": true,
    "multiLineSuggestionsEnabled": true
  },
  "cascade.flows": {
    "preferStreaming": true,
    "timeoutMs": 30000,  # 30000: 30 seconds in ms
    "retryCount": 2
  }
}

Step 3: Efficient Context Management

// .windsurf/context.ts - Define project-specific context rules
// Place in workspace root to help Cascade understand your project

/**
 * @windsurf-context
 * Framework: Next.js 14 with App Router
 * Language: TypeScript strict mode
 * Styling: Tailwind CSS
 * State: Zustand
 * Testing: Vitest + Testing Library
 *
 * Key patterns:
 * - Server Components by default
 * - Client Components marked with 'use client'
 * - API routes in app/api/
 * - Shared types in types/
 */

// Create a .windsurfrules file for persistent context
const WINDSURF_RULES = `
When generating code:
- Use TypeScript strict mode
- Prefer async/await over .then()
- Use named exports, not default
- Add JSDoc comments for public APIs
- Use Tailwind classes, not inline styles
`;

Step 4: Keybinding Optimization for Flow Speed

// keybindings.json - Fast access to Cascade features
[
  {
    "key": "ctrl+shift+k",
    "command": "cascade.openChat",
    "when": "editorTextFocus"
  },
  {
    "key": "ctrl+shift+i",
    "command": "cascade.inlineEdit",
    "when": "editorTextFocus"
  },
  {
    "key": "tab",
    "command": "cascade.acceptSuggestion",
    "when": "cascade.suggestionsVisible"
  },
  {
    "key": "alt+]",
    "command": "cascade.nextSuggestion",
    "when": "cascade.suggestionsVisible"
  }
]

Error Handling

Issue Cause Solution
Slow indexing Large node_modules indexed Add to exclude patterns
Irrelevant suggestions Too much context Reduce maxFiles and maxTokensPerFile
Cascade timeout Complex multi-file operation Break into smaller Cascade steps
High memory usage Semantic indexing on large repo Limit maxFileSize, exclude binaries

Examples

Project-Specific Rules File

<!-- .windsurfrules -->
# Project Context for AI

## Architecture
- Monorepo with pnpm workspaces
- packages/api - Express REST API
- packages/web - Next.js frontend
- packages/shared - Shared types

## Conventions
- Use zod for runtime validation
- Error responses follow RFC 7807  # 7807 = configured value
- All dates are ISO 8601 UTC  # 8601 = configured value

Resources

Output

  • Configuration files or code changes applied to the project
  • Validation report confirming correct implementation
  • Summary of changes made and their rationale

04 同仓库更多 Skills

SamuelChien
SamuelChien/mega-skills-collection

zustand-store-ts

Create Zustand stores with TypeScript, subscribeWithSelector middleware, and proper state/action separation. Use when building React state management, creating global stores, or implementing reactive state patterns with Zustand.

★ 0
SamuelChien
SamuelChien/mega-skills-collection

zustand-store-creator

Zustand Store Creator - Auto-activating skill for Frontend Development. Triggers on: zustand store creator, zustand store creator Part of the Frontend Development skill category.

★ 0
SamuelChien
SamuelChien/mega-skills-collection

zero-trust-config-helper

Zero Trust Config Helper - Auto-activating skill for Security Advanced. Triggers on: zero trust config helper, zero trust config helper Part of the Security Advanced skill category.

★ 0
SamuelChien
SamuelChien/mega-skills-collection

zapier-integration-helper

Zapier Integration Helper - Auto-activating skill for Business Automation. Triggers on: zapier integration helper, zapier integration helper Part of the Business Automation skill category.

★ 0
SamuelChien
SamuelChien/mega-skills-collection

zai-cli

Execute z.AI CLI providing vision, search, reader, and GitHub exploration via CLI and MCP. Use when user needs image/video analysis, OCR, UI-to-code conversion, error diagnosis, real-time web search, web page to markdown extraction, or GitHub code exploration. Trigger with phrases like "analyze this image", "search the web for", "read this page", "explore this repo", or "use zai". Requires Z_AI_API_KEY.

★ 0
SamuelChien
SamuelChien/mega-skills-collection

yt-research

Research competitor YouTube channels, niches, and trending topics for your content strategy. Use this skill whenever the user says "research channels", "analyze competitors", "find trending topics", "niche analysis", "competitive research", "what are other creators doing", "scrape YouTube channels", or wants to understand the competitive landscape for a specific tool or topic area. Use when working with yt research. Trigger with 'yt', 'research'.

★ 0