PluginBench
Rule

htmx basic

via PatrickJS/awesome-cursorrules

HTMX development setup with best practices and folder structure guidance.

What is htmx basic?

This rule provides foundational HTMX development practices, including HTTP verb usage, content swapping strategies, and recommended project structure. Use it when building interactive web applications with HTMX attributes and server-side templating.

  • Guides HTTP verb selection (hx-get, hx-post) and request handling
  • Explains content swapping with hx-swap and hx-target for dynamic updates
  • Recommends folder structure separating templates, static assets, and application code
  • Covers loading indicators, custom event triggers, and HTMX extensions
  • Emphasizes semantic HTML5, CSRF protection, and progressive enhancement
  • Suggests server-side templating integration (Jinja2, Handlebars)

Applies to

File patterns this rule matches.

**/*
Rule definition (reference)

Source of truth, from the repository.

// HTMX Basic Setup .cursorrules

// HTMX best practices

const htmxBestPractices = [ "Use hx-get for GET requests", "Implement hx-post for POST requests", "Utilize hx-trigger for custom events", "Use hx-swap to control how content is swapped", "Implement hx-target to specify where to swap content", "Utilize hx-indicator for loading indicators", ];

// Folder structure

const folderStructure = src/ templates/ static/ css/ js/ app.py;

// Additional instructions

const additionalInstructions = `

  1. Use semantic HTML5 elements
  2. Implement proper CSRF protection
  3. Utilize HTMX extensions when needed
  4. Use hx-boost for full page navigation
  5. Implement proper error handling
  6. Follow progressive enhancement principles
  7. Use server-side templating (e.g., Jinja2, Handlebars) `;

Related rules

HTMX development with Django integration best practices and patterns.

**/*
41k
via PatrickJS/awesome-cursorrules

HTMX development with Flask integration best practices and patterns.

**/*
41k
via PatrickJS/awesome-cursorrules

Go development with HTMX for server-side rendered interactive web applications.

**/*
41k
via PatrickJS/awesome-cursorrules

Go Fiber best practices for building HTMX-driven web applications.

**/*
41k
via PatrickJS/awesome-cursorrules

Senior Java developer persona with Effective Java principles, SOLID, and functional programming best practices.

**/*
41k
via PatrickJS/awesome-cursorrules

Java Spring Boot 3 with JPA/Hibernate development guide following SOLID principles and OWASP best practices.

**/*
41k
via PatrickJS/awesome-cursorrules