Rule

0 installs · 0 said it worked

PatrickJS@patrickjs·
CodingRule· for Cursor

Cursor rules for building HTMX web apps in Go

A .cursorrules file that guides Cursor to build Go server apps with HTMX, covering html/template rendering, handler patterns, project folder layout, CSRF protection, and graceful shutdown.

People use this for

  • htmx go web app rules
  • cursor rules go htmx
  • go html template server rendering
  • htmx golang project setup prompt
  • generate go htmx app structure
Name
cursor-rules-for-building-htmx-web-apps-in-go
Works with
Cursor
License
CC0(as observed at the source)
Version
v1 · updated Nov 29, 2026
Imported · UnclaimedCC0

Imported on Nov 29, 2026 from github.com . License observed at the source on Nov 29, 2026: CC0.

Are you the author?Claim this profileRequest removal

Use this rule

$ curl -fsSL "https://promptcommunity.dev/api/v1/posts/cursor-rules-for-building-htmx-web-apps-in-go-rf7t/export/mdc" -o .cursor/rules/cursor-rules-for-building-htmx-web-apps-in-go.mdc

Then open a new session; Cursor picks it up from .cursor/rules/.

Download cursor-rules-for-building-htmx-web-apps-in-go.mdc
Manual install

Save cursor-rules-for-building-htmx-web-apps-in-go.mdc as .cursor/rules/cursor-rules-for-building-htmx-web-apps-in-go.mdc for this project or ~/.cursor/rules/cursor-rules-for-building-htmx-web-apps-in-go.mdc for every project, then start a new session.

Rule


description: "Cursor rules for Go development with basic setup." globs: */ alwaysApply: false

// HTMX with Go (Basic Setup) .cursorrules

// HTMX and Go best practices

const htmxGoBestPractices = [ "Use html/template for server-side rendering", "Implement http.HandlerFunc for handling HTMX requests", "Utilize gorilla/mux for routing if needed", "Use encoding/json for JSON responses", "Implement proper error handling and logging", "Utilize context for request cancellation and timeouts", ];

// Folder structure

const folderStructure = cmd/ main.go internal/ handlers/ models/ templates/ static/ css/ js/ go.mod go.sum;

// Additional instructions

const additionalInstructions = `

  1. Use semantic HTML5 elements with HTMX attributes
  2. Implement proper CSRF protection
  3. Utilize HTMX extensions when needed
  4. Use hx-boost for full page navigation
  5. Follow Go's idiomatic error handling
  6. Implement graceful shutdown for the server
  7. Use Go modules for dependency management `;

No result recorded yet. Added it? File a Tried-it report so the next person knows how it went in your editor.

Tried it

Reports from people who added this rule to their editor. They roll up into the badges above.

No one has filed a report yet. Try the prompt and be the first.

License: CC0v1 · published Nov 29, 2026

Comments

No comments yet. If you tried this prompt, say how it went.