advanced-alchemy
Auto-activate for advanced_alchemy imports, alembic/, SQLAlchemyAsyncRepositoryService, SQLAlchemyAsyncConfig, repository_type, service_class, filters, or…
Auto-activate for litestar_autowire, AutowirePlugin, AutowireConfig, domain_packages, AutowireIntegration, AutowireLoader, or clear_autowire_cache. Not for manual Router composition — use explicit routes.
$ npx -y skills add litestar-org/litestar-skills --skill litestar-autowire --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/litestar-autowireContext preview
The summary Claude sees to decide when to auto-load this skill.
Auto-activate for litestar_autowire, AutowirePlugin, AutowireConfig, domain_packages, AutowireIntegration, AutowireLoader, or clear_autowire_cache. Not for manual Router composition — use explicit routes.
name: litestar-autowire description: "Auto-activate for litestar_autowire, AutowirePlugin, AutowireConfig, domain_packages, AutowireIntegration, AutowireLoader, or clear_autowire_cache. Not for manual Router composition — use explicit routes."
`litestar-autowire` 0.2.0 discovers Litestar controllers and event listeners from domain packages. It can also load optional integration modules without turning application setup into a central list of every domain component.
Use Autowire when the project already groups features into stable Python packages. Keep manual `Router` and plugin composition when the app is small, route registration is intentionally explicit, or packages do not follow a consistent convention.
wraps their domain-owned components.
pip install litestar-autowire==0.2.0
Install only the integrations already used by the project:
pip install "litestar-autowire[dishka]==0.2.0" pip install "litestar-autowire[queues]==0.2.0"
my_app/
└── domains/
├── accounts/
│ ├── controllers.py
│ ├── events.py
│ └── jobs.py
└── billing/
└── routes.pyRegular packages and PEP 420 namespace packages are supported. Autowire checks the configured root and each direct child package. Read [Discovery](references/discovery.md) before changing module conventions or debugging a missing component.
from litestar import Litestar
from litestar_autowire import AutowireConfig, AutowirePlugin
autowire = AutowirePlugin(
AutowireConfig(domain_packages=["my_app.domains"]),
)
app = Litestar(plugins=[autowire])The default component modules are:
| Component | Module names | Enabled | | --- | --- | --- | | Controllers | `controllers`, `routes`, `controller`, `route` | Yes | | Event listeners | `events`, `listeners` | Yes | | Litestar Queues tasks | `jobs` | Only with `integrations=["queues"]` |
Customize module names without changing the domain layout:
config = AutowireConfig(
domain_packages=["my_app.domains"],
controller_modules=["http"],
listener_modules=["subscribers"],
discover_listeners=False,
)By default, discovered controller classes are appended directly to `AppConfig.route_handlers`. Set `router_class=Router` when the project needs a wrapper for router-level `before_request` or `after_response` hooks:
from litestar import Router
from litestar_autowire import AutowireConfig
config = AutowireConfig(
domain_packages=["my_app.domains"],
router_class=Router,
before_request=set_request_context,
after_response=record_response,
)The wrapper is constructed with `path="/"`, the discovered controller classes, and the configured hooks. Use `integrations=["dishka"]` instead when the project already uses Dishka and needs `DishkaRouter`. See [Integrations](references/integrations.md).
<workflow>
1. Inspect the project layout and confirm domains are importable package roots. 2. Choose Autowire only when domain packages follow consistent controller or listener module conventions. 3. Register one `AutowirePlugin(AutowireConfig(...))` in the app plugin list. 4. Keep the default module names or configure explicit module-name tuples. 5. Enable only integrations already present in the project stack. 6. Configure Dishka or Litestar Queues through their own application plugins. 7. Test discovery, error propagation, and cache isolation with the patterns in [Testing](references/testing.md).
</workflow>
<guardrails>
configured root and direct feature children; component modules may themselves contain importable leaf modules.
`Controller` subclasses and `EventListener` objects.
must be selected and its optional dependency installed.
package or absent target component module is skipped.
`DishkaIntegration` preserves an already selected router class.
name collisions fail during configuration.
process-local caches before rediscovery.
</guardrails>
<validation>
re-exported into it.
domain.
</validation>
<example>
from litestar import Controller, get class
Opinionated, first-party agent skills, plugins, subagents, slash commands, and MCP servers for the Litestar framework and its ecosystem — publishable to every major AI agent and IDE from a single repo.
Repo: litestar-org/litestar-skills
Auto-activate for advanced_alchemy imports, alembic/, SQLAlchemyAsyncRepositoryService, SQLAlchemyAsyncConfig, repository_type, service_class, filters, or…
Auto-activate for Google ADK, LlmAgent, Runner, SQLSpecSessionService, Vertex AI, SSE agent chats, tool calls, or Litestar model workflows. Not for offline ML…
Auto-activate for guards=, Guard, ASGIConnection, JWTAuth, JWTCookieAuth, SessionAuth, role or tenant checks, or WebSocket auth. Not for frontend route…
Auto-activate for uv build, hatch build, PyApp, PYAPP_*, wheel assets, GitHub release matrices, cargo-zigbuild, or python-build-standalone. Not for runtime…
Auto-activate for SQLAlchemyAsyncRepositoryService, SQLSpecAsyncService, create_filter_dependencies, LimitOffsetFilter, OffsetPagination, filters, or CRUD…
Auto-activate for Dockerfile, compose, Railway, Cloud Run, GKE, systemd, Kubernetes, Terraform, deploy scripts, or granian/litestar run at runtime. Not for…