From fls
Create or edit Django templates with cotton components, template partials, and proper Tailwind usage. Use when creating/editing HTML templates, adding components, or when the user mentions templates, UI, or frontend work.
npx claudepluginhub preludetech/django-craftThis skill is limited to using the following tools:
Use this Skill when:
Guides simple web development prioritizing semantic HTML, CSS, HTMX for interactivity, and minimal JS. Use for writing or reviewing templates, stylesheets, scripts.
Enables server-side rendering with Jinja2 templates, Tailwind 4, DaisyUI 5, and Vite bundling in myfy Python web apps. Auto-scaffolds frontend dirs for templates and static assets.
Guides templUI component setup in Go templ apps including dropdowns, dialogs, tabs, toasts; Script() configuration, JS interpolation in handlers, non-responsive fixes, HTML-to-templ conversion, and HTMX/Alpine.js integration.
Share bugs, ideas, or general feedback.
Use this Skill when:
freedom_ls/<app_name>/templates/
├── <app_name>/ # Page templates (app-namespaced)
├── cotton/ # Cotton components
└── partials/ # Template partials
Base template: freedom_ls/base/templates/_base.html
freedom_ls/<app_name>/templates/<app_name>/<page>.htmlfreedom_ls/<app_name>/templates/cotton/<component>.htmlfreedom_ls/<app_name>/templates/partials/<partial>.html{% extends '_base.html' %}
{% block title %}Page Title{% endblock %}
{% block content %}
<div class="space-y-6">
<h1>{{ page_title }}</h1>
<!-- Content -->
</div>
{% endblock %}
From _base.html:
{% block title %} - Page title{% block content %} - Main content{% block header %} - Header section{% block extra_head %} - Additional head content{% block extra_body %} - After main contentReusable UI components using <c-component-name> syntax.
Location: freedom_ls/<app_name>/templates/cotton/<name>.html
<c-vars
prop1="default"
prop2=""
class=""
/>
<div class="{{ class }}" {{ attrs }}>
{{ slot }}
</div>
{% comment %}
Usage:
<c-name prop1="value">Content</c-name>
{% endcomment %}
<c-button>Click me</c-button>
<c-button variant="primary" href="/url">Link</c-button>
<c-loading-indicator id="loader" message="Loading..." />
<c-modal id="confirm" title="Confirm">Are you sure?</c-modal>
<c-vars> with defaultsclass and {{ attrs }} for flexibility{{ slot }} for contentLocation: freedom_ls/<app_name>/templates/partials/<name>.html
<!-- Include in template -->
{% include "partials/header.html" %}
<!-- Load via HTMX -->
<div hx-get="{% url 'app:partial' %}" hx-trigger="load"></div>
Inline partials are a Django 6+ built-in feature ({% partialdef %} / {% partial %} tags are part of the Django Template Language).
{% partialdef "partial_name" %}
<!-- content -->
{% endpartialdef %}
<!-- Use it -->
{% partial "partial_name" %}
<!-- Pass context -->
{% with foo=bar %}
{% partial "partial_name" %}
{% endwith %}
Note: Use {% with %} to pass context, NOT {% partial "name" foo=bar %}
HTMX loaded globally. CSRF token set in _base.html via hx-headers. Do not add CSRF tokens to individual requests.
partial_ (e.g., partial_course_toc, partial_list_courses)render(request, template, context) — no special HTMX response classes needed{% partialdef %} blocks (e.g., {% partialdef view-course-button %})<!-- Load on page load -->
<div hx-get="{% url 'app:endpoint' %}" hx-trigger="load"></div>
<!-- Form submission -->
<form hx-post="{% url 'app:submit' %}" hx-target="#result">
<c-button type="submit">Submit</c-button>
</form>
<!-- Click to load -->
<c-button hx-get="{% url 'app:more' %}" hx-target="#content">
Load More
</c-button>
Loaded globally for reactive components.
<div x-data="{ open: false }">
<c-button @click="open = !open">Toggle</c-button>
<div x-show="open">Content</div>
</div>
freedom_ls/<app_name>/templates/<app_name>/ls freedom_ls/*/templates/cotton/cat tailwind.components.css_base.html, use existing componentsnpm run tailwind_buildtailwind.components.css first - Use component classes{% url %} tag<app_name>/ subdirectory