qwik-tailwind-cursorrules-prompt-file — Cursor rule for Qwik and Tailwind
A Cursor rule that tells the agent how to write Qwik components with Tailwind CSS: lazy functions, signals, folder layout. Useful on a Qwik City project in TypeScript.
.cursor/rules/qwik-tailwind-cursorrules-prompt-file.mdcWhat qwik-tailwind-cursorrules-prompt-file does
The file spells out how Qwik components should be written and styled. The agent gets a list of practices: a $ suffix on lazily loaded functions, useSignal() for reactive state, Tailwind classes for styling, and the @apply directive in CSS for reusable sets of styles.
A folder layout is included too: src/ with components/ and routes/, plus global.css, root.tsx and entry.ssr.tsx, and at the root tailwind.config.js, postcss.config.js, vite.config.ts and tsconfig.json. A separate block of instructions asks for TypeScript in every .ts and .tsx file, purging unused Tailwind classes in production builds, Qwik City for routing, the @layer directive for custom styles, dark mode through Tailwind's dark variant, and server$ for server-side code.
The rule ships with alwaysApply: false and a **/* glob, so in Cursor you switch it on per task. On a React or Svelte codebase it gets in the way, because it pulls in Qwik City conventions and a folder layout that won't match.
What it helps with
- teach the agent the
$suffix on Qwik functions - move component styling to Tailwind classes
- set up reactive state with
useSignal() - put server-side code behind
server$ - keep the Qwik City folder layout when new files are generated
Example prompts for the agent
- Create a counter component in
src/components/using Qwik,useSignal()for state and Tailwind classes for styling - Add dark mode through Tailwind's
darkvariant and check that the classes don't clash - Write a route in
src/routes/with Qwik City and move data loading intoserver$
How to install qwik-tailwind-cursorrules-prompt-file
Manually: put the files in place
.cursor/rules/qwik-tailwind-cursorrules-prompt-file.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.claude/rules/qwik-tailwind-cursorrules-prompt-file.mdThe paths frontmatter field limits the files: move globs from the source into paths
AGENTS.md
Codex reads AGENTS.md: paste the rule text there
Manually: put the files in place
.github/instructions/qwik-tailwind-cursorrules-prompt-file.instructions.mdThe applyTo field sets which files it applies to: move globs from the source into applyTo
Manually: put the files in place
.devin/rules/qwik-tailwind-cursorrules-prompt-file.mdManually: put the files in place
.clinerules/qwik-tailwind-cursorrules-prompt-file.mdStep by step, with commands for each platform: Cursor rules: .mdc files, four modes and what replaced .cursorrules
Questions about qwik-tailwind-cursorrules-prompt-file
How do I install qwik-tailwind-cursorrules-prompt-file in Cursor?
Place the file at .cursor/rules/qwik-tailwind-cursorrules-prompt-file.mdc in your project root. Cursor picks it up as a rule.
What does this rule do?
It sets Qwik and Tailwind CSS conventions for the agent: $ on lazy functions, useSignal() for state, Tailwind classes for styling, TypeScript in all .ts and .tsx files.
Does the rule apply to every file on its own?
No. It has alwaysApply: false, so you enable it manually. The **/* glob covers any file in the project once it's on.
Source text
qwik-tailwind-cursorrules-prompt-file.mdc · CC0-1.0
--- description: "Cursor rules for Qwik development with Tailwind CSS integration." globs: **/* alwaysApply: false --- // Qwik.js with Tailwind CSS (TypeScript and Vite included) .cursorrules // Prefer functional components const preferFunctionalComponents = true; // Qwik.js and Tailwind CSS best practices const qwikTailwindBestPractices = [ "Use $ suffix for lazy-loaded functions", "Utilize useSignal() for reactive state", "Implement Tailwind CSS classes for styling", "Use @apply directive in CSS files for reusable styles", "Implement responsive design using Tailwind's responsive classes", "Utilize Tailwind's configuration file for customization", "Leverage TypeScript for type safety", "Use Vite's fast HMR for development", ]; // Folder structure const folderStructure = ` src/ components/ routes/ global.css root.tsx entry.ssr.tsx public/ tailwind.config.js postcss.config.js vite.config.ts tsconfig.json `; // Additional instructions const additionalInstructions = ` 1. Use TypeScript for all .ts and .tsx files 2. Implement proper Tailwind CSS purging for production builds 3. Utilize Qwik City for routing when applicable 4. Use Tailwind's @layer directive for custom styles 5. Implement dark mode using Tailwind's dark variant 6. Follow both Qwik and Tailwind naming conventions 7. Use server$ for server-side code execution 8. Leverage Vite plugins for optimized builds `;
© PatrickJS · CC0-1.0 · PatrickJS/awesome-cursorrules