websocket-handler-decomposition

Community

Split WebSocket handlers for maintainable code.

Authorsytone
Version1.0.0
Installs0

System Documentation

What problem does it solve?

A WebSocket handler tends to accumulate several concerns (transport lifecycle, session locking, message routing, replay persistence). You need to improve maintainability while preserving endpoint/method contracts.

Core Features & Use Cases

  • Extract a thin orchestrator as the top-level handler and delegate to specialized components.
  • Create a ConnectionManager to handle reconnect throttling, active-session lock management, duplicate close semantics, and ping/pong keepalive handling.
  • Create a MessageDispatcher to route inbound messages, dispatch agent commands, and persist replay sequences with outbound formatting.
  • Preserve endpoint mappings and public signatures to avoid breaking callers.
  • Update DI registrations and tests to wire the new components explicitly.

Quick Start

Refactor by extracting a ConnectionManager and a MessageDispatcher while preserving endpoint contracts.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: websocket-handler-decomposition
Download link: https://github.com/sytone/botnexus/archive/main.zip#websocket-handler-decomposition

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.