AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Litestar Di

skill-litestar-org-litestar-skills-litestar-di · by litestar-org

Auto-activate for Provide, NamedDependency, SkipValidation, Dependency(skip_validation=True), dependencies=, litestar.di, Dishka FromDishka, Inject, or providers. Not for plain parameters.

No reviews yet
0 installs
22 views
0.0% view→install

Install

$ agentstack add skill-litestar-org-litestar-skills-litestar-di

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-litestar-org-litestar-skills-litestar-di)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
2mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Litestar Di? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Litestar Dependency Injection

Use this skill for Provide, NamedDependency / SkipValidation (Litestar ≥ 2.23), dependency maps, provider factories, request-scoped resources, and Dishka integration.

Code Style Rules

  • Prefer NamedDependency[T] and NamedDependency[SkipValidation[T]] (≥ 2.24) over implicit DI / Annotated[T, Dependency()] / Dependency(skip_validation=True); params.Dependency and implicit dependency injection are deprecated (removed in 3.0).
  • Use Litestar dependency maps for simple and medium apps.
  • Use Dishka when the project needs explicit scopes and provider modules.
  • Keep provider names stable and descriptive.
  • Do not open request-scoped resources at import time.

Quick Reference

  • DI patterns: [di.md](references/di.md)
  • Pair with [litestar-data-services](../litestar-data-services/SKILL.md) for service providers.
  • Pair with [litestar-settings](../litestar-settings/SKILL.md) for settings injection.

Workflow

  1. Identify whether the dependency is app, request, transaction, or function scoped.
  2. Choose built-in dependency maps or the existing DI framework.
  3. Register providers at the narrowest useful scope.
  4. Inject dependencies by name or type according to the chosen stack.

Guardrails

  • Do not introduce Dishka for one or two simple providers.
  • Do not mix dependency naming conventions in one app.
  • Do not keep database sessions or clients as global mutable state.
  • Do not hide business logic inside providers.

Validation Checkpoint

  • [ ] Dependency scope is explicit.
  • [ ] Providers are async when they manage async resources.
  • [ ] Tests can override providers cleanly.
  • [ ] Provider wiring matches the app's existing DI style.

Example

from litestar.di import NamedDependency, Provide

async def provide_user_service(db_session: NamedDependency[AsyncSession]) -> UserService:
    return UserService(session=db_session)

dependencies = {"users_service": Provide(provide_user_service)}

References Index

  • [di.md](references/di.md)

Official References

  • - Litestar documentation
  • - Litestar API reference

Shared Styleguide Baseline

  • [General](../litestar-styleguide/references/general.md)
  • [Python](../litestar-styleguide/references/python.md)
  • [Litestar](../litestar-styleguide/references/litestar.md)

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.