Skip to main content
rule

sveltekit-restful-api-tailwind-css-cursorrules-pro — Cursor rule

This rule gives Cursor project guidance for SvelteKit, REST APIs, Tailwind CSS, testing, and file management. Use it to keep those practices in view while working on a project.

Install into Cursor · Manually: put the files in place All methods and platforms ↓
.cursor/rules/sveltekit-restful-api-tailwind-css-cursorrules-pro.mdc
Open on GitHub

What sveltekit-restful-api-tailwind-css-cursorrules-pro does

The rule targets a stack built around SvelteKit, PostgreSQL through Supabase, Tailwind CSS, Vercel, and Supabase Auth. It directs the assistant to write a failing test first, implement the smallest change that passes, then refactor. It names Vitest for unit and integration tests, Zod for validation, and TypeScript for type safety.

It asks Cursor to give full file paths, update AI.MD when adding files or directories, and keep package.json, README.md, and CHANGELOG.md current. The guidance also covers REST API design, responsive layouts, dark mode, and accessibility. Its **/* glob covers all files, while alwaysApply is false, so the rule is not automatically active in every Cursor context.

For Windows, it calls for PowerShell commands and avoids Unix-specific ones such as rm. The rule sets a test coverage target of 80% or higher; check that target against the project's test setup.

What it helps with

  • structure SvelteKit changes around a test-first workflow
  • remind the assistant to use Vitest and Zod
  • require full paths when creating or editing files
  • choose PowerShell commands for Windows workflows
  • include responsive design and accessibility guidance

Example prompts for the agent

  • Add a REST endpoint to this SvelteKit project, start with a failing test, and give the full path for every file you change.
  • Update this Tailwind CSS component for dark mode and mobile layouts, and consider accessibility.
  • Write Zod validation tests and use PowerShell commands for this Windows project.

How to install sveltekit-restful-api-tailwind-css-cursorrules-pro

Manually: put the files in place

.cursor/rules/sveltekit-restful-api-tailwind-css-cursorrules-pro.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 sveltekit-restful-api-tailwind-css-cursorrules-pro

How do I install sveltekit-restful-api-tailwind-css-cursorrules-pro in Cursor?

Add the rule file to the project at .cursor/rules/sveltekit-restful-api-tailwind-css-cursorrules-pro.mdc.

What does sveltekit-restful-api-tailwind-css-cursorrules-pro do?

It guides Cursor on SvelteKit, REST APIs, Tailwind CSS, testing, documentation, and file operations. It also includes Windows shell guidance and interface design requirements.

When does Cursor apply this rule?

Its **/* glob covers all files, but alwaysApply is false. That means the rule is not automatically active in every Cursor context.

Source text

sveltekit-restful-api-tailwind-css-cursorrules-pro.mdc · CC0-1.0
---
description: "Cursor rules for SvelteKit development with RESTful API and Tailwind CSS integration."
globs: **/*
alwaysApply: false
---
# File Path Usage

# IMPORTANT: Always use full file paths when referencing, editing, or creating files.
# Example: E:\Stojanovic-One\src\routes\Home.svelte
# This rule applies to all file operations and must be followed consistently.

You are an AI assistant for the Stojanovic-One web application project. Adhere to these guidelines:

Please this is utterly important provide full file paths for each file you edit, create or delete.
Always provide it in a format like this: edit this file now: E:\Stojanovic-One\src\routes\Home.svelte or create this file in this path: E:\Stojanovic-One\src\routes\Home.svelte
Also always provide file paths as outlined in @AI.MD like if you say lets update this file or lets create this file always provide the paths.

1. Tech Stack:
  - Frontend & Backend: SvelteKit
  - Database: PostgreSQL (via Supabase)
  - UI Styling: Tailwind CSS
  - Deployment: Vercel
  - Authentication: Supabase Auth

2. Follow Elon Musk's Algorithm for Efficiency:
  a. Question every requirement critically
  b. Delete unnecessary parts
  c. Simplify and optimize remaining components
  d. Accelerate cycle time
  e. Automate as the final step

3. Practice Test-Driven Development (TDD):
  - Write failing tests first
  - Implement minimum code to pass tests
  - Refactor while maintaining passing tests

4. File Management:
  - Include full file path as a comment at the start of each file
  - Update project structure in AI.MD when adding new files/directories
  - Maintain up-to-date package.json

5. Testing:
  - Use Vitest for unit and integration tests
  - Aim for high test coverage (80% or higher)

6. Code Quality:
  - Prioritize readability and maintainability
  - Implement comprehensive error handling
  - Use TypeScript for type safety

7. Documentation:
  - Write clear comments and use JSDoc when appropriate
  - Keep README.md and AI.MD updated
  - Maintain CHANGELOG.md for significant changes

8. Truthfulness and Clarity:
  - Provide accurate, thoughtful answers
  - Admit when you don't know something
  - Be concise while ensuring clarity

9. Development Workflow:
  - Question and refine requirements
  - Break down tasks into small, manageable issues
  - For each task:
   a. Write failing tests
   b. Implement minimum code to pass tests
   c. Refactor and optimize
  - Conduct self-review before suggesting merges
  - Ensure CI passes before finalizing changes

10. Best Practices:
  - Follow RESTful API design principles when applicable
  - Implement responsive design for components
  - Use Zod for data validation
  - Regularly update dependencies and check for vulnerabilities

11. Continuous Improvement:
  - Suggest process improvements when applicable
  - Look for opportunities to simplify and optimize code and workflows

12. Windows Compatibility:
  - Provide PowerShell commands for Windows users
  - Avoid Unix-specific commands (e.g., use `Remove-Item` instead of `rm`)
  - Use cross-platform Node.js commands when possible

Always refer to AI.MD for detailed project-specific guidelines and up-to-date practices. Continuously apply Elon Musk's efficiency principles throughout the development process.

13. Design and User Experience:
  - Implement dark mode compatibility
  - Ensure mobile-friendly and responsive design
  - Optimize for performance
  - Create modern and beautiful UI
  - Consider accessibility in all design decisions

© PatrickJS · CC0-1.0 · PatrickJS/awesome-cursorrules

Similar IDE rules

All IDE rules for Frontend and UI →

From the same set210

tailwind-react-firebase-cursorrules-prompt-file A Cursor rule that sets conventions for a mobile-first web app built with Tailwind, React and Firebase. ★ 41,024repo stars swiftui-guidelines-cursorrules-prompt-file This rule guides Cursor through SwiftUI architecture, concurrency, UI composition, and testing. Add it when you want those conventions reflected in code suggestions. ★ 41,024repo stars sveltekit-typescript-guide-cursorrules-prompt-file A Cursor rule that points the agent at Svelte 5, SvelteKit and TypeScript: project structure, runes, state handling. ★ 41,024repo stars sveltekit-tailwindcss-typescript-cursorrules-promp Defines project conventions for SvelteKit 2, Tailwind CSS, and TypeScript in Cursor. It keeps code consistent by enforcing typed components and proper directory structure. ★ 41,024repo stars svelte A Cursor rule that steers the agent toward Svelte conventions: component structure, reactivity, stores, SvelteKit routing and tests. Useful when the agent writes or edits Svelte code. ★ 41,024repo stars svelte-5-vs-svelte-4-cursorrules-prompt-file Guides Cursor to write Svelte 5 code instead of Svelte 4, adopting runes like $state and $derived, native event attributes, and snippets. ★ 41,024repo stars solidjs-typescript-cursorrules-prompt-file This rule guides Cursor through Solid.js and TypeScript conventions, from typed reactive state to component props. Use it when you want those practices reflected in code suggestions. ★ 41,024repo stars solidjs-tailwind-cursorrules-prompt-file A Cursor rule that tells the agent how to write Solid.js code with Tailwind CSS: signals, utility classes, folder layout. ★ 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