agent-instructions
Use when writing project instructions for a coding agent (CLAUDE.md, AGENTS.md, or equivalent). Covers what belongs in them, what…
Use when building Django applications. Covers ORM query performance, model design, migrations, Django REST Framework, security defaults, and testing. Trigger on "django view is slow", "too many queries from the orm", "add a drf endpoint", "migration on a big table". Do not use
Claude Code
$ npx -y skills add nimadorostkar/Claude-Skills-collection --skill django --agent claude-code
Codex
$ npx skills add nimadorostkar/Claude-Skills-collection --skill django -a codex -y
Cursor
$ npx skills add nimadorostkar/Claude-Skills-collection --skill django -a cursor -y
Gemini CLI
$ npx skills add nimadorostkar/Claude-Skills-collection --skill django -a gemini-cli -y
GitHub Copilot
$ npx skills add nimadorostkar/Claude-Skills-collection --skill django -a github-copilot -y
OpenCode
$ npx skills add nimadorostkar/Claude-Skills-collection --skill django -a opencode -y
Windsurf
$ npx skills add nimadorostkar/Claude-Skills-collection --skill django -a windsurf -y
name: django description: Use when building Django applications. Covers ORM query performance, model design, migrations, Django REST Framework, security defaults, and testing. Trigger on "django view is slow", "too many queries from the orm", "add a drf endpoint", "migration on a big table". Do not use for API contract decisions independent of Django — see the api-design skill. metadata: category: backend version: 1.0.0 tags: [django, orm, drf, migrations, python]
Build Django applications that use the ORM efficiently and the framework's security defaults correctly. Most Django performance problems are one missing `select_related` away from being fixed.
1. **Count the queries** — `assertNumQueries` in tests, `django-debug-toolbar` in development. An N+1 is invisible until you count. 2. **Fix them at the queryset** — `select_related` for forward foreign keys (a join), `prefetch_related` for reverse and many-to-many (a second query). Not both, not neither. 3. **Push work into the database** — `annotate`, `aggregate`, `bulk_create`, `update`. A loop that saves each object issues one query per iteration. 4. **Constrain at the database** — `UniqueConstraint`, `CheckConstraint`. Application-level validation does not survive concurrency or a shell script. 5. **Migrate safely** — On a large table, adding a column with a default rewrites it. Add nullable, backfill in batches, then set the default. 6. **Check the deploy settings** — `DEBUG = False`, `ALLOWED_HOSTS`, `SECURE_*`, `SECRET_KEY` from the environment.
**Removing an N+1 and pushing aggregation into the database:**
# Before: 1 query for orders + 1 per customer + 1 per line-item count = ~2N+1.
orders = Order.objects.filter(status="open")
for order in orders:
print(order.customer.name, order.items.count())
# After: 2 queries total, count computed by the database.
orders = (
Order.objects
.filter(status="open")
.select_related("customer") # join
.annotate(item_count=Count("items")) # aggregate in SQL
)
for order in orders:
print(order.customer.name, order.item_count)**Database-level constraint rather than a hopeful `clean()`:**
class Subscription(models.Model):
tenant = models.ForeignKey(Tenant, on_delete=models.CASCADE)
period_start = models.DateField()
period_end = models.DateField()
class Meta:
constraints = [
models.UniqueConstraint(
fields=["tenant", "period_start"],
name="uniq_subscription_period",
),
models.CheckConstraint(
check=models.Q(period_end__gt=models.F("period_start")),
name="period_end_after_start",
),
]A curated library of 137 production-grade skills for Claude and other AI coding agents. Every skill follows one structure, speaks with one voice, and earns its place by changing what the agent does.
Use when writing project instructions for a coding agent (CLAUDE.md, AGENTS.md, or equivalent). Covers what belongs in them, what…
Use when an agent needs state that survives a session or a context compaction. Covers what to persist, file-based memory,…
Use when automating agent behavior with lifecycle hooks. Covers hook events, deterministic enforcement of rules the model should…
Use when packaging skills, commands, hooks, and MCP servers into a distributable plugin. Covers manifest structure, bundling,…
Use when writing a new skill for an AI agent. Covers scoping, description writing for reliable triggering, progressive…
Use when reviewing or improving an existing agent skill. Covers triggering accuracy, content quality, redundancy with the base…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.