Generate django-modern-rest transport-layer skeletons from OpenAPI 3.1+ specs. Use when Codex needs to turn an OpenAPI file, URL, or pasted document into typed DTOs, controllers, routers, Django URL wiring, and minimal tests for this repository or similar projects built on dmr. Trigger on requests to scaffold APIs, bootstrap apps, or map OpenAPI operations to Controller, Router, and OpenAPI view constructs without implementing business logic.
72
88%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Low
Low-risk findings worth noting
Generate runnable transport-layer skeletons for django-modern-rest from OpenAPI 3.1+ specifications. Keep the output intentionally thin: produce typed DTOs, base controllers, routers, docs wiring, and minimal tests, with zero business logic by default.
Use the repository examples under django_test_app/server/apps/* and tests/* as the local source of truth. Read references/framework-patterns.md when choosing dmr constructs, references/project-map.md when deciding where generated files should live, and references/spec-fidelity.md whenever a source OpenAPI document is authoritative and the generated project should preserve the public contract closely enough for a useful boilerplate.
Primary framework documentation:
openapi is 3.1.x or newer. If the document is older, ambiguous, or incomplete, say so before generating files.oneOf, anyOf, allOf, discriminators, multiple media types, callbacks, and webhook sections.wemake-django-template as the project base unless the user explicitly asks for a plain Django skeleton.wemake-django-template.uv when the target repository does not already enforce another tool.poetry when the target repository already uses pyproject.toml with Poetry.pip only when the user explicitly asks for it or the environment is intentionally minimal.django-modern-rest together with the extras needed by the generated code.django-modern-rest[pydantic].django-modern-rest[msgspec] as well, even for Pydantic projects, because local docs recommend msgspec for faster JSON parsing and rendering.django-modern-rest[jwt] only when the OpenAPI security model and the user request require JWT support.3.11+ and Django 5.0+.'dmr' to INSTALLED_APPS unless the generated project must serve static files for OpenAPI docs.django-modern-rest[openapi], openapi-spec-validator, or schemathesis unless the repository already has them or the user explicitly asks for them.wemake-django-template is used, layer the generated DTOs, controllers, routers, docs wiring, and tests on top of its structure instead of rebuilding the project shell by hand.views.py and urls.py for every app.serializers.py when an app has reusable request and response DTOs. Keep tiny private helper models inline only when that matches the surrounding code better.urls.py OpenAPI docs wiring for every runnable project skeleton.PydanticSerializer by default.MsgspecSerializer only when the repository already standardizes on it or the user explicitly asks for it.PydanticSerializer for complex OpenAPI 3.1 features such as unions, discriminators, aliases, nullability, rich field constraints, or mixed content models.Body[...].Query[...].Path[...].Headers[...].Cookies[...].components.schemas parity if the public API contract is already preserved.ControllersoperationId when it is stable and explicit. Otherwise derive names from resource plus verb such as UserListController, UserCreateController, or InvoiceRetrieveController.@modify(status_code=HTTPStatus.NO_CONTENT) and -> None for 204 or 304 style endpoints.self.to_response(...) only when low-level response construction is actually required.TODO comments where persistence, orchestration, auth backends, or external integrations would normally start.Router([...], prefix='.../').path(...) or re_path(...) inside the router exactly as local code does.include((router.urls, 'app_name'), namespace='...').build_schema(...), OpenAPIJsonView, RedocView, SwaggerView, and ScalarView./api/ prefix, trailing slash, or kebab-case rewrite unless the user explicitly wants the public API shape changed.pyproject.toml or the package-manager equivalent consistent with the chosen tool.manage.py, Django settings, root urls.py, and app package initializers when they do not exist yet.uv run python manage.py runserver or poetry run python manage.py runserver.openapi, redoc, swagger, and scalar endpoints in runnable skeletons.info, externalDocs, servers, tags), or docs endpoints not opening.title keys) as acceptable after brief disclosure.ResponseSpec through responses = (...), @modify(extra_responses=[...]), or @validate(...).Body[...] to methods that normally forbid a request body unless the spec truly requires it and the user accepts explicit HttpSpec overrides.TODO instead of inventing a backend.operationId when possible.uv add 'django-modern-rest[msgspec, openapi]',
poetry add 'django-modern-rest[msgspec, openapi]',
or pip install 'django-modern-rest[msgspec, openapi]',
then extend with extras as needed.OpenAPIConfig: title, version, summary, description, terms_of_service, contact, license, external_docs, servers, and tags.application/json and application/xml, generate matching parsers and renderers or explicitly state that fidelity is partial. Do not silently collapse the contract to JSON-only.application/x-www-form-urlencoded when the source spec declares it, and keep application/octet-stream or file-style bodies explicit in the generated endpoint contract.minimal-working mode: generate minimal passthrough parser and renderer placeholders so endpoints stay callable with curl while still marked as TODO.
strict-stub mode: generate parser and renderer stubs that raise NotImplementedError.Unsupported media type "<media_type>" is not implemented in this project. Choose scaffold mode: "minimal-working" (callable TODO placeholder) or "strict-stub" (NotImplementedError stub).dmr.errors.ErrorModel, APIError, and related built-in error mechanics over custom source-specific error DTOs unless the user explicitly asks to preserve a custom error schema.ResponseSpec(..., headers={...}) instead of dropping them.DMR_SETTINGS = {Settings.semantic_responses: False}.security_scheme and security_requirement expose the source OpenAPI contract, even if the runtime auth logic itself is still a TODO.views.py with typed controllers and placeholder implementations.urls.py with Router wiring for every generated app.preserved contract,
requires user approval.ebee1f2
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.