WI

windsurf-webhooks-events

Provides a guide to building custom Windsurf extensions and integrating them with VS Code workspace events.

Install

mkdir -p .claude/skills/windsurf-webhooks-events && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/8350" && unzip -o skill.zip -d .claude/skills/windsurf-webhooks-events && rm skill.zip

Installs to .claude/skills/windsurf-webhooks-events

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Build Windsurf extensions and integrate with VS Code extension API events.
74 charsno explicit “when” trigger
Intermediate

Key capabilities

  • Scaffold new extensions using the VS Code generator
  • Monitor workspace events like file saves and active editor changes
  • Capture terminal output for error or failure patterns
  • Configure custom extension settings via package.json
  • Package extensions into .vsix files for installation
  • Debounce event transmissions to external webhooks

How it works

The skill utilizes the VS Code Extension API to register listeners for workspace events, which are then processed and optionally transmitted to an external URL via fetch. Developers scaffold the project using the yo generator and define configuration properties in package.json to manage extension behavior.

Inputs & outputs

You give it
VS Code workspace events and configuration settings
You get back
Compiled .vsix extension package or HTTP POST requests to a webhook URL

When to use windsurf-webhooks-events

  • Build custom editor extensions
  • Track workspace editor events
  • Integrate external tools via extensions
  • Develop custom IDE plugins

About this skill

Windsurf Extension Development & Events

Overview

Windsurf is built on VS Code and supports the full VS Code Extension API. Build custom extensions to track workspace events, integrate with external tools, and extend Cascade's capabilities. This skill covers extension development specific to the Windsurf environment.

Prerequisites

  • Node.js 18+ and npm
  • VS Code Extension API familiarity
  • yo and generator-code for scaffolding
  • Windsurf IDE for testing

Instructions

Step 1: Scaffold Extension

# Install scaffolding tools
npm install -g yo generator-code

# Generate extension
yo code
# Select: New Extension (TypeScript)
# Name: my-windsurf-extension

Step 2: Track Workspace Events

// src/extension.ts
import * as vscode from "vscode";

export function activate(context: vscode.ExtensionContext) {
  console.log("Extension active in Windsurf");

  // Track file saves
  const saveListener = vscode.workspace.onDidSaveTextDocument(
    async (document) => {
      const diagnostics = vscode.languages.getDiagnostics(document.uri);
      const errors = diagnostics.filter(
        (d) => d.severity === vscode.DiagnosticSeverity.Error
      );
      if (errors.length > 0) {
        vscode.window.showWarningMessage(
          `${document.fileName}: ${errors.length} error(s) after save`
        );
      }
    }
  );

  // Track active editor changes
  const editorListener = vscode.window.onDidChangeActiveTextEditor(
    (editor) => {
      if (editor) {
        const lang = editor.document.languageId;
        const lines = editor.document.lineCount;
        console.log(`Opened: ${editor.document.fileName} (${lang}, ${lines} lines)`);
      }
    }
  );

  // Track terminal output
  const terminalListener = vscode.window.onDidWriteTerminalData((event) => {
    // Can monitor for specific patterns (errors, warnings)
    if (event.data.includes("ERROR") || event.data.includes("FAIL")) {
      vscode.window.showWarningMessage("Error detected in terminal output");
    }
  });

  context.subscriptions.push(saveListener, editorListener, terminalListener);
}

Step 3: Send Events to External System

// src/webhook.ts
import * as vscode from "vscode";

interface WorkspaceEvent {
  event: string;
  file?: string;
  language?: string;
  timestamp: string;
  metadata?: Record<string, unknown>;
}

async function sendEvent(event: WorkspaceEvent): Promise<void> {
  const webhookUrl = vscode.workspace
    .getConfiguration("windsurf-events")
    .get<string>("webhookUrl");

  if (!webhookUrl) return;

  try {
    await fetch(webhookUrl, {
      method: "POST",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify(event),
    });
  } catch (err) {
    console.warn("Webhook delivery failed:", err);
  }
}

// Debounce frequent events
const debounceMap = new Map<string, NodeJS.Timeout>();

function debouncedSend(event: WorkspaceEvent, delayMs = 2000): void {
  const key = `${event.event}:${event.file}`;
  clearTimeout(debounceMap.get(key));
  debounceMap.set(
    key,
    setTimeout(() => {
      sendEvent(event);
      debounceMap.delete(key);
    }, delayMs)
  );
}

Step 4: Extension package.json

{
  "name": "windsurf-events",
  "displayName": "Windsurf Events",
  "version": "1.0.0",
  "engines": { "vscode": "^1.85.0" },
  "activationEvents": ["onStartupFinished"],
  "main": "./dist/extension.js",
  "contributes": {
    "configuration": {
      "title": "Windsurf Events",
      "properties": {
        "windsurf-events.webhookUrl": {
          "type": "string",
          "description": "URL to send workspace events to"
        },
        "windsurf-events.trackSaves": {
          "type": "boolean",
          "default": true,
          "description": "Track file save events"
        },
        "windsurf-events.trackErrors": {
          "type": "boolean",
          "default": true,
          "description": "Track terminal error events"
        }
      }
    },
    "commands": [
      {
        "command": "windsurf-events.showStatus",
        "title": "Windsurf Events: Show Status"
      }
    ]
  }
}

Step 5: Build and Install

# Build
npm run compile
# or: npm run build

# Package as .vsix
npx vsce package

# Install in Windsurf
windsurf --install-extension windsurf-events-1.0.0.vsix

# Or publish to marketplace
npx vsce publish

Step 6: Test in Windsurf

1. Open Extension Development Host: F5 in Windsurf
2. A new Windsurf window opens with extension loaded
3. Open a file, save it, trigger events
4. Check Output panel > "Windsurf Events" channel
5. Verify webhook delivery (use https://webhook.site for testing)

Error Handling

IssueCauseSolution
Extension not activatingWrong activationEventsUse onStartupFinished for always-on
Webhook failsNetwork/URL issueQueue locally, retry with backoff
High CPU usageToo many listenersDebounce frequent events (saves, edits)
API incompatibilityWindsurf vs VS Code versionPin engines.vscode version
vsce package failsMissing fieldsAdd publisher, repository, license

Examples

Team Analytics Extension

// Track AI acceptance rate per developer
vscode.languages.registerInlineCompletionItemProvider(
  { pattern: "**" },
  {
    provideInlineCompletionItems(document, position) {
      // Log completion requests (don't interfere with Supercomplete)
      console.log(`Completion at ${document.fileName}:${position.line}`);
      return []; // Return empty -- let Windsurf handle completions
    }
  }
);

Quick Test Webhook

# Start a test webhook receiver
npx -y webhook-relay -p 3456
# Configure extension: windsurf-events.webhookUrl = "http://localhost:3456"

Resources

Next Steps

For multi-environment setup, see windsurf-multi-env-setup.

When not to use it

  • When requiring native Windsurf backend integration outside of the VS Code extension API
  • When attempting to modify core Windsurf IDE behavior without an extension

Prerequisites

Node.js 18+ and npmVS Code Extension API familiarityyo and generator-codeWindsurf IDE

Limitations

  • Requires pinning engines.vscode version to maintain compatibility
  • High CPU usage can occur if too many listeners are active without debouncing
  • Webhook delivery failures require local queuing and retry logic

How it compares

Unlike manual IDE configuration, this approach creates a persistent, event-driven extension that automates data collection and external tool integration directly within the Windsurf environment.

Compared to similar skills

windsurf-webhooks-events side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
windsurf-webhooks-events (this skill)027dReviewIntermediate
browser-tools69moReviewIntermediate
browser-extension-builder66moNo flagsIntermediate
obsidian-data-handling427dNo flagsAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

More by jeremylongshore

View all by jeremylongshore

analyzing-logs

jeremylongshore

Analyze application logs to detect performance issues, identify error patterns, and improve stability by extracting key insights.

14123

ollama-setup

jeremylongshore

Configure auto-configure Ollama when user needs local LLM deployment, free AI alternatives, or wants to eliminate hosted API costs. Trigger phrases: "install ollama", "local AI", "free LLM", "self-hosted AI", "replace OpenAI", "no API costs". Use when appropriate context detected. Trigger with relevant phrases based on skill purpose.

1167

backtesting-trading-strategies

jeremylongshore

Backtest crypto and traditional trading strategies against historical data. Calculates performance metrics (Sharpe, Sortino, max drawdown), generates equity curves, and optimizes strategy parameters. Use when user wants to test a trading strategy, validate signals, or compare approaches. Trigger with phrases like "backtest strategy", "test trading strategy", "historical performance", "simulate trades", "optimize parameters", or "validate signals".

1071

generating-database-seed-data

jeremylongshore

Process this skill enables AI assistant to generate realistic test data and database seed scripts for development and testing environments. it uses faker libraries to create realistic data, maintains relational integrity, and allows configurable data volumes. u... Use when working with databases or data models. Trigger with phrases like 'database', 'query', or 'schema'.

1033

cursor-codebase-indexing

jeremylongshore

Execute set up and optimize Cursor codebase indexing. Triggers on "cursor index setup", "codebase indexing", "index codebase", "cursor semantic search". Use when working with cursor codebase indexing functionality. Trigger with phrases like "cursor codebase indexing", "cursor indexing", "cursor".

885

testing-mobile-apps

jeremylongshore

Execute mobile app testing on iOS and Android devices/simulators. Use when performing specialized testing. Trigger with phrases like "test mobile app", "run iOS tests", or "validate Android functionality".

810

Search skills

Search the agent skills registry