plugins/litestar/skills/litestar-responses/SKILL.md
Build Litestar responses with typed return values, explicit Response containers, layered response classes, headers, cookies, status-code control, redirects, files, streams, server-sent events, ASGI app returns, and background tasks. Use when shaping outbound HTTP behavior, correcting response contracts, or choosing the right Litestar response primitive. Do not use for request parsing, validation, or authentication policy design.
npx skillsauth add alti3/litestar-skills litestar-responsesInstall 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.
Response[T], or a specialized response container.Response[T] when you need runtime control over headers, cookies, background tasks, or status code.204, 304, and other no-body responses as None-returning contracts.response_class, response_headers, and response_cookies overrides intentional and local.Response[T] when the payload is normal but metadata is dynamic.response_class= when many endpoints need the same serialization strategy.ASGIApp when wrapping third-party ASGI response objects or custom low-level behavior.File, Stream, ServerSentEvent, or redirect responses when the transport semantics are special.Read only the sections you need:
Response[T], status codes, layered response_class, custom response classes, and background tasks, read references/response-basics.md.litestar.status_codes in both code and tests.documentation_only=True metadata and set the runtime value in the response or hook.Response[Any] everywhere and losing schema precision.Response[T] or built-in container is enough.204 No Content endpoints.File.None annotations and bodies.response_class, response_headers, and response_cookies precedence is intentional.litestar-openapi metadata and examples.litestar-exception-handling for error-envelope and failure-response design.litestar-openapi when response changes materially affect schema output.litestar-templating for deeper template-engine concerns.litestar-testing for assertions on status, headers, cookies, streams, redirects, and SSE behavior.development
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.
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.