Home › All rules › Community › Htmx Go Basic Cursor Rules

Htmx Go Basic Cursor Rules

Cursor rules for Go development with basic setup.

CursorhtmxCommunity (CC0)

How to use

Save this as .cursor/rules/htmx-go-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-go-basic-cursorrules-prompt-file.mdcDownload  
---
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
`;

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

Cursor rules for HTMX development with Flask integration.

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.