agentsclimarketplace

Litestar middleware

Skill litestar-org/litestar-skills/skills/litestar-middleware

Auto-activate for ASGIMiddleware, DefineMiddleware, middleware=, CORSConfig, CSRFConfig, AllowedHostsConfig, CompressionConfig, request IDs, or ASGI scopes. Not for route logic.From its SKILL.md

Install
npx -y skills add litestar-org/litestar-skills --skill litestar-middleware

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 13 stars13 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

2.2 KB, 433 tokens by cl100k_base, as published. Nobody here has run it

Litestar Middleware

Use this skill for built-in middleware config, custom ASGI middleware, request lifecycle hooks, and auth user loading.

Code Style Rules

  • Use built-in middleware configs before custom middleware.
  • Keep middleware focused on cross-cutting request behavior.
  • Filter by ASGI scope when middleware applies only to HTTP or WebSocket.
  • Keep business policy in Guards and services.

Quick Reference

<workflow>

Workflow

  1. Decide whether a built-in config solves the need.
  2. Choose custom middleware only for cross-cutting behavior.
  3. Set ordering deliberately.
  4. Verify HTTP and WebSocket behavior separately when both apply.
</workflow> <guardrails>

Guardrails

  • Do not put business workflows in middleware.
  • Do not apply HTTP-only middleware to WebSocket scopes.
  • Do not mutate request state without documenting the key.
  • Do not duplicate Guard policy in middleware.
</guardrails> <validation>

Validation Checkpoint

  • Middleware order is intentional.
  • Scope filtering is correct.
  • Built-in configs are used where available.
  • Tests cover the request path affected by middleware.
</validation> <example>

Example

from litestar.middleware import ASGIMiddleware

middleware = [RequestIDMiddleware()]
</example>

References Index

Official References

Shared Styleguide Baseline

What ships with it: 1 file

2.9 KB alongside SKILL.md

references/

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.