drf-api

drf-api is an agent for Claude Code from toffyui/ccteams. It costs 54 tokens per session (844 once invoked), scanned A, original, MIT.

A specialist for building JSON web APIs with Django, a Python web framework, using Django REST Framework, its API-building toolkit. It covers the parts that receive requests, validate data, control access, and return results.

In plain words
What is it for?
Use it to create or change serializers, views, routers, permissions, authentication, pagination, rate limits, filtering, and database queries for Django APIs.
Why use it?
It helps avoid inconsistent API design, unsafe data exposure, permission mistakes, and slow database access when adding endpoints to a Django project.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md). Also seen: model in frontmatter; reads .claude/ paths.

Good fit Use it to create or change serializers, views, routers, permissions, authentication, pagination, rate limits, filtering, and database queries for Django APIs.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/toffyui/ccteams/drf-api
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.

Clone the repo
git clone --depth 1 https://github.com/toffyui/ccteams

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 drf-api

README.md
[![agentmods](https://agentmods.dev/badge/agents/toffyui/ccteams/drf-api/github.svg)](https://agentmods.dev/agents/toffyui/ccteams/drf-api)
Your own site
<a href="https://agentmods.dev/agents/toffyui/ccteams/drf-api"><img src="https://agentmods.dev/badge/agents/toffyui/ccteams/drf-api/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 drf-api

Your own site · 80×15
<a href="https://agentmods.dev/agents/toffyui/ccteams/drf-api"><img src="https://agentmods.dev/badge/agents/toffyui/ccteams/drf-api.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 54 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 844 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.00054 $0.00844
Opus 5.5 $0.00022 $0.00338
Sonnet 5.5 $0.00011 $0.00169
Haiku 4.5 $0.00005 $0.00084

Measured 1mo ago against content hash 0a4feb2b90c4, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

drf-api 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 1mo 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.

teams/django/agents/drf-api.md · 65 lines

How it starts

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

You implement REST APIs with Django REST Framework idiomatically. Read existing serializers, viewsets, and the router/url wiring before writing — mirror the project's conventions for serializer layout, permission classes, and pagination before adding new patterns.

FIRST ACTION: Read .claude/skills/django-playbook/SKILL.md and follow it. If the file is absent, apply the rules below. Non-negotiable minimums from it: pin the DRF version from the dependency file and read the REST_FRAMEWORK settings block (default permission/auth/pagination) before writing; every view/viewset declares explicit permission_classes and scopes get_queryset() by request.user where ownership matters; never fields = '__all__' on a writable serializer — use an explicit fields list with server-controlled fields read_only; apply select_related/prefetch_related in get_queryset so nested/SerializerMethodField serializers don't N+1; choose ModelViewSet+router for full CRUD but APIView/generics for bespoke or non-resource endpoints (don't force a non-resource into a router).

Default assumptions (override if the project says otherwise)

  • Detect the Django and DRF versions from the project's dependency files and stay within their API.
  • Match the project's existing API style: viewsets + routers vs explicit APIViews, versioning scheme, and URL conventions. Do not mix styles in one app.

Serializers

  • Serializers own field-level and object-level validation (validate_<field>, validate()). Keep business rules on the model/service; serializers validate shape and input constraints.
  • Use ModelSerializer with an explicit fields list — never fields = '__all__' on anything writable, to avoid leaking or mass-assigning unintended fields.
  • Mark server-controlled fields read_only (ids, timestamps, owner). Separate read and write serializers when their shapes genuinely diverge rather than overloading one.
  • Nested writes are a smell — prefer separate endpoints or explicit create/update overrides, and say why when you add one.

Read the full file on GitHub · 65 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. 1mo ago First seen · 65 lines · 54 tokens per session scan A 0a4feb2b90c4

Subscribe to this mod's changes

drf-api is an agent published in the GitHub repository toffyui/ccteams (48 stars, last pushed 1mo ago), licensed MIT. It adds 54 tokens to every session and 844 once invoked, about $0.0002 per session on Opus 5.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.

Related

Other agents, from other repositories

backend-engineer

Backend implementation - APIs, databases, Python, business logic, data processing, server-side work.

jpoley/flowspec · 22 tokens

python-architect

Plain Python backend implementer (backend aspect). Replaces the vanilla developer on Python projects without a recognized web framework. Handles module design, CLI tools (argparse/click/typer), data pipelines, external API clients, configuration (pydantic-settings / python-decouple), and library packaging. Do NOT use…

AratKruglik/claude-sdlc · 104 tokens

hermes

Backend specialist — FastAPI, Python, async, TDD (RED→GREEN→REFACTOR), modern Python stdlib, obsolete lib detection. Calls apollo for discovery, sends to themis.

ils15/pantheon-legacy · 44 tokens

error-handlers-integrator

Initializes REST API exception-to-HTTP mapping end-to-end. Invoke with: @error-handlers-integrator.

voro6yov/spec-driven-development · 33 tokens

python-engineer

Hands-on Python 3.12+ engineer. Ships async-first, type-safe, tested code with uv, ruff, FastAPI and Pydantic. TRIGGER WHEN: planning a new Python project, designing architecture, making tech-stack decisions, or implementing features. DO NOT TRIGGER WHEN: the task is writing tests (use testing:test-writer) or isolated…

acaprino/daodan · 87 tokens

fastapi-pro

Build high-performance async APIs with FastAPI, SQLAlchemy 2.0, and Pydantic V2. Master microservices, WebSockets, and modern Python async patterns. Use PROACTIVELY for FastAPI development, async optimization, or API architecture.

NOMARJ/sigil · 57 tokens