PluginBench
Rule

htmx go basic

via PatrickJS/awesome-cursorrules

Go server-side rendering with HTMX for interactive web applications

What is htmx go basic?

Basic setup guide for building HTMX-powered web applications in Go using server-side rendering. Use this rule when starting a new Go + HTMX project to establish routing, templating, and request handling patterns.

  • Use html/template for server-side rendering with HTMX attributes
  • Handle HTMX requests with http.HandlerFunc and gorilla/mux routing
  • Implement CSRF protection and HTMX extensions for enhanced interactivity
  • Organize code with cmd/, internal/handlers, internal/models, and internal/templates directories
  • Apply Go idiomatic error handling, context usage, and graceful server shutdown
  • Use semantic HTML5 with hx-boost for full-page navigation and dynamic content updates

Applies to

File patterns this rule matches.

**/*
Rule definition (reference)

Source of truth, from the repository.

// 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 `;

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