Home › All rules › Community › Htmx Flask Cursor Rules

Htmx Flask Cursor Rules

Cursor rules for HTMX development with Flask integration.

CursorhtmxCommunity (CC0)

How to use

Save this as .cursor/rules/htmx-flask-cursorrules-prompt-file.mdc in your project, commit it, and Cursor will load it. Review it first: community files can be opinionated or out of date.

Note: Review and test before use. Provided as is, without warranty. See Terms.

.cursor/rules/htmx-flask-cursorrules-prompt-file.mdcDownload  
---
description: "Cursor rules for HTMX development with Flask integration."
globs: **/*
alwaysApply: false
---
// 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
`;

More: htmx rules · all community rules

Related rules

htmx + server-rendered HTML AGENTS.md

AGENTS.md for htmx 2 apps with server-rendered templates (any backend), partials, and progressive enhancement.

AGENTS.mdhtmx

Htmx Basic Cursor Rules

Cursor rules for HTMX development with basic setup.

CursorhtmxCommunity (CC0)

Htmx Django Cursor Rules

Cursor rules for HTMX development with Django integration.

CursorhtmxCommunity (CC0)

Htmx Go Basic Cursor Rules

Cursor rules for Go development with basic setup.

CursorhtmxCommunity (CC0)

Htmx Go Fiber Cursor Rules

Cursor rules for Go development with Fiber integration.

CursorhtmxCommunity (CC0)

Get new rules weekly

One email a week: fresh rule files, agent tips, and what's changing in Cursor, Claude Code and Copilot. Free, unsubscribe anytime.

Opens the Rulestack Newsletter on beehiiv in a new tab. Or subscribe directly on beehiiv.