add .mdc file

This commit is contained in:
sanjeed5
2025-02-17 17:50:15 +05:30
parent 2087f9d628
commit 71ac7fc7cc
879 changed files with 7725 additions and 0 deletions
@@ -0,0 +1,10 @@
---
description: Applies general best practices for using HTMX with Go, focusing on server-side rendering and request handling.
globs: **/*.go
---
- 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
@@ -0,0 +1,11 @@
---
description: Provides additional instructions for implementing HTMX with Go, including semantic HTML, CSRF protection, and error handling.
globs: **/*.html
---
- Use semantic HTML5 elements with HTMX attributes
- Implement proper CSRF protection
- Utilize HTMX extensions when needed
- Use hx-boost for full page navigation
- Follow Go's idiomatic error handling
- Implement graceful shutdown for the server
- Use Go modules for dependency management
@@ -0,0 +1,16 @@
---
description: Specifies the recommended folder structure for a Go project using HTMX, including directories for commands, internal logic, templates, and static assets.
globs: go.mod
---
- Use the following folder structure:
cmd/
main.go
internal/
handlers/
models/
templates/
static/
css/
js/
go.mod
go.sum