django-import-enforcer

django-import-enforcer is a skill for Claude Code from smicolon/ai-kit. It costs 41 tokens per session (1,278 once invoked), scanned A, original, MIT.

A coding tool for checking Django imports, where Django is a Python web framework. It changes imports to absolute paths and uses aliases for modular code.

In plain words
What is it for?
It validates and fixes imports when writing, creating, or modifying Django and Python files, or when existing import statements need review.
Why use it?
It helps prevent inconsistent or unwanted import patterns as Python files are created or edited.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the django plugin — 8 skills shipped together

Good fit It validates and fixes imports when writing, creating, or modifying Django and Python files, or when existing import statements need review.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/smicolon/ai-kit/import-convention-enforcer
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add smicolon/ai-kit --skill import-convention-enforcer
Clone the repo
git clone --depth 1 https://github.com/smicolon/ai-kit

Made for: Claude Code.

Or install django, the plugin that ships this one along with the rest of its 8 skills.

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 django-import-enforcer

README.md
[![agentmods](https://agentmods.dev/badge/skills/smicolon/ai-kit/import-convention-enforcer/github.svg)](https://agentmods.dev/skills/smicolon/ai-kit/import-convention-enforcer)
Your own site
<a href="https://agentmods.dev/skills/smicolon/ai-kit/import-convention-enforcer"><img src="https://agentmods.dev/badge/skills/smicolon/ai-kit/import-convention-enforcer/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 django-import-enforcer

Your own site · 80×15
<a href="https://agentmods.dev/skills/smicolon/ai-kit/import-convention-enforcer"><img src="https://agentmods.dev/badge/skills/smicolon/ai-kit/import-convention-enforcer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 41 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,278 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.
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.00041 $0.01278
Opus 5 $0.00020 $0.00639
Sonnet 5 $0.00008 $0.00256
Haiku 4.5 $0.00004 $0.00128

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

Security

Grade A, and why

django-import-enforcer 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 6d 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.

packs/django/skills/import-convention-enforcer/SKILL.md · 227 lines

How it starts

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

Import Convention Enforcer

Enforces absolute modular import conventions for Django projects.

Activation Triggers

This skill activates when:

  • Writing or modifying Python files
  • Creating models, services, views, or serializers
  • Mentioning "import", "add", "create", or "refactor"
  • Reviewing or fixing code

Django Import Pattern (MANDATORY)

✅ CORRECT Pattern

# Absolute modular imports with app-prefixed aliases
import users.models as _users_models
import users.services as _users_services
import users.serializers as _users_serializers
import core.utils as _core_utils

# Usage - clear which app each import is from
user = _users_models.User.objects.get(id=user_id)
result = _users_services.UserService.create_user(data)
serializer = _users_serializers.UserSerializer(user)
token = _core_utils.generate_token()

Pattern Rule

import {app}.{module} as _{app}_{module}

❌ WRONG Patterns

# Relative imports - NEVER USE
from .models import User
from ..services import UserService

# Direct class imports - NEVER USE
from users.models import User
from users.services import UserService

# Relative module imports - NEVER USE
import .models as models
from . import models

Validation Process

Step 1: Detect Import Violations

Scan Python code for:

Violation Type 1: Relative imports

from .models import User          # ❌
from ..services import UserService  # ❌

Violation Type 2: Direct class imports

from users.models import User     # ❌

Violation Type 3: Missing alias

import users.models               # ❌ (no alias)

Step 2: Auto-Fix Violations

Before (Violation):

from .models import User, Profile
from users.services import UserService

After (Corrected):

import users.models as _users_models
import users.services as _users_services

# Update usage
user = _users_models.User.objects.get(...)
profile = _users_models.Profile.objects.get(...)
result = _users_services.UserService.create_user(...)

Read the full file on GitHub · 227 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 6d ago Changed ccd4e532f382
  2. 9d ago First seen · 227 lines · 41 tokens per session scan A 933bbc382601

Subscribe to this mod's changes

django-import-enforcer is a skill published in the GitHub repository smicolon/ai-kit (6 stars, last pushed 6d ago), licensed MIT. It adds 41 tokens to every session and 1,278 once invoked, about $0.0002 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-31.

Related

Other skills, from other repositories

statistical-analysis

Structured pipeline for statistical analysis deliverables — SPSS, R, Python. Covers reliability, chi-square, correlation, regression, assumption checking, and client-ready reporting.

winstonkoh87/Athena-Public · 37 tokens

distribution-physics

Analyzes market dynamics and go-to-market strategies using "Distribution First" architecture.

winstonkoh87/Athena-Public · 20 tokens

cirq

Google quantum computing framework. Use when targeting Google Quantum AI hardware, designing noise-aware circuits, or running quantum characterization experiments. Best for Google hardware, noise modeling, and low-level circuit design. For IBM hardware use qiskit; for quantum ML with autodiff use pennylane; for…

LeonChaoX/qinyan-academic-skills · 67 tokens

qiskit

IBM quantum computing framework. Use when targeting IBM Quantum hardware, working with Qiskit Runtime for production workloads, or needing IBM optimization tools. Best for IBM hardware execution, quantum error mitigation, and enterprise quantum computing. For Google hardware use cirq; for gradient-based quantum ML use…

LeonChaoX/qinyan-academic-skills · 73 tokens

modal

Run Python code in the cloud with serverless containers, GPUs, and autoscaling. Use when deploying ML models, running batch processing jobs, scheduling compute-intensive tasks, or serving APIs that require GPU acceleration or dynamic scaling.

LeonChaoX/qinyan-academic-skills · 46 tokens

transformers

This skill should be used when working with pre-trained transformer models for natural language processing, computer vision, audio, or multimodal tasks. Use for text generation, classification, question answering, translation, summarization, image classification, object detection, speech recognition, and fine-tuning…

LeonChaoX/qinyan-academic-skills · 63 tokens