Token导航 LogoToken导航TokenDH.com
研究检索操作浏览器github未标认证来源可访问许可证需确认审计通过

websocket-client-resiliencewebsocket 客户端弹性

Agent Skill

websocket-client-resilience 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

412

周安装

17

GitHub Stars

5

下载量

135
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:websocket-client-resilience(websocket 客户端弹性)
来源仓库:https://github.com/apankov1/quality-engineering
仓库路径:skills/websocket-client-resilience
安装命令:
npx skills add https://github.com/apankov1/quality-engineering --skill websocket-client-resilience
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/apankov1/quality-engineering --skill websocket-client-resilience

简介

用于查找、检索和筛选相关信息以支持决策。websocket-client-resilience 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

  • 适合在需要快速定位候选结果的任务场景中使用。
  • 通过关键词或来源线索进行信息聚合与过滤。
  • 从指定 GitHub 仓库安装并参考原始文档确认功能。
  • 注意权限范围和维护状态,避免触发不必要的网络请求。

SKILL.md

WebSocket Client Resilience

6 resilience patterns for WebSocket clients, extracted from real-world mobile network conditions.

Mobile WebSocket connections fail in ways that local development environments don't surface. P99 latency on 4G networks is 5-8 seconds. A 5-second health check timeout causes false positives on every slow network.

When to use: Implementing WebSocket client reconnection logic, building real-time features with persistent connections, mobile app WebSocket handling, any client that maintains long-lived server connections.

When not to use: Server-side WebSocket handlers, HTTP request/response patterns, Server-Sent Events (SSE).

Rationalizations (Do Not Skip)

RationalizationWhy It's WrongRequired Action
"Our users are on fast networks"Mobile users exist. Even desktop WiFi has transient blips.Test with throttled networks
"Simple retry is enough"Without jitter, all clients retry at once after an outageAdd randomized jitter
"One missed heartbeat means disconnected"Network blips last 1-3 seconds. Single miss = false positive.Use hysteresis (2+ misses)
"We'll add resilience later"Reconnection logic is foundational. Retrofitting it is much harder.Build it in from the start
"5 seconds is plenty of timeout"Mobile P99 is 5-8s. That "timeout" is normal latency for mobile.Use 10s+ for mobile

Included Utilities

// WebSocket resilience pattern implementations (zero dependencies)
import {
  getBackoffDelay,
  circuitBreakerTransition,
  shouldDisconnect,
  CommandAckTracker,
  detectSequenceGap,
  classifyTimeout,
} from './resilience.ts';

getBackoffDelay() accepts an optional RNG function for deterministic tests:

const lowJitter = getBackoffDelay(0, 1000, 30000, () => 0); // 750
const highJitter = getBackoffDelay(0, 1000, 30000, () => 1); // 1250

Quick Reference

PatternDetectFixSeverity
Backoff without jitterMath.pow(2, attempt) without Math.random()Add +/- 25% jittermust-fail
No circuit breakerReconnect without failure counterTrip after 5 failures, 60s cooldownmust-fail
Single heartbeat misssetTimeout disconnect without miss counterRequire 2+ missed heartbeatsshould-fail
No command ackws.send() without commandId trackingTrack pending commands, timeout at 30snice-to-have
No sequence trackingonmessage without sequence checkTrack lastReceivedSequence, detect gapsnice-to-have
Short mobile timeoutHealth timeout < 10sUse 10s+ for all health checksmust-fail

Coverage

PatternUtilityStatus
1. Backoff with jittergetBackoffDelay()Code + tests
2. Circuit breakercircuitBreakerTransition()Code + tests
3. Heartbeat hysteresisshouldDisconnect()Code + tests
4. Command acknowledgmentCommandAckTrackerCode + tests
5. Sequence gap detectiondetectSequenceGap()Code + tests
6. Mobile-aware timeoutsclassifyTimeout()Code + tests

All 6 patterns have executable utilities and tests.

Companion Skills

This skill provides client-side resilience patterns, not WebSocket server architecture guidance. For broader methodology:

  • Search websocket on skills.sh for server-side handlers, protocol design, and connection management
  • The circuit breaker is a state machine (closed/open/half-open) — use model-based-testing for systematic transition matrix coverage of all state pairs
  • Backoff, circuit breaker, and retry patterns need fault simulation — use fault-injection-testing for circuit breaker testing utilities and queue preservation assertions
  • Connection lifecycle events should log at correct levels — use observability-testing to assert structured log output on connect/disconnect/reconnect

Framework Adaptation

These patterns are framework-agnostic. They work with:

  • Browser: Native WebSocket, Socket.IO, ws library
  • React/Vue/Svelte: Wrap in composable/hook
  • React Native / Flutter: Same patterns, different APIs
  • Node.js: ws library for server-to-server WebSocket clients

The core principle: real-world network conditions are more variable than controlled environments. Design for mobile latency, not localhost.

See patterns.md for full before/after code examples and detection commands for each pattern.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

38.94%
按下载量换算53

Claude

27.47%
按下载量换算37

Cursor

18.06%
按下载量换算24

Gemini CLI

9.55%
按下载量换算13

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills