Rules For AI
This page is your cheat sheet for getting AI tools to generate code that fits the Gravity architecture.
Whether you're building views, setting up routes, styling with Tailwind, or wiring API calls, these rules ensure the AI follows the same patterns used across the codebase so everything stays consistent.
Supported AI Tools
Gravity includes pre-configured rules for multiple AI environments:
Cursor →
.cursorrulesClaude →
claude.mdAgents (multi-step workflows) →
agents.mdGitHub Copilot →
copilot-instructions.mdWindsurf →
windsurf.rules
Each file is tailored to how that tool reads instructions, but they all enforce the same core patterns.
Domain-Specific Rules
On top of tool-specific configs, Gravity includes domain-specific rules that define:
Project structure
Naming conventions
Component and view patterns
API and data-fetching patterns
These ensure that regardless of the AI tool you use, the output aligns with how Gravity is built.
By Architecture
Next.js
Unified rule system for frontend + backend
Covers routing, server actions, and co-located logic
Node.js
Rules are split across:
Server (API, services, DB)
Web (React client)
Last updated