roninforge/roninforge-django/django-model
Claude Code and agent skill by roninforge/roninforge-django
- community
Checking that the SKILL.md file is still in the repository.
Scaffold a complete Django model with serializer, viewset, URL registration, admin configuration, and the migration command to run. Generates a full vertical slice, not just a model class.
Install
npx vskill@latest install roninforge/roninforge-django/django-modelSKILL.md
The same SKILL.md was published earlier as roninforge/roninforge-django/django-model.
Scaffold Django Model
When to Use
Use this skill when:
- Creating a new Django model with its full API/admin stack
- The user asks for a new resource or entity in their Django project
- You need to generate model + serializer + viewset + URL + admin in one shot
Instructions
- Ask or infer the model name and fields from the user's description.
- Read the project's existing models to understand conventions:
- Check
settings.pyforAUTH_USER_MODEL(use it instead ofUser) - Check existing models for naming patterns, base classes, common mixins
- Check if the project uses DRF (look for
rest_frameworkinINSTALLED_APPS) - Check if the project uses
django-filter(for filter backends)
- Generate the following files/additions, using correct Django 5.x patterns:
Model (in models.py or models/):
- Use appropriate field types (not CharField for everything)
- Include
__str__andMetawithordering - Add
related_nameon all ForeignKey/M2M fields - Add
db_index=Trueon frequently filtered fields - Use
TextChoicesfor enum fields - Use
blank=True, default=""on optional string fields (notnull=True) - Use
db_defaultfor database-level defaults where appropriate
Serializer (in serializers.py):
- Use
ModelSerializer - Explicit
fieldslist (never'__all__') - Set
read_only_fieldsfor auto-generated fields - If nested relationships exist, optimize with
select_related/prefetch_relatednote
ViewSet (in views.py or viewsets.py):
- Use
ModelViewSetfor full CRUD,ReadOnlyModelViewSetfor read-only - Override
get_queryset()withselect_related/prefetch_related - Set
permission_classes - Use
perform_createto set request-dependent fields (e.g., author) - Add filter backends if django-filter is available
URL registration (in urls.py):
- Register with router if using DRF viewsets
- Use
app_namenamespace - Use
path()with named patterns
Admin (in admin.py):
- Register with
@admin.register - Set
list_display,list_filter,search_fields - Set
readonly_fieldsfor auto-generated fields
- At the end, output the migration command:
``bash python manage.py makemigrations <app_name> python manage.py migrate ``
- Consult the model patterns reference for field type selection and common patterns.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/django-model/SKILL.md
Popularity
- 7-day trend score
- 5
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/roninforge/roninforge-django/django-model)