Hypermedia .cursorrules
A minimal .cursorrules template for hypermedia-driven projects in Cursor IDE.
Template (30 lines)
Section titled “Template (30 lines)”# Hypermedia Project Rules
## Tech Stack- [Backend: Go/Python/Elixir/etc.]- HTMX or Datastar for interactivity- Server-rendered HTML templates- No SPA framework
## Principles- Return HTML fragments, not JSON- Server handles all routing- Progressive enhancement- Minimal JavaScript
## Code Style- HATEOAS: Hypermedia as the engine of application state- Every action returns HTML- No client-side state management- No React/Vue/Svelte/Angular
## HTMX Patterns- `hx-get/post` for requests- `hx-target` for response destination- `hx-swap` for insertion method- `hx-trigger` for event binding
## Gotchas- [Add your project-specific gotchas]
## File Patterns- Templates: `templates/[name].html` or `*.templ`- Handlers: return `HTMLResponse`, not `JSONResponse`- Partials: `templates/partials/[name].html`- Copy the template above
- Save as
.cursorrulesin your project root - Review and update the Tech Stack to match your backend
- Choose HTMX or Datastar and remove the other
- Add your project-specific gotchas
Why This Matters
Section titled “Why This Matters”AI tools default to SPA patterns. This template explicitly tells the AI:
- No JSON APIs - Return HTML, not JSON
- No frontend framework - No React, Vue, or Svelte
- Server routing - No client-side router
- Hypermedia - Use
hx-*attributes for interactivity
Without this context, the AI will likely suggest REST APIs with a separate frontend.