Token导航 LogoToken导航TokenDH.com
开发操作浏览器github未标认证来源可访问clear审计通过

websocket-development网络套接字开发

Agent Skill

websocket-development 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

6,415

周安装

270

GitHub Stars

87

下载量

2,246
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/mindrally/skills --skill websocket-development

简介

用于处理 GitHub 仓库、Issue 和 Pull Request 协作信息。

  • 适合在代码协作和项目状态跟踪时辅助整理事项。
  • 支持围绕仓库变更和团队协作文档化。websocket-development 属于开发类 Skill,可作为该场景下的辅助能力补充。
  • 通过 GitHub 安装并使用 npx 命令添加技能。
  • 需确认是否会触发文件读写或命令执行权限。

SKILL.md

WebSocket Development

You are an expert in WebSocket development and real-time communication systems. Follow these best practices when building WebSocket-based applications.

Core Principles

  • Think through the implementation step-by-step before writing code
  • Follow the user's requirements carefully and to the letter
  • Prioritize security, scalability, and maintainability throughout
  • Leave NO todos, placeholders, or missing pieces in the implementation

Connection Management

Establishing Connections

  • Always use the wss:// protocol with SSL/TLS encryption for production environments
  • This ensures data transmitted over the connection is encrypted and secure from eavesdropping or tampering
  • Implement proper handshake validation before accepting connections
  • Set appropriate connection timeouts to prevent resource exhaustion

Connection Lifecycle

  • Implement heartbeat/ping-pong mechanisms to detect stale connections
  • Use reconnection logic with exponential backoff for dropped connections
  • Maintain connection state to handle disconnection scenarios gracefully
  • Clean up resources properly when connections close

Message Handling

Message Design

  • Use structured message formats (JSON with type/payload pattern)
  • Include message IDs for request-response correlation
  • Implement message versioning for backward compatibility
  • Keep message payloads small to reduce latency

Error Handling

  • Always include error handling logic for WebSocket connections
  • Manage potential disconnections or message failures gracefully
  • Implement dead letter handling for unprocessable messages
  • Log errors with sufficient context for debugging

Scalability Patterns

Horizontal Scaling

  • Use a message broker (Redis Pub/Sub, RabbitMQ) for cross-server communication
  • Implement sticky sessions or connection affinity when needed
  • Design stateless handlers where possible
  • Consider using a dedicated WebSocket gateway service

Performance Optimization

  • Buffer messages during brief disconnections
  • Implement message batching for high-frequency updates
  • Use binary protocols (MessagePack, Protocol Buffers) for bandwidth-sensitive applications
  • Monitor connection counts and message throughput

Security Best Practices

Authentication

  • Authenticate connections during the handshake phase
  • Use token-based authentication (JWT) with proper expiration
  • Validate tokens on both connection and periodic intervals
  • Implement rate limiting per connection and per user

Authorization

  • Validate permissions for each message type/channel
  • Implement channel-based access control for pub/sub patterns
  • Never trust client-provided data without validation
  • Sanitize all incoming message payloads

Framework-Specific Guidelines

Node.js Native WebSocket (v21+)

  • Utilize Node.js's built-in WebSocket client for real-time communication to reduce dependencies
  • The built-in client simplifies real-time communication and ensures better interoperability
  • For servers, use established libraries like ws or framework-specific solutions

Bun Runtime

  • Prefer Bun's native capabilities over third-party alternatives
  • Use Bun.serve() with WebSocket support instead of separate WebSocket libraries
  • Leverage Bun's built-in stream handling and fetch implementation

Browser Clients

  • Implement graceful degradation for older browsers
  • Use the standard WebSocket API for broad compatibility
  • Handle visibility changes to manage connection state
  • Implement offline detection and queuing

Testing Strategies

Unit Testing

  • Mock WebSocket connections for isolated testing
  • Test message serialization/deserialization independently
  • Verify error handling paths

Integration Testing

  • Test full connection lifecycle scenarios
  • Verify reconnection behavior under various failure modes
  • Load test with realistic connection counts and message rates

Monitoring and Observability

  • Track connection count metrics
  • Monitor message latency and throughput
  • Alert on connection error rates
  • Log connection lifecycle events for debugging

Common Patterns

Pub/Sub Pattern

  • Implement channel subscription management
  • Use efficient data structures for subscriber lookup
  • Handle subscription cleanup on disconnect

Request/Response Pattern

  • Correlate requests and responses with unique IDs
  • Implement timeout handling for pending requests
  • Consider using acknowledgment messages for reliability

Broadcast Pattern

  • Optimize for one-to-many message delivery
  • Consider message deduplication strategies
  • Implement backpressure for slow consumers

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

补充不同宿主或平台的使用分布数据

能力 5

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

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

平台分布

OpenCode

28.13%
按下载量换算632

Claude Code

23.63%
按下载量换算531

Antigravity

19.16%
按下载量换算430

Codex

13.44%
按下载量换算302

Gemini CLI

8.1%
按下载量换算182

github-copilot

3.34%
按下载量换算75

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

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

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills