Skip to main content
rule

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.

Install into Cursor · Manually: put the files in place All methods and platforms ↓
.cursor/rules/qwik-tailwind-cursorrules-prompt-file.mdc
Open on GitHub

What 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 dark variant and check that the classes don't clash
  • Write a route in src/routes/ with Qwik City and move data loading into server$

How to install qwik-tailwind-cursorrules-prompt-file

Manually: put the files in place

.cursor/rules/qwik-tailwind-cursorrules-prompt-file.mdc

Frontmatter: description, globs, alwaysApply

Step 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

Similar IDE rules

All IDE rules for Frontend and UI →

From the same set210

react-components-creation-cursorrules-prompt-file Guides React component creation in Cursor by checking for duplicates, building v0.dev generation links, and standardising shadcn/ui imports. ★ 41,024repo stars react-chakra-ui-cursorrules-prompt-file A Cursor rule for React projects using Chakra UI, covering component style, theming, responsive layouts, accessibility, and project structure. ★ 41,024repo stars rails-cursorrules-prompt-file A Cursor rule file that tells the agent how to write Rails 8 code: generators, bin/dev, the Solid stack, Minitest and Hotwire. ★ 41,024repo stars r-cursorrules-prompt-file-best-practices Enforces R project structuring, tidyverse formatting standards, renv lockfiles, and package documentation guidelines in Cursor. ★ 41,024repo stars qwik-basic-cursorrules-prompt-file A Cursor rule that sets Qwik conventions for the agent: lazy functions with the $ suffix, signals, tasks, and a TypeScript plus Vite project layout. ★ 41,024repo stars qa-bug-report-cursorrules-prompt-file Configures Cursor to generate detailed bug reports acting as a QA engineer. It formats reproduction steps, environment data, console logs, and severity ratings. ★ 41,024repo stars pytorch-scikit-learn-cursorrules-prompt-file This Cursor rule guides Python machine-learning work on chemistry problems with scikit-learn and PyTorch. It covers molecular data, model training, and evaluation. ★ 41,024repo stars python A Cursor rule that sets project layout, code style and stack choices for Python work with Flask and SQLite. Useful when the agent edits files in your repo. ★ 41,024repo stars

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor