PluginBench
Rule

htmx flask

via PatrickJS/awesome-cursorrules

HTMX and Flask integration patterns for dynamic server-rendered web applications.

What is htmx flask?

This rule provides best practices for building interactive web applications using HTMX with Flask. Use it when developing dynamic, server-rendered UIs that leverage HTMX attributes for seamless partial page updates without full page reloads.

  • Server-side rendering with Flask's render_template and Jinja2 templating
  • Form handling with Flask-WTF including CSRF protection
  • URL generation with Flask's url_for for HTMX requests
  • JSON responses via Flask's jsonify for AJAX endpoints
  • Database operations with Flask-SQLAlchemy and Flask-Migrate
  • Modular application structure using Flask Blueprints

Applies to

File patterns this rule matches.

**/*
Rule definition (reference)

Source of truth, from the repository.

// HTMX with Flask .cursorrules

// HTMX and Flask best practices

const htmxFlaskBestPractices = [ "Use Flask's render_template for server-side rendering", "Implement Flask-WTF for form handling", "Utilize Flask's url_for for generating URLs", "Use Flask's jsonify for JSON responses", "Implement Flask-SQLAlchemy for database operations", "Utilize Flask's Blueprint for modular applications", ];

// Folder structure

const folderStructure = app/ templates/ static/ css/ js/ models/ routes/ __init__.py config.py run.py;

// Additional instructions

const additionalInstructions = `

  1. Use Jinja2 templating with HTMX attributes
  2. Implement proper CSRF protection with Flask-WTF
  3. Utilize Flask's request object for handling HTMX requests
  4. Use Flask-Migrate for database migrations
  5. Implement proper error handling and logging
  6. Follow Flask's application factory pattern
  7. Use environment variables for configuration `;

Related rules

Senior full-stack TypeScript, React, Node.js guidance with clean architecture, testing, and WHY-oriented reasoning.

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

Quantitative factor research skills for designing, evaluating, and mining alpha factors in equities markets.

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

Android development with Jetpack Compose, clean architecture, and Material Design 3.

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

Angular development with Novo Elements UI library using standalone components.

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

Expert Angular 18 + TypeScript development with Jest, emphasizing clean code and performance.

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

Manage Kubernetes clusters, add-ons, stacks, and credentials via the Ankra CLI platform.

**/*.sh +5
41k
via PatrickJS/awesome-cursorrules