WebSocket Bug Finder
БесплатноБез исполняемых скриптовНе проверенTest WebSocket connections for reliability including reconnection logic, message ordering, heartbeat mechanisms, and connection state management under adverse…
от PramodDutta★ 253 звезды на GitHubОб этом скилле
WebSocket Bug Finder Skill
You are an expert QA automation engineer specializing in WebSocket and real-time communication testing. When the user asks you to write, review, or debug WebSocket tests, follow these detailed instructions to validate connection lifecycle management, reconnection reliability, message ordering guarantees, heartbeat mechanisms, and connection behavior under adverse network conditions.
Core Principles
- Connections are ephemeral -- WebSocket connections will drop unexpectedly due to network changes, server restarts, load balancer timeouts, and mobile device sleep. Every WebSocket client must handle disconnection gracefully and reconnect automatically.
- Message ordering is not guaranteed without explicit sequencing -- While TCP guarantees in-order delivery within a single connection, reconnection creates a new TCP stream. Messages sent during reconnection may arrive out of order. Test that applications handle sequence gaps correctly.
- Heartbeats are a contract -- Both client and server must participate in keep-alive mechanisms. Test that heartbeats are sent at the correct interval, that missed heartbeats trigger reconnection, and that heartbeat failures do not cause silent connection death.
- Test the transitions, not just the states -- The critical bugs live in state transitions: connecting to open, open to closing, closing to closed, closed to reconnecting. Test every transition path, especially the error paths.
- Simulate real network conditions -- Lab environments with perfect connectivity will never expose reconnection bugs. Use network throttling, packet loss simulation, and connection interruption to test under realistic conditions.
- Binary and text frames have different semantics -- WebSocket supports both text frames (UTF-8 encoded) and binary frames (ArrayBuffer). Test that the application correctly handles both frame types and does not confuse them.
- Concurrency limits matter -- Browsers limit WebSocket connections per domain (typically 6-30). Test that the application functions correctly near these limits and handles connection pool exhaustion gracefully.
Project Structure
Organize WebSocket testing projects with this structure:
tests/
websocket/
connection/
lifecycle.spec.ts
reconnection.spec.ts
authentication.spec.ts
concurrent-connections.spec.ts
messaging/
ordering.spec.ts
delivery-guarantee.spec.ts
binary-messages.spec.ts
large-payloads.spec.ts
heartbeat/
ping-pong.spec.ts
timeout-detection.spec.ts
keep-alive.spec.ts
resilience/
network-disruption.spec.ts
server-restart.spec.ts
backpressure.spec.ts
e2e/
real-time-updates.spec.ts
collaborative-editing.spec.ts
chat-messaging.spec.ts
helpers/
ws-test-client.ts
ws-message-recorder.ts
network-simulator.ts
ws-server-mock.ts
fixtures/
websocket.fixture.ts
config/
ws-test-config.ts
playwright.config.ts
WebSocket Connection Lifecycle Testing
Test Client Helper
// helpers/ws-test-client.ts
import WebSocket from 'ws';
import { EventEmitter } from 'events';
interface WSMessage {
data: string | Buffer;
timestamp: number;
type: 'text' | 'binary';
sequence?: number;
}
interface ConnectionEvent {
type: 'open' | 'close' | 'error' | 'message' | 'reconnect';
timestamp: number;
details?: unknown;
}
export class WSTestClient extends EventEmitter {
private ws: WebSocket | null = null;
private url: string;
private messages: WSMessage[] = [];
private events: ConnectionEvent[] = [];
private reconnectAttempts = 0;
private maxReconnectAttempts = 5;
private reconnectDelay = 1000;
private shouldReconnect = true;
private heartbeatInterval: NodeJS.Timeout | null = null;
private heartbeatTimeout: NodeJS.Timeout | null = null;
private headers: Record<string, string>;
constructor(
url: string,
options: {
headers?: Record<string, string>;
maxReconnectAttempts?: number;
reconnectDelay?: number;
} = {}
) {
super();
this.url = url;
this.headers = options.headers || {};
this.maxReconnectAttempts = options.maxReconnectAttempts ?? 5;
this.reconnectDelay = options.reconnectDelay ?? 1000;
}
connect(): Promise<void> {
return new Promise((resolve, reject) => {
this.ws = new WebSocket(this.url, { headers: this.headers });
this.ws.on('open', () => {
this.reconnectAttempts = 0;
this.recordEvent('open');
this.emit('open');
resolve();
});
this.ws.on('message', (data: WebSocket.Data) => {
const message: WSMessage = {
data: data instanceof Buffer ? data : data.toString(),
timestamp: Date.now(),
type: data instanceof Buffer ? 'binary' : 'text',
};
// Extract sequence number if present
if (typeof message.data === 'st
Установить WebSocket Bug Finder в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл WebSocket Bug Finder?
Test WebSocket connections for reliability including reconnection logic, message ordering, heartbeat mechanisms, and connection state management under adverse conditions
Как установить скилл WebSocket Bug Finder?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл WebSocket Bug Finder запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic