All databases

Cursor rule

Htmx Go Basic Cursorrules Prompt File

Cursor rules for Go development with basic setup.

HTMX and Go best practices

js
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

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

Additional instructions

js
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 Frontend rules

Frequently asked questions

What is the Htmx Go Basic Cursorrules Prompt File Cursor rule?

Cursor rules for Go development with basic setup. It is a Frontend rule, stored as htmx-go-basic-cursorrules-prompt-file.mdc.

How do I use the Htmx Go Basic Cursorrules Prompt File rule in Cursor?

Copy the rule from this page and save it as htmx-go-basic-cursorrules-prompt-file.mdc in your project's .cursor/rules folder, or paste it into Cursor's project rules settings.