{"id":"c94ca085-bdb3-4c13-a416-cb3859dc71a4","shortId":"EkWCGv","kind":"skill","title":"litestar-settings","tagline":"Auto-activate for get_env, dataclass settings, pydantic_settings, BaseSettings, lru_cache settings factories, app.state settings, LITESTAR_APP, env var parsing, or typed app config. Use when defining Litestar settings, config factories, env loading, or settings injection. Not for","description":"# Litestar Settings\n\nUse this skill for typed settings, env loading, cached settings factories, and app-state wiring.\n\n## Code Style Rules\n\n- Use dataclass settings plus get_env for fresh Litestar apps.\n- Use pydantic-settings when the project already depends on Pydantic for config.\n- Cache settings once per process.\n- Keep secret values out of logs and generated docs.\n\n## Quick Reference\n\n- Settings patterns: [settings.md](references/settings.md)\n- Pair with [litestar-di](../litestar-di/SKILL.md) for settings providers.\n- Pair with [litestar-deployment](../litestar-deployment/SKILL.md) for runtime env wiring.\n\n<workflow>\n\n## Workflow\n\n1. Inventory required env vars and defaults.\n2. Choose dataclass settings or the existing Pydantic settings path.\n3. Add a cached factory.\n4. Inject settings through app state or DI.\n\n</workflow>\n\n<guardrails>\n\n## Guardrails\n\n- Do not parse env vars repeatedly in handlers.\n- Do not use msgspec Structs for env loading.\n- Do not bake environment-specific values into code.\n- Do not log secrets while debugging config.\n\n</guardrails>\n\n<validation>\n\n## Validation Checkpoint\n\n- [ ] Settings are typed.\n- [ ] Settings are cached.\n- [ ] Required values fail early.\n- [ ] Tests can override settings without mutating global process env unexpectedly.\n\n</validation>\n\n<example>\n\n## Example\n\n```python\nfrom dataclasses import dataclass, field\nfrom functools import lru_cache\nfrom os import getenv\n\ndef get_env(key: str, default: str) -> str:\n    return getenv(key, default)\n\n@dataclass(frozen=True)\nclass AppSettings:\n    name: str = field(default_factory=lambda: get_env(\"APP_NAME\", \"api\"))\n\n@lru_cache(maxsize=1)\ndef get_settings() -> AppSettings:\n    return AppSettings()\n```\n\n</example>\n\n## References Index\n\n- [settings.md](references/settings.md)\n\n## Official References\n\n- <https://docs.litestar.dev/> - Litestar documentation\n- <https://docs.litestar.dev/latest/reference/> - Litestar API reference\n\n## Shared Styleguide Baseline\n\n- [General](../litestar-styleguide/references/general.md)\n- [Python](../litestar-styleguide/references/python.md)\n- [Litestar](../litestar-styleguide/references/litestar.md)","tags":["litestar","settings","skills","litestar-org","advanced-alchemy","agent-skills","agentskills","ai-agents","claude-code-plugin","claude-code-skills","gemini-cli-extension","htmx"],"capabilities":["skill","source-litestar-org","skill-litestar-settings","topic-advanced-alchemy","topic-agent-skills","topic-agentskills","topic-ai-agents","topic-claude-code-plugin","topic-claude-code-skills","topic-gemini-cli-extension","topic-htmx","topic-inertia","topic-litestar","topic-mcp","topic-python"],"categories":["litestar-skills"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/litestar-org/litestar-skills/litestar-settings","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add litestar-org/litestar-skills","source_repo":"https://github.com/litestar-org/litestar-skills","install_from":"skills.sh"}},"qualityScore":"0.453","qualityRationale":"deterministic score 0.45 from registry signals: · indexed on github topic:agent-skills · 7 github stars · SKILL.md body (2,148 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-05-18T19:13:54.759Z","embedding":null,"createdAt":"2026-05-18T13:20:58.685Z","updatedAt":"2026-05-18T19:13:54.759Z","lastSeenAt":"2026-05-18T19:13:54.759Z","tsv":"'/latest/reference/':278 '/litestar-deployment/skill.md':122 '/litestar-di/skill.md':113 '/litestar-styleguide/references/general.md':286 '/litestar-styleguide/references/litestar.md':290 '/litestar-styleguide/references/python.md':288 '1':128,260 '2':135 '3':145 '4':150 'activ':6 'add':146 'alreadi':82 'api':256,280 'app':22,28,59,74,154,254 'app-stat':58 'app.state':19 'appset':245,264,266 'auto':5 'auto-activ':4 'bake':177 'baselin':284 'baseset':14 'cach':16,54,88,148,198,224,258 'checkpoint':192 'choos':136 'class':244 'code':62,183 'config':29,35,87,190 'dataclass':10,66,137,216,218,241 'debug':189 'def':229,261 'default':134,234,240,249 'defin':32 'depend':83 'deploy':121 'di':112,157 'doc':101 'docs.litestar.dev':273,277 'docs.litestar.dev/latest/reference/':276 'document':275 'earli':202 'env':9,23,37,52,70,125,131,162,173,211,231,253 'environ':179 'environment-specif':178 'exampl':213 'exist':141 'factori':18,36,56,149,250 'fail':201 'field':219,248 'fresh':72 'frozen':242 'functool':221 'general':285 'generat':100 'get':8,69,230,252,262 'getenv':228,238 'global':209 'guardrail':158 'handler':166 'import':217,222,227 'index':268 'inject':41,151 'inventori':129 'keep':93 'key':232,239 'lambda':251 'litestar':2,21,33,44,73,111,120,274,279,289 'litestar-deploy':119 'litestar-di':110 'litestar-set':1 'load':38,53,174 'log':98,186 'lru':15,223,257 'maxsiz':259 'msgspec':170 'mutat':208 'name':246,255 'offici':271 'os':226 'overrid':205 'pair':108,117 'pars':25,161 'path':144 'pattern':105 'per':91 'plus':68 'process':92,210 'project':81 'provid':116 'pydant':12,77,85,142 'pydantic-set':76 'python':214,287 'quick':102 'refer':103,267,272,281 'references/settings.md':107,270 'repeat':164 'requir':130,199 'return':237,265 'rule':64 'runtim':124 'secret':94,187 'set':3,11,13,17,20,34,40,45,51,55,67,78,89,104,115,138,143,152,193,196,206,263 'settings.md':106,269 'share':282 'skill':48 'skill-litestar-settings' 'source-litestar-org' 'specif':180 'state':60,155 'str':233,235,236,247 'struct':171 'style':63 'styleguid':283 'test':203 'topic-advanced-alchemy' 'topic-agent-skills' 'topic-agentskills' 'topic-ai-agents' 'topic-claude-code-plugin' 'topic-claude-code-skills' 'topic-gemini-cli-extension' 'topic-htmx' 'topic-inertia' 'topic-litestar' 'topic-mcp' 'topic-python' 'true':243 'type':27,50,195 'unexpect':212 'use':30,46,65,75,169 'valid':191 'valu':95,181,200 'var':24,132,163 'wire':61,126 'without':207 'workflow':127","prices":[{"id":"b0a0372f-66e9-4612-b194-e63081bef82b","listingId":"c94ca085-bdb3-4c13-a416-cb3859dc71a4","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"litestar-org","category":"litestar-skills","install_from":"skills.sh"},"createdAt":"2026-05-18T13:20:58.685Z"}],"sources":[{"listingId":"c94ca085-bdb3-4c13-a416-cb3859dc71a4","source":"github","sourceId":"litestar-org/litestar-skills/litestar-settings","sourceUrl":"https://github.com/litestar-org/litestar-skills/tree/main/skills/litestar-settings","isPrimary":false,"firstSeenAt":"2026-05-18T13:20:58.685Z","lastSeenAt":"2026-05-18T19:13:54.759Z"}],"details":{"listingId":"c94ca085-bdb3-4c13-a416-cb3859dc71a4","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"litestar-org","slug":"litestar-settings","github":{"repo":"litestar-org/litestar-skills","stars":7,"topics":["advanced-alchemy","agent-skills","agentskills","ai-agents","claude-code-plugin","claude-code-skills","gemini-cli-extension","htmx","inertia","litestar","mcp","python","sqlspec"],"license":"mit","html_url":"https://github.com/litestar-org/litestar-skills","pushed_at":"2026-05-13T16:04:09Z","description":"Opinionated first-party agent skills, plugins, subagents, slash commands, and MCP servers for the Litestar framework ecosystem — publishable to Claude Code, Gemini CLI, Codex CLI, Cursor, OpenCode, and VS Code/Copilot from a single repo.","skill_md_sha":"bb77d9775e19606ea6bfee193beeec76915cf2f8","skill_md_path":"skills/litestar-settings/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/litestar-org/litestar-skills/tree/main/skills/litestar-settings"},"layout":"multi","source":"github","category":"litestar-skills","frontmatter":{"name":"litestar-settings","description":"Auto-activate for get_env, dataclass settings, pydantic_settings, BaseSettings, lru_cache settings factories, app.state settings, LITESTAR_APP, env var parsing, or typed app config. Use when defining Litestar settings, config factories, env loading, or settings injection. Not for frontend environment variables or deployment secrets management alone."},"skills_sh_url":"https://skills.sh/litestar-org/litestar-skills/litestar-settings"},"updatedAt":"2026-05-18T19:13:54.759Z"}}