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
- Distinctive: line 7
Use only English text and English comments in code
- Very specific: line 22
Use useQuery for data fetching
- Distinctive: line 23
Never add Index files
- Distinctive: line 63
CREATE POLICY "Select tasks policy" ON "public"."tasks" AS PERMISSIVE FOR SELECT TO authenticated USING (requesting_user_id () = user_id).
- Distinctive: line 68
CREATE POLICY "Insert tasks policy" ON "public"."tasks" AS PERMISSIVE FOR INSERT TO authenticated WITH CHECK (requesting_user_id () = …
- Distinctive: line 70
CHECK (requesting_user_id () = user_id).
≈ “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.
Files
---
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
Trending
More talk lately.thin dataabout the whole repository
Who's talking about serafimcloud/21st
- keithdealwis-ui/the-source“Licence coverage gap: 94 host-recognised dataset projects have no licence classification”GitHub · Oct 17, 2026
- usuevgpt-lang/Claude-code“Install 21st-ai skill from 21st-dev/skill”GitHub · Sep 27, 2026
- variableway/fire-skills“需要示范代码”GitHub · Apr 22, 2026
- mayankmankhand/llm-peer-review“Evaluate 21st.dev component library”GitHub · Mar 8, 2026
- WarningImHack3r/intellij-shadcn-plugin“Support for components from 21st.dev”GitHub · Jan 19, 2025
The biggest 5 of 5 mentions linking to the repository that our crawl found. Each line is their own headline.
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
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.

