litestar
Skill4 starsChanged 9 months agoUnlicenseView on GitHub
Use when building, reviewing, or debugging a Litestar app — handlers, controllers/routers, dependency injection, DTOs, middleware, lifecycle hooks, templating, static files, websockets, or testing. Triggers on: "Litestar", an app that fails at startup after adding a handler or moving imports behind `TYPE_CHECKING`, sync-handler thread warnings, custom 404/405 handlers that never fire, `Provide`/`Dependency` wiring, or DTO configuration. Not a source of truth for generic FastAPI/Starlette guidance or deep ORM internals.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- litestar-org/litestar-skillstheir own version, first seen Oct 4, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- litestar-org/litestar-skills★ 15same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository70 other files it gives its agents.
- agent/AGENTS.mdAGENTS.md
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- git-guardrails-claude-codeSkill
- setup-project-skillsSkill
- skill-creatorSkill
- websearchSkill
- writing-great-skillsSkill
- codebase-designSkill
- construction-craftSkill
- critical-partnerSkill
- data-intensiveSkill
- diagnosing-bugsSkill
- django-disciplineSkill
- docker-disciplineSkill
- documentation-lifecycleSkill
- domain-driven-designSkill
- enterprise-patternsSkill
- git-disciplineSkill
- legacy-codeSkill
- production-readinessSkill
- refactoring-passSkill
- resolving-merge-conflictsSkill
- tddSkill
- testing-workflowSkill
- ui-design-directionSkill
- webapp-testingSkill
- django-allauthSkill
- djangoSkill
- dockerSkill
- drfSkill
- full-calendarSkill
- giteaSkill
- htmxSkill
- http-status-codesSkill
- hyperscriptSkill
- langchainSkill
- prestashopSkill
- pykeSkill
- python-asyncSkill
- tablerSkill
- cleanroom-rewriteSkill
- councilSkill
- court-jesterSkill
- domain-modelingSkill
- fix-prSkill
- grillingSkill
- grill-meSkill
- grill-with-docsSkill
- handoffSkill
- humanifySkill
- implementSkill
- implement-specSkill
- improve-codebase-architectureSkill
- ponytail-auditSkill
- ponytail-debtSkill
- prototypeSkill
- qaSkill
- researchSkill
- restore-test-pyramidSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 1 is distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 19
Use semantic HTTP decorators: - Prefer @get, @post, @put, @patch, @delete, not @route(), unless multi-method handling is truly required.
- Very specific: line 30
Use current static-files API: - Prefer create_static_files_router().
- Distinctive: line 34
Generic FastAPI or Starlette advice: - Do not treat Litestar as a drop-in alias.
- Very specific: line 41
All files live in references/.
- Very specific: line 64
If runtime annotation availability or sync_to_thread behavior is part of the issue, say that explicitly instead of giving generic Python …
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Litestar Framework Reference
Use this skill for core Litestar framework implementation and integration: application structure, layered configuration, handlers, requests, dependency injection, DTOs, middleware, lifecycle hooks, exceptions, templating, static files, testing, websockets, and guards. Open the single best reference file from the routing table, add a second only when the task clearly crosses domains, and implement with verified Litestar patterns, not generic ASGI guesses.
Critical Rules
- Use semantic HTTP decorators - Prefer
@get,@post,@put,@patch,@delete, not@route(), unless multi-method handling is truly required. - Annotate everything - Litestar requires full argument and return type annotations for handlers. Missing annotations fail app startup.
- Keep runtime types available - Handler and dependency annotations are inspected at runtime.
TYPE_CHECKING-only imports can break signature parsing unless you providesignature_typesorsignature_namespace. - Decide sync execution explicitly - Synchronous handlers and dependencies should set
sync_to_thread=Truefor blocking work orFalsefor safe non-blocking work. Implicit sync raises warnings. - Respect layer precedence - For layered settings, the closest layer to the handler wins. Guards are the exception: they accumulate.
- Middleware order is deterministic - Middleware executes app -> router -> controller -> handler, left to right within each layer.
- Dependency keys must match kwargs - Dependency dictionary keys and injected parameter names must match exactly, and scope is limited to the declaring layer.
- Yield dependencies clean up before send - Cleanup runs after the handler returns but before the HTTP response is sent. Cleanup failures are re-raised later as
ExceptionGroup. - Request body defaults to JSON - For forms, multipart, or MessagePack, annotate
datawithBody(media_type=...). File uploads should useUploadFile. - 404 and 405 are app-layer concerns - Litestar raises router-generated
404 Not Foundand405 Method Not Allowedbefore the normal middleware stack and lower-layer exception handlers are called. Handle them at the app layer, and when explaining them, state that timing directly instead of stopping at consequences like "controller middleware does not see them." - Websocket dependencies are connection-scoped - Listener and stream dependencies are evaluated for the connection lifetime, not per message. Do not hold scarce resources for long-lived streams.
- Use current static-files API - Prefer
create_static_files_router().StaticFilesConfigis deprecated in current docs.
When Not To Use This Skill
- Generic FastAPI or Starlette advice - Do not treat Litestar as a drop-in alias. Handler signatures, DI, DTOs, layering, and websockets differ in important ways.
- ORM-specific implementation details - For deep SQLAlchemy, Piccolo, or repository-plugin behavior, use the relevant integration docs or project-specific skill.
- HTMX attribute semantics - Litestar covers HTMX integration points, not full
hx-*behavior. For swap, trigger, and attribute rules, load@htmx. - Project business rules - For app-specific architecture, load the project's custom skill.
Task Routing
All files live in references/. Add the secondary reference only when the task genuinely spans both domains.
| Task | Primary | Secondary |
Creating Litestar(...), routers, controllers, app state, lifespan, or layered config | architecture-layers.md | — |
| Building HTTP handlers, path params, request parsing, uploads, or custom requests | handlers-requests.md | — |
Implementing DI, Provide, Dependency, or DTO configuration | dependencies-dto.md | — |
| Adding middleware, lifecycle hooks, or exception handlers | middleware-hooks-errors.md | — |
| Building websocket listeners, streams, or Litestar tests | websockets-testing.md | — |
| Rendering templates or serving static files | templating-static.md | — |
| HTMX plugin usage, template engine extras, or framework boundary questions | integrations.md | — |
| Multipart upload endpoint with DTO or dependency validation | handlers-requests.md | dependencies-dto.md |
| Custom error handling that fails for 404 or 405 | middleware-hooks-errors.md | architecture-layers.md |
| HTMX partial rendering in a Litestar app | integrations.md | templating-static.md |
| Websocket endpoint with auth or connection-scoped resources | websockets-testing.md | dependencies-dto.md |
Startup failure after TYPE_CHECKING imports or forward refs | handlers-requests.md | architecture-layers.md |
| Warnings or confusion around sync handlers and thread offloading | handlers-requests.md | architecture-layers.md |
| Cross-cutting routing help | REFERENCE.md | — |
Output Expectations
- Name the reference files used and call out the Litestar rules that matter for the change.
- State the minimum verification steps: tests, startup validation, request or websocket checks, or OpenAPI checks.
- If runtime annotation availability or
sync_to_threadbehavior is part of the issue, say that explicitly instead of giving generic Python advice. - Flag any 2.x vs 3.0 transition or deprecation risk if it affects the task.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

