Home › All rules › Community › Htmx Basic Cursor Rules

Htmx Basic Cursor Rules

Cursor rules for HTMX development with basic setup.

CursorhtmxCommunity (CC0)

How to use

Save this as .cursor/rules/htmx-basic-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-basic-cursorrules-prompt-file.mdcDownload  
---
description: "Cursor rules for HTMX development with basic setup."
globs: **/*
alwaysApply: false
---
// 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)
`;

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 Django Cursor Rules

Cursor rules for HTMX development with Django integration.

CursorhtmxCommunity (CC0)

Htmx Flask Cursor Rules

Cursor rules for HTMX development with Flask 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.