{"id":"37226d3e-6b29-4628-b62b-a0678b0a3a7f","shortId":"5DkbjK","kind":"skill","title":"litestar-dto-openapi","tagline":"Auto-activate for MsgspecDTO, DTOConfig, litestar.dto, OpenAPIConfig, request body schemas, response DTOs, schema_extra, RequestEncodingType, or /schema output. Use when shaping Litestar DTOs, OpenAPI schemas, wire names, request encoding, or response models. Not for persistence ","description":"# Litestar DTO and OpenAPI\n\nUse this skill for DTO selection, msgspec-first schemas, request/response typing, and OpenAPI shape.\n\n## Code Style Rules\n\n- Prefer msgspec DTOs in Litestar apps unless the project is already Pydantic-led.\n- Keep persistence models separate from API DTOs.\n- Use camelCase wire names while Python stays snake_case.\n- Exclude server-owned fields from write DTOs.\n\n## Quick Reference\n\n- DTO patterns: [dto.md](references/dto.md)\n- Pair with [litestar-data-services](../litestar-data-services/SKILL.md) when mapping service results.\n- Pair with [msgspec](../msgspec/SKILL.md) for deeper Struct modeling.\n\n<workflow>\n\n## Workflow\n\n1. Identify input, output, and persistence shapes separately.\n2. Choose msgspec DTOs or match the existing Pydantic stack.\n3. Configure excludes, partial updates, rename behavior, and media type.\n4. Check the generated OpenAPI schema.\n\n</workflow>\n\n<guardrails>\n\n## Guardrails\n\n- Do not leak internal persistence-only fields into write DTOs.\n- Do not switch an existing Pydantic-heavy project to msgspec opportunistically.\n- Do not rely on untyped dict payloads when request shape is known.\n- Do not treat OpenAPI as documentation only; it is the contract.\n\n</guardrails>\n\n<validation>\n\n## Validation Checkpoint\n\n- [ ] Request and response DTOs are explicit.\n- [ ] Wire names match the API convention.\n- [ ] Server-owned fields are excluded from writes.\n- [ ] /schema output matches the intended contract.\n\n</validation>\n\n<example>\n\n## Example\n\n```python\nfrom litestar.dto import DTOConfig, MsgspecDTO\n\nclass UserWriteDTO(MsgspecDTO[UserWrite]):\n    config = DTOConfig(exclude={\"id\", \"created_at\"})\n```\n\n</example>\n\n## References Index\n\n- [dto.md](references/dto.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","dto","openapi","skills","litestar-org","advanced-alchemy","agent-skills","agentskills","ai-agents","claude-code-plugin","claude-code-skills","gemini-cli-extension"],"capabilities":["skill","source-litestar-org","skill-litestar-dto-openapi","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-dto-openapi","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,080 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:53.703Z","embedding":null,"createdAt":"2026-05-18T13:20:57.020Z","updatedAt":"2026-05-18T19:13:53.703Z","lastSeenAt":"2026-05-18T19:13:53.703Z","tsv":"'/latest/reference/':264 '/litestar-data-services/skill.md':113 '/litestar-styleguide/references/general.md':272 '/litestar-styleguide/references/litestar.md':276 '/litestar-styleguide/references/python.md':274 '/msgspec/skill.md':121 '/schema':22,230 '1':127 '2':135 '3':145 '4':155 'activ':7 'alreadi':73 'api':82,220,266 'app':68 'auto':6 'auto-activ':5 'baselin':270 'behavior':151 'bodi':14 'camelcas':85 'case':92 'check':156 'checkpoint':209 'choos':136 'class':243 'code':60 'config':247 'configur':146 'contract':207,235 'convent':221 'creat':251 'data':111 'deeper':123 'dict':190 'docs.litestar.dev':259,263 'docs.litestar.dev/latest/reference/':262 'document':202,261 'dto':3,42,49,103 'dto.md':105,255 'dtoconfig':10,241,248 'dtos':17,28,65,83,100,138,172,213 'encod':34 'exampl':236 'exclud':93,147,227,249 'exist':142,177 'explicit':215 'extra':19 'field':97,169,225 'first':53 'general':271 'generat':158 'guardrail':161 'heavi':180 'id':250 'identifi':128 'import':240 'index':254 'input':129 'intend':234 'intern':165 'keep':77 'known':196 'leak':164 'led':76 'litestar':2,27,41,67,110,260,265,275 'litestar-data-servic':109 'litestar-dto-openapi':1 'litestar.dto':11,239 'map':115 'match':140,218,232 'media':153 'model':37,79,125 'msgspec':52,64,120,137,183 'msgspec-first':51 'msgspecdto':9,242,245 'name':32,87,217 'offici':257 'openapi':4,29,44,58,159,200 'openapiconfig':12 'opportunist':184 'output':23,130,231 'own':96,224 'pair':107,118 'partial':148 'pattern':104 'payload':191 'persist':40,78,132,167 'persistence-on':166 'prefer':63 'project':71,181 'pydant':75,143,179 'pydantic-heavi':178 'pydantic-l':74 'python':89,237,273 'quick':101 'refer':102,253,258,267 'references/dto.md':106,256 'reli':187 'renam':150 'request':13,33,193,210 'request/response':55 'requestencodingtyp':20 'respons':16,36,212 'result':117 'rule':62 'schema':15,18,30,54,160 'select':50 'separ':80,134 'server':95,223 'server-own':94,222 'servic':112,116 'shape':26,59,133,194 'share':268 'skill':47 'skill-litestar-dto-openapi' 'snake':91 'source-litestar-org' 'stack':144 'stay':90 'struct':124 'style':61 'styleguid':269 'switch':175 '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' 'treat':199 'type':56,154 'unless':69 'untyp':189 'updat':149 'use':24,45,84 'userwrit':246 'userwritedto':244 'valid':208 'wire':31,86,216 'workflow':126 'write':99,171,229","prices":[{"id":"cd7292e6-d49e-4fac-a9f4-66e0cd3fb5d7","listingId":"37226d3e-6b29-4628-b62b-a0678b0a3a7f","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:57.020Z"}],"sources":[{"listingId":"37226d3e-6b29-4628-b62b-a0678b0a3a7f","source":"github","sourceId":"litestar-org/litestar-skills/litestar-dto-openapi","sourceUrl":"https://github.com/litestar-org/litestar-skills/tree/main/skills/litestar-dto-openapi","isPrimary":false,"firstSeenAt":"2026-05-18T13:20:57.020Z","lastSeenAt":"2026-05-18T19:13:53.703Z"}],"details":{"listingId":"37226d3e-6b29-4628-b62b-a0678b0a3a7f","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"litestar-org","slug":"litestar-dto-openapi","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":"9d164190a028a9f14b348b2b20bb6bf9a4ad9620","skill_md_path":"skills/litestar-dto-openapi/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/litestar-org/litestar-skills/tree/main/skills/litestar-dto-openapi"},"layout":"multi","source":"github","category":"litestar-skills","frontmatter":{"name":"litestar-dto-openapi","description":"Auto-activate for MsgspecDTO, DTOConfig, litestar.dto, OpenAPIConfig, request body schemas, response DTOs, schema_extra, RequestEncodingType, or /schema output. Use when shaping Litestar DTOs, OpenAPI schemas, wire names, request encoding, or response models. Not for persistence models alone or non-Litestar API schema tools."},"skills_sh_url":"https://skills.sh/litestar-org/litestar-skills/litestar-dto-openapi"},"updatedAt":"2026-05-18T19:13:53.703Z"}}