agentleFS
serafimcloudserafimcloud/21st/.cursor/rules/21st.mdc

21st / rules

Cursor rule5.5k starsChanged 18 months agoMITView on GitHub

21st.dev Cursor Rule 1. Language Requirements - Use only English text and English comments in code 7. Project Context 21st.dev is an AI-powered UI component library and platform designed for modern frontend developers and design engineers. It provides high-quality, ready-to-use UI components that are easily customizable and instantly usable in projects built with React, Next.js, and Tailwind CSS. The core idea behind 21st.dev is to solve the cold-start problem for developers by offering a curated set of plug-and-play UI components…

  • Reads credentials

We split this 21st.mdc into the rules it gives an agent

6 rules. About 0 are common, 5 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use only English text and English comments in code

    line 7
  2. Very specific:

    Use useQuery for data fetching

    line 22
  3. Distinctive:

    Never add Index files

    line 23
  4. Distinctive:

    CREATE POLICY "Select tasks policy" ON "public"."tasks" AS PERMISSIVE FOR SELECT TO authenticated USING (requesting_user_id () = user_id).

    line 63
  5. Distinctive:

    CREATE POLICY "Insert tasks policy" ON "public"."tasks" AS PERMISSIVE FOR INSERT TO authenticated WITH CHECK (requesting_user_id () = …

    line 68
  6. Distinctive:

    CHECK (requesting_user_id () = user_id).

    line 70

≈ “Common” is an estimate: at least 1 in 5 of the 6,350 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
21st.mdc
---
description: 
globs: 
alwaysApply: true
---
21st.dev Cursor Rule

1. **Language Requirements**
   - Use only English text and English comments in code

2. **Tech Stack**
   - TypeScript
   - Turborepo with App Router
   - Motion/React: `import { motion } from "motion/react"`
   - Supabase for database
   - PNPM package manager

3. **Project Structure**
   - Main app location: `apps/web`
   - Environment variables: `apps/web/.env.local`

4. **Best Practices**
   - Minimize use of `useEffect`
   - Use `useQuery` for data fetching
   - Never add Index files

5. **Supabase Access**
   - Server-side: 
     ```typescript
     import { supabaseWithAdminAccess } from "@/lib/supabase"
     ```
   - Client-side:
     ```typescript
     import { useClerkSupabaseClient } from "@/lib/clerk"
     ```

6. **SQL Handling**
   - SQL queries should be written for Supabase SQL Editor
   - Queries will be executed manually

7. **Project Context**
21st.dev is an AI-powered UI component library and platform designed for modern frontend developers and design engineers. It provides high-quality, ready-to-use UI components that are easily customizable and instantly usable in projects built with React, Next.js, and Tailwind CSS.

The core idea behind 21st.dev is to solve the cold-start problem for developers by offering a curated set of plug-and-play UI components that follow best practices, modern design trends, and efficient code structures. Unlike traditional UI libraries that focus solely on static components, 21st.dev is built around AI-assisted generation and customization, allowing developers to modify components to fit their needs instantly.

Who are the users of 21st.dev?
	•	Frontend developers who need high-quality, pre-built UI components to speed up development.
	•	Design engineers looking for components that are visually appealing and built with best UI/UX practices.
	•	Startup teams & indie hackers who want to ship faster without reinventing the wheel.
	•	AI enthusiasts who want to leverage AI-powered UI generation to build unique, custom interfaces.
	•	Companies that need a scalable design system with AI-assisted customization to maintain consistency across products.

How is 21st.dev useful?

✅ Instant Access to Quality UI Components – A vast collection of battle-tested UI elements following modern design principles.
✅ AI-Assisted Customization – AI suggestions help users modify components to match their brand identity, layout needs, or functionality.
✅ Built for Modern Stacks – Fully optimized for React, Next.js, Tailwind CSS, and shadcn/ui.
✅ Component Marketplace – Developers can publish, share, and monetize their own UI components.
✅ No-Code Styling & Configuration – Adjust components visually without modifying code.
✅ AI-Powered UI Generation – Users can describe a UI component in plain English, and Magic MCP will generate it.

8. RLS Polices
As we use Clerk + Supabase - please wryle RLS polices this way
-- This policy will enforce that only tasks where the `user_id` matches the Clerk user ID are returned.
CREATE POLICY "Select tasks policy" ON "public"."tasks" AS PERMISSIVE FOR
SELECT
  TO authenticated USING (requesting_user_id () = user_id);

-- This policy will enforce the `user_id` field on INSERT statements matches the Clerk user ID.
CREATE POLICY "Insert tasks policy" ON "public"."tasks" AS PERMISSIVE FOR INSERT TO authenticated
WITH
  CHECK (requesting_user_id () = user_id);

9. Users table
We use public.users table, and user_id - TEXT, as we use Clerk integration

Download now (ZIP)

Trending

More talk lately.thin dataabout the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 1 mentionApr 2026: 1 mentionMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 0 mentionsSep 2026: 1 mentionOct 2026: 1 mentionNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the serafimcloud/21st repository that our weekly crawl found: only 5 in all, so this is a hint, not a trend. There is no adoption data for this file yet.
  • Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.

    Of the Cursor rule files we read, the 3,978 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.