Skip to main content

Autonomous development framework for the Django-Bolt ecosystem

Project description

Claude-on-Django

An autonomous development framework that leverages AI agent teams for Django development. Developers describe what they want to build, and the swarm coordinates implementation across all Django layers automatically.

Ported from claude-on-rails with full feature parity.

How It Works

Claude-on-Django creates a team of specialized AI agents, each focused on a specific domain:

Agent Responsibility
Architect System design, coordination, project structure
Modeler Django models, migrations, database optimization
API Specialist REST API (DRF), JWT/OAuth authentication, serialization
Views Templates, class-based views, UI (full-stack only)
Services Business logic, service layer, design patterns
QA Engineer Unit + integration tests, TDD, test coverage
DevOps Docker, CI/CD, deployment, production config
Tasks Celery, background jobs (when Celery detected)

Installation

pip install claude-on-django

Then initialize in your Django project:

python manage.py claude_swarm_init

This will:

  • Analyze your project (detect DRF, Celery, GraphQL, HTMX, database, deployment)
  • Generate agent prompts in .claude-on-django/prompts/
  • Build a swarm topology matching your project features
  • Create/update CLAUDE.md with project context

Usage

Natural Language Development

Describe what you want and the swarm handles implementation across all layers:

claude "Add user authentication with JWT and OAuth"
claude "Create a task management API with filtering and pagination"
claude "Optimize the dashboard queries for performance"

Generate a Sandbox Project

Generate a complete example project with CRUD, JWT, OAuth, and full test coverage:

# Generates sandbox using Claude AI agents (requires ANTHROPIC_API_KEY with credits)
python manage.py claude_sandbox_generate --path examples/sandbox

The sandbox includes:

  • User registration and profiles
  • JWT authentication (SimpleJWT)
  • OAuth login (Google, Apple)
  • Project and Task CRUD with owner isolation
  • Task filtering (status, priority, assignee)
  • Task assignment and completion endpoints
  • 23 unit tests (models, services, auth)
  • 33 integration tests (all API endpoints, pagination, data isolation)

Architecture

claude_on_django/
├── project_analyzer.py      # Detects Django project features
├── swarm_builder.py         # Generates agent topology from analysis
├── configuration.py         # Global settings with env var overrides
├── orchestrator/
│   ├── swarm.py             # SwarmOrchestrator (PydanticAI agents)
│   └── maintainer.py        # CLAUDE.md auto-updater
├── toolsets/
│   └── core.py              # Filesystem and command toolsets
├── mcp_server/
│   ├── structure.py         # MCP server for API metadata scanning
│   └── support.py           # MCP availability and installation
├── agents/                  # 8 agent system prompts (.md)
└── management/commands/
    ├── claude_swarm_init.py          # Project analysis + setup
    └── claude_sandbox_generate.py    # Sandbox project generator

ProjectAnalyzer

Detects your Django project features:

  • Frameworks: DRF, GraphQL (Graphene/Strawberry), HTMX, Channels
  • Background tasks: Celery
  • Database: PostgreSQL, MySQL, SQLite
  • Deployment: Docker, Kubernetes, Heroku, Fly.io
  • Custom patterns: services, serializers, permissions, middleware, signals

SwarmBuilder

Generates a conditional agent topology based on analysis:

  • API-only projects skip the Views agent
  • Celery projects get a Tasks agent
  • GraphQL projects get a GraphQL agent
  • Architect connections are wired to all active agents

Project Structure After Init

your-django-project/
├── CLAUDE.md                              # Project context for Claude
└── .claude-on-django/
    ├── context.md                         # Detected project features
    ├── sessions/                          # Agent session logs
    └── prompts/                           # Agent system prompts
        ├── architect.md
        ├── modeler.md
        ├── api_specialist.md
        ├── views.md
        ├── services.md
        ├── qa_engineer.md
        ├── devops.md
        └── tasks.md

Configuration

Environment Variables

# Required: Anthropic API key (for AI sandbox generation, the default)
ANTHROPIC_API_KEY=sk-ant-...

# Optional: Override the default model (default: anthropic:claude-sonnet-4-6)
CLAUDE_ON_DJANGO_MODEL=anthropic:claude-sonnet-4-6

# Optional: Enable experimental agent teams
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1

Python Configuration

from claude_on_django import configure

configure(
    default_model="anthropic:claude-opus-4-6",
    vibe_mode=False,
    max_parallel_agents=3,
)

Development

# Install dev dependencies
make dev-install

# Run package tests (21 tests)
make test

# Generate sandbox and run its tests (56 tests)
make sandbox-init
make sandbox-test

# Run swarm verification script
make sandbox-run

# Lint
make lint

# Build and publish
make build
make publish

License

MIT License - see LICENSE for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

claude_on_django-0.2.0.tar.gz (23.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

claude_on_django-0.2.0-py3-none-any.whl (33.9 kB view details)

Uploaded Python 3

File details

Details for the file claude_on_django-0.2.0.tar.gz.

File metadata

  • Download URL: claude_on_django-0.2.0.tar.gz
  • Upload date:
  • Size: 23.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for claude_on_django-0.2.0.tar.gz
Algorithm Hash digest
SHA256 e7b5e4904945e7c4d3cb8acda4beb16f6d12e1f234bcb7c8ea3c9b0ff7a694a8
MD5 16b7a4ab1f142fedf1917408899f6b83
BLAKE2b-256 b51db0351b1b01490c31de9accd6fe567f4ad67051fbced0aee1adb4c8ae3a45

See more details on using hashes here.

File details

Details for the file claude_on_django-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for claude_on_django-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2f9ae7b7510d1353414700cf4df17f91586e604686ef09c345c8d7768bdc6222
MD5 1cef462591d83372c49fb0f039475629
BLAKE2b-256 76b365ecd1ea6329cb64a196a0c6637d34aff1da839694078ceee1a09b324a9f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page