AGENT SKILL

windsurf-advanced-troubleshooting

Apply Windsurf advanced debugging techniques for hard-to-diagnose issues. Use when standard troubleshooting fails, investigating complex race conditions, or preparing evidence bundles for Windsurf support escalation. Trigger with phrases like "windsurf hard bug", "windsurf mystery error", "windsurf impossible to debug", "difficult windsurf issue", "windsurf deep debug".

License 许可
MIT
最近更新
2026-03-20
Stars
★ 4
Forks
0

01 前言 Front Matter

name
windsurf-advanced-troubleshooting
author
Jeremy Longshore <jeremy@intentsolutions.io>
license
MIT
version
1.0.0
description
Apply Windsurf advanced debugging techniques for hard-to-diagnose issues. Use when standard troubleshooting fails, investigating complex race conditions, or preparing evidence bundles for Windsurf support escalation. Trigger with phrases like "windsurf hard bug", "windsurf mystery error", "windsurf impossible to debug", "difficult windsurf issue", "windsurf deep debug".
allowed-tools
Read, Grep, Bash(kubectl:*), Bash(curl:*), Bash(tcpdump:*)
compatible-with
claude-code, codex, openclaw

03 SKILL.md 正文

Windsurf Advanced Troubleshooting

Overview

Deep debugging techniques for complex Windsurf issues that resist standard troubleshooting.

Prerequisites

  • Access to production logs and metrics
  • kubectl access to clusters
  • Network capture tools available
  • Understanding of distributed tracing

Evidence Collection Framework

Comprehensive Debug Bundle

#!/bin/bash
set -euo pipefail
# advanced-windsurf-debug.sh

BUNDLE="windsurf-advanced-debug-$(date +%Y%m%d-%H%M%S)"
mkdir -p "$BUNDLE"/{logs,metrics,network,config,traces}

# 1. Extended logs (1 hour window)
kubectl logs -l app=windsurf-integration --since=1h > "$BUNDLE/logs/pods.log"
journalctl -u windsurf-service --since "1 hour ago" > "$BUNDLE/logs/system.log"

# 2. Metrics dump
curl -s localhost:9090/api/v1/query?query=windsurf_requests_total > "$BUNDLE/metrics/requests.json"  # 9090: Prometheus port
curl -s localhost:9090/api/v1/query?query=windsurf_errors_total > "$BUNDLE/metrics/errors.json"  # Prometheus port

# 3. Network capture (30 seconds)
timeout 30 tcpdump -i any port 443 -w "$BUNDLE/network/capture.pcap" &  # 443: HTTPS port

# 4. Distributed traces
curl -s localhost:16686/api/traces?service=windsurf > "$BUNDLE/traces/jaeger.json"  # 16686: Jaeger UI port

# 5. Configuration state
kubectl get cm windsurf-config -o yaml > "$BUNDLE/config/configmap.yaml"
kubectl get secret windsurf-secrets -o yaml > "$BUNDLE/config/secrets-redacted.yaml"

tar -czf "$BUNDLE.tar.gz" "$BUNDLE"
echo "Advanced debug bundle: $BUNDLE.tar.gz"

Systematic Isolation

Layer-by-Layer Testing

// Test each layer independently
async function diagnoseWindsurfIssue(): Promise<DiagnosisReport> {
  const results: DiagnosisResult[] = [];

  // Layer 1: Network connectivity
  results.push(await testNetworkConnectivity());

  // Layer 2: DNS resolution
  results.push(await testDNSResolution('api.windsurf.com'));

  // Layer 3: TLS handshake
  results.push(await testTLSHandshake('api.windsurf.com'));

  // Layer 4: Authentication
  results.push(await testAuthentication());

  // Layer 5: API response
  results.push(await testAPIResponse());

  // Layer 6: Response parsing
  results.push(await testResponseParsing());

  return { results, firstFailure: results.find(r => !r.success) };
}

Minimal Reproduction

// Strip down to absolute minimum
async function minimalRepro(): Promise<void> {
  // 1. Fresh client, no customization
  const client = new WindsurfClient({
    apiKey: process.env.WINDSURF_API_KEY!,
  });

  // 2. Simplest possible call
  try {
    const result = await client.ping();
    console.log('Ping successful:', result);
  } catch (error) {
    console.error('Ping failed:', {
      message: error.message,
      code: error.code,
      stack: error.stack,
    });
  }
}

Timing Analysis

class TimingAnalyzer {
  private timings: Map<string, number[]> = new Map();

  async measure<T>(label: string, fn: () => Promise<T>): Promise<T> {
    const start = performance.now();
    try {
      return await fn();
    } finally {
      const duration = performance.now() - start;
      const existing = this.timings.get(label) || [];
      existing.push(duration);
      this.timings.set(label, existing);
    }
  }

  report(): TimingReport {
    const report: TimingReport = {};
    for (const [label, times] of this.timings) {
      report[label] = {
        count: times.length,
        min: Math.min(...times),
        max: Math.max(...times),
        avg: times.reduce((a, b) => a + b, 0) / times.length,
        p95: this.percentile(times, 95),
      };
    }
    return report;
  }
}

Memory and Resource Analysis

// Detect memory leaks in Windsurf client usage
const heapUsed: number[] = [];

setInterval(() => {
  const usage = process.memoryUsage();
  heapUsed.push(usage.heapUsed);

  // Alert on sustained growth
  if (heapUsed.length > 60) { // 1 hour at 1/min
    const trend = heapUsed[59] - heapUsed[0];
    if (trend > 100 * 1024 * 1024) { // 100MB growth  # 1024: 1 KB
      console.warn('Potential memory leak in windsurf integration');
    }
  }
}, 60000);  # 60000: 1 minute in ms

Race Condition Detection

// Detect concurrent access issues
class WindsurfConcurrencyChecker {
  private inProgress: Set<string> = new Set();

  async execute<T>(key: string, fn: () => Promise<T>): Promise<T> {
    if (this.inProgress.has(key)) {
      console.warn(`Concurrent access detected for ${key}`);
    }

    this.inProgress.add(key);
    try {
      return await fn();
    } finally {
      this.inProgress.delete(key);
    }
  }
}

Support Escalation Template

## Windsurf Support Escalation

**Severity:** P[1-4]
**Request ID:** [from error response]
**Timestamp:** [ISO 8601]  # 8601 = configured value

### Issue Summary
[One paragraph description]

### Steps to Reproduce
1. [Step 1]
2. [Step 2]

### Expected vs Actual
- Expected: [behavior]
- Actual: [behavior]

### Evidence Attached
- [ ] Debug bundle (windsurf-advanced-debug-*.tar.gz)
- [ ] Minimal reproduction code
- [ ] Timing analysis
- [ ] Network capture (if relevant)

### Workarounds Attempted
1. [Workaround 1] - Result: [outcome]
2. [Workaround 2] - Result: [outcome]

Instructions

Step 1: Collect Evidence Bundle

Run the comprehensive debug script to gather all relevant data.

Step 2: Systematic Isolation

Test each layer independently to identify the failure point.

Step 3: Create Minimal Reproduction

Strip down to the simplest failing case.

Step 4: Escalate with Evidence

Use the support template with all collected evidence.

Output

  • Comprehensive debug bundle collected
  • Failure layer identified
  • Minimal reproduction created
  • Support escalation submitted

Error Handling

Issue Cause Solution
Can't reproduce Race condition Add timing analysis
Intermittent failure Timing-dependent Increase sample size
No useful logs Missing instrumentation Add debug logging
Memory growth Resource leak Use heap profiling

Examples

Quick Layer Test

set -euo pipefail
# Test each layer in sequence
curl -v https://api.windsurf.com/health 2>&1 | grep -E "(Connected|TLS|HTTP)"

Resources

Next Steps

For load testing, see windsurf-load-scale.

04 同仓库更多 Skills

micsapp
micsapp/micstec-skills

azure-apim-architecture

Analyzes and explains Azure API Management architecture decisions for enterprise API marketplace implementations using VNet Internal mode, Front Door, hybrid authentication, and multi-environment strategies. Use when discussing APIM component selection, network topology, cost optimization, or comparing alternatives like workspaces vs instances, VNet Internal vs External mode, or Front Door vs Application Gateway.

★ 4
micsapp
micsapp/micstec-skills

apiops-deployment

Guides deployment of Azure API Management infrastructure using Infrastructure as Code (Bicep/Terraform), CI/CD pipelines (GitHub Actions/Azure DevOps), and APIOps workflows. Use when deploying APIM, creating pipelines, or implementing dev→test→prod promotion strategies.

★ 4
micsapp
micsapp/micstec-skills

apim-policy-authoring

Creates production-ready Azure API Management policy XML for authentication (OAuth 2.0, JWT validation, subscription keys), rate limiting, CORS configuration, error handling, and API transformations. Use when implementing API security, access control, or request/response processing logic.

★ 4
micsapp
micsapp/micstec-skills

api-security-review

Reviews Azure API Management configurations for security vulnerabilities, OWASP API Security Top 10 compliance, VNet Internal mode validation, Private Link verification, and Azure Security Benchmark alignment. Use when performing security audits, pre-deployment validation, or compliance reviews.

★ 4
micsapp
micsapp/micstec-skills

jira-cli

Interact with Jira from the command line to create, list, view, edit, and transition issues, manage sprints and epics, and perform common Jira workflows. Use when the user asks about Jira tasks, tickets, issues, sprints, or needs to manage project work items.

★ 4
micsapp
micsapp/micstec-skills

calculator

Performs arbitrary-precision arithmetic calculations including addition, subtraction, multiplication, division, and exponents. Use when the user asks to calculate, compute, or evaluate math expressions, or when precise decimal arithmetic is needed to avoid floating-point errors.

★ 4