litestar-lifecycle-hooks
Installation
SKILL.md
Lifecycle Hooks
Use this skill when the requirement is specifically about the request-handler lifecycle for HTTP handlers, not application bootstrapping or whole-ASGI wrapping.
Execution Workflow
- Decide which stage matches the requirement:
before_request,after_request, orafter_response(the exact lifecycle stage needed for behavior injection). - Choose the layer intentionally: app, router, controller, or handler (the layer to place the hook in).
- Keep hook behavior small, deterministic, and clearly cross-cutting.
- Implement request-state handoff or response mutation explicitly.
- Test normal flow, short-circuit flow, and layer-precedence behavior explicitly.