architecture

Installation
SKILL.md

Implement a Django Feature

You are implementing a feature in an opinionated, fully type-safe Django project managed with uv. Every convention below is mandatory. Do not deviate.

Why this architecture exists: Django's ORM is powerful but hard to type — querysets, model instances, related managers, and F()/Q() expressions don't play well with static type checkers. This project solves that by pushing all ORM usage into repositories that return Pydantic DTOs. Services receive repos via constructor injection and contain pure business logic with zero ORM imports. Views are thin dispatchers. The result: everything from the repository boundary outward is fully typed, IDE-friendly, and testable in isolation.

Tooling: uv is the package manager. All commands use uv run. Never use pip, poetry, or raw python — always uv run python, uv run pytest, etc. To add a dependency: uv add <package>.

BEFORE WRITING CODE

Gather current project state by reading:

  • src/project/ids.py — existing ID prefixes (must be unique)
  • src/project/services.py — registered repos/services
  • src/project/settings.pyINSTALLED_APPS
  • src/project/api/__init__.pyNinjaAPI(), mounted resource routers, exception handlers
  • src/project/api/<resource>/ — existing per-resource route packages
  • src/project/types.pyAuthedRequest and other shared request types
  • ARCHITECTURE.md if present — full pattern reference
Related skills

More from dvf/opinionated-django

Installs
11
GitHub Stars
105
First Seen
Apr 11, 2026