plugins/litestar/skills/litestar-websockets/SKILL.md
Build Litestar WebSocket endpoints with low-level websocket handlers, websocket listeners, websocket streams, dependency injection, custom websocket classes, transport-mode control, and graceful connection lifecycle handling. Use when implementing bidirectional real-time communication, reactive websocket message handling, or proactive server push over WebSockets. Do not use for server-side pub/sub fanout that is better expressed with channels alone.
npx skillsauth add alti3/litestar-skills litestar-websocketsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
@websocket, reactive @websocket_listener, or proactive @websocket_stream / send_websocket_stream().send_websocket_stream() when you need to combine streaming with receiving data concurrently.@websocket for manual accept, receive, send, and task orchestration.@websocket_listener or WebsocketListener for event-driven typed messages and simpler business logic.@websocket_stream for one-way push from server to client.send_websocket_stream() with a low-level handler or listener when you must send a stream and receive messages concurrently.websocket_class only when connection-level behavior must be extended consistently.Read only the sections you need:
WebsocketListener, typed send and receive behavior, websocket streams, and stream/listener combinations, read references/listener-and-stream-patterns.md.bytes values only, or text mode means Python str values only.litestar-channels for server-side event fanout and broker-backed subscriptions.litestar-authentication or litestar-security for connection auth and authorization rules.litestar-testing for websocket client patterns and disconnect assertions.litestar-dependency-injection when websocket handlers depend on services or scoped resources.tools
Test Litestar applications with TestClient, AsyncTestClient, create_test_client, websocket test helpers, dependency overrides, mocked dependencies, lifecycle-aware fixtures, and deterministic success and failure assertions. Use when adding or fixing Litestar test coverage, including exception contracts, override precedence, websocket behavior, event-bus side effects, or live-server-only response patterns. Do not use as a substitute for production observability or runtime debugging strategy.
development
Configure Litestar templating with `TemplateConfig`, Jinja/Mako/MiniJinja engines, file-or-string `Template` responses, request and CSRF-aware context, template callables, and custom engine integration. Use when implementing or fixing server-rendered HTML in Litestar. Do not use for static asset serving or pure JSON API endpoints.
development
Configure Litestar stores and the store registry for caching, server-side sessions, rate limiting, and other key-value state with explicit backend selection, bytes-safe data handling, TTL and renewal policy, namespacing, registry wiring, and lifecycle cleanup. Use when a Litestar app depends on `MemoryStore`, `FileStore`, `RedisStore`, `ValkeyStore`, or `StoreRegistry`. Do not use for relational persistence, domain repositories, or response-caching policy details that belong in database or caching-focused skills.
development
Serve static assets in Litestar with `create_static_files_router()`, explicit mount paths, HTML mode, cache-control policy, URL reversal, custom file systems, and symlink-safe directory boundaries. Use when exposing JS, CSS, images, downloadable artifacts, or static HTML from controlled directories. Do not use for upload ingestion, user-writable file publication, or arbitrary file-download endpoints that need per-request authorization logic.