django-architecture-enforcer

Enforce three-layer Django/DRF architecture by detecting violations in views and services.

1|Updated Mar 17, 2025
One-click install
npx skills add https://github.com/MaciWP/CV_Astro --skill django-architecture-enforcer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: django-architecture-enforcer
Source: https://github.com/MaciWP/CV_Astro/tree/main/.claude/skills/django-architecture-enforcer
Command: npx skills add https://github.com/MaciWP/CV_Astro --skill django-architecture-enforcer

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires Django, Django REST Framework, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill automatically enforces a clean service layer architecture in Django/DRF applications, preventing business logic from cluttering views and serializers, leading to more maintainable, testable, and scalable code.

Core Features & Use Cases

  • Three-Layer Architecture: Guides and enforces strict separation between Views (HTTP), Services (Business Logic), and Models (Data).
  • Violation Detection: Automatically identifies critical anti-patterns like ORM calls or email sending in views, and missing dependency injection in services.
  • Use Case: Refactor a monolithic Django ViewSet that currently performs ORM operations and sends emails directly, moving all business logic to a new service layer with dependency injection and proper type hints.

Quick Start

Refactor a Django ViewSet that currently performs ORM operations and sends emails directly, moving all business logic to a new service layer with dependency injection.