PluginBench
Rule

htmx go basic

via PatrickJS/awesome-cursorrules

Go development with HTMX for server-side rendered interactive web applications.

What is htmx go basic?

This rule provides best practices and setup guidance for building web applications with Go and HTMX. Use it when creating server-side rendered applications that need interactive UI updates without full page reloads.

  • Use html/template for server-side rendering with HTMX attributes
  • Implement http.HandlerFunc and gorilla/mux for request routing and HTMX handling
  • Structure projects with cmd/, internal/, and static/ directories for maintainability
  • Apply semantic HTML5 with HTMX attributes like hx-boost for navigation
  • Implement CSRF protection and proper error handling with Go idioms
  • Use context for request cancellation and timeouts in handlers

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

Go Fiber best practices for building HTMX-driven web applications.

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

Senior Java developer persona with Effective Java principles, SOLID, and functional programming best practices.

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

Java Spring Boot 3 with JPA/Hibernate development guide following SOLID principles and OWASP best practices.

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

Expert guidance for building fast, scalable web apps with Astro, JavaScript, and Tailwind CSS.

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

Expert guidance for Chrome extension development with JavaScript and Chrome APIs.

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

Senior developer guidelines for clean, maintainable JavaScript and TypeScript code.

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