windsurf-webhooks-events
Build Windsurf extensions and integrate with VS Code extension API events. Use when building custom Windsurf extensions, tracking editor events, or integrating Windsurf with external tools via extension development. Trigger with phrases like "windsurf extension", "windsurf events", "windsurf plugin", "build windsurf extension", "windsurf API".
What this skill does
# 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
```bash
# 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
```typescript
// 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
```typescript
// 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
```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
```bash
# 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
| Issue | Cause | Solution |
|-------|-------|----------|
| Extension not activating | Wrong `activationEvents` | Use `onStartupFinished` for always-on |
| Webhook fails | Network/URL issue | Queue locally, retry with backoff |
| High CPU usage | Too many listeners | Debounce frequent events (saves, edits) |
| API incompatibility | Windsurf vs VS Code version | Pin `engines.vscode` version |
| `vsce package` fails | Missing fields | Add publisher, repository, license |
## Examples
### Team Analytics Extension
```typescript
// 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
```bash
# Start a test webhook receiver
npx -y webhook-relay -p 3456
# Configure extension: windsurf-events.webhookUrl = "http://localhost:3456"
```
## Resources
- [VS Code Extension API](https://code.visualstudio.com/api)
- [VS Code Extension Publishing](https://code.visualstudio.com/api/working-with-extensions/publishing-extension)
- [Windsurf Marketplace](https://marketplace.windsurf.com)
## Next Steps
For multi-environment setup, see `windsurf-multi-env-setup`.
Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.