Communitygithub.com

Ali-Fani/django-unfold-skills

Agent skill suite for django-unfold: 22 expert skills covering ModelAdmin, actions, filters, tabs, components, dashboards, theming, security and production patterns

Qu'est-ce que django-unfold-skills ?

django-unfold-skills is a Claude Code agent skill that agent skill suite for django-unfold: 22 expert skills covering ModelAdmin, actions, filters, tabs, components, dashboards, theming, security and production patterns.

Compatible avec~Claude Code~Codex CLI~Cursor
npx skills add Ali-Fani/django-unfold-skills

Demander à votre IA préférée

Ouvre une nouvelle conversation avec cette compétence d'agent déjà préchargée.

Documentation

Verified against: django-unfold 0.104.1

Docs: https://unfoldadmin.com/docs/ , https://github.com/unfoldadmin/django-unfold

Dependencies: none. Related: unfold-installation, unfold-modeladmin, unfold-settings, unfold-navigation.

Unfold Core — Mental Model & Routing

Purpose

Establish the correct mental model for Unfold work: Unfold is a restyling and enhancement layer on top of django.contrib.admin, not a replacement. Nearly everything Unfold does is Django admin with new templates (Tailwind), a settings dictionary, and extra opt-in features (actions, filters, tabs, components, command palette).

An agent that internalizes the layering rules below will not misattribute features, fight Django mechanics, or invent configuration.

Layering rules

Every capability belongs to exactly one layer:

LayerWhat it coversExamples
[DJANGO]Standard admin machinery — Unfold only changes appearancelist_display, search_fields, fieldsets, inlines, get_queryset(), has_*_permission, actions dropdown, autocomplete_fields, raw_id_fields, list pagination
[UNFOLD]Official Unfold additions — settings dict, contrib apps, decorators, components, mixinsUNFOLD = {...}, unfold.admin.ModelAdmin, @display, @action, unfold.contrib.filters, UnfoldModelAdminViewMixin, BaseComponent, InfinitePaginator, actions_list/row/detail/submit_line, tabs, command palette
[CUSTOM]Project-level code the agent writestemplates/admin/index.html override, Tailwind build, custom views with forms, service/queryset layers, custom components
[STUDIO]Paid Unfold Studio plugin capabilitiesboxed layout, sticky header, minimal sidebar, forced dark sidebar, banner, nested navigation, dashboard templates. See unfold-studio skill for public-API equivalents.

Rule: attribute a feature to the lowest layer that provides it. If plain Django does it, recommend plain Django.

Routing table (which mechanism for which need)

User wantsMechanismSkill
CRUD for a modelModelAdmin (Django)unfold-modeladmin
Bulk operation on selected rowsactions (Django dropdown) or Unfold actions_listunfold-actions
Operation on one row from the listactions_rowunfold-actions
Operation on one object from its detail pageactions_detailunfold-actions
Extra save-mode button on changeformactions_submit_lineunfold-actions
Confirmation dialog before an action@action(dialog={...})unfold-actions
Filter/side panel on changelistlist_filter (+ Unfold filter classes)unfold-filters
Search box on changelistsearch_fields (Django)unfold-modeladmin
Global brand/title/logoUNFOLD settingsunfold-settings
Sidebar menu with icons/badgesUNFOLD["SIDEBAR"]unfold-navigation
Extra tabs above changelist/changeformUNFOLD["TABS"]unfold-tabs
Tabs inside the changeform formfieldsets "tab" class, inline tab = Trueunfold-tabs
Non-CRUD page (analytics, wizard)custom admin view (UnfoldModelAdminViewMixin)unfold-custom-pages
Admin landing page with cards/chartsDASHBOARD_CALLBACK + templates/admin/index.html override, or custom pageunfold-dashboard
Related objects on changeforminlines (Django; Unfold base classes)unfold-inlines
Changeform field groupingfieldsets (Django; Unfold adds tab classes)unfold-modeladmin, unfold-tabs
Compact repeatable field listArrayWidgetunfold-fields
Rich text editingWysiwygWidgetunfold-fields
Visual color/theme changeUNFOLD["COLORS"], BORDER_RADIUS, THEMEunfold-theming
Anything beyond settings visuallyTailwind/template overrideunfold-tailwind
Huge table slow paginationInfinitePaginatorunfold-performance
Model data in cmd+K paletteUNFOLD["COMMAND"]unfold-navigation
Related-record tables in changelist rows (expandable)list_sections with TableSection/TemplateSectionunfold-modeladmin
Secondary changelist on changeformchange_form_datasets (BaseDataset)unfold-modeladmin

When configuration is NOT enough (custom implementation required):

  • Anything with a form + POST that isn't an action dialog → custom page (unfold-custom-pages).
  • Dashboard richer than components → dashboard template override + Tailwind (unfold-dashboard).
  • Visual effects not exposed as settings → Tailwind CSS or template override (unfold-tailwind, unfold-studio).
  • Business logic beyond simple mutations → service layer, never ModelAdmin methods (unfold-production).

Golden rules

  1. Every admin class must inherit unfold.admin.ModelAdmin (and every inline unfold.admin.TabularInline/StackedInline) or pages render unstyled. Third-party ModelAdmins need re-registration with Unfold bases.
  2. "unfold" goes before django.contrib.admin in INSTALLED_APPS. Contrib apps (unfold.contrib.filters, unfold.contrib.forms, unfold.contrib.inlines) go immediately after.
  3. Unfold does not replace admin URLs, templates path (admin/base_site.html extends work), or Django's permission machinery — extend, don't fight.
  4. Never hardcode Unfold internals (template names beyond documented components, private template tags); use documented settings/classes only.
  5. Business logic does not live in ModelAdmin. ModelAdmin is an HTTP/permissions layer over a service layer. See unfold-production.
  6. Unfold changes fast; anything behaving unexpectedly → check docs/version-notes.md and current docs before debugging deeper.

Version facts (verified)

  • Current PyPI release: 0.104.1 (this suite verified against it).
  • Requires Python ≥3.12, Django ≥5.2 (requires_dist: django>=5.2).
  • Tailwind v4 since 0.56.0 (broke v3 custom stylesheets).
  • Unfold works alongside default admin; incremental adoption OK.

Related skills

Load unfold-installation for setup tasks; everything else routes from the table above.

Skills associés