{"name":"cursor-rules","title":"Cursor rules examples","description":"Two Cursor rules examples in .cursor/rules, one always applied and one scoped to React files, with every rule type and its frontmatter explained.","category":"agents","updated":"2026-11-08","url":"https://sniptide.com/templates/cursor-rules","files":[{"name":".cursor/rules/project.mdc","language":"markdown","content":"---\ndescription: Project overview, commands and rules that apply to every task\nalwaysApply: true\n---\n\n# Acme Dashboard\n\nNext.js App Router, TypeScript, Tailwind CSS and Drizzle on Postgres.\n\n## Commands\n\n- Dev server: `pnpm dev`\n- Tests: `pnpm test`\n- Lint and types: `pnpm lint && pnpm typecheck`\n\nRun the tests and the type check before you finish a task.\n\n## Rules\n\n- TypeScript strict mode. Use `unknown` and narrow it instead of `any`.\n- Database access only in `lib/db`. Components call functions from there.\n- Ask before you add a dependency.\n"},{"name":".cursor/rules/react-components.mdc","language":"markdown","content":"---\ndescription: How to write React components in this project\nglobs: components/**/*.tsx, app/**/*.tsx\nalwaysApply: false\n---\n\n# React components\n\n- Server Components by default. Add `\"use client\"` only for state, effects or browser APIs.\n- One component per file, named export, file name in kebab-case: `order-table.tsx`.\n- Props get a `type`, not an `interface`, declared above the component.\n- Style with Tailwind classes. Merge conditional classes with `cn()` from `@/lib/utils`.\n- Build on the primitives in `components/ui` before writing new markup.\n\nFollow the structure of this example:\n\n@components/ui/empty-state.tsx\n"}]}