dj-architecture

dj-architecture is a skill for Claude Code from dvf/opinionated-django. It costs 78 tokens per session (3,872 once invoked), scanned A, original, MIT.

A set of rules for adding features to a Django application, a Python framework for building web software, using the project's required structure and tools.

In plain words
What is it for?
It helps add entities, endpoints, apps, and business logic while following the specified ID, repository, data-transfer, service, API, background-task, and testing patterns.
Why use it?
It prevents new code from conflicting with the project's conventions and keeps data access, business logic, APIs, and tests organized.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is uv run python src/manage.py makemigrations && uv run python src/manage.py migrate.

Good fit It helps add entities, endpoints, apps, and business logic while following the specified ID, repository, data-transfer, service, API, background-task, and testing patterns.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/dvf/opinionated-django
agentmods
npx agentmods add skills/dvf/opinionated-django/dj-architecture

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for dj-architecture

README.md
[![agentmods](https://agentmods.dev/badge/skills/dvf/opinionated-django/dj-architecture/github.svg)](https://agentmods.dev/skills/dvf/opinionated-django/dj-architecture)
Your own site
<a href="https://agentmods.dev/skills/dvf/opinionated-django/dj-architecture"><img src="https://agentmods.dev/badge/skills/dvf/opinionated-django/dj-architecture/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for dj-architecture

Your own site · 80×15
<a href="https://agentmods.dev/skills/dvf/opinionated-django/dj-architecture"><img src="https://agentmods.dev/badge/skills/dvf/opinionated-django/dj-architecture.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 78 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,872 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00078 $0.03872
Opus 5 $0.00039 $0.01936
Sonnet 5 $0.00016 $0.00774
Haiku 4.5 $0.00008 $0.00387

Measured 11d ago against content hash cecd43376920, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

dj-architecture scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/dj-architecture/SKILL.md · 433 lines

How it starts

The opening of the file, as written. The whole thing — 433 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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
  • Any existing app the feature touches

Then state your implementation plan: models, DTOs, repos, services, routes, tests, and ID prefixes.


LAYER-BY-LAYER IMPLEMENTATION

Follow this exact order. Do not skip layers. Each layer has rules that are non-negotiable.

Layer 1: ID Generator

Add to src/project/ids.py:

generate_xxx_id = _make_generator("xxx")  # 3-4 char prefix

Prefixes must be unique across the project and short enough to be readable in logs.

Layer 2: Model

File: src/<app>/models/<entity>.py

Follow the models skill for full conventions. The key rules:

Read the full file on GitHub · 433 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 433 lines · 78 tokens per session scan A cecd43376920

Subscribe to this mod's changes

dj-architecture is a skill published in the GitHub repository dvf/opinionated-django (110 stars, last pushed 27d ago), licensed MIT. It adds 78 tokens to every session and 3,872 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.